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-nmm6 (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-nmm6 (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-nmm6 (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
Timer
Author Message
Van Glan Bloom
Journeyman
*

Posts: 104
Likes Given: 2
Likes Received: 3 in 3 posts
Joined: Jun 2013
Reputation: 0



Post: #1
Timer
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
03-27-2017 10:31 AM
Find all posts by this user Like Post Quote this message in a reply
Coruja
Sphere Developer
*****

Posts: 987
Likes Given: 5
Likes Received: 226 in 187 posts
Joined: Jul 2012
Reputation: 7

Dimension Shard

Post: #2
RE: Timer
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
03-27-2017 11:00 AM
Find all posts by this user Like Post Quote this message in a reply
Van Glan Bloom
Journeyman
*

Posts: 104
Likes Given: 2
Likes Received: 3 in 3 posts
Joined: Jun 2013
Reputation: 0



Post: #3
RE: Timer
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)?
03-28-2017 07:47 AM
Find all posts by this user Like Post Quote this message in a reply
Leonidas
Master
**

Posts: 277
Likes Given: 3
Likes Received: 13 in 12 posts
Joined: May 2013
Reputation: 1



Post: #4
RE: Timer
On the "Val Targeter" timer add "Return 1" and it should fix that error.
03-30-2017 01:51 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)