SphereCommunity
Timer - Printable Version

+- SphereCommunity (https://forum.spherecommunity.net)
+-- Forum: Sphere 0.56d (/Forum-Sphere-0-56d)
+--- Forum: General Help (/Forum-General-Help)
+--- Thread: Timer (/Thread-Timer--5272)



Timer - Van Glan Bloom - 03-27-2017 10:31 AM

Long time ago i dont script and now a problem occured in one script i try make.

In my script I try to make a particular mob stand stone. And that after a period of time the stone is automatically removed. However I am not able to create the script

Code:
.....
elseif (<src.targ.isevent.e_fire_drake_no_training>) && (<src.targ.tag.level> >= 2) && (<src.FINDLAYER(21).RESCOUNT i_gold> > 10000)
        src.consume 10000 i_gold
        src.targ.events +e_fire_drake_training1
        src.targ.events -e_fire_Drake_no_training
        src.targ.events +e_stone_free
        src.targ.stone 1
        src.sysmessage blah blah blah
        return 1
else
    src.sysmessage @09c1 test test
return 1
endif

Code:
[Events e_stone_free]

on=@create
timer=1

on=@timer
if (<src.isevent.e_stone_free>)
src.newitem i_stone_free
src.act.equip
return 1
endif

[itemdef i_stone_free]
name=Stone Free
id=i_memory
Type=t_eq_script

on=@create
attr=attr_decay
more1=10

ON=@EQUIP
timer=1

on=@timer
if (<cont>)
    if (<more1>)
        more=<more> +-1
    timer=1
return 1
src.stone 0
src.events -e_stone_free
endif
remove
return 1
endif



RE: Timer - Coruja - 03-27-2017 11:00 AM

if you just want make the char get stoned for some few seconds, you can replace e_stone_free / i_stone_free with just 2 simple functions
Code:
SRC.TARG.STONE 1
SRC.TARG.TIMERF 10, STONE 0
this will set STONE 1 and after 10 seconds will set STONE 0


RE: Timer - Van Glan Bloom - 03-28-2017 07:47 AM

Thx you Coruja. You helped me a lot.

However, an error occurred in my console, regarding the timer,

Code:
22:44:ERROR:Timer expired without DECAY flag 'Val Targeter' (UID=040000ce1)?
22:44:ERROR:Timer expired without DECAY flag 'Val Targeter' (UID=040000cdf)?



RE: Timer - Leonidas - 03-30-2017 01:51 AM

On the "Val Targeter" timer add "Return 1" and it should fix that error.