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
Stats (hits) change trigger
Author Message
tleilax
Journeyman
*

Posts: 56
Likes Given: 0
Likes Received: 1 in 1 posts
Joined: Jun 2012
Reputation: 0



Post: #1
Stats (hits) change trigger
Hello,

quick question - is there a trigger which fires every time hits/stam/mana of character is changed?

Even if it's by health regen.

@statchange works only if STR (etc) is changed, but not current health


Thanks
01-24-2013 06:45 AM
Find all posts by this user Like Post Quote this message in a reply
Skul
Master
**

Posts: 413
Likes Given: 0
Likes Received: 19 in 15 posts
Joined: Jun 2012
Reputation: 9



Post: #2
RE: Stats (hits) change trigger
No, no such trigger... sorry.

"I ask a question to the answer I already know."

Marchadium :: http://www.marchadium.ca/ :: Join us!
01-25-2013 01:45 AM
Visit this user's website Find all posts by this user Like Post Quote this message in a reply
tleilax
Journeyman
*

Posts: 56
Likes Given: 0
Likes Received: 1 in 1 posts
Joined: Jun 2012
Reputation: 0



Post: #3
RE: Stats (hits) change trigger
How bad idea would it be to make some memory on every player, which would check every second, if HP (of the player) changed?

Could this lag the server? Cause instability? I'm talking about 50 players online at max.

Also, how would you use script profiler to check this?
01-25-2013 01:56 AM
Find all posts by this user Like Post Quote this message in a reply
Skul
Master
**

Posts: 413
Likes Given: 0
Likes Received: 19 in 15 posts
Joined: Jun 2012
Reputation: 9



Post: #4
RE: Stats (hits) change trigger
Not really, as long as the timer is triggered only if the player is logged in. Here's a little example I thought up of for you:
Code:
[function checkstat]
if (<isempty <tag.statchange_hits>>) || (<isempty <tag.statchange_mana>>) || (<isempty <tag.statchange_stam>>)
  tag.statchange_hits=<hits>
  tag.statchange_mana=<mana>
  tag.statchange_stam=<stam>
else
  if !(<dtag0.statchange_hits>==<hits>)
    trigger @statchange_hits
  endif
  if !(<dtag0.statchange_mana>==<mana>)
    trigger @statchange_mana
  endif
  if !(<dtag0.statchange_stam>==<stam>)
    trigger @statchange_stam
  endif
endif
if (<isonline>)
  timerf 1, checkstat
else
  tag.statchange_hits=
  tag.statchange_mana=
  tag.statchange_stam=
endif
Pass 'checkstat' upon every player that logs in to start the function, use @statchange_hits, @statchange_mana, and @statchange_stam as triggers in player events to code the things you need to.

"I ask a question to the answer I already know."

Marchadium :: http://www.marchadium.ca/ :: Join us!
01-25-2013 03:38 AM
Visit this user's website Find all posts by this user Like Post Quote this message in a reply
tleilax
Journeyman
*

Posts: 56
Likes Given: 0
Likes Received: 1 in 1 posts
Joined: Jun 2012
Reputation: 0



Post: #5
RE: Stats (hits) change trigger
Works like a charm, thanks a lot.
01-25-2013 04:31 AM
Find all posts by this user Like Post Quote this message in a reply
RanXerox
Master
**

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



Post: #6
RE: Stats (hits) change trigger
I use something similar (mine is a 10 second timer object in every player's memory) for the 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>)
      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
01-25-2013 05:38 AM
Find all posts by this user Like Post Quote this message in a reply
Ben
Sphere Developer
*****

Posts: 612
Likes Given: 2
Likes Received: 123 in 70 posts
Joined: Mar 2010
Reputation: 18

SphereCommunity

Post: #7
RE: Stats (hits) change trigger
No one thought of the @userStats trigger? It's not well documented in the wiki, but in the revisions, it says that it is triggered at every status update, and if ARGN3=1 then it's the user that opened the status window.
Maybe this could help?

AxisII's current version: 2.0.4j
AxisII SourceCode on Github
AxisII up to date changelog
01-25-2013 11:36 AM
Visit this user's website Find all posts by this user Like Post Quote this message in a reply
RanXerox
Master
**

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



Post: #8
RE: Stats (hits) change trigger
The wiki says "Fires when the player opens the status window" and it says "This trigger fires when a status update is sent to a player"... so which is it?
01-25-2013 02:07 PM
Find all posts by this user Like Post Quote this message in a reply
Skul
Master
**

Posts: 413
Likes Given: 0
Likes Received: 19 in 15 posts
Joined: Jun 2012
Reputation: 9



Post: #9
RE: Stats (hits) change trigger
(01-25-2013 02:07 PM)RanXerox Wrote:  The wiki says "Fires when the player opens the status window" and it says "This trigger fires when a status update is sent to a player"... so which is it?

Both?

"I ask a question to the answer I already know."

Marchadium :: http://www.marchadium.ca/ :: Join us!
01-25-2013 04:05 PM
Visit this user's website Find all posts by this user Like Post Quote this message in a reply
tleilax
Journeyman
*

Posts: 56
Likes Given: 0
Likes Received: 1 in 1 posts
Joined: Jun 2012
Reputation: 0



Post: #10
RE: Stats (hits) change trigger
(01-25-2013 02:07 PM)RanXerox Wrote:  The wiki says "Fires when the player opens the status window" and it says "This trigger fires when a status update is sent to a player"... so which is it?

It only updates when status window is opened or when stats (STR, DEX, INT, not health or mana) is changed. I've already tried it...
01-25-2013 06:59 PM
Find all posts by this user Like Post Quote this message in a reply
Post Reply 


Forum Jump:


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