Hello again!
I'll go a head a post another question. I'll be using sphereserver 56b and I have encountered a problem that I cannot solve.
I have custom made abilities and custom class/race traits. These particular ones are depending on what state the character is in.
For example, I want mana to regenerate by 1 every 5 seconds, when he is in warmode, and drop 1 every 3 seconds when he isn't.
This is how I tried to solve it;
[itemdef s_witchhunter_focus]
id=i_rune_cunning
type=t_eq_script
NAME=Witch Hunter focus
ON=@DCLICK
equip
update
ON=@EQUIP
src.events= +e_witchhunter
src.message @031 Witch Hunter focus activated!
ON=@timer
IF (<cont.flags> && statf_war)
cont.mana=<cont.mana> + 1
IF <cont.mana> > 100
cont.mana=100
ENDIF
timer=5
ELSE
cont.mana=<cont.mana> + (-1)
IF <cont.mana> < 0
cont.mana=0
ENDIF
timer=3
ENDIF
cont.maxmana=100
return 1
For some reason, no matter what I do it seems like the character is in warmode at all times. I've tried to reset the flags but it doesn't work.
Also some abilities (which acually are items that they use by dclicking it) shouldn't be able to be used when character is dead.
ON=@DCLICK
IF !(<src.flags> && statf_dead)
IF !(<src.isevents.e_witchhunter_grappleshot>)
IF !(<src.findid.i_ability_cooldown_grappleshot>)
IF <src.mana> > 9
IF <src.findlayer.1.tag.bow> == 2 //CROSSBOW
IF <src.restest 1 i_rope>
src.message @036 Grapple Shot activated
src.events= +e_witchhunter_grappleshot
ELSE
src.message You need a rope
ENDIF
ELSE
src.message You must have a crossbow equipped
ENDIF
ELSE
src.message Not enough focus
ENDIF
ELSE
src.message Grapple Shot deactivated
src.events= -e_witchhunter_grappleshot
ENDIF
ELSE
src.message <name> will be ready in <src.findid.i_ability_cooldown_grappleshot.timer> seconds.
ENDIF
ELSE
src.message You cannot use this ability when you are dead
ENDIF
This one is also not working. Nomatter what it believes I am already dead, by giving me the message; You cannot use this ability when you are dead.
What am I doing wrong?