Stats Regen Rate...

Get Help on scripting in POL with configurations, config setups, script trouble shooting, etc.

Moderator: POL Developer

Post Reply
Harley
Forum Regular
Posts: 360
Joined: Sat Mar 18, 2006 1:41 am
Location: Germany

Stats Regen Rate...

Post by Harley »

Tell me please, how can I speed up regen rate separately stats?
I have regen.src

Code: Select all

exported function GetLifeRegenRateExported(mob)

	var rate := GetObjProperty(mob, CPROP_NAME_PREFIX_REGEN_RATE + VITALID_LIFE);
	if (rate != error)
          return Cint(rate);
    /*
		rate := Cint(rate);
		if(rate != error)
			return rate;
		endif
    */
	endif

	return 1200;
endfunction
end etc.. functions.
When I change return 1200; to return 600; or toreturn 6000;

Nothing happened. My stat (gm & non-gm) growing 1 in 5 seconds.
Who know that system? With best regards!
User avatar
Austin
Former Developer
Posts: 621
Joined: Wed Jan 25, 2006 2:30 am

Re: Stats Regen Rate...

Post by Austin »

If you are changing the return value of function GetLifeRegenRateExported(mob) in your script then you would have to restart POL because it is an exported function.
Exported functions get cached in a special way to make them run extremely fast.

If you want to change the regeneration rates without restarting POL you need to set a base rate, then a custom property system that modifies on that.

Simple Example:

Code: Select all

exported function GetHitsRegenRate(mobile)
	var base_regen := 1200;

	return base_regen + CInt(GetObjProperty(mobile, "HitsRegenerationMod"));
endfunction

After you change your regeneration modifying cprop you need to call the RecalcVitals() function in vitals.em (099)


Here was my approach to it years ago

Attributes package:
http://sourceforge.net/p/mytharria/code ... ttributes/

Files specifically of interest:
http://sourceforge.net/p/mytharria/code ... vitals.cfg (core file to set vitals up)
http://sourceforge.net/p/mytharria/code ... ttings.cfg (regen elem)
http://sourceforge.net/p/mytharria/code ... alInit.src (virtal hook)
http://sourceforge.net/p/mytharria/code ... /regen.inc (additional regen utility functions)
Harley
Forum Regular
Posts: 360
Joined: Sat Mar 18, 2006 1:41 am
Location: Germany

Re: Stats Regen Rate...

Post by Harley »

Austin, thank u for ur answer!
Yes, I restarted my server, but nothing happened! That's why I'm interested in, where & what have I change...

All that u uploaded, I have used..

With best regards!
User avatar
Austin
Former Developer
Posts: 621
Joined: Wed Jan 25, 2006 2:30 am

Re: Stats Regen Rate...

Post by Austin »

The usual is 1200. Try setting it to something more extreme like 4000.
Harley
Forum Regular
Posts: 360
Joined: Sat Mar 18, 2006 1:41 am
Location: Germany

Re: Stats Regen Rate...

Post by Harley »

I got one! There is in my script:

Code: Select all

var rate := GetObjProperty(mob, CPROP_NAME_PREFIX_REGEN_RATE + VITALID_LIFE);
   if (rate != error)
          return Cint(rate);
So, when I have changed return 1200; in the end of the code, nothing happened! But when I changed code in thoose example, I have stat (health) regeneration (I have added return Cint(6000);) 6 points per 5 seconds!

Now my question is - where can I change time of stats regeneration?

With best regards!
Yukiko
Distro Developer
Posts: 2825
Joined: Thu Feb 02, 2006 1:41 pm
Location: San Antonio, Texas
Contact:

Re: Stats Regen Rate...

Post by Yukiko »

Tell me please, how can I speed up regen rate separately stats?
Now my question is - where can I change time of stats regeneration?
There is a setting in ..\pkg\systems\attributes\config\settings.cfg called GainSpeed. Maybe that is what you are looking for. It is referenced in two functions in the file ..\pkg\systems\attributes\include\advanceCheck.inc

It looks like this setting is applied to skills and vitals universally without regard for each stat or skill. If this is the setting you are looking for then it doesn't look like it can be set to a different rate per each stat as the scripts are currently written. Which is what I gather you want to do.
Post Reply