Dispell code cleanup - GetDispelChance now really returns dispel chance and not resist chance.

--HG--
branch : trunk
This commit is contained in:
Xanadu committed 2010-06-27 04:03:30 +02:00
1 parent 26f4fae802
commit 39429b0548
3 files changed
+8 -6

No files matched your search

+4 -2
View File
@@ -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)