Out of combat regen rates.
I wanted to add the increased out of combat regen rates to my server like live. I coded it to check if there were variables called HPRegen, MPRegen and ENRegen in the variables table, if not it just defaults to normal regen rates. So admins can set thier regen rates however they like. Here is the code if anyone wants to use it.
change Code:
void Client::DoHPRegen() { Code:
void Client::DoHPRegen() { Code:
void Client::DoManaRegen() { Code:
void Client::DoManaRegen() { Code:
void Client::DoEnduranceRegen() Code:
void Client::DoEnduranceRegen() Code:
INSERT INTO `variables` (`varname`,`value`,`information`) VALUES ('HPRegen','1','Out of combat hit point regen is multiplied by this number. Default: 1'); I also changed my server to allow players to meditate while standing. it is setup with a variable to turn it on or off too... if anyone wants it just use this code for the "void Client::DoManaRegen() "instead of the above code... Code:
void Client::DoManaRegen() { Code:
INSERT INTO `variables` (`varname`,`value`,`information`) VALUES ('SitToMed','0','0 = Player has to sit to med. 1 = Player meditates while standing. Default: 0'); This is my first contribution, as I am relativly new to the eqemu scene, I hope someone will get some use out of this, and if you find any problems with it, just let me know and i'll try and get it fixed... Zydria |
This looks interesting.
I am going to move this for now into "Custom Code" until KLS weighs in and where she thinks this ought to go. I can see the argument for this getting integrating into the official code... |
Character:HPRegenMultiplier, Character:ManaRegenMultiplier, and Character:EnduranceRegenMultiplier are all already rules...
Though, your mana regen addition may be able to be modified to allow people to med while on horses. |
I have tried to get those working, perhaps im not setting them properly, but they do not seem to have any effect on regen amounts. I have added them both though ingame commands and directly to the database, but each time i test it, my regen rates are just normal.
|
Feature
This was implemented in live and I think its a great feature. The longer you sit the more hp/mana you gain over time. I think the delay between combat and rest mode is something like 10-15 seconds isnt it?
-Mard |
Ok, I got the HPRegenMultiplier, ManaRegenMultiplier and EnduranceRegenMultiplier rules to work, so I change my code to work with those. The code now checks a variable to see if the server allows increase out of combat regen rates, if it does, it will increase the characters out of combat regen rate by the amount in the HP, Mana and EnduranceRegenMultiplier rules.
If the server is not using out of combat regen rates, but has the regenmultiplier rules set, then it will use them the way the worked before. Here's the new code. Code:
void Client::DoHPRegen() { Code:
void Client::DoManaRegen() { Code:
void Client::DoEnduranceRegen() and insert the variable in the db Code:
INSERT INTO `variables` (`varname`,`value`,`information`) VALUES ('OOCRegen','0','Out Of Combat Regen Multiplier. If set to 1 characters hp, mana and endurance will regen at regular speed multiplied by the values entered in the HPRegenMultiplier, ManaRegenMultiplier and EnduranceRegenMultiplier rules. Default is 0 (Off), you must set the above rules or players will only recieve regular regen rates'); By default, the out of combat regen is turned off, so change the variable OOCRegen to 1 to turn it on Zydria |
Sorry for double post, I just update the code to check if players were mounted, if they are, meditate is always on....
just use this instead of the void Client::DoManaRegen() above Code:
void Client::DoManaRegen() { |
Quote:
I'm no developer, but I'm pretty sure the trend is to move away from the variables table and use rules instead. The benefit of course, is that they can be changed and refreshed in-game with a few commands. Most variables require a server reboot to take effect. Your OOCRegen variable probably should be made into a bool rule. Quote:
The mount change is a much needed one, and I am certain many people will appreciate it. However, I see you have the same if statement repeated twice. Couldn't you just combine sitting and mounted together, like: Code:
if (IsSitting() || GetHorseId() != 0){ |
Quote:
|
I actually thought that's how it already was, that's why I got confused. Sorry for the misunderstanding I understand now, thank you :)
|
I havent played on live for a year or two. I heard they did something like you just described, though. I'll look over your code in detail later tonight when i have some time to dedicate towards it. I'm beginning to think now that this should probably go into the server repository after all, but I want to look over it myself and hear what KLS thinks before I make that decision.
|
I went through the code and fixed a few mistakes i made in the other posts and cleaned it up a bit. I also switched from a variable to a rule to turn out of combat regen on or off...
Here's the new code... client_process.cpp Code:
void Client::DoHPRegen() { Code:
void Client::DoManaRegen() { Code:
void Client::DoEnduranceRegen() Code:
RULE_BOOL( Character, OutOfCombatRegen, false ) // Whether or not to used increased regen rates while player is not in combat. |
hm.. im kinda conflicted.
I mean if we're going to go put something like this in we might as well go all the way and replicate eq live's system. Yet the client doesn't support the window that tells us if we're resting or not.. at least not titanium or 6.2, anniv does but it currently is not fully functional by any means.. it's something we could put in that's on EQ live just not on the clients we support atm... I tend to lean toward adding it however because if we don't have it we aren't replicating EQlive gameplay. From what I remember there were a couple different combat states that determined how you regenerated mana and health. Code:
enum CombatState { Recovering is the period from when you leave combat to when you can enter resting... I believe it varies depending on either the zone you're in or the mob you left combat with. I know at the lower levels it's pretty short, 5-10 seconds at most. You can be in Resting but if you're conflicted (Have a detrimental spell on you) you will not be able to take advantage of the effects of Resting. Once you're resting so long as you stay you regen health, mana and endurance at a much faster rate than normal and never any slower than your in combat sitting regeneration. Wouldn't be much to work our really. Hardest part would be the transition from in combat to resting with the timers and that wouldn't be hard at all! |
KLS, is it possible to add the code in anticipation of Anniversary Edition support? And for those who do not have those clients, allow the admin to simply set a rule to handle it? I don't know what "resting" is in EQLive, as I have not actually played in 2 years... but I know the concept from other games.
Gimme mah fellowships, brotherhoods, and vitality xpz!! ;) |
I was testing (read playing) last night and tested this out on the phlarg fiends who notoriously have a ultra long disease effect on you during combat. I can verify that your hp regen rate does continue to rise the longer you sit even with detrimental spell effects on you. It just takes forever (a minute or two) for the regen rate to overcome the disease damage. There has to be some kind of multiplier over time. If you guys want I can always check it out some more for details if you want.
|
All times are GMT -4. The time now is 03:53 AM. |
Powered by vBulletin®, Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.