[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);

View file

@ -1537,6 +1537,10 @@ bool SpellMgr::IsNoStackSpellDueToSpell(uint32 spellId_1, uint32 spellId_2) cons
(spellId_2 == 33891 && spellId_1 == 34123))
return false;
// Innervate and Glyph of Innervate and some other spells
if (spellInfo_1->SpellIconID == 62 && spellInfo_2->SpellIconID == 62)
return false;
// Wrath of Elune and Nature's Grace
if( spellInfo_1->Id == 16886 && spellInfo_2->Id == 46833 || spellInfo_2->Id == 16886 && spellInfo_1->Id == 46833 )
return false;

View file

@ -1,4 +1,4 @@
#ifndef __REVISION_NR_H__
#define __REVISION_NR_H__
#define REVISION_NR "8891"
#define REVISION_NR "8892"
#endif // __REVISION_NR_H__