[9411] More SpellEffectIndex using in apropriate cases

This commit is contained in:
VladimirMangos 2010-02-19 04:27:24 +03:00
parent 6469c21c41
commit 84080aaf60
26 changed files with 199 additions and 196 deletions

View file

@ -371,7 +371,7 @@ pAuraHandler AuraHandler[TOTAL_AURAS]=
static AuraType const frozenAuraTypes[] = { SPELL_AURA_MOD_ROOT, SPELL_AURA_MOD_STUN, SPELL_AURA_NONE };
Aura::Aura(SpellEntry const* spellproto, uint32 eff, int32 *currentBasePoints, Unit *target, Unit *caster, Item* castItem) :
Aura::Aura(SpellEntry const* spellproto, SpellEffectIndex eff, int32 *currentBasePoints, Unit *target, Unit *caster, Item* castItem) :
m_spellmod(NULL), m_caster_guid(0), m_target(target), m_castItemGuid(castItem?castItem->GetGUID():0),
m_timeCla(1000), m_periodicTimer(0), m_periodicTick(0), m_removeMode(AURA_REMOVE_BY_DEFAULT), m_AuraDRGroup(DIMINISHING_NONE),
m_effIndex(eff), m_auraSlot(MAX_AURAS), m_auraFlags(AFLAG_NONE), m_auraLevel(1), m_procCharges(0), m_stackAmount(1),
@ -449,7 +449,6 @@ m_isRemovedOnShapeLost(true), m_in_use(0), m_deleted(false)
sLog.outDebug("Aura: construct Spellid : %u, Aura : %u Duration : %d Target : %d Damage : %d", m_spellProto->Id, m_spellProto->EffectApplyAuraName[eff], m_maxduration, m_spellProto->EffectImplicitTargetA[eff],damage);
m_effIndex = eff;
SetModifier(AuraType(m_spellProto->EffectApplyAuraName[eff]), damage, m_spellProto->EffectAmplitude[eff], m_spellProto->EffectMiscValue[eff]);
// Apply periodic time mod
@ -483,7 +482,7 @@ Aura::~Aura()
{
}
AreaAura::AreaAura(SpellEntry const* spellproto, uint32 eff, int32 *currentBasePoints, Unit *target,
AreaAura::AreaAura(SpellEntry const* spellproto, SpellEffectIndex eff, int32 *currentBasePoints, Unit *target,
Unit *caster, Item* castItem) : Aura(spellproto, eff, currentBasePoints, target, caster, castItem)
{
m_isAreaAura = true;
@ -537,7 +536,7 @@ AreaAura::~AreaAura()
{
}
PersistentAreaAura::PersistentAreaAura(SpellEntry const* spellproto, uint32 eff, int32 *currentBasePoints, Unit *target,
PersistentAreaAura::PersistentAreaAura(SpellEntry const* spellproto, SpellEffectIndex eff, int32 *currentBasePoints, Unit *target,
Unit *caster, Item* castItem) : Aura(spellproto, eff, currentBasePoints, target, caster, castItem)
{
m_isPersistent = true;
@ -547,7 +546,7 @@ PersistentAreaAura::~PersistentAreaAura()
{
}
SingleEnemyTargetAura::SingleEnemyTargetAura(SpellEntry const* spellproto, uint32 eff, int32 *currentBasePoints, Unit *target,
SingleEnemyTargetAura::SingleEnemyTargetAura(SpellEntry const* spellproto, SpellEffectIndex eff, int32 *currentBasePoints, Unit *target,
Unit *caster, Item* castItem) : Aura(spellproto, eff, currentBasePoints, target, caster, castItem)
{
if (caster)
@ -565,7 +564,7 @@ Unit* SingleEnemyTargetAura::GetTriggerTarget() const
return ObjectAccessor::GetUnit(*m_target, m_casters_target_guid);
}
Aura* CreateAura(SpellEntry const* spellproto, uint32 eff, int32 *currentBasePoints, Unit *target, Unit *caster, Item* castItem)
Aura* CreateAura(SpellEntry const* spellproto, SpellEffectIndex eff, int32 *currentBasePoints, Unit *target, Unit *caster, Item* castItem)
{
if (IsAreaAuraEffect(spellproto->Effect[eff]))
return new AreaAura(spellproto, eff, currentBasePoints, target, caster, castItem);
@ -982,7 +981,7 @@ void Aura::_AddAura()
// Lookup for some spell auras (and get slot from it)
for(uint8 i = 0; i < m_effIndex; ++i)
{
Unit::spellEffectPair spair = Unit::spellEffectPair(GetId(), i);
Unit::spellEffectPair spair = Unit::spellEffectPair(GetId(), SpellEffectIndex(i));
for(Unit::AuraMap::const_iterator itr = m_target->GetAuras().lower_bound(spair); itr != m_target->GetAuras().upper_bound(spair); ++itr)
{
// allow use single slot only by auras from same caster
@ -1119,7 +1118,7 @@ bool Aura::_RemoveAura()
// find other aura in same slot (current already removed from list)
for(int i = 0; i < MAX_EFFECT_INDEX; ++i)
{
Unit::spellEffectPair spair = Unit::spellEffectPair(GetId(), i);
Unit::spellEffectPair spair = Unit::spellEffectPair(GetId(), SpellEffectIndex(i));
for(Unit::AuraMap::const_iterator itr = m_target->GetAuras().lower_bound(spair); itr != m_target->GetAuras().upper_bound(spair); ++itr)
{
if(itr->second->GetAuraSlot() == slot)
@ -4563,8 +4562,8 @@ void Aura::HandlePeriodicTriggerSpell(bool apply, bool /*Real*/)
return;
case 42783: //Wrath of the Astrom...
if (m_removeMode == AURA_REMOVE_BY_DEFAULT && GetEffIndex() + 1 < 3)
m_target->CastSpell(m_target, m_spellProto->CalculateSimpleValue(GetEffIndex()+1), true);
if (m_removeMode == AURA_REMOVE_BY_DEFAULT && GetEffIndex() + 1 < MAX_EFFECT_INDEX)
m_target->CastSpell(m_target, m_spellProto->CalculateSimpleValue(SpellEffectIndex(GetEffIndex()+1)), true);
return;
default:
break;
@ -6675,7 +6674,7 @@ void Aura::PeriodicTick()
{
uint32 percent =
GetEffIndex() < EFFECT_INDEX_2 && GetSpellProto()->Effect[GetEffIndex()] == SPELL_EFFECT_DUMMY ?
pCaster->CalculateSpellDamage(GetSpellProto(), GetEffIndex() + 1, GetSpellProto()->EffectBasePoints[GetEffIndex() + 1], m_target) :
pCaster->CalculateSpellDamage(GetSpellProto(), SpellEffectIndex(GetEffIndex() + 1), GetSpellProto()->EffectBasePoints[GetEffIndex() + 1], m_target) :
100;
if(m_target->GetHealth() * 100 >= m_target->GetMaxHealth() * percent )
{