Help - Search - Members - Calendar
Full Version: Func To Modify Regen_[$statid]
SphereServer Forums > Sphere .56/.57 > FUNCTION & EVENTS Script Submissions
Galthar
Using the TAG.OVERRIDE.REGEN_[$statID] (even not working!)

CODE

[FUNCTION HitsRegen]
//If <argn> is present, changes the time (in seconds) to earn a Hitpoint by regeneration and returns the old value.
//If not present return the time (in seconds) to earn a Hitpoint by regeneration.
IF (!<argn>)
return <eval (<serv.regen0>/10)-<TAG0.OVERRIDE.Regen_0>>
endif
local.old=<eval (<serv.regen0>/10)-<TAG0.OVERRIDE.Regen_0>>
TAG.OVERRIDE.Regen_0=<eval (<serv.regen0>/10)-<argn>>
return <local.old>

[FUNCTION ManaRegen]
//If <argn> is present, changes the time (in seconds) to earn a Mana point by regeneration and returns the old value.
//If not present return the time (in seconds) to earn a Mana point by regeneration.
IF (!<argn>)
return <eval (<serv.regen1>/10)-<TAG0.OVERRIDE.Regen_1>>
endif
local.old=<eval (<serv.regen1>/10)-<TAG0.OVERRIDE.Regen_1>>
TAG.OVERRIDE.Regen_1=<eval (<serv.regen1>/10)-<argn>>
return <local.old>

[FUNCTION StamRegen]
//If <argn> is present, changes the time (in seconds) to earn a Stam point by regeneration and returns the old value.
//If not present return the time (in seconds) to earn a Stam point by regeneration.
IF (!<argn>)
return <eval (<serv.regen2>/10)-<TAG0.OVERRIDE.Regen_2>>
endif
local.old=<eval (<serv.regen2>/10)-<TAG0.OVERRIDE.Regen_2>>
TAG.OVERRIDE.Regen_2=<eval (<serv.regen2>/10)-<argn>>
return <local.old>


Ingame, if you want to see the stam regen you can type '.show stamregen'
To set stamregen you can type '.stamregen 15' to earn a stam point every 15 seconds.

It's tested.
Very usefull in Focus Skill, aye?
I'm using in a race system.
GorGoUO
Does not work for me, any reason? Thanks.
Galthar
Hum... I'm using it for months and nothing wrong happened.
If you type '.StamRegen 1' and then '.show StamRegen' what do you got?
If you so set '.stam=0' in which time you earn a new stam point?
GorGoUO
OK let's see...It appears to work in my personal Sphere (my own pc, Windows XP) but does not work in my server (Windows 2003 SP2). Same script, same archives...Any idea? Thanks!
Galthar
Are you sure you are using the same Sphere version?
I don't now if this stuff is enabled by Sphere.ini experimental flags. Try to copy all experimental flags you are using in home to your server's Sphere.ini.
My personal is XP and our server is Ubuntu and it's just fine.
GorGoUO
Yes, I just have copied all sphere directory into my PC. Same archives and scripts...Its so strange...
Galthar
Mah... So I have no idea what happens.
If you just copy/past the Sphere folder, the only thing that could happen is to have wrong paths in spheretables.scp. Sush as use absolute path in [RESOURCES] section.
Check it out, friend.
GorGoUO
All is OK. I will continue trying to make it works, i tell you something when i've find my problem, thanks!
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2010 Invision Power Services, Inc.