[8892] Implement spell 29166 and glyph 40908.

Original patch provided by bobaz.

Signed-off-by: VladimirMangos <vladimir@getmangos.com>

Also add protection from wrong periodic heal at relogin.
This commit is contained in:
Sarjuuk 2009-11-29 19:20:43 +03:00 committed by VladimirMangos
parent 8465ae23f9
commit d542e25302
3 changed files with 29 additions and 4 deletions

View file

@ -4428,10 +4428,31 @@ void Aura::HandlePeriodicEnergize(bool apply, bool Real)
if (!Real)
return;
if (apply)
// For prevent double apply bonuses
bool loading = (m_target->GetTypeId() == TYPEID_PLAYER && ((Player*)m_target)->GetSession()->PlayerLoading());
if (apply && !loading)
{
switch (GetId())
{
case 54833: // Glyph of Innervate (value%/2 of casters base mana)
{
Unit* caster = GetCaster();
m_modifier.m_amount = int32(caster->GetCreateMana() * GetBasePoints() / (200 * m_maxduration / m_periodicTimer));
break;
}
case 29166: // Innervate (value% of casters base mana)
{
Unit* caster = GetCaster();
// Glyph of Innervate
if (caster && caster->HasAura(54832))
caster->CastSpell(caster,54833,true,NULL,this);
m_modifier.m_amount = int32(caster->GetCreateMana() * GetBasePoints() / (100 * m_maxduration / m_periodicTimer));
break;
}
case 48391: // Owlkin Frenzy 2% base mana
m_modifier.m_amount = m_target->GetCreateMana() * 2 / 100;
break;
@ -4461,8 +4482,6 @@ void Aura::HandleAuraPeriodicDummy(bool apply, bool Real)
// For prevent double apply bonuses
bool loading = (m_target->GetTypeId() == TYPEID_PLAYER && ((Player*)m_target)->GetSession()->PlayerLoading());
Unit* caster = GetCaster();
SpellEntry const*spell = GetSpellProto();
switch( spell->SpellFamilyName)
{
@ -4482,6 +4501,8 @@ void Aura::HandleAuraPeriodicDummy(bool apply, bool Real)
}
case SPELLFAMILY_HUNTER:
{
Unit* caster = GetCaster();
// Explosive Shot
if (apply && !loading && caster)
m_modifier.m_amount += int32(caster->GetTotalAttackPowerValue(RANGED_ATTACK) * 14 / 100);