*Fix dispel chance mod calculation.

*Fix Escape artist-by Lightguard.

--HG--
branch : trunk
This commit is contained in:
QAston
2009-03-01 18:50:33 +01:00
parent 44de012148
commit 281f4ce49a
5 changed files with 54 additions and 11 deletions
+15
View File
@@ -5066,6 +5066,21 @@ void Aura::HandleShapeshiftBoosts(bool apply)
m_target->SetHealth(uint32(ceil((double)m_target->GetMaxHealth() * healthPercentage)));*/
}
bool Aura::GetDispelChance(Spell* spell)
{
// we assume that aura dispel chance is 100% on start
// need formula for level difference based chance
int32 miss_chance = 100;
// Apply dispel mod from aura caster
if (Unit *caster = GetCaster())
{
if ( Player* modOwner = caster->GetSpellModOwner() )
modOwner->ApplySpellMod(GetId(), SPELLMOD_RESIST_DISPEL_CHANCE, miss_chance, spell);
}
// Try dispel
return roll_chance_i(miss_chance);
}
void Aura::HandleAuraEmpathy(bool apply, bool Real)
{
if(m_target->GetTypeId() != TYPEID_UNIT)