From dd02c879c403d5cda5e6b9fb14cc1b4833f9709a Mon Sep 17 00:00:00 2001 From: VladimirMangos Date: Mon, 16 May 2011 20:45:28 +0400 Subject: [PATCH] [11495] Implement damage taken reduce part of spell 20911, 25899. --- src/game/SpellEffects.cpp | 1 + src/game/Unit.cpp | 36 ++++++++++++++++++++++++++---------- src/shared/revision_nr.h | 2 +- 3 files changed, 28 insertions(+), 11 deletions(-) diff --git a/src/game/SpellEffects.cpp b/src/game/SpellEffects.cpp index 8f4953e23ef..41b1290b88f 100644 --- a/src/game/SpellEffects.cpp +++ b/src/game/SpellEffects.cpp @@ -2767,6 +2767,7 @@ void Spell::EffectDummy(SpellEffectIndex eff_idx) } case 31231: // Cheat Death { + // Cheating Death m_caster->CastSpell(m_caster, 45182, true); return; } diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp index e0d9aae4ecc..129e23ba024 100644 --- a/src/game/Unit.cpp +++ b/src/game/Unit.cpp @@ -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; } } @@ -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) @@ -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; } } diff --git a/src/shared/revision_nr.h b/src/shared/revision_nr.h index 37c2dc97e73..844fb7432e4 100644 --- a/src/shared/revision_nr.h +++ b/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__