From da06d09c45d2bac410c9b32da6e39c4eb6dca728 Mon Sep 17 00:00:00 2001 From: VladimirMangos Date: Tue, 24 May 2011 16:30:38 +0400 Subject: [PATCH] [11532] Prevent triggering some spells at 0 damage hit. --- src/game/Unit.h | 1 + src/game/UnitAuraProcHandler.cpp | 33 ++++++++++++++++++++++++++++++-- src/shared/revision_nr.h | 2 +- 3 files changed, 33 insertions(+), 3 deletions(-) diff --git a/src/game/Unit.h b/src/game/Unit.h index 091881fa9..f80fe8c8e 100644 --- a/src/game/Unit.h +++ b/src/game/Unit.h @@ -1849,6 +1849,7 @@ class MANGOS_DLL_SPEC Unit : public WorldObject SpellAuraProcResult HandleModDamagePercentDoneAuraProc(Unit *pVictim, uint32 damage, Aura* triggeredByAura, SpellEntry const *procSpell, uint32 procFlag, uint32 procEx, uint32 cooldown); SpellAuraProcResult HandleModRating(Unit *pVictim, uint32 damage, Aura* triggeredByAura, SpellEntry const *procSpell, uint32 procFlag, uint32 procEx, uint32 cooldown); SpellAuraProcResult HandleManaShieldAuraProc(Unit *pVictim, uint32 damage, Aura* triggeredByAura, SpellEntry const *procSpell, uint32 procFlag, uint32 procEx, uint32 cooldown); + SpellAuraProcResult HandleModResistanceAuraProc(Unit *pVictim, uint32 damage, Aura* triggeredByAura, SpellEntry const *procSpell, uint32 procFlag, uint32 procEx, uint32 cooldown); SpellAuraProcResult HandleNULLProc(Unit* /*pVictim*/, uint32 /*damage*/, Aura* /*triggeredByAura*/, SpellEntry const* /*procSpell*/, uint32 /*procFlag*/, uint32 /*procEx*/, uint32 /*cooldown*/) { // no proc handler for this aura type diff --git a/src/game/UnitAuraProcHandler.cpp b/src/game/UnitAuraProcHandler.cpp index f40522272..620e9c1e4 100644 --- a/src/game/UnitAuraProcHandler.cpp +++ b/src/game/UnitAuraProcHandler.cpp @@ -54,7 +54,7 @@ pAuraProcHandler AuraProcHandler[TOTAL_AURAS]= &Unit::HandleNULLProc, // 19 SPELL_AURA_MOD_INVISIBILITY_DETECTION &Unit::HandleNULLProc, // 20 SPELL_AURA_OBS_MOD_HEALTH &Unit::HandleNULLProc, // 21 SPELL_AURA_OBS_MOD_MANA - &Unit::HandleNULLProc, // 22 SPELL_AURA_MOD_RESISTANCE + &Unit::HandleModResistanceAuraProc, // 22 SPELL_AURA_MOD_RESISTANCE &Unit::HandleNULLProc, // 23 SPELL_AURA_PERIODIC_TRIGGER_SPELL &Unit::HandleNULLProc, // 24 SPELL_AURA_PERIODIC_ENERGIZE &Unit::HandleNULLProc, // 25 SPELL_AURA_MOD_PACIFY @@ -1844,6 +1844,10 @@ SpellAuraProcResult Unit::HandleDummyAuraProc(Unit *pVictim, uint32 damage, Aura // Judgement of Light case 20185: { + // only at real damage + if (!damage) + return SPELL_AURA_PROC_FAILED; + basepoints[0] = int32( pVictim->GetMaxHealth() * triggeredByAura->GetModifier()->m_amount / 100 ); pVictim->CastCustomSpell(pVictim, 20267, &basepoints[0], NULL, NULL, true, NULL, triggeredByAura); return SPELL_AURA_PROC_OK; @@ -1851,6 +1855,10 @@ SpellAuraProcResult Unit::HandleDummyAuraProc(Unit *pVictim, uint32 damage, Aura // Judgement of Wisdom case 20186: { + // only at real damage + if (!damage) + return SPELL_AURA_PROC_FAILED; + if (pVictim->getPowerType() == POWER_MANA) { // 2% of maximum base mana @@ -3011,7 +3019,13 @@ SpellAuraProcResult Unit::HandleProcTriggerSpellAuraProc(Unit *pVictim, uint32 d trigger_spell_id = 12721; break; } - if (auraSpellInfo->Id == 50421) // Scent of Blood + else if (auraSpellInfo->SpellIconID == 2961) // Taste for Blood + { + // only at real damage + if (!damage) + return SPELL_AURA_PROC_FAILED; + } + else if (auraSpellInfo->Id == 50421) // Scent of Blood trigger_spell_id = 50422; break; case SPELLFAMILY_WARLOCK: @@ -3968,3 +3982,18 @@ SpellAuraProcResult Unit::HandleManaShieldAuraProc(Unit *pVictim, uint32 damage, return SPELL_AURA_PROC_OK; } + +SpellAuraProcResult Unit::HandleModResistanceAuraProc(Unit* /*pVictim*/, uint32 damage, Aura* triggeredByAura, SpellEntry const* /*procSpell*/, uint32 /*procFlag*/, uint32 /*procEx*/, uint32 /*cooldown*/) +{ + SpellEntry const *spellInfo = triggeredByAura->GetSpellProto(); + + // Inner Fire + if (spellInfo->IsFitToFamilyMask(SPELLFAMILY_PRIEST, UI64LIT(0x0000000000002))) + { + // only at real damage + if (!damage) + return SPELL_AURA_PROC_FAILED; + } + + return SPELL_AURA_PROC_OK; +} diff --git a/src/shared/revision_nr.h b/src/shared/revision_nr.h index f2ef7bbf5..a9293671d 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 "11531" + #define REVISION_NR "11532" #endif // __REVISION_NR_H__