diff options
author | _manuel_ <manue.l@live.com.ar> | 2010-07-22 13:04:47 -0300 |
---|---|---|
committer | _manuel_ <manue.l@live.com.ar> | 2010-07-22 13:04:47 -0300 |
commit | 3f9086fb4ff6518d75f2e494ebfb9d46c2839e85 (patch) | |
tree | da4ee9dac969a00585c7f3528cafed4d1a005fc6 | |
parent | 31956e06b8180ef2650025f6c68d55f6f42229d6 (diff) |
Fixed resist chances with Positive Auras.
BIG thanks to QAston.
--HG--
branch : trunk
-rw-r--r-- | src/server/game/Entities/Unit/Unit.cpp | 20 |
1 files changed, 18 insertions, 2 deletions
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) |