aboutsummaryrefslogtreecommitdiff
path: root/src/game/SpellEffects.cpp
diff options
context:
space:
mode:
authorQAston <none@none>2009-03-01 18:50:33 +0100
committerQAston <none@none>2009-03-01 18:50:33 +0100
commit281f4ce49a614fecab071836b82f98f524f85ef2 (patch)
tree37736178fb906ad75d881b30d3d1be049cf0e11c /src/game/SpellEffects.cpp
parent44de012148eda14fd3286b04a933ad9f9e286105 (diff)
*Fix dispel chance mod calculation.
*Fix Escape artist-by Lightguard. --HG-- branch : trunk
Diffstat (limited to 'src/game/SpellEffects.cpp')
-rw-r--r--src/game/SpellEffects.cpp25
1 files changed, 14 insertions, 11 deletions
diff --git a/src/game/SpellEffects.cpp b/src/game/SpellEffects.cpp
index fa33d76571f..967b3407326 100644
--- a/src/game/SpellEffects.cpp
+++ b/src/game/SpellEffects.cpp
@@ -3434,18 +3434,10 @@ void Spell::EffectDispel(uint32 i)
SpellEntry const* spellInfo = aur->GetSpellProto();
// Base dispel chance
// TODO: possible chance depend from spell level??
- int32 miss_chance = 0;
- // Apply dispel mod from aura caster
- if (Unit *caster = aur->GetCaster())
- {
- if ( Player* modOwner = caster->GetSpellModOwner() )
- modOwner->ApplySpellMod(spellInfo->Id, SPELLMOD_RESIST_DISPEL_CHANCE, miss_chance, this);
- }
- // Try dispel
- if (roll_chance_i(miss_chance))
- fail_list.push_back(aur->GetId());
- else
+ if (aur->GetDispelChance(this))
success_list.push_back(std::pair<uint32,uint64>(aur->GetId(),aur->GetCasterGUID()));
+ else
+ fail_list.push_back(aur->GetId());
// Remove buff from list for prevent doubles
for (std::vector<Aura *>::iterator j = dispel_list.begin(); j != dispel_list.end(); )
{
@@ -4774,6 +4766,15 @@ void Spell::EffectScriptEffect(uint32 effIndex)
unitTarget->HandleEmoteCommand(EMOTE_STATE_DANCE);
break;
}
+ // Escape artist
+ case 20589:
+ {
+ if(!unitTarget)
+ return;
+ // It is said that removing effects by script should include dispel resist mods
+ unitTarget->RemoveSpellsCausingAuraWithDispel(SPELL_AURA_MOD_ROOT, this);
+ unitTarget->RemoveSpellsCausingAuraWithDispel(SPELL_AURA_MOD_DECREASE_SPEED, this);
+ }
// Mirren's Drinking Hat
case 29830:
{
@@ -6205,6 +6206,8 @@ void Spell::EffectDispelMechanic(uint32 i)
next = iter;
++next;
SpellEntry const *spell = sSpellStore.LookupEntry(iter->second->GetSpellProto()->Id);
+ if (!iter->second->GetDispelChance(this))
+ continue;
if(spell->Mechanic == mechanic || spell->EffectMechanic[iter->second->GetEffIndex()] == mechanic)
{
unitTarget->RemoveAurasDueToSpell(spell->Id);