From 3f9086fb4ff6518d75f2e494ebfb9d46c2839e85 Mon Sep 17 00:00:00 2001 From: _manuel_ Date: Thu, 22 Jul 2010 13:04:47 -0300 Subject: Fixed resist chances with Positive Auras. BIG thanks to QAston. --HG-- branch : trunk --- src/server/game/Entities/Unit/Unit.cpp | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index 9156612392f..604bb2830d5 100644 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -2899,8 +2899,24 @@ SpellMissInfo Unit::MagicSpellHitResult(Unit *pVictim, SpellEntry const *spell) tmp += resist_chance; // Chance resist debuff - tmp += pVictim->GetMaxPositiveAuraModifierByMiscValue(SPELL_AURA_MOD_DEBUFF_RESISTANCE, int32(spell->Dispel)) * 100; - tmp += pVictim->GetMaxNegativeAuraModifierByMiscValue(SPELL_AURA_MOD_DEBUFF_RESISTANCE, int32(spell->Dispel)) * 100; + if (!IsPositiveSpell(spell->Id)) + { + bool bNegativeAura = false; + for (uint8 I = 0; I < 3; I++) + { + if (spell->EffectApplyAuraName[I] != 0) + { + bNegativeAura = true; + break; + } + } + + if (bNegativeAura) + { + tmp += pVictim->GetMaxPositiveAuraModifierByMiscValue(SPELL_AURA_MOD_DEBUFF_RESISTANCE, int32(spell->Dispel)) * 100; + tmp += pVictim->GetMaxNegativeAuraModifierByMiscValue(SPELL_AURA_MOD_DEBUFF_RESISTANCE, int32(spell->Dispel)) * 100; + } + } // Roll chance if (rand < tmp) -- cgit v1.2.3