aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/game/SpellEffects.cpp12
-rw-r--r--src/game/SpellMgr.cpp6
-rw-r--r--src/game/SpellMgr.h4
-rw-r--r--src/game/Unit.cpp4
-rw-r--r--src/game/Unit.h2
5 files changed, 17 insertions, 11 deletions
diff --git a/src/game/SpellEffects.cpp b/src/game/SpellEffects.cpp
index d01e992ed90..021fd24fd71 100644
--- a/src/game/SpellEffects.cpp
+++ b/src/game/SpellEffects.cpp
@@ -3358,7 +3358,7 @@ void Spell::EffectDispel(uint32 i)
for (uint32 i=urand(0, list_size-1);i>0;--i)
itr++;
- if (GetDispelChance(this, (*itr)->GetCaster(), (*itr)->GetId()))
+ if (GetDispelChance((*itr)->GetCaster(), (*itr)->GetId()))
{
success_list.push_back(*itr);
dispel_list.erase(itr);
@@ -5876,13 +5876,19 @@ void Spell::EffectDispelMechanic(uint32 i)
Unit::AuraMap& Auras = unitTarget->GetAuras();
for(Unit::AuraMap::iterator iter = Auras.begin(); iter != Auras.end(); iter++)
+ {
if(GetAllSpellMechanicMask(iter->second->GetSpellProto()) & (1<<(mechanic)))
+ {
dispel_list.push(iter->second);
+ }
+ }
for(;dispel_list.size();dispel_list.pop())
{
- if (GetDispelChance(this, dispel_list.front()->GetCaster(), dispel_list.front()->GetId()))
- unitTarget->RemoveAura(dispel_list.front()->GetId(), dispel_list.front()->GetCasterGUID());
+ if (GetDispelChance(dispel_list.front()->GetCaster(), dispel_list.front()->GetId()))
+ {
+ unitTarget->RemoveAura(dispel_list.front(), AURA_REMOVE_BY_ENEMY_SPELL);
+ }
}
}
diff --git a/src/game/SpellMgr.cpp b/src/game/SpellMgr.cpp
index 59063eb05b1..c5c70b0d92f 100644
--- a/src/game/SpellMgr.cpp
+++ b/src/game/SpellMgr.cpp
@@ -230,7 +230,7 @@ int32 GetSpellMaxDuration(SpellEntry const *spellInfo)
return (du->Duration[2] == -1) ? -1 : abs(du->Duration[2]);
}
-bool GetDispelChance(Spell* spell, Unit* caster, uint32 spellId)
+bool GetDispelChance(Unit* caster, uint32 spellId)
{
// we assume that aura dispel chance is 100% on start
// need formula for level difference based chance
@@ -239,7 +239,7 @@ bool GetDispelChance(Spell* spell, Unit* caster, uint32 spellId)
if (caster)
{
if ( Player* modOwner = caster->GetSpellModOwner() )
- modOwner->ApplySpellMod(spellId, SPELLMOD_RESIST_DISPEL_CHANCE, miss_chance, spell);
+ modOwner->ApplySpellMod(spellId, SPELLMOD_RESIST_DISPEL_CHANCE, miss_chance);
}
// Try dispel
return !roll_chance_i(miss_chance);
@@ -1158,7 +1158,7 @@ void SpellMgr::LoadSpellBonusess()
sLog.outString( ">> Loaded %u extra spell bonus data", count);
}
-bool SpellMgr::IsSpellProcEventCanTriggeredBy(SpellProcEventEntry const*& spellProcEvent, uint32 EventProcFlag, SpellEntry const * procSpell, uint32 procFlags, uint32 procExtra, bool active)
+bool SpellMgr::IsSpellProcEventCanTriggeredBy(SpellProcEventEntry const* spellProcEvent, uint32 EventProcFlag, SpellEntry const * procSpell, uint32 procFlags, uint32 procExtra, bool active)
{
// No extra req need
uint32 procEvent_procEx = PROC_EX_NONE;
diff --git a/src/game/SpellMgr.h b/src/game/SpellMgr.h
index 45285121c1a..41a6cf41cf3 100644
--- a/src/game/SpellMgr.h
+++ b/src/game/SpellMgr.h
@@ -152,7 +152,7 @@ SpellSpecific GetSpellSpecific(uint32 spellId);
inline float GetSpellRadiusForHostile(SpellRadiusEntry const *radius) { return (radius ? radius->radiusHostile : 0); }
inline float GetSpellRadiusForFriend(SpellRadiusEntry const *radius) { return (radius ? radius->radiusFriend : 0); }
uint32 GetSpellCastTime(SpellEntry const* spellInfo, Spell const* spell = NULL);
-bool GetDispelChance(Spell* spell, Unit* caster, uint32 spellId);
+bool GetDispelChance(Unit* caster, uint32 spellId);
inline float GetSpellMinRangeForHostile(SpellRangeEntry const *range) { return (range ? range->minRangeHostile : 0); }
inline float GetSpellMaxRangeForHostile(SpellRangeEntry const *range) { return (range ? range->maxRangeHostile : 0); }
inline float GetSpellMinRangeForFriend(SpellRangeEntry const *range) { return (range ? range->minRangeFriend : 0); }
@@ -715,7 +715,7 @@ class SpellMgr
return NULL;
}
- bool IsSpellProcEventCanTriggeredBy( SpellProcEventEntry const *& spellProcEvent, uint32 EventProcFlag, SpellEntry const * procSpell, uint32 procFlags, uint32 procExtra, bool active);
+ bool IsSpellProcEventCanTriggeredBy( SpellProcEventEntry const * spellProcEvent, uint32 EventProcFlag, SpellEntry const * procSpell, uint32 procFlags, uint32 procExtra, bool active);
// Spell bonus data
SpellBonusEntry const* GetSpellBonusData(uint32 spellId) const
diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp
index 1395288d19d..33bcfa6d75c 100644
--- a/src/game/Unit.cpp
+++ b/src/game/Unit.cpp
@@ -4075,7 +4075,7 @@ void Unit::RemoveAurasByTypeWithDispel(AuraType auraType, Spell * spell)
{
Aura * aur = (*iter)->GetParentAura();
++iter;
- if (GetDispelChance(spell, aur->GetCaster(), aur->GetId()))
+ if (GetDispelChance(aur->GetCaster(), aur->GetId()))
{
uint32 removedAuras = m_removedAuras.size();
RemoveAura(aur, AURA_REMOVE_BY_ENEMY_SPELL);
@@ -12306,7 +12306,7 @@ Pet* Unit::CreateTamedPetFrom(Creature* creatureTarget,uint32 spell_id)
return pet;
}
-bool Unit::IsTriggeredAtSpellProcEvent(Unit *pVictim, Aura * aura, SpellEntry const* procSpell, uint32 procFlag, uint32 procExtra, WeaponAttackType attType, bool isVictim, bool active, SpellProcEventEntry const*& spellProcEvent )
+bool Unit::IsTriggeredAtSpellProcEvent(Unit *pVictim, Aura * aura, SpellEntry const* procSpell, uint32 procFlag, uint32 procExtra, WeaponAttackType attType, bool isVictim, bool active, SpellProcEventEntry const *& spellProcEvent )
{
SpellEntry const* spellProto = aura->GetSpellProto ();
diff --git a/src/game/Unit.h b/src/game/Unit.h
index 5076f87bd26..4559bd97bba 100644
--- a/src/game/Unit.h
+++ b/src/game/Unit.h
@@ -1623,7 +1623,7 @@ class TRINITY_DLL_SPEC Unit : public WorldObject
void SendAttackStop(Unit* victim); // only from AttackStop(Unit*)
//void SendAttackStart(Unit* pVictim); // only from Unit::AttackStart(Unit*)
- bool IsTriggeredAtSpellProcEvent(Unit *pVictim, Aura* aura, SpellEntry const * procSpell, uint32 procFlag, uint32 procExtra, WeaponAttackType attType, bool isVictim, bool active, SpellProcEventEntry const*& spellProcEvent );
+ bool IsTriggeredAtSpellProcEvent(Unit *pVictim, Aura* aura, SpellEntry const * procSpell, uint32 procFlag, uint32 procExtra, WeaponAttackType attType, bool isVictim, bool active, SpellProcEventEntry const *& spellProcEvent );
bool HandleDummyAuraProc( Unit *pVictim, uint32 damage, AuraEffect* triggeredByAura, SpellEntry const *procSpell, uint32 procFlag, uint32 procEx, uint32 cooldown);
bool HandleObsModEnergyAuraProc( Unit *pVictim, uint32 damage, AuraEffect* triggeredByAura, SpellEntry const *procSpell, uint32 procFlag, uint32 procEx, uint32 cooldown);
bool HandleHasteAuraProc( Unit *pVictim, uint32 damage, AuraEffect* triggeredByAura, SpellEntry const *procSpell, uint32 procFlag, uint32 procEx, uint32 cooldown);