mirror of
https://github.com/mangosfour/server.git
synced 2025-12-13 04:37:00 +00:00
[9411] More SpellEffectIndex using in apropriate cases
This commit is contained in:
parent
6469c21c41
commit
84080aaf60
26 changed files with 199 additions and 196 deletions
|
|
@ -2746,7 +2746,7 @@ SpellMissInfo Unit::MeleeSpellHitResult(Unit *pVictim, SpellEntry const *spell)
|
|||
// Get effects mechanic and chance
|
||||
for(int eff = 0; eff < MAX_EFFECT_INDEX; ++eff)
|
||||
{
|
||||
int32 effect_mech = GetEffectMechanic(spell, eff);
|
||||
int32 effect_mech = GetEffectMechanic(spell, SpellEffectIndex(eff));
|
||||
if (effect_mech)
|
||||
{
|
||||
int32 temp = pVictim->GetTotalAuraModifierByMiscValue(SPELL_AURA_MOD_MECHANIC_RESISTANCE, effect_mech);
|
||||
|
|
@ -2889,7 +2889,7 @@ SpellMissInfo Unit::MagicSpellHitResult(Unit *pVictim, SpellEntry const *spell)
|
|||
// Get effects mechanic and chance
|
||||
for(int eff = 0; eff < MAX_EFFECT_INDEX; ++eff)
|
||||
{
|
||||
int32 effect_mech = GetEffectMechanic(spell, eff);
|
||||
int32 effect_mech = GetEffectMechanic(spell, SpellEffectIndex(eff));
|
||||
if (effect_mech)
|
||||
{
|
||||
int32 temp = pVictim->GetTotalAuraModifierByMiscValue(SPELL_AURA_MOD_MECHANIC_RESISTANCE, effect_mech);
|
||||
|
|
@ -3919,7 +3919,7 @@ bool Unit::RemoveNoStackAurasDueToAura(Aura *Aur)
|
|||
return false;
|
||||
|
||||
uint32 spellId = Aur->GetId();
|
||||
uint32 effIndex = Aur->GetEffIndex();
|
||||
SpellEffectIndex effIndex = Aur->GetEffIndex();
|
||||
|
||||
// passive spell special case (only non stackable with ranks)
|
||||
if(IsPassiveSpell(spellId))
|
||||
|
|
@ -3956,7 +3956,7 @@ bool Unit::RemoveNoStackAurasDueToAura(Aura *Aur)
|
|||
continue;
|
||||
}
|
||||
|
||||
uint32 i_effIndex = (*i).second->GetEffIndex();
|
||||
SpellEffectIndex i_effIndex = (*i).second->GetEffIndex();
|
||||
|
||||
if(i_spellId == spellId) continue;
|
||||
|
||||
|
|
@ -4068,7 +4068,7 @@ bool Unit::RemoveNoStackAurasDueToAura(Aura *Aur)
|
|||
return true;
|
||||
}
|
||||
|
||||
void Unit::RemoveAura(uint32 spellId, uint32 effindex, Aura* except)
|
||||
void Unit::RemoveAura(uint32 spellId, SpellEffectIndex effindex, Aura* except)
|
||||
{
|
||||
spellEffectPair spair = spellEffectPair(spellId, effindex);
|
||||
for(AuraMap::iterator iter = m_Auras.lower_bound(spair); iter != m_Auras.upper_bound(spair);)
|
||||
|
|
@ -4095,7 +4095,7 @@ void Unit::RemoveAurasByCasterSpell(uint32 spellId, uint64 casterGUID)
|
|||
}
|
||||
}
|
||||
|
||||
void Unit::RemoveAurasByCasterSpell(uint32 spellId, uint32 effindex, uint64 casterGUID)
|
||||
void Unit::RemoveAurasByCasterSpell(uint32 spellId, SpellEffectIndex effindex, uint64 casterGUID)
|
||||
{
|
||||
spellEffectPair spair = spellEffectPair(spellId, effindex);
|
||||
for(AuraMap::iterator iter = m_Auras.lower_bound(spair); iter != m_Auras.upper_bound(spair);)
|
||||
|
|
@ -4265,7 +4265,7 @@ void Unit::RemoveSingleAuraFromStack(AuraMap::iterator &i, AuraRemoveMode mode)
|
|||
}
|
||||
|
||||
|
||||
void Unit::RemoveSingleAuraFromStack(uint32 spellId, uint32 effindex, AuraRemoveMode mode)
|
||||
void Unit::RemoveSingleAuraFromStack(uint32 spellId, SpellEffectIndex effindex, AuraRemoveMode mode)
|
||||
{
|
||||
AuraMap::iterator iter = m_Auras.find(spellEffectPair(spellId, effindex));
|
||||
if(iter != m_Auras.end())
|
||||
|
|
@ -4274,17 +4274,17 @@ void Unit::RemoveSingleAuraFromStack(uint32 spellId, uint32 effindex, AuraRemove
|
|||
|
||||
void Unit::RemoveSingleSpellAurasFromStack(uint32 spellId, AuraRemoveMode mode)
|
||||
{
|
||||
for (int i=0; i<3; ++i)
|
||||
RemoveSingleAuraFromStack(spellId, i, mode);
|
||||
for (int i = 0; i < MAX_EFFECT_INDEX; ++i)
|
||||
RemoveSingleAuraFromStack(spellId, SpellEffectIndex(i), mode);
|
||||
}
|
||||
|
||||
void Unit::RemoveSingleSpellAurasByCasterSpell(uint32 spellId, uint64 casterGUID, AuraRemoveMode mode)
|
||||
{
|
||||
for (int i=0; i<3; ++i)
|
||||
RemoveSingleAuraByCasterSpell(spellId, i, casterGUID, mode);
|
||||
for (int i = 0; i < MAX_EFFECT_INDEX; ++i)
|
||||
RemoveSingleAuraByCasterSpell(spellId, SpellEffectIndex(i), casterGUID, mode);
|
||||
}
|
||||
|
||||
void Unit::RemoveSingleAuraByCasterSpell(uint32 spellId, uint32 effindex, uint64 casterGUID, AuraRemoveMode mode)
|
||||
void Unit::RemoveSingleAuraByCasterSpell(uint32 spellId, SpellEffectIndex effindex, uint64 casterGUID, AuraRemoveMode mode)
|
||||
{
|
||||
spellEffectPair spair = spellEffectPair(spellId, effindex);
|
||||
for(AuraMap::iterator iter = m_Auras.lower_bound(spair); iter != m_Auras.upper_bound(spair); ++iter)
|
||||
|
|
@ -4302,14 +4302,14 @@ void Unit::RemoveSingleAuraByCasterSpell(uint32 spellId, uint32 effindex, uint64
|
|||
void Unit::RemoveAurasDueToSpell(uint32 spellId, Aura* except)
|
||||
{
|
||||
for (int i = 0; i < MAX_EFFECT_INDEX; ++i)
|
||||
RemoveAura(spellId,i,except);
|
||||
RemoveAura(spellId,SpellEffectIndex(i),except);
|
||||
}
|
||||
|
||||
void Unit::RemoveAurasDueToItemSpell(Item* castItem,uint32 spellId)
|
||||
{
|
||||
for (int k=0; k < MAX_EFFECT_INDEX; ++k)
|
||||
{
|
||||
spellEffectPair spair = spellEffectPair(spellId, k);
|
||||
spellEffectPair spair = spellEffectPair(spellId, SpellEffectIndex(k));
|
||||
for (AuraMap::iterator iter = m_Auras.lower_bound(spair); iter != m_Auras.upper_bound(spair);)
|
||||
{
|
||||
if (iter->second->GetCastItemGUID() == castItem->GetGUID())
|
||||
|
|
@ -4491,7 +4491,7 @@ void Unit::RemoveAllAurasOnDeath()
|
|||
}
|
||||
}
|
||||
|
||||
void Unit::DelayAura(uint32 spellId, uint32 effindex, int32 delaytime)
|
||||
void Unit::DelayAura(uint32 spellId, SpellEffectIndex effindex, int32 delaytime)
|
||||
{
|
||||
AuraMap::const_iterator iter = m_Auras.find(spellEffectPair(spellId, effindex));
|
||||
if (iter != m_Auras.end())
|
||||
|
|
@ -4521,7 +4521,7 @@ void Unit::_ApplyAllAuraMods()
|
|||
}
|
||||
}
|
||||
|
||||
Aura* Unit::GetAura(uint32 spellId, uint32 effindex)
|
||||
Aura* Unit::GetAura(uint32 spellId, SpellEffectIndex effindex)
|
||||
{
|
||||
AuraMap::const_iterator iter = m_Auras.find(spellEffectPair(spellId, effindex));
|
||||
if (iter != m_Auras.end())
|
||||
|
|
@ -4549,7 +4549,7 @@ bool Unit::HasAura(uint32 spellId) const
|
|||
{
|
||||
for (int i = 0; i < MAX_EFFECT_INDEX ; ++i)
|
||||
{
|
||||
AuraMap::const_iterator iter = m_Auras.find(spellEffectPair(spellId, i));
|
||||
AuraMap::const_iterator iter = m_Auras.find(spellEffectPair(spellId, SpellEffectIndex(i)));
|
||||
if (iter != m_Auras.end())
|
||||
return true;
|
||||
}
|
||||
|
|
@ -4593,7 +4593,7 @@ void Unit::RemoveAllDynObjects()
|
|||
}
|
||||
}
|
||||
|
||||
DynamicObject * Unit::GetDynObject(uint32 spellId, uint32 effIndex)
|
||||
DynamicObject * Unit::GetDynObject(uint32 spellId, SpellEffectIndex effIndex)
|
||||
{
|
||||
for (DynObjectGUIDs::iterator i = m_dynObjGUIDs.begin(); i != m_dynObjGUIDs.end();)
|
||||
{
|
||||
|
|
@ -5031,7 +5031,7 @@ bool Unit::HandleSpellCritChanceAuraProc(Unit *pVictim, uint32 /*damage*/, Aura*
|
|||
bool Unit::HandleDummyAuraProc(Unit *pVictim, uint32 damage, Aura* triggeredByAura, SpellEntry const * procSpell, uint32 procFlag, uint32 procEx, uint32 cooldown)
|
||||
{
|
||||
SpellEntry const *dummySpell = triggeredByAura->GetSpellProto ();
|
||||
uint32 effIndex = triggeredByAura->GetEffIndex();
|
||||
SpellEffectIndex effIndex = triggeredByAura->GetEffIndex();
|
||||
int32 triggerAmount = triggeredByAura->GetModifier()->m_amount;
|
||||
|
||||
Item* castItem = triggeredByAura->GetCastItemGUID() && GetTypeId()==TYPEID_PLAYER
|
||||
|
|
@ -9695,7 +9695,7 @@ bool Unit::IsImmunedToSpell(SpellEntry const* spellInfo)
|
|||
return false;
|
||||
}
|
||||
|
||||
bool Unit::IsImmunedToSpellEffect(SpellEntry const* spellInfo, uint32 index) const
|
||||
bool Unit::IsImmunedToSpellEffect(SpellEntry const* spellInfo, SpellEffectIndex index) const
|
||||
{
|
||||
//If m_immuneToEffect type contain this effect type, IMMUNE effect.
|
||||
uint32 effect = spellInfo->Effect[index];
|
||||
|
|
@ -11139,7 +11139,7 @@ bool Unit::SelectHostileTarget()
|
|||
//======================================================================
|
||||
//======================================================================
|
||||
|
||||
int32 Unit::CalculateSpellDamage(SpellEntry const* spellProto, uint8 effect_index, int32 effBasePoints, Unit const* target)
|
||||
int32 Unit::CalculateSpellDamage(SpellEntry const* spellProto, SpellEffectIndex effect_index, int32 effBasePoints, Unit const* target)
|
||||
{
|
||||
Player* unitPlayer = (GetTypeId() == TYPEID_PLAYER) ? (Player*)this : NULL;
|
||||
|
||||
|
|
@ -11194,7 +11194,7 @@ int32 Unit::CalculateSpellDamage(SpellEntry const* spellProto, uint8 effect_inde
|
|||
return value;
|
||||
}
|
||||
|
||||
int32 Unit::CalculateSpellDuration(SpellEntry const* spellProto, uint8 effect_index, Unit const* target)
|
||||
int32 Unit::CalculateSpellDuration(SpellEntry const* spellProto, SpellEffectIndex effect_index, Unit const* target)
|
||||
{
|
||||
Player* unitPlayer = (GetTypeId() == TYPEID_PLAYER) ? (Player*)this : NULL;
|
||||
|
||||
|
|
@ -13158,7 +13158,7 @@ bool Unit::HandleMendingAuraProc( Aura* triggeredByAura )
|
|||
{
|
||||
// aura can be deleted at casts
|
||||
SpellEntry const* spellProto = triggeredByAura->GetSpellProto();
|
||||
uint32 effIdx = triggeredByAura->GetEffIndex();
|
||||
SpellEffectIndex effIdx = triggeredByAura->GetEffIndex();
|
||||
int32 heal = triggeredByAura->GetModifier()->m_amount;
|
||||
uint64 caster_guid = triggeredByAura->GetCasterGUID();
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue