Update max stat - Printable Version +- SphereCommunity (https://forum.spherecommunity.net) +-- Forum: Sphere 0.56d (/Forum-Sphere-0-56d) +--- Forum: Script Help (/Forum-Script-Help) +--- Thread: Update max stat (/Thread-Update-max-stat) |
Update max stat - Alexdan - 05-01-2014 05:22 PM 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 But userstats call is very heavy for server. Exist other way to enable autoupdate of this stat ? RE: Update max stat - XuN - 05-01-2014 07:52 PM 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. Update max stat - karma - 05-01-2014 09:13 PM 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? RE: Update max stat - Alexdan - 05-01-2014 09:55 PM (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 Update max stat - karma - 05-02-2014 04:13 AM Devs, is it useful to have this trigger called so many times? When is it called? RE: Update max stat - Alexdan - 05-02-2014 04:55 AM (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. RE: Update max stat - XuN - 05-02-2014 05:07 AM 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 ). Update max stat - karma - 05-02-2014 06:23 AM Thanks guys. What about making @StatChange fire also when stats are changed by setting them with str=* ostr=* modstr=* ? RE: Update max stat - XuN - 05-02-2014 04:41 PM @UserStats and @StatChange are different triggers, last one is already changing in every stat change Ostat,ModStat,MaxStat anf for hits/mana/stam. Update max stat - karma - 05-02-2014 09:13 PM 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 |