Log in

View Full Version : PC HP and MANA regen & sitting


kavren
12-08-2008, 12:46 PM
Is there a way for me to adjust my server so that I can tweak HP and Mana regen time for characters that are sitting?

I would like to have the ability to both lower and increase the regen times, just for curiosities sake.

kavren
12-08-2008, 12:58 PM
This is specifically in reference to "sitting". When standing, I want the PC's to have different regen stats than from when they where sitting.

trevius
12-08-2008, 05:28 PM
I don't think there is a currently a rule for that. But, it wouldn't be hard to edit that in the source if you wanted to.

in client_process.cpp
void Client::DoManaRegen() {
if (GetMana() >= max_mana)
return;
int32 level=GetLevel();
int32 regen = 0;
if (IsSitting() ||(GetHorseId() != 0)) { //this should be changed so we dont med while camping, etc...
if(HasSkill(MEDITATE)) {
medding = true;
regen = (((GetSkill(MEDITATE)/10)+(level-(level/4)))/4)+4;
regen += spellbonuses.ManaRegen + itembonuses.ManaRegen;
CheckIncreaseSkill(MEDITATE, -10);
}
else
regen = 2+spellbonuses.ManaRegen+itembonuses.ManaRegen+(le vel/5);
}
else {
medding = false;
regen = 2+spellbonuses.ManaRegen+itembonuses.ManaRegen+(le vel/5);
}
regen += GetAA(aaMentalClarity);
regen += GetAA(aaBodyAndMindRejuvenation);
regen = (regen * RuleI(Character, ManaRegenMultiplier)) / 100;

SetMana(GetMana() + regen);
SendManaUpdatePacket();
}

You can just change the line in RED and add or subtract whatever you want. Or you could add another line above it and multiply by something like this:

regen *= 5;

That would multiple your total regen by 5 before adding in the item and spell bonuses.

kavren
12-08-2008, 06:04 PM
I'm not very good at coding, so this may sound dumb, but...

Doesn't the line "if(HasSkill(MEDITATE))" mean that a person would not only have to be sitting, but also have this skill "meditate"? Which I don't know what that is.

Also,

If I changed this:

medding = true;
regen = (((GetSkill(MEDITATE)/10)+(level-(level/4)))/4)+4;
regen += spellbonuses.ManaRegen + itembonuses.ManaRegen;

to this:

medding = true;
regen = (((GetSkill(MEDITATE)/10)+(level-(level/4)))/4)+4;
regen *= 1.2;
regen += spellbonuses.ManaRegen + itembonuses.ManaRegen;

Would that increase mana regen by 1.2 percent?
Would it have an effect on HP regen?

Kobaz
12-08-2008, 06:18 PM
That would increase regen by 20% before items and spells are taken into account. You want

regen *= 1.012

to get a 1.2% increase.

kavren
12-08-2008, 10:13 PM
Doesn't the line "if(HasSkill(MEDITATE))" mean that a person would not only have to be sitting, but also have this skill "meditate"? Which I don't know what that is.

Also, does this affect HP in any way, or just mana?

trevius
12-08-2008, 10:30 PM
Meditate is a skill that that all casting classes get at low level (train it at your class GM trainer). Meditate is what makes you regenerate mana faster when sitting. The higher your skill in Meditate is, the faster you regen mana. You could set it to just regenerate when sitting without having meditate, but that wouldn't exactly be in line with how EQ works.

These changes don't effect HP regen, you would have to change code in DoHPRegen for that.