[9346] Implement bonuses for spell 50464

* Implement percent bonus at own Hot at target. Original patch provided by rechapa79
* Implement glyph 45603. Original patch provided by Splinter.
* Rewrite code for spell 60137.
This commit is contained in:
VladimirMangos 2010-02-10 06:21:20 +03:00
parent 96202d7dfd
commit 841cf86402
2 changed files with 31 additions and 14 deletions

View file

@ -9437,19 +9437,17 @@ uint32 Unit::SpellHealingBonus(Unit *pVictim, SpellEntry const *spellProto, uint
case 8477: // Nourish Heal Boost
{
int32 stepPercent = (*i)->GetModifier()->m_amount;
int32 modPercent = 0;
AuraMap const& victimAuras = pVictim->GetAuras();
for (AuraMap::const_iterator itr = victimAuras.begin(); itr != victimAuras.end(); ++itr)
{
if (itr->second->GetCasterGUID()!=GetGUID())
continue;
SpellEntry const* m_spell = itr->second->GetSpellProto();
if (m_spell->SpellFamilyName != SPELLFAMILY_DRUID ||
!(m_spell->SpellFamilyFlags & UI64LIT(0x0000001000000050)))
continue;
modPercent += stepPercent * itr->second->GetStackAmount();
}
DoneTotalMod *= (modPercent+100.0f)/100.0f;
int ownHotCount = 0;
Unit::AuraList const& RejorRegr = pVictim->GetAurasByType(SPELL_AURA_PERIODIC_HEAL);
for(Unit::AuraList::const_iterator i = RejorRegr.begin(); i != RejorRegr.end(); ++i)
if ((*i)->GetSpellProto()->SpellFamilyName == SPELLFAMILY_DRUID &&
(*i)->GetCasterGUID() == GetGUID())
ownHotCount += (*i)->GetStackAmount();
if (ownHotCount)
TakenTotalMod *= (stepPercent * ownHotCount + 100.0f) / 100.0f;
break;
}
case 7871: // Glyph of Lesser Healing Wave
@ -9539,6 +9537,25 @@ uint32 Unit::SpellHealingBonus(Unit *pVictim, SpellEntry const *spellProto, uint
if((*itr)->GetId() == 29203)
TakenTotalMod *= ((*itr)->GetModifier()->m_amount+100.0f) / 100.0f;
}
// Nourish 20% of heal increase if target is affected by Druids HOTs
else if (spellProto->SpellFamilyName == SPELLFAMILY_DRUID && (spellProto->SpellFamilyFlags & UI64LIT(0x0200000000000000)))
{
int ownHotCount = 0;
Unit::AuraList const& RejorRegr = pVictim->GetAurasByType(SPELL_AURA_PERIODIC_HEAL);
for(Unit::AuraList::const_iterator i = RejorRegr.begin(); i != RejorRegr.end(); ++i)
if ((*i)->GetSpellProto()->SpellFamilyName == SPELLFAMILY_DRUID &&
(*i)->GetCasterGUID() == GetGUID())
ownHotCount += (*i)->GetStackAmount();
if (ownHotCount)
{
TakenTotalMod *= 1.2f; // base bonus at HoTs
if (Aura* glyph = GetAura(62971,0)) // Glyph of Nourish
TakenTotalMod *= (glyph->GetModifier()->m_amount * ownHotCount + 100.0f) / 100.0f;
}
}
AuraList const& mHealingGet= pVictim->GetAurasByType(SPELL_AURA_MOD_HEALING_RECEIVED);
for(AuraList::const_iterator i = mHealingGet.begin(); i != mHealingGet.end(); ++i)