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
Update max stat
Author Message
Alexdan
Apprentice
*

Posts: 6
Likes Given: 1
Likes Received: 0 in 0 posts
Joined: May 2014
Reputation: 0

New Hera Rebord

Post: #1
Update max stat
Hello,
I have a question i update sphere in last night build but have a little problem whit bless, potion.

When bless or drink potion, stat incrase but not incrase maxstr or maxmana ecc..
For solve this problem i have forced it to update in @Userstats whit this code:

Code:
ON=@Userstats
maxhits = <eval <ostr> + <modstr>>
maxmana = <eval <oint> + <modint>>
maxstam = <eval <odex> + <moddex>>

But userstats call is very heavy for server.
Exist other way to enable autoupdate of this stat ?
(This post was last modified: 05-01-2014 05:22 PM by Alexdan.)
05-01-2014 05:22 PM
Find all posts by this user Like Post Quote this message in a reply
XuN
Sphere Developer
*****

Posts: 852
Likes Given: 102
Likes Received: 156 in 119 posts
Joined: Jul 2013
Reputation: 30



Post: #2
RE: Update max stat
If you want maxhits = ostr + modstr just type maxhits to remove custom maxhits, in this case the stat will be properly updated.

Remove any effect from yourself, type maxhits 0 and then cast bless, you'll see. What you say will only happen if you have custom stats, in which case you are already using the trigger so it's the same.
05-01-2014 07:52 PM
Find all posts by this user Like Post Quote this message in a reply
karma
Moderator
****

Posts: 178
Likes Given: 17
Likes Received: 32 in 29 posts
Joined: Jul 2012
Reputation: 3



Post: #3
Update max stat
Is @Userstats so heavy? I determine maxhits with a formula which involves all the three stats. Years ago i used a function every time i did temporary (or permanent) stat modifications, but wouldn't be better now using this trigger?
05-01-2014 09:13 PM
Find all posts by this user Like Post Quote this message in a reply
Alexdan
Apprentice
*

Posts: 6
Likes Given: 1
Likes Received: 0 in 0 posts
Joined: May 2014
Reputation: 0

New Hera Rebord

Post: #4
RE: Update max stat
(05-01-2014 09:13 PM)karma Wrote:  Is @Userstats so heavy? I determine maxhits with a formula which involves all the three stats. Years ago i used a function every time i did temporary (or permanent) stat modifications, but wouldn't be better now using this trigger?

In a normal pvp time this load of this trigger whit only code reported.

Code:
TRIGGER '@userstats' called 11771 times, took 1.2203 msec average (0.0141 min, 9.3909 max), total: 14364.9353 msec

For standard is heavy .... i think
(This post was last modified: 05-01-2014 09:56 PM by Alexdan.)
05-01-2014 09:55 PM
Find all posts by this user Like Post Quote this message in a reply
karma
Moderator
****

Posts: 178
Likes Given: 17
Likes Received: 32 in 29 posts
Joined: Jul 2012
Reputation: 3



Post: #5
Update max stat
Devs, is it useful to have this trigger called so many times? When is it called?
05-02-2014 04:13 AM
Find all posts by this user Like Post Quote this message in a reply
Alexdan
Apprentice
*

Posts: 6
Likes Given: 1
Likes Received: 0 in 0 posts
Joined: May 2014
Reputation: 0

New Hera Rebord

Post: #6
RE: Update max stat
(05-02-2014 04:13 AM)karma Wrote:  Devs, is it useful to have this trigger called so many times? When is it called?

Is called every time status update (on player). This is the description in wiki.
05-02-2014 04:55 AM
Find all posts by this user Like Post Quote this message in a reply
XuN
Sphere Developer
*****

Posts: 852
Likes Given: 102
Likes Received: 156 in 119 posts
Joined: Jul 2013
Reputation: 30



Post: #7
RE: Update max stat
The most factor against triggers/functions is always the amount of code that they need to run, however this trigger is being called when a Stat Update packet is needed, depends on various things. However to know about a trigger ... the best is to add it to yourself and attach to it a sysmessage or serv.log to see how much is it being called, also enabling script profiler in the ini and using P in the console <-- this one is the best method to know what is failing (if anything is failing Tongue).
05-02-2014 05:07 AM
Find all posts by this user Like Post Quote this message in a reply
karma
Moderator
****

Posts: 178
Likes Given: 17
Likes Received: 32 in 29 posts
Joined: Jul 2012
Reputation: 3



Post: #8
Update max stat
Thanks guys. What about making @StatChange fire also when stats are changed by setting them with str=* ostr=* modstr=* ?
05-02-2014 06:23 AM
Find all posts by this user Like Post Quote this message in a reply
XuN
Sphere Developer
*****

Posts: 852
Likes Given: 102
Likes Received: 156 in 119 posts
Joined: Jul 2013
Reputation: 30



Post: #9
RE: Update max stat
@UserStats and @StatChange are different triggers, last one is already changing in every stat change Ostat,ModStat,MaxStat anf for hits/mana/stam.
05-02-2014 04:41 PM
Find all posts by this user Like Post Quote this message in a reply
karma
Moderator
****

Posts: 178
Likes Given: 17
Likes Received: 32 in 29 posts
Joined: Jul 2012
Reputation: 3



Post: #10
Update max stat
Oh, perfect, i did not have at hand my pc to do some tests and i read the wiki, which states that @UserStats fires when statgain is dued to skillgain, maybe the description can be more precise
05-02-2014 09:13 PM
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)