Posted: Fri Apr 28, 2006 3:18 pm Post subject: Method to execute script when vitals are regened
How difficult would it be to implement some sort of function that is called when a stat point is gained? Meditation is suposed to increase whenever a player gains a point of mana and it is also suposed to increase the rate at which the player regenerates.
Currently I understand that it would only be possible to affect the rate gain. Perhaps by calling RecalcVitals() on a player whenever they gain a point of intelligence or meditation, which then checks the regen rate of that stat, which could then be changed to reflect the new skill/stat. But getting Meditation to have a chance to increase whenever a point of mana is regenerated wouldn't be easy. The only way I can think of would be to have some sort of script sitting on the player checking every second and if it notices a change in mana from the time before, award some points.
Is there a way a more elegant solution could be afforded by the core? Something like defining a regen function in vitals.cfg that is called whenever that point is regenerated. This could also help in implementing Focus, which is the same thing except more for strength and stamina (but also affects meditation).
If I'm incorrect in any of this, please let me know.
Author
Message
MuadDib POL Developer
Joined: 13 Feb 2006 Posts: 830 Location: Indiana, USA
Posted: Sat Apr 29, 2006 12:11 am Post subject:
Yeah, there is.
Have a passive med script fire on char logon etc, and use it to award points during it's loop, whenever mana is less than max. Be careful of the speed of your wait, make sure it's no to insanely fast.
Re: Method to execute script when vitals are regened
Posted: Sat Apr 29, 2006 12:56 am Post subject: Re: Method to execute script when vitals are regened
tekproxy wrote:
The only way I can think of would be to have some sort of script sitting on the player checking every second and if it notices a change in mana from the time before, award some points.
I thought that wouldn't be very clean but you know what you're talking about so I'll believe you!