PenUltima Online

It is currently Sat Aug 30, 2008 3:25 am

All times are UTC - 8 hours




Post new topic Reply to topic  [ 3 posts ] 
Author Message
 Post subject: Method to execute script when vitals are regened
PostPosted: Fri Apr 28, 2006 11:18 am 
Offline
Distro Developer
User avatar

Joined: Thu Apr 06, 2006 5:11 pm
Posts: 350
Location: Nederland, Texas
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.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Apr 28, 2006 8:11 pm 
Offline
POL Developer
User avatar

Joined: Sun Feb 12, 2006 9:50 pm
Posts: 834
Location: Indiana, USA
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.


Top
 Profile  
 
 Post subject: Re: Method to execute script when vitals are regened
PostPosted: Fri Apr 28, 2006 8:56 pm 
Offline
Distro Developer
User avatar

Joined: Thu Apr 06, 2006 5:11 pm
Posts: 350
Location: Nederland, Texas
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! :-D

Thanks.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC - 8 hours


Who is online

Users browsing this forum: No registered users and 0 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
Style based on FI Subice by phpBBservice.nl