[8030] Fixed spell 64901 work and related target selection code refactoring.

* Replace 64904 by 64901 in spellbook and action bars.
* Implement proper max mana percent buff
* Implement proper target selection.
* Move group/raid targets seelction code to functions for reuse code.
This commit is contained in:
VladimirMangos 2009-06-17 00:01:05 +04:00
parent 1526b7aad5
commit 7024862b82
10 changed files with 165 additions and 144 deletions

View file

@ -4789,7 +4789,7 @@ void Aura::HandleAuraModIncreaseMaxHealth(bool apply, bool /*Real*/)
}
}
void Aura::HandleAuraModIncreaseEnergy(bool apply, bool /*Real*/)
void Aura::HandleAuraModIncreaseEnergy(bool apply, bool Real)
{
Powers powerType = m_target->getPowerType();
if(int32(powerType) != m_modifier.m_miscvalue)
@ -4797,6 +4797,19 @@ void Aura::HandleAuraModIncreaseEnergy(bool apply, bool /*Real*/)
UnitMods unitMod = UnitMods(UNIT_MOD_POWER_START + powerType);
// Special case with temporary increase max/current power (percent)
if (GetId()==64904) // Hymn of Hope
{
if(Real)
{
uint32 val = m_target->GetPower(powerType);
m_target->HandleStatModifier(unitMod, TOTAL_PCT, float(m_modifier.m_amount), apply);
m_target->SetPower(powerType, apply ? val*(100+m_modifier.m_amount)/100 : val*100/(100+m_modifier.m_amount));
}
return;
}
// generic flat case
m_target->HandleStatModifier(unitMod, TOTAL_VALUE, float(m_modifier.m_amount), apply);
}