The following warnings occurred:
Warning [2] Use of undefined constant SAPI_NAME - assumed 'SAPI_NAME' (this will throw an Error in a future version of PHP) - Line: 3388 - File: inc/functions.php PHP 7.4.33-nmm7 (Linux)
File Line Function
/inc/functions.php 3388 errorHandler->error
/showthread.php 116 build_archive_link
Warning [2] Use of undefined constant IN_ARCHIVE - assumed 'IN_ARCHIVE' (this will throw an Error in a future version of PHP) - Line: 3331 - File: inc/functions.php PHP 7.4.33-nmm7 (Linux)
File Line Function
/inc/functions.php 3331 errorHandler->error
/inc/functions.php 3324 build_forum_breadcrumb
/showthread.php 195 build_forum_breadcrumb
Warning [2] Use of undefined constant IN_ARCHIVE - assumed 'IN_ARCHIVE' (this will throw an Error in a future version of PHP) - Line: 3331 - File: inc/functions.php PHP 7.4.33-nmm7 (Linux)
File Line Function
/inc/functions.php 3331 errorHandler->error
/showthread.php 195 build_forum_breadcrumb






Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Armor disappearing timer
Author Message
Q23A
Apprentice
*

Posts: 30
Likes Given: 0
Likes Received: 0 in 0 posts
Joined: Apr 2012
Reputation: 0



Post: #1
Armor disappearing timer
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
05-14-2012 10:30 PM
Find all posts by this user Like Post Quote this message in a reply
admin phoenix
Master
**

Posts: 354
Likes Given: 1
Likes Received: 23 in 13 posts
Joined: Mar 2012
Reputation: 3



Post: #2
RE: Armor disappearing timer
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
05-14-2012 10:37 PM
Find all posts by this user Like Post Quote this message in a reply
Q23A
Apprentice
*

Posts: 30
Likes Given: 0
Likes Received: 0 in 0 posts
Joined: Apr 2012
Reputation: 0



Post: #3
RE: Armor disappearing timer
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
05-14-2012 10:47 PM
Find all posts by this user Like Post Quote this message in a reply
admin phoenix
Master
**

Posts: 354
Likes Given: 1
Likes Received: 23 in 13 posts
Joined: Mar 2012
Reputation: 3



Post: #4
RE: Armor disappearing timer
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
05-14-2012 11:00 PM
Find all posts by this user Like Post Quote this message in a reply
Q23A
Apprentice
*

Posts: 30
Likes Given: 0
Likes Received: 0 in 0 posts
Joined: Apr 2012
Reputation: 0



Post: #5
RE: Armor disappearing timer
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
05-14-2012 11:35 PM
Find all posts by this user Like Post Quote this message in a reply
admin phoenix
Master
**

Posts: 354
Likes Given: 1
Likes Received: 23 in 13 posts
Joined: Mar 2012
Reputation: 3



Post: #6
RE: Armor disappearing timer
tag0.timer -=2
and not
tag0.timer =-2

and try to use

IF (<dtag0.timer> <= 0)
05-14-2012 11:58 PM
Find all posts by this user Like Post Quote this message in a reply
Q23A
Apprentice
*

Posts: 30
Likes Given: 0
Likes Received: 0 in 0 posts
Joined: Apr 2012
Reputation: 0



Post: #7
RE: Armor disappearing timer
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.
05-15-2012 12:36 AM
Find all posts by this user Like Post Quote this message in a reply
WRWR
Journeyman
*

Posts: 212
Likes Given: 30
Likes Received: 1 in 1 posts
Joined: Mar 2012
Reputation: 1



Post: #8
RE: Armor disappearing timer
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
05-15-2012 06:01 AM
Find all posts by this user Like Post Quote this message in a reply
Q23A
Apprentice
*

Posts: 30
Likes Given: 0
Likes Received: 0 in 0 posts
Joined: Apr 2012
Reputation: 0



Post: #9
RE: Armor disappearing timer
Thank you all Smile
05-15-2012 08:46 AM
Find all posts by this user Like Post Quote this message in a reply
Post Reply 


Forum Jump:


User(s) browsing this thread: 1 Guest(s)