View Single Post
  #1  
Old 09-24-2015, 05:49 AM
AdrianD
Discordant
 
Join Date: Dec 2013
Posts: 297
Default

Thanks Uleat.

I understand the concept but the vocab is still a little beyond me.

I figured to add to this thread with a different snippet since the same question applies. It appears to work with 12 > SkillMeditate > 0 in game.

Both #showstats and watching ticks are accurate although client mana# jumps around. Not sure when it normalizes but, a level 50 at max meditate (235) shows the ticks perfectly for a titanium client.

Does this look right/could it be better?

Comments within the code below:
Code:
int32 Client::CalcBaseManaRegen()
{
	uint8 clevel = GetLevel();
	int32 regen = 0;
	if (IsSitting() || (GetHorseId() != 0)) {
		if (HasSkill(SkillMeditate) && GetSkill(SkillMeditate) > 11) { // added GetSkill(SkillMeditate) > 11 so obtaining meditate isn't an immediate detriment at low levels
			regen = ((GetSkill(SkillMeditate) / 12)) + 1; // changed equation
		}
		else {
			regen = 2;
		}
	}
	else {
		regen = 1; // changed to 1 from 2
	}
	return regen;
}

int32 Client::CalcManaRegen()
{
	uint8 clevel = GetLevel();
	int32 regen = 0;
	//this should be changed so we dont med while camping, etc...
	if (IsSitting() || (GetHorseId() != 0)) {
		BuffFadeBySitModifier();
		if (HasSkill(SkillMeditate) && GetSkill(SkillMeditate) > 11) { // added GetSkill(SkillMeditate) > 11 so obtaining meditate isn't an immediate detriment at low levels
			regen = ((GetSkill(SkillMeditate) / 12)) + 1;  // changed equation
			regen += spellbonuses.ManaRegen + itembonuses.ManaRegen;
			CheckIncreaseSkill(SkillMeditate, nullptr, -5);
		}
		else {
			regen = 2 + spellbonuses.ManaRegen + itembonuses.ManaRegen;
		}
	}
	else {
		this->medding = false;
		regen = 1 + spellbonuses.ManaRegen + itembonuses.ManaRegen; // changed to 1 from 2
	}
	//AAs
	regen += aabonuses.ManaRegen;
	return (regen * RuleI(Character, ManaRegenMultiplier) / 100);
}
I'm open to all critique.

Thanks
Reply With Quote