mirror of
https://github.com/mangosfour/server.git
synced 2025-12-16 04:37:00 +00:00
[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:
parent
5c05280c44
commit
7c555add76
14 changed files with 128 additions and 128 deletions
|
|
@ -399,7 +399,7 @@ void Spell::EffectSchoolDMG(uint32 effect_idx)
|
|||
// Shockwave ${$m3/100*$AP}
|
||||
else if (m_spellInfo->SpellFamilyFlags & UI64LIT(0x0000800000000000))
|
||||
{
|
||||
int32 pct = m_caster->CalculateSpellDamage(m_spellInfo, 2, m_spellInfo->EffectBasePoints[2], unitTarget);
|
||||
int32 pct = m_caster->CalculateSpellDamage(m_spellInfo, 2, m_spellInfo->EffectBasePoints[EFFECT_INDEX_2], unitTarget);
|
||||
if (pct > 0)
|
||||
damage+= int32(m_caster->GetTotalAttackPowerValue(BASE_ATTACK) * pct / 100);
|
||||
break;
|
||||
|
|
@ -500,7 +500,7 @@ void Spell::EffectSchoolDMG(uint32 effect_idx)
|
|||
if ((*i)->GetSpellProto()->SpellFamilyName == SPELLFAMILY_PRIEST &&
|
||||
((*i)->GetSpellProto()->SpellIconID == 95))
|
||||
{
|
||||
int chance = (*i)->GetSpellProto()->CalculateSimpleValue(1);
|
||||
int chance = (*i)->GetSpellProto()->CalculateSimpleValue(EFFECT_INDEX_1);
|
||||
if (roll_chance_i(chance))
|
||||
// Mind Trauma
|
||||
m_caster->CastSpell(unitTarget, 48301, true);
|
||||
|
|
@ -525,7 +525,7 @@ void Spell::EffectSchoolDMG(uint32 effect_idx)
|
|||
m_caster->SetPower(POWER_ENERGY,energy-used_energy);
|
||||
}
|
||||
// Rake
|
||||
else if (m_spellInfo->SpellFamilyFlags & UI64LIT(0x0000000000001000) && m_spellInfo->Effect[2]==SPELL_EFFECT_ADD_COMBO_POINTS)
|
||||
else if (m_spellInfo->SpellFamilyFlags & UI64LIT(0x0000000000001000) && m_spellInfo->Effect[EFFECT_INDEX_2] == SPELL_EFFECT_ADD_COMBO_POINTS)
|
||||
{
|
||||
// $AP*0.01 bonus
|
||||
damage += int32(m_caster->GetTotalAttackPowerValue(BASE_ATTACK) / 100);
|
||||
|
|
@ -571,7 +571,7 @@ void Spell::EffectSchoolDMG(uint32 effect_idx)
|
|||
{
|
||||
if ((*iter)->GetSpellProto()->SpellFamilyName == SPELLFAMILY_ROGUE && (*iter)->GetSpellProto()->SpellIconID == 1960)
|
||||
{
|
||||
if (int32 chance = (*iter)->GetSpellProto()->CalculateSimpleValue(2))
|
||||
if (int32 chance = (*iter)->GetSpellProto()->CalculateSimpleValue(EFFECT_INDEX_2))
|
||||
if (roll_chance_i(chance))
|
||||
needConsume = false;
|
||||
|
||||
|
|
@ -718,7 +718,7 @@ void Spell::EffectSchoolDMG(uint32 effect_idx)
|
|||
{
|
||||
// Add main hand dps * effect[2] amount
|
||||
float average = (m_caster->GetFloatValue(UNIT_FIELD_MINDAMAGE) + m_caster->GetFloatValue(UNIT_FIELD_MAXDAMAGE)) / 2;
|
||||
int32 count = m_caster->CalculateSpellDamage(m_spellInfo, 2, m_spellInfo->EffectBasePoints[2], unitTarget);
|
||||
int32 count = m_caster->CalculateSpellDamage(m_spellInfo, 2, m_spellInfo->EffectBasePoints[EFFECT_INDEX_2], unitTarget);
|
||||
damage += count * int32(average * IN_MILISECONDS) / m_caster->GetAttackTime(BASE_ATTACK);
|
||||
}
|
||||
// Shield of Righteousness
|
||||
|
|
@ -1276,10 +1276,10 @@ void Spell::EffectDummy(uint32 i)
|
|||
{
|
||||
case 0:
|
||||
{
|
||||
uint32 spellID = m_spellInfo->CalculateSimpleValue(0);
|
||||
uint32 reqAuraID = m_spellInfo->CalculateSimpleValue(1);
|
||||
uint32 spellID = m_spellInfo->CalculateSimpleValue(EFFECT_INDEX_0);
|
||||
uint32 reqAuraID = m_spellInfo->CalculateSimpleValue(EFFECT_INDEX_1);
|
||||
|
||||
if (m_caster->HasAura(reqAuraID,0))
|
||||
if (m_caster->HasAura(reqAuraID, EFFECT_INDEX_0))
|
||||
m_caster->CastSpell(m_caster, spellID, true, NULL);
|
||||
return;
|
||||
}
|
||||
|
|
@ -1491,7 +1491,7 @@ void Spell::EffectDummy(uint32 i)
|
|||
if ((*itr)->GetSpellProto()->SpellIconID == 1989)
|
||||
{
|
||||
// saved rage top stored in next affect
|
||||
uint32 lastrage = (*itr)->GetSpellProto()->CalculateSimpleValue(1)*10;
|
||||
uint32 lastrage = (*itr)->GetSpellProto()->CalculateSimpleValue(EFFECT_INDEX_1)*10;
|
||||
if(lastrage < rage)
|
||||
rage -= lastrage;
|
||||
break;
|
||||
|
|
@ -3739,7 +3739,7 @@ void Spell::EffectDispel(uint32 i)
|
|||
// Devour Magic
|
||||
if (m_spellInfo->SpellFamilyName == SPELLFAMILY_WARLOCK && m_spellInfo->Category == SPELLCATEGORY_DEVOUR_MAGIC)
|
||||
{
|
||||
int32 heal_amount = m_spellInfo->CalculateSimpleValue(1);
|
||||
int32 heal_amount = m_spellInfo->CalculateSimpleValue(EFFECT_INDEX_1);
|
||||
m_caster->CastCustomSpell(m_caster, 19658, &heal_amount, NULL, NULL, true);
|
||||
}
|
||||
}
|
||||
|
|
@ -5055,7 +5055,7 @@ void Spell::EffectScriptEffect(uint32 effIndex)
|
|||
|
||||
// check presence
|
||||
for(int j = 0; j < 4; ++j)
|
||||
if(unitTarget->HasAura(spells[j],0))
|
||||
if(unitTarget->HasAura(spells[j], EFFECT_INDEX_0))
|
||||
return;
|
||||
|
||||
// select spell
|
||||
|
|
@ -5295,8 +5295,8 @@ void Spell::EffectScriptEffect(uint32 effIndex)
|
|||
if(!unitTarget || unitTarget->GetTypeId() != TYPEID_PLAYER || effIndex!=0)
|
||||
return;
|
||||
|
||||
uint32 spellID = m_spellInfo->CalculateSimpleValue(0);
|
||||
uint32 questID = m_spellInfo->CalculateSimpleValue(1);
|
||||
uint32 spellID = m_spellInfo->CalculateSimpleValue(EFFECT_INDEX_0);
|
||||
uint32 questID = m_spellInfo->CalculateSimpleValue(EFFECT_INDEX_1);
|
||||
|
||||
if (((Player*)unitTarget)->GetQuestStatus(questID) == QUEST_STATUS_COMPLETE && !((Player*)unitTarget)->GetQuestRewardStatus (questID))
|
||||
unitTarget->CastSpell(unitTarget, spellID, true);
|
||||
|
|
@ -5464,7 +5464,7 @@ void Spell::EffectScriptEffect(uint32 effIndex)
|
|||
case 63521:
|
||||
{
|
||||
// Divine Plea, refresh on target (3 aura slots)
|
||||
if (Aura* aura = unitTarget->GetAura(54428,0))
|
||||
if (Aura* aura = unitTarget->GetAura(54428, EFFECT_INDEX_0))
|
||||
aura->RefreshAura();
|
||||
return;
|
||||
}
|
||||
|
|
@ -5526,14 +5526,14 @@ void Spell::EffectScriptEffect(uint32 effIndex)
|
|||
aura->RefreshAura();
|
||||
|
||||
// Serpent Sting - Instantly deals 40% of the damage done by your Serpent Sting.
|
||||
if ((familyFlag & UI64LIT(0x0000000000004000)) && aura->GetEffIndex() == 0)
|
||||
if ((familyFlag & UI64LIT(0x0000000000004000)) && aura->GetEffIndex() == EFFECT_INDEX_0)
|
||||
{
|
||||
// m_amount already include RAP bonus
|
||||
basePoint = aura->GetModifier()->m_amount * 5 * 40 / 100;
|
||||
spellId = 53353; // Chimera Shot - Serpent
|
||||
}
|
||||
// Viper Sting - Instantly restores mana to you equal to 60% of the total amount drained by your Viper Sting.
|
||||
if ((familyFlag & UI64LIT(0x0000008000000000)) && aura->GetEffIndex() == 0)
|
||||
if ((familyFlag & UI64LIT(0x0000008000000000)) && aura->GetEffIndex() == EFFECT_INDEX_0)
|
||||
{
|
||||
uint32 target_max_mana = unitTarget->GetMaxPower(POWER_MANA);
|
||||
if (!target_max_mana)
|
||||
|
|
@ -5629,7 +5629,7 @@ void Spell::EffectScriptEffect(uint32 effIndex)
|
|||
for(Unit::AuraList::const_iterator itr = m_dummyAuras.begin(); itr != m_dummyAuras.end(); ++itr)
|
||||
{
|
||||
// search seal (offensive seals have judgement's aura dummy spell id in 2 effect
|
||||
if ((*itr)->GetEffIndex() != 2 || !IsSealSpell((*itr)->GetSpellProto()))
|
||||
if ((*itr)->GetEffIndex() != EFFECT_INDEX_2 || !IsSealSpell((*itr)->GetSpellProto()))
|
||||
continue;
|
||||
spellId2 = (*itr)->GetModifier()->m_amount;
|
||||
SpellEntry const *judge = sSpellStore.LookupEntry(spellId2);
|
||||
|
|
@ -5643,7 +5643,7 @@ void Spell::EffectScriptEffect(uint32 effIndex)
|
|||
Unit::AuraList const& procTriggerAuras = m_caster->GetAurasByType(SPELL_AURA_PROC_TRIGGER_SPELL);
|
||||
for(Unit::AuraList::const_iterator itr = procTriggerAuras.begin(); itr != procTriggerAuras.end(); ++itr)
|
||||
{
|
||||
if ((*itr)->GetEffIndex() != 0 || !IsSealSpell((*itr)->GetSpellProto()))
|
||||
if ((*itr)->GetEffIndex() != EFFECT_INDEX_0 || !IsSealSpell((*itr)->GetSpellProto()))
|
||||
continue;
|
||||
spellId2 = 54158;
|
||||
break;
|
||||
|
|
@ -5684,7 +5684,7 @@ void Spell::EffectScriptEffect(uint32 effIndex)
|
|||
|
||||
// don't overwrite an existing aura
|
||||
for(uint8 i = 0; i < 5; ++i)
|
||||
if(unitTarget->HasAura(spellid + i, 0))
|
||||
if (unitTarget->HasAura(spellid + i, EFFECT_INDEX_0))
|
||||
return;
|
||||
unitTarget->CastSpell(unitTarget, spellid+urand(0, 4), true);
|
||||
break;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue