[7184] Implement more generic work for some SPELL_AURA_OVERRIDE_CLASS_SCRIPTS auras

Fix warlock 17804 and ranks
Implement druid 643 set bonus
Shaman 23199, 28248, 32330 item (totems)
DK 49202 and ranks, 49024 and ranks
Priest 47573 and ranks
Hunter 53241 and ranks

Signed-off-by: DiSlord <dislord@nomail.com>
This commit is contained in:
DiSlord 2009-01-26 00:45:46 +03:00
parent 9e52b0f748
commit 7ee5dd6387
3 changed files with 127 additions and 60 deletions

View file

@ -7477,19 +7477,139 @@ uint32 Unit::SpellDamageBonus(Unit *pVictim, SpellEntry const *spellProto, uint3
if( (*i)->GetModifier()->m_miscvalue & GetSpellSchoolMask(spellProto) )
TakenTotalMod *= ((*i)->GetModifier()->m_amount+100.0f)/100.0f;
// .. taken pct: scripted (increases damage of * against targets *)
// done scripted mod
AuraList const& mOverrideClassScript = GetAurasByType(SPELL_AURA_OVERRIDE_CLASS_SCRIPTS);
for(AuraList::const_iterator i = mOverrideClassScript.begin(); i != mOverrideClassScript.end(); ++i)
{
if (!(*i)->isAffectedOnSpell(spellProto))
continue;
switch((*i)->GetModifier()->m_miscvalue)
{
//Molten Fury
case 4920: case 4919:
// Molten Fury
case 4920:
case 4919:
{
if(pVictim->HasAuraState(AURA_STATE_HEALTHLESS_35_PERCENT))
TakenTotalMod *= (100.0f+(*i)->GetModifier()->m_amount)/100.0f; break;
TakenTotalMod *= (100.0f+(*i)->GetModifier()->m_amount)/100.0f;
break;
}
// Soul Siphon
case 4992:
case 4993:
{
// effect 1 m_amount
int32 maxPercent = (*i)->GetModifier()->m_amount;
// effect 0 m_amount
int32 stepPercent = CalculateSpellDamage((*i)->GetSpellProto(), 0, (*i)->GetSpellProto()->EffectBasePoints[0], this);
// count affliction effects and calc additional damage in percentage
int32 modPercent = 0;
Unit::AuraMap const& victimAuras = pVictim->GetAuras();
for (Unit::AuraMap::const_iterator itr = victimAuras.begin(); itr != victimAuras.end(); ++itr)
{
SpellEntry const* m_spell = itr->second->GetSpellProto();
if (m_spell->SpellFamilyName != SPELLFAMILY_WARLOCK || !(m_spell->SpellFamilyFlags & 0x0004071B8044C402LL))
continue;
modPercent += stepPercent;
if (modPercent >= maxPercent)
{
modPercent = maxPercent;
break;
}
}
DoneTotalMod *= (modPercent+100.0f)/100.0f;
break;
}
// Starfire Bonus
case 5481:
{
AuraList const& auras = pVictim->GetAurasByType(SPELL_AURA_PERIODIC_DAMAGE);
for(AuraList::const_iterator itr = auras.begin(); itr != auras.end(); ++itr)
{
SpellEntry const* m_spell = (*itr)->GetSpellProto();
if (m_spell->SpellFamilyName == SPELLFAMILY_DRUID &&
m_spell->SpellFamilyFlags & 0x0000000000200002LL)
{
DoneTotalMod *= ((*i)->GetModifier()->m_amount+100.0f)/100.0f;
break;
}
}
break;
}
// Increased Lightning Damage
case 4554:
case 5142:
case 6008:
{
pdamage+=(*i)->GetModifier()->m_amount;
break;
}
// Tundra Stalker
// Merciless Combat
case 7277:
{
// Merciless Combat
if ((*i)->GetSpellProto()->SpellIconID == 2656)
{
if(pVictim->HasAuraState(AURA_STATE_HEALTHLESS_35_PERCENT))
TakenTotalMod *= (100.0f+(*i)->GetModifier()->m_amount)/100.0f;
}
else // Tundra Stalker
{
AuraList const& auras = pVictim->GetAurasByType(SPELL_AURA_DUMMY);
for(AuraList::const_iterator itr = auras.begin(); itr != auras.end(); ++itr)
{
SpellEntry const* m_spell = (*itr)->GetSpellProto();
if (m_spell->SpellFamilyName == SPELLFAMILY_DEATHKNIGHT &&
m_spell->SpellFamilyFlags & 0x0400000000000000LL)
{
DoneTotalMod *= ((*i)->GetModifier()->m_amount+100.0f)/100.0f;
break;
}
}
}
break;
}
// Twisted Faith
case 7377:
{
AuraList const& auras = pVictim->GetAurasByType(SPELL_AURA_PERIODIC_DAMAGE);
for(AuraList::const_iterator itr = auras.begin(); itr != auras.end(); ++itr)
{
SpellEntry const* m_spell = (*itr)->GetSpellProto();
if (m_spell->SpellFamilyName == SPELLFAMILY_PRIEST &&
m_spell->SpellFamilyFlags & 0x0000000000008000LL &&
(*itr)->GetCasterGUID()==GetGUID())
{
DoneTotalMod *= ((*i)->GetModifier()->m_amount+100.0f)/100.0f;
break;
}
}
break;
}
}
}
// taken scripted mod
AuraList const& mOverrideClassScriptTaken = GetAurasByType(SPELL_AURA_OVERRIDE_CLASS_SCRIPTS);
for(AuraList::const_iterator i = mOverrideClassScriptTaken.begin(); i != mOverrideClassScriptTaken.end(); ++i)
{
if (!(*i)->isAffectedOnSpell(spellProto))
continue;
switch((*i)->GetModifier()->m_miscvalue)
{
// Marked for Death
case 7598:
case 7599:
case 7600:
case 7601:
case 7602:
{
if ((*i)->GetCasterGUID()==GetGUID() || // Self
(*i)->GetCasterGUID()==GetOwnerGUID()) // Owner
DoneTotalMod *= ((*i)->GetModifier()->m_amount+100.0f)/100.0f;
break;
}
}
}
// .. taken pct: dummy auras
AuraList const& mDummyAuras = pVictim->GetAurasByType(SPELL_AURA_DUMMY);
for(AuraList::const_iterator i = mDummyAuras.begin(); i != mDummyAuras.end(); ++i)
@ -7508,7 +7628,7 @@ uint32 Unit::SpellDamageBonus(Unit *pVictim, SpellEntry const *spellProto, uint3
TakenTotalMod *= (mod+100.0f)/100.0f;
}
break;
//Mangle
// Mangle
case 2312:
for(int j=0;j<3;j++)
{