SphereCommunity
Armor disappearing timer - Printable Version

+- SphereCommunity (https://forum.spherecommunity.net)
+-- Forum: Sphere 0.56d (/Forum-Sphere-0-56d)
+--- Forum: Script Help (/Forum-Script-Help)
+--- Thread: Armor disappearing timer (/Thread-Armor-disappearing-timer)



Armor disappearing timer - Q23A - 05-14-2012 10:30 PM

Hello. I have this robe, which is tournament revard. I need timer or function which will remove this robe after one week.

[ITEMDEF i_king_robe]
NAME=King Robe
ID=0204e

REQSTR=100
WEIGHT=6.0
TYPE=t_armor
ARMOR=300

RESOURCES=
SKILLMAKE=TAILORING 600.0

On=@Create
HITPOINTS=99999
color=0a34
ATTR=attr_newbie


On=@Equip
src.modstr += 20
TIMER=+2
endif

ON=@UNEQUIP
src.modstr -= 20
TIMER=-2
endif


ON=@Timer
IF (<CONT.MANA> < <CONT.INT>)
CONT.MANA=<CONT.MANA> +10
ENDIF
IF (<CONT.STAM> < <CONT.DEX>)
CONT.STAM=<CONT.STAM> +10
ENDIF
IF (<CONT.HITS> < <CONT.STR>)
CONT.HITS=<CONT.HITS> +10
ENDIF
TIMER=2
RETURN 1


Thank YouSmile


RE: Armor disappearing timer - admin phoenix - 05-14-2012 10:37 PM

ON=@CREATE
tag0.timer=60*60*24*7

ON=@EQUIP
timer=<tag0.timer>

ON=@UNEQUIP
tag0.timer=<timer>

ON=@TIMER
IF (<timer> < 0)
remove
ENDIF
RETURN 1


RE: Armor disappearing timer - Q23A - 05-14-2012 10:47 PM

I can't combinate that with this.
ON=@Timer
IF (<CONT.MANA> < <CONT.INT>)
CONT.MANA=<CONT.MANA> +10
ENDIF
IF (<CONT.STAM> < <CONT.DEX>)
CONT.STAM=<CONT.STAM> +10
ENDIF
IF (<CONT.HITS> < <CONT.STR>)
CONT.HITS=<CONT.HITS> +10
ENDIF
TIMER=2
RETURN 1


RE: Armor disappearing timer - admin phoenix - 05-14-2012 11:00 PM

that you have to count it with a tag
for example in your timer
ON=@CREATE
tag0.timer=60*60*24*7

ON=@EQUIP
timer=<tag0.timer>

ON=@UNEQUIP
tag0.timer=<timer>

ON=@TIMER
IF (<dtag0.timer> == 0)
remove
ELSE
your code

tag0.timer =-2
timer=2
ENDIF
RETURN 1


RE: Armor disappearing timer - Q23A - 05-14-2012 11:35 PM

Still something is not working. My regeneration is working, but robe is not disappearing.

[ITEMDEF i_king_robe]
NAME=King Robe
ID=0204e

REQSTR=100
WEIGHT=6.0
TYPE=t_armor
ARMOR=300

RESOURCES=
SKILLMAKE=TAILORING 600.0

On=@Create
HITPOINTS=99999
color=0a34
ATTR=attr_newbie
tag0.timer=60

On=@Equip
Src.str=<src.str>+20
timer=<tag0.timer>


ON=@UNEQUIP
Src.str=<src.str>-20
tag0.timer=<timer>


ON=@Timer
IF (<dtag0.timer> == 0)
remove
ELSE
IF (<CONT.MANA> < <CONT.INT>)
CONT.MANA=<CONT.MANA> +10
ENDIF
IF (<CONT.STAM> < <CONT.DEX>)
CONT.STAM=<CONT.STAM> +10
ENDIF
IF (<CONT.HITS> < <CONT.STR>)
CONT.HITS=<CONT.HITS> +10
ENDIF
tag0.timer =-2
timer=2
ENDIF
RETURN 1


RE: Armor disappearing timer - admin phoenix - 05-14-2012 11:58 PM

tag0.timer -=2
and not
tag0.timer =-2

and try to use

IF (<dtag0.timer> <= 0)


RE: Armor disappearing timer - Q23A - 05-15-2012 12:36 AM

Still something isn't right. I try many variations.. I need that every 2 seconds, when robe are equipped regent stamina, mana, hits, also I need timer, which will remove robe after one week. I need that regent timer start when equip item and stop when unequipped. But second timer which checks when will remove robe work all the time.Even if player put this item in bank for one week, it should be removed.


RE: Armor disappearing timer - WRWR - 05-15-2012 06:01 AM

you can add
Code:
ON=@CREATE
SRC.TAG0.RobeLive= <EVAL <SERV.TIME>+(10*60*60*24*7)>

and checking every time when regen work
Code:
ON=@TIMER
IF (<CONT.MANA> < <CONT.INT>)
CONT.MANA +=10
ENDIF
IF (<CONT.STAM> < <CONT.DEX>)
CONT.STAM +=10
ENDIF
IF (<CONT.HITS> < <CONT.STR>)
CONT.HITS +=10
ENDIF

IF <SRC.TAG0.RobeLive> < <SERV.TIME>
REMOVE
ENDIF
RETURN 1



RE: Armor disappearing timer - Q23A - 05-15-2012 08:46 AM

Thank you all Smile