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
Tactics, Focus or similar script
Author Message
RanXerox
Master
**

Posts: 550
Likes Given: 1
Likes Received: 12 in 9 posts
Joined: Dec 2010
Reputation: 19



Post: #2
RE: Tactics, Focus or similar script
Here is a example of a passive focus gain:

The skill looks like this (feel free to remove the SYSMESSAGES when you are convinced it is working correctly)

Code:
[SKILL 50]
DEFNAME=skill_Focus
KEY=Focus
TITLE=Stoic
//FLAGS=SKF_SCRIPTED|SKF_NOANIM
ADV_RATE=5.0,50.0,100.0
GAINRADIUS=100.0
VALUES=1,50,100
BONUS_STATS=0
BONUS_STR=0
BONUS_DEX=0
BONUS_INT=0
STAT_STR=0
STAT_INT=0
STAT_DEX=0
ON=@Success
   SRC.SYSMESSAGE @color_text,,1 Focus skill used!
ON=@UseQuick
   SRC.SYSMESSAGE @color_text,,1 Focus skill used!

The Skill needs to be triggered every once in a while... so this EVENT is added to the player. All it does is add a timer to them when they login, the timer does the real work:

Code:
[EVENTS e_focus]
ON=@Login
   IF !(<SRC.FINDID.i_focus_timer>)
      SERV.NEWITEM=i_focus_timer
      NEW.CONT=<SRC>
      NEW.TIMER=10
   ENDIF

The timer triggers every 10 seconds and decides if the player should use their Focus skill:

Code:
[ITEMDEF i_focus_timer]
ID=i_candle_thin_lit
TYPE=t_eq_script
LAYER=layer_special
WEIGHT=0
ON=@Create
   ATTR=attr_decay|attr_can_decay
   TIMER=10
ON=@Timer
   IF (<CONT.STAM> < <CONT.MAXSTAM>) || (<CONT.HITS> < <CONT.MAXHITS>) || (<CONT.MANA> < <CONT.MAXMANA>)
      //FIXME: "use skillcheck first?"
      //FIXME: "test if skill is locked"
      LOCAL.Difficulty=<EVAL <CONT.Focus> / 10>
      IF (<LOCAL.Difficulty> > 90)
         LOCAL.Difficulty=90
      ENDIF
      IF (<LOCAL.Difficulty> < 10)
         LOCAL.Difficulty=10
      ENDIF
      CONT.SKILLGAIN focus <LOCAL.Difficulty>
   ENDIF
   TIMER=10
   RETURN 1
09-25-2013 09:11 AM
Find all posts by this user Like Post Quote this message in a reply
Post Reply 


Messages In This Thread
Tactics, Focus or similar script - Archaaz - 09-24-2013, 07:08 PM
RE: Tactics, Focus or similar script - RanXerox - 09-25-2013 09:11 AM
RE: Tactics, Focus or similar script - XuN - 09-25-2013, 09:31 PM
RE: Tactics, Focus or similar script - XuN - 09-26-2013, 01:26 AM
RE: Tactics, Focus or similar script - XuN - 09-26-2013, 03:00 AM

Forum Jump:


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