From 39429b05488705195a0d8f75ac2194fedfc014a1 Mon Sep 17 00:00:00 2001 From: Xanadu Date: Sun, 27 Jun 2010 04:03:30 +0200 Subject: Dispell code cleanup - GetDispelChance now really returns dispel chance and not resist chance. --HG-- branch : trunk --- src/server/game/Spells/SpellMgr.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/server/game/Spells/SpellMgr.cpp') diff --git a/src/server/game/Spells/SpellMgr.cpp b/src/server/game/Spells/SpellMgr.cpp index 19702f1b8f7..2f2e313fb31 100644 --- a/src/server/game/Spells/SpellMgr.cpp +++ b/src/server/game/Spells/SpellMgr.cpp @@ -290,7 +290,7 @@ int32 GetSpellMaxDuration(SpellEntry const *spellInfo) return (du->Duration[2] == -1) ? -1 : abs(du->Duration[2]); } -int32 GetDispelChance(Unit* auraCaster, Unit* target, uint32 spellId, bool offensive, bool *result) +uint32 GetDispelChance(Unit* auraCaster, Unit* target, uint32 spellId, bool offensive, bool *result) { // we assume that aura dispel chance is 100% on start // need formula for level difference based chance @@ -310,7 +310,9 @@ int32 GetDispelChance(Unit* auraCaster, Unit* target, uint32 spellId, bool offen if (result) *result = !roll_chance_i(resist_chance); - return resist_chance; + resist_chance = resist_chance < 0 ? 0 : resist_chance; + resist_chance = resist_chance > 100 ? 100 : resist_chance; + return 100 - resist_chance; } uint32 GetSpellCastTime(SpellEntry const* spellInfo, Spell * spell) -- cgit v1.2.3