SphereCommunity
typedefs and ghosts @dclick - Printable Version

+- SphereCommunity (https://forum.spherecommunity.net)
+-- Forum: Sphere 0.56d (/Forum-Sphere-0-56d)
+--- Forum: General Help (/Forum-General-Help)
+--- Thread: typedefs and ghosts @dclick (/Thread-typedefs-and-ghosts-dclick)

Pages: 1 2


typedefs and ghosts @dclick - Reflex - 04-16-2012 05:33 PM

I'm trying to work on a script for ghosts to res via an ankh or healer through a dialog. I've gotten the dialog done and tried attaching it simply to an ankh to test but ghosts get "hand passes through this object" What properties am I missing for a ghost to be able to dclick the item ?

[ITEMDEF i_ankh_res]
id=02
on=@dclick
src.dialog d_res_gump

^the quick version^

Also how do you go about creating a unique typedef for example I would want to create the following so I can just set the type to any future items I want to call the dialog ?

[typedef t_res_dialog]
on=@dclick
src.dialog d_res_gump


RE: typedefs and ghosts @dclick - admin phoenix - 04-16-2012 05:58 PM

try this one
ON=@STEP
if <timer> < 0
src.dialog xxxxxx
timer=10
endif


RE: typedefs and ghosts @dclick - darksun84 - 04-16-2012 06:41 PM

i think you should override the typedef t_shrine

[typedef t_shrine]
src.dialog d_res_gump
return 1

then you put the typedef t_shrine in your item Big Grin


RE: typedefs and ghosts @dclick - admin phoenix - 04-16-2012 07:39 PM

and how will it be activated?
you have no trigger inside your typedef Wink


RE: typedefs and ghosts @dclick - darksun84 - 04-16-2012 07:39 PM

ops , with ON=@Dclick Big Grin


RE: typedefs and ghosts @dclick - Reflex - 04-17-2012 01:25 AM

where are the typedefs currently held? I couldn't find anything more than the following:

spheredefs.scp
[TYPEDEFS]
t_normal 0
t_container 1 // any unlocked container or corpse. ccontainer based
t_container_locked 2
t_door 3 // 3 = door can be opened

OR

sphere_types.scp
[TYPEDEF t_water]
TERRAIN = 0a8 0ab
TERRAIN = 0136 0137

So I assume by default the types are "hardcoded" in until modified ? I dont want to modify the default t_shrine in-case I actually need the default t_shrine seeing how it has more functions than just resurrect.


RE: typedefs and ghosts @dclick - Shaklaban - 04-17-2012 02:48 AM

then just give a tag or check the item baseid id on=@dclick for example:
Code:
[typedef t_shrine]
on=@dclick
if (<tag0.shrine_override>)
    dialog d_blabla
    return 1
endif



RE: typedefs and ghosts @dclick - darksun84 - 04-17-2012 02:49 AM

all the typedefs are found in spheredefs.scp

t_shrine 38 // = can res you


RE: typedefs and ghosts @dclick - Reflex - 04-17-2012 01:20 PM

(04-17-2012 02:48 AM)Shaklaban Wrote:  then just give a tag or check the item baseid id on=@dclick for example:
Code:
[typedef t_shrine]
on=@dclick
if (<tag0.shrine_override>)
    dialog d_blabla
    return 1
endif

Can you please explain if (<tag0.shrine_override>) i think i understand what it does but not sure how it works ?


RE: typedefs and ghosts @dclick - Reflex - 04-17-2012 03:23 PM

Ok I cant figure this out at all here is what I'm trying to do... Create a Dialog that is compatible for NPC's and Ankh's that allows someone to res as long as they are within line of sight and dead via the dialog.. also have there be a timer so people cant instantly ress.. say 10 seconds or whatever.. If anyone replies please if you can take time to explain the script and how it works..

Item

Code:
[ITEMDEF 02]
DEFNAME=i_ankh
RESOURCES=100 i_rock_plain
CATEGORY=Decoration - Miscellaneous
SUBSECTION=Statues
DESCRIPTION=Ankh (w) 1/2
DUPELIST=03,04,05

Modifying sphere_override_shrine.scp

[TYPEDEF T_SHRINE]
on=@dclick
statements and or handle it all through the dialog
use this dialog

[DIALOG d_RESURRECT_CONFIRM]
280,190
SRC.CLOSEALLDIALOGS
PAGE 0
gumppictiled 65 33 320 44 201
gumppic 22 33 206
gumppic 380 33 207
gumppictiled 22 77 44 280 202
gumppictiled 380 77 44 280 203
gumppictiled 65 355 320 44 233
gumppic 380 355 205
gumppic 22 355 204
gumppictiled 66 77 320 300 200

xmfhtmlgump 180 60 70 25 1015222 0 0


IF (<UID.<CTAG0.RESSER>.NPC> == brain_healer)
xmfhtmlgump 75 100 290 150 1011025 1 1
ELSE
xmfhtmlgump 75 100 290 150 1011026 1 1
ENDIF

button 90 285 4005 4006 1 0 1
xmfhtmlgump 125 288 70 25 1011011 0 0

button 230 285 4005 4006 1 0 0
xmfhtmlgump 265 288 70 25 1011012 0 0

[DIALOG d_RESURRECT_CONFIRM BUTTON]
ON=1
IF (!(<CANSEELOS <CTAG0.RESSER>>))
MESSAGE @,,2 502390
ELIF (<UID.<CTAG0.RESSER>.FLAGS>&statf_dead)
MESSAGE @,,2 501040
ELSE
REF1=<REGION.UID>
    IF (<REF1.BASEID> == i_champion_spawn)
    LOCAL.OLDP=<P>
    P=1,1
    SPELLEFFECT s_resurrection,1000,<CTAG0.RESSER>
    P=<LOCAL.OLDP>
    UPDATEX
    ELSE
    SPELLEFFECT s_resurrection,1000,<CTAG0.RESSER>
    ENDIF
ENDIF
CTAG.RESSER

ON=0
TRYSRC <CTAG0.RESSER> SRC.MESSAGE @,,2 503256
CTAG.RESSER