Russian
Journeyman
Posts: 75
Likes Given: 4
Likes Received: 2 in 2 posts
Joined: Jul 2012
Reputation: 0
|
Set timer of any item
Hello!
I create GM sphere, this gm sphere can set time of live any item:
Code:
[ITEMDEF I_GM_ITEM_TIMER_SPHERE]
NAME=Set timer on item sphere
ID=I_CRYSTAL_BALL
ON=@CREATE
COLOR=0BAE
ATTR=ATTR_NEWBIE
ON=@DCLICK
TARGET
RETURN 1
ON=@TARGON_ITEM
SRC.DIALOGCLOSE D_GM_SET_TIMER
SRC.DIALOG D_GM_SET_TIMER
RETURN 1
[DIALOG D_GM_SET_TIMER]
...
[DIALOG D_GM_SET_TIMER BUTTON]
...
ONBUTTON=1
SRC.TARG.TIMER=<ARGTXT[0]>
SRC.TARG.TIMERF=<ARGTXT[0]>
SRC.TARG.ATTR=ATTR_CAN_DECAY
SRC.DIALOGCLOSE D_GM_SET_TIMER
SRC.SYSMESSAGE @0486,,1 Seconds left: <SRC.TARG.TIMER>
RETURN 1
But after time left, the items not removed and i got error:
|
|
11-18-2014 04:57 AM |
|
|
Russian
Journeyman
Posts: 75
Likes Given: 4
Likes Received: 2 in 2 posts
Joined: Jul 2012
Reputation: 0
|
RE: Set timer of any item
(11-18-2014 05:20 AM)darksun84 Wrote: try with attr_decay
Does not help, because after equip/unequip item - it set timer=-1
(11-18-2014 07:19 AM)Feeh Wrote: Use the @TIMER trigger
return 0 will delete the item no matter if you have or not the attr_decay flag and default actions will take place
return 1 will stop any default action, the item will NOT decay and this message will not show
I want create function/item, what set to ANY item a timer. You advise to add to EACH subject trigger @TIMER?
My not worked script:
Code:
[ITEMDEF I_GM_ITEM_TIMER_SPHERE]
NAME=Set timer on item sphere
ID=I_CRYSTAL_BALL
ON=@CLICK
MESSAGE @0487,,1 Сфера установки временных предметов
RETURN 1
ON=@CREATE
COLOR=0BAE
ATTR=ATTR_NEWBIE
ON=@DCLICK
TARGET
RETURN 1
ON=@TARGON_ITEM
IF (<SRC.TARG.ATTR> & ATTR_DECAY)
RETURN 1
ELSE
SRC.DIALOGCLOSE D_GM_SET_TIMER
SRC.DIALOG D_GM_SET_TIMER
RETURN 1
ENDIF
ON=@TARGON_CHAR
RETURN 1
[DIALOG D_GM_SET_TIMER]
133, 27
RESIZEPIC 0 0 83 144 88
RESIZEPIC 17 16 3000 72 27
DTEXTENTRY 23 19 300 30 0 0 <SRC.TARG.TIMER>
BUTTON 97 21 4023 4025 1 0 1
[DIALOG D_GM_SET_TIMER BUTTON]
ONBUTTON=0
RETURN 1
ONBUTTON=1
SRC.TARG.TIMER=<ARGTXT[0]>
SRC.TARG.ATTR=ATTR_DECAY
SRC.DIALOGCLOSE D_GM_SET_TIMER
SRC.SYSMESSAGE @0486,,1 Seconds left: <SRC.TARG.TIMER>
RETURN 1
(This post was last modified: 11-18-2014 03:56 PM by Russian.)
|
|
11-18-2014 03:54 PM |
|
|
Extreme
Grandmaster Poster
Posts: 1,141
Likes Given: 217
Likes Received: 90 in 77 posts
Joined: May 2012
Reputation: 20
SphereCommunity
|
|
11-18-2014 11:13 PM |
|
|
Russian
Journeyman
Posts: 75
Likes Given: 4
Likes Received: 2 in 2 posts
Joined: Jul 2012
Reputation: 0
|
RE: Set timer of any item
Worked script:
Code:
[ITEMDEF I_GM_ITEM_TIMER_SPHERE]
NAME=Set timer on item sphere
ID=I_CRYSTAL_BALL
ON=@CLICK
MESSAGE @0487,,1 Сфера установки временных предметов
RETURN 1
ON=@CREATE
COLOR=0BAE
ATTR=ATTR_NEWBIE
ON=@DCLICK
TARGET
RETURN 1
ON=@TARGON_ITEM
IF (<SRC.TARG.ATTR> & ATTR_CAN_DECAY)
RETURN 1
ELSE
SRC.DIALOGCLOSE D_GM_SET_TIMER
SRC.DIALOG D_GM_SET_TIMER
RETURN 1
ENDIF
ON=@TARGON_CHAR
RETURN 1
[DIALOG D_GM_SET_TIMER]
133, 27
RESIZEPIC 0 0 83 144 88
RESIZEPIC 17 16 3000 72 27
DTEXTENTRY 23 19 300 30 0 0 <SRC.TARG.TIMER>
BUTTON 97 21 4023 4025 1 0 1
[DIALOG D_GM_SET_TIMER BUTTON]
ONBUTTON=0
RETURN 1
ONBUTTON=1
SRC.TARG.ATTR=ATTR_CAN_DECAY
SRC.TARG.TIMERF <ARGTXT[0]>,REMOVE
SRC.TARG.TIMER=<ARGTXT[0]>
SRC.DIALOGCLOSE D_GM_SET_TIMER
SRC.SYSMESSAGE @0486,,1 Seconds left: <SRC.TARG.TIMER>
RETURN 1
Thank you for help!
|
|
11-19-2014 03:51 PM |
|
|