[9403] Replace number with enum name where explicitly used in array/other checks

Signed-off-by: NoFantasy <nofantasy@nf.no>
This commit is contained in:
NoFantasy 2010-02-17 19:06:09 +01:00
parent 5c05280c44
commit 7c555add76
14 changed files with 128 additions and 128 deletions

View file

@ -610,7 +610,7 @@ void Aura::Update(uint32 diff)
// GetEffIndex()==0 prevent double/triple apply manaPerSecond/manaPerSecondPerLevel to same spell with many auras
// all spells with manaPerSecond/manaPerSecondPerLevel have aura in effect 0
if(GetEffIndex()==0 && m_timeCla <= 0)
if (GetEffIndex() == EFFECT_INDEX_0 && m_timeCla <= 0)
{
if(Unit* caster = GetCaster())
{
@ -2388,8 +2388,8 @@ void Aura::HandleAuraDummy(bool apply, bool Real)
else
{
if( m_target->GetTypeId() == TYPEID_PLAYER &&
( GetSpellProto()->Effect[0]==72 || GetSpellProto()->Effect[0]==6 &&
( GetSpellProto()->EffectApplyAuraName[0]==1 || GetSpellProto()->EffectApplyAuraName[0]==128 ) ) )
(GetSpellProto()->Effect[EFFECT_INDEX_0] == 72 || GetSpellProto()->Effect[EFFECT_INDEX_0] == 6 &&
(GetSpellProto()->EffectApplyAuraName[EFFECT_INDEX_0] == 1 || GetSpellProto()->EffectApplyAuraName[EFFECT_INDEX_0] == 128)))
{
// spells with SpellEffect=72 and aura=4: 6196, 6197, 21171, 21425
((Player*)m_target)->SetFarSightGUID(0);
@ -2828,7 +2828,7 @@ void Aura::HandleAuraDummy(bool apply, bool Real)
return;
}
if(GetEffIndex()==0 && m_target->GetTypeId()==TYPEID_PLAYER)
if (GetEffIndex() == EFFECT_INDEX_0 && m_target->GetTypeId() == TYPEID_PLAYER)
{
SpellAreaForAreaMapBounds saBounds = sSpellMgr.GetSpellAreaForAuraMapBounds(GetId());
if(saBounds.first != saBounds.second)
@ -2844,7 +2844,7 @@ void Aura::HandleAuraDummy(bool apply, bool Real)
// some auras applied at aura apply
else if(itr->second->autocast)
{
if( !m_target->HasAura(itr->second->spellId, 0) )
if (!m_target->HasAura(itr->second->spellId, EFFECT_INDEX_0))
m_target->CastSpell(m_target, itr->second->spellId, true);
}
}
@ -3135,7 +3135,7 @@ void Aura::HandleAuraModShapeshift(bool apply, bool Real)
if(itr->second->state == PLAYERSPELL_REMOVED) continue;
SpellEntry const *spellInfo = sSpellStore.LookupEntry(itr->first);
if (spellInfo && spellInfo->SpellFamilyName == SPELLFAMILY_WARRIOR && spellInfo->SpellIconID == 139)
Rage_val += m_target->CalculateSpellDamage(spellInfo, 0, spellInfo->EffectBasePoints[0], m_target) * 10;
Rage_val += m_target->CalculateSpellDamage(spellInfo, 0, spellInfo->EffectBasePoints[EFFECT_INDEX_0], m_target) * 10;
}
}
@ -4315,7 +4315,7 @@ void Aura::HandleAuraModIncreaseFlightSpeed(bool apply, bool Real)
m_target->ApplySpellImmune(GetId(),IMMUNITY_MECHANIC,MECHANIC_POLYMORPH,apply);
// Dragonmaw Illusion (overwrite mount model, mounted aura already applied)
if( apply && m_target->HasAura(42016,0) && m_target->GetMountID())
if (apply && m_target->HasAura(42016, EFFECT_INDEX_0) && m_target->GetMountID())
m_target->SetUInt32Value(UNIT_FIELD_MOUNTDISPLAYID,16314);
// Festive Holiday Mount
@ -4719,9 +4719,9 @@ void Aura::HandlePeriodicDamage(bool apply, bool Real)
float mwb_max = caster->GetWeaponDamageRange(BASE_ATTACK,MAXDAMAGE);
m_modifier.m_amount+=int32(((mwb_min+mwb_max)/2+ap*mws/14000)*0.2f);
// If used while target is above 75% health, Rend does 35% more damage
if( m_spellProto->CalculateSimpleValue(1) !=0 &&
m_target->GetHealth() > m_target->GetMaxHealth() * m_spellProto->CalculateSimpleValue(1) / 100)
m_modifier.m_amount += m_modifier.m_amount * m_spellProto->CalculateSimpleValue(2) / 100;
if (m_spellProto->CalculateSimpleValue(EFFECT_INDEX_1) !=0 &&
m_target->GetHealth() > m_target->GetMaxHealth() * m_spellProto->CalculateSimpleValue(EFFECT_INDEX_1) / 100)
m_modifier.m_amount += m_modifier.m_amount * m_spellProto->CalculateSimpleValue(EFFECT_INDEX_2) / 100;
return;
}
break;
@ -4729,7 +4729,7 @@ void Aura::HandlePeriodicDamage(bool apply, bool Real)
case SPELLFAMILY_DRUID:
{
// Rake
if (m_spellProto->SpellFamilyFlags & UI64LIT(0x0000000000001000) && m_spellProto->Effect[2]==SPELL_EFFECT_ADD_COMBO_POINTS)
if (m_spellProto->SpellFamilyFlags & UI64LIT(0x0000000000001000) && m_spellProto->Effect[EFFECT_INDEX_2] == SPELL_EFFECT_ADD_COMBO_POINTS)
{
// $AP*0.18/3 bonus per tick
m_modifier.m_amount += int32(caster->GetTotalAttackPowerValue(BASE_ATTACK) * 6 / 100);
@ -6129,7 +6129,7 @@ void Aura::HandleSpellSpecificBoosts(bool apply)
if (dummyEntry->SpellFamilyName == SPELLFAMILY_PRIEST && dummyEntry->SpellIconID == 2218 &&
dummyEntry->SpellVisual[0]==0)
{
chance = (*itr)->GetSpellProto()->CalculateSimpleValue(1);
chance = (*itr)->GetSpellProto()->CalculateSimpleValue(EFFECT_INDEX_1);
break;
}
}
@ -6582,11 +6582,11 @@ void Aura::HandleSchoolAbsorb(bool apply, bool Real)
SpellEntry const* vSpell = (*itr)->GetSpellProto();
// Rapture (main spell)
if(vSpell->SpellFamilyName == SPELLFAMILY_PRIEST && vSpell->SpellIconID == 2894 && vSpell->Effect[1])
if(vSpell->SpellFamilyName == SPELLFAMILY_PRIEST && vSpell->SpellIconID == 2894 && vSpell->Effect[EFFECT_INDEX_1])
{
switch((*itr)->GetEffIndex())
{
case 0:
case EFFECT_INDEX_0:
{
// energize caster
int32 manapct1000 = 5 * ((*itr)->GetModifier()->m_amount + sSpellMgr.GetSpellRank(vSpell->Id));
@ -6594,7 +6594,7 @@ void Aura::HandleSchoolAbsorb(bool apply, bool Real)
caster->CastCustomSpell(caster, 47755, &basepoints0, NULL, NULL, true);
break;
}
case 1:
case EFFECT_INDEX_1:
{
// energize target
if (!roll_chance_i((*itr)->GetModifier()->m_amount) || caster->HasAura(63853))
@ -6674,7 +6674,7 @@ void Aura::PeriodicTick()
case 38772:
{
uint32 percent =
GetEffIndex() < 2 && GetSpellProto()->Effect[GetEffIndex()] == SPELL_EFFECT_DUMMY ?
GetEffIndex() < EFFECT_INDEX_2 && GetSpellProto()->Effect[GetEffIndex()] == SPELL_EFFECT_DUMMY ?
pCaster->CalculateSpellDamage(GetSpellProto(), GetEffIndex() + 1, GetSpellProto()->EffectBasePoints[GetEffIndex() + 1], m_target) :
100;
if(m_target->GetHealth() * 100 >= m_target->GetMaxHealth() * percent )
@ -7506,7 +7506,7 @@ void Aura::PeriodicDummyTick()
if (rage == 0)
return;
int32 mod = (rage < 100) ? rage : 100;
int32 points = m_target->CalculateSpellDamage(spell, 1, spell->EffectBasePoints[1], m_target);
int32 points = m_target->CalculateSpellDamage(spell, 1, spell->EffectBasePoints[EFFECT_INDEX_1], m_target);
int32 regen = m_target->GetMaxHealth() * (mod * points / 10) / 1000;
m_target->CastCustomSpell(m_target, 22845, &regen, NULL, NULL, true, NULL, this);
m_target->SetPower(POWER_RAGE, rage-mod);
@ -7620,7 +7620,7 @@ void Aura::PeriodicDummyTick()
if (spell->SpellFamilyFlags & UI64LIT(0x0000400000000000))
{
// Get 0 effect aura
Aura *slow = m_target->GetAura(GetId(), 0);
Aura *slow = m_target->GetAura(GetId(), EFFECT_INDEX_0);
if (slow)
{
slow->ApplyModifier(false, true);
@ -7642,7 +7642,7 @@ void Aura::PeriodicDummyTick()
{
// Increases your attack power by $s1 for every $s2 armor value you have.
// Calculate AP bonus (from 1 efect of this spell)
int32 apBonus = m_modifier.m_amount * m_target->GetArmor() / m_target->CalculateSpellDamage(spell, 1, spell->EffectBasePoints[1], m_target);
int32 apBonus = m_modifier.m_amount * m_target->GetArmor() / m_target->CalculateSpellDamage(spell, 1, spell->EffectBasePoints[EFFECT_INDEX_1], m_target);
m_target->CastCustomSpell(m_target, 61217, &apBonus, &apBonus, NULL, true, NULL, this);
return;
}
@ -7818,7 +7818,7 @@ void Aura::HandlePhase(bool apply, bool Real)
((Player*)m_target)->GetSession()->SendSetPhaseShift(apply ? GetMiscValue() : PHASEMASK_NORMAL);
if(GetEffIndex()==0)
if (GetEffIndex() == EFFECT_INDEX_0)
{
SpellAreaForAreaMapBounds saBounds = sSpellMgr.GetSpellAreaForAuraMapBounds(GetId());
if(saBounds.first != saBounds.second)
@ -7834,7 +7834,7 @@ void Aura::HandlePhase(bool apply, bool Real)
// some auras applied at aura apply
else if(itr->second->autocast)
{
if( !m_target->HasAura(itr->second->spellId, 0) )
if (!m_target->HasAura(itr->second->spellId, EFFECT_INDEX_0))
m_target->CastSpell(m_target, itr->second->spellId, true);
}
}