aboutsummaryrefslogtreecommitdiff
path: root/src/server/game/Spells/SpellMgr.cpp
diff options
context:
space:
mode:
authorXanadu <none@none>2010-06-27 04:03:30 +0200
committerXanadu <none@none>2010-06-27 04:03:30 +0200
commit39429b05488705195a0d8f75ac2194fedfc014a1 (patch)
tree2d6c271e1973e1ce811c38a381f69e39e4bdf339 /src/server/game/Spells/SpellMgr.cpp
parent26f4fae8020ac805376c9b696331857ed1004c94 (diff)
Dispell code cleanup - GetDispelChance now really returns dispel chance and not resist chance.
--HG-- branch : trunk
Diffstat (limited to 'src/server/game/Spells/SpellMgr.cpp')
-rw-r--r--src/server/game/Spells/SpellMgr.cpp6
1 files changed, 4 insertions, 2 deletions
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)