Skip to content

Commit

Permalink
[11495] Implement damage taken reduce part of spell 20911, 25899.
Browse files Browse the repository at this point in the history
  • Loading branch information
VladimirMangos committed May 16, 2011
1 parent d9676f2 commit dd02c87
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 11 deletions.
1 change: 1 addition & 0 deletions src/game/SpellEffects.cpp
Expand Up @@ -2767,6 +2767,7 @@ void Spell::EffectDummy(SpellEffectIndex eff_idx)
}
case 31231: // Cheat Death
{
// Cheating Death
m_caster->CastSpell(m_caster, 45182, true);
return;
}
Expand Down
36 changes: 26 additions & 10 deletions src/game/Unit.cpp
Expand Up @@ -6529,15 +6529,28 @@ uint32 Unit::SpellDamageBonusTaken(Unit *pCaster, SpellEntry const *spellProto,
TakenTotalMod *= GetTotalAuraMultiplierByMiscMask(SPELL_AURA_MOD_DAMAGE_PERCENT_TAKEN, schoolMask);

// .. taken pct: dummy auras
if (GetTypeId() == TYPEID_PLAYER)
AuraList const& mDummyAuras = GetAurasByType(SPELL_AURA_DUMMY);
for(AuraList::const_iterator i = mDummyAuras.begin(); i != mDummyAuras.end(); ++i)
{
//Cheat Death
if (Aura *dummy = GetDummyAura(45182))
switch((*i)->GetId())
{
float mod = -((Player*)this)->GetRatingBonusValue(CR_CRIT_TAKEN_SPELL)*2*4;
if (mod < float(dummy->GetModifier()->m_amount))
mod = float(dummy->GetModifier()->m_amount);
TakenTotalMod *= (mod+100.0f)/100.0f;
case 45182: // Cheating Death
if((*i)->GetModifier()->m_miscvalue & SPELL_SCHOOL_MASK_NORMAL)
{
if(GetTypeId() != TYPEID_PLAYER)
continue;

float mod = ((Player*)this)->GetRatingBonusValue(CR_CRIT_TAKEN_MELEE)*(-8.0f);
if (mod < float((*i)->GetModifier()->m_amount))
mod = float((*i)->GetModifier()->m_amount);

TakenTotalMod *= (mod + 100.0f) / 100.0f;
}
break;
case 20911: // Blessing of Sanctuary
case 25899: // Greater Blessing of Sanctuary
TakenTotalMod *= ((*i)->GetModifier()->m_amount + 100.0f) / 100.0f;
break;
}
}

Expand Down Expand Up @@ -7501,10 +7514,9 @@ uint32 Unit::MeleeDamageBonusTaken(Unit *pCaster, uint32 pdamage,WeaponAttackTyp
AuraList const& mDummyAuras = GetAurasByType(SPELL_AURA_DUMMY);
for(AuraList::const_iterator i = mDummyAuras.begin(); i != mDummyAuras.end(); ++i)
{
switch((*i)->GetSpellProto()->SpellIconID)
switch((*i)->GetId())
{
//Cheat Death
case 2109:
case 45182: // Cheating Death
if((*i)->GetModifier()->m_miscvalue & SPELL_SCHOOL_MASK_NORMAL)
{
if(GetTypeId() != TYPEID_PLAYER)
Expand All @@ -7517,6 +7529,10 @@ uint32 Unit::MeleeDamageBonusTaken(Unit *pCaster, uint32 pdamage,WeaponAttackTyp
TakenPercent *= (mod + 100.0f) / 100.0f;
}
break;
case 20911: // Blessing of Sanctuary
case 25899: // Greater Blessing of Sanctuary
TakenPercent *= ((*i)->GetModifier()->m_amount + 100.0f) / 100.0f;
break;
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/shared/revision_nr.h
@@ -1,4 +1,4 @@
#ifndef __REVISION_NR_H__
#define __REVISION_NR_H__
#define REVISION_NR "11494"
#define REVISION_NR "11495"
#endif // __REVISION_NR_H__

0 comments on commit dd02c87

Please sign in to comment.