[11748] Replace SpellModifier struct by direct aura access (this should fix charge drops of 36032) also revert [11740]

This commit is contained in:
Laise 2011-07-20 15:41:01 +03:00
parent c9a9179d89
commit e178c79d51
10 changed files with 131 additions and 267 deletions

View file

@ -4441,7 +4441,7 @@ void Unit::RemoveAurasDueToSpellBySteal(uint32 spellId, ObjectGuid casterGuid, U
int32 basePoints = aur->GetBasePoints();
// construct the new aura for the attacker - will never return NULL, it's just a wrapper for
// some different constructors
Aura * new_aur = CreateAura(aur->GetSpellProto(), aur->GetEffIndex(), &basePoints, new_holder, stealer, this);
Aura * new_aur = CreateAura(spellProto, aur->GetEffIndex(), &basePoints, new_holder, stealer, this);
// set periodic to do at least one tick (for case when original aura has been at last tick preparing)
int32 periodic = aur->GetModifier()->periodictime;
@ -6530,6 +6530,13 @@ uint32 Unit::SpellDamageBonusTaken(Unit *pCaster, SpellEntry const *spellProto,
case 25899: // Greater Blessing of Sanctuary
TakenTotalMod *= ((*i)->GetModifier()->m_amount + 100.0f) / 100.0f;
break;
case 47580: // Pain and Suffering (Rank 1) TODO: can be pct modifier aura
case 47581: // Pain and Suffering (Rank 2)
case 47582: // Pain and Suffering (Rank 3)
// Shadow Word: Death
if (spellProto->IsFitToFamilyMask(UI64LIT(0x0000000200000000)))
TakenTotalMod *= ((*i)->GetModifier()->m_amount + 100.0f) / 100.0f;
break;
}
}
@ -6956,22 +6963,40 @@ uint32 Unit::SpellHealingBonusDone(Unit *pVictim, SpellEntry const *spellProto,
}
}
// Nourish 20% of heal increase if target is affected by Druids HOTs
if (spellProto->SpellFamilyName == SPELLFAMILY_DRUID && (spellProto->SpellFamilyFlags & UI64LIT(0x0200000000000000)))
if (spellProto->SpellFamilyName == SPELLFAMILY_DRUID)
{
int ownHotCount = 0; // counted HoT types amount, not stacks
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() == GetObjectGuid())
++ownHotCount;
if (ownHotCount)
// Nourish 20% of heal increase if target is affected by Druids HOTs
if (spellProto->SpellFamilyFlags & UI64LIT(0x0200000000000000))
{
DoneTotalMod *= 1.2f; // base bonus at HoTs
int ownHotCount = 0; // counted HoT types amount, not stacks
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() == GetObjectGuid())
++ownHotCount;
if (Aura* glyph = GetAura(62971, EFFECT_INDEX_0))// Glyph of Nourish
DoneTotalMod *= (glyph->GetModifier()->m_amount * ownHotCount + 100.0f) / 100.0f;
if (ownHotCount)
{
DoneTotalMod *= 1.2f; // base bonus at HoTs
if (Aura* glyph = GetAura(62971, EFFECT_INDEX_0))// Glyph of Nourish
DoneTotalMod *= (glyph->GetModifier()->m_amount * ownHotCount + 100.0f) / 100.0f;
}
}
// Lifebloom
else if (spellProto->IsFitToFamilyMask(0x0000001000000000))
{
AuraList const& dummyList = owner->GetAurasByType(SPELL_AURA_DUMMY);
for(AuraList::const_iterator i = dummyList.begin(); i != dummyList.end(); ++i)
{
switch((*i)->GetId())
{
case 34246: // Idol of the Emerald Queen TODO: can be flat modifier aura
case 60779: // Idol of Lush Moss
DoneTotal += (*i)->GetModifier()->m_amount / 7;
break;
}
}
}
}
@ -9724,12 +9749,17 @@ void Unit::ProcDamageAndSpellFor( bool isVictim, Unit * pTarget, uint32 procFlag
{
if (!procSpell->IsFitToFamilyMask(spellProcEvent->spellFamilyMask[i]))
continue;
// modifier aura procs by default are not active and only allowed with non zero charges
// procEx == PROC_EX_NORMAL_HIT only for real "on cast" cases
if (!useCharges && damage == 0 && procExtra == PROC_EX_NORMAL_HIT && (procFlag & SPELL_CAST_TRIGGER_MASK))
continue;
}
// don't check dbc FamilyFlags if schoolMask exists
else if (!triggeredByAura->CanProcFrom(procSpell, spellProcEvent->procEx, procExtra, damage != 0, !spellProcEvent->schoolMask))
else if (!triggeredByAura->CanProcFrom(procSpell, procFlag, spellProcEvent->procEx, procExtra, damage != 0, !spellProcEvent->schoolMask))
continue;
}
else if (!triggeredByAura->CanProcFrom(procSpell, PROC_EX_NONE, procExtra, damage != 0, true))
else if (!triggeredByAura->CanProcFrom(procSpell, procFlag, PROC_EX_NONE, procExtra, damage != 0, true))
continue;
}