[9408] Add MAX_EFFECT_INDEX to enum SpellEffectIndex and use it.

This commit is contained in:
VladimirMangos 2010-02-18 23:32:26 +03:00
parent 2a5ce2198c
commit ff8d494ed4
18 changed files with 114 additions and 112 deletions

View file

@ -104,7 +104,7 @@ uint16 GetSpellAuraMaxTicks(SpellEntry const* spellInfo)
if(DotDuration > 30000)
DotDuration = 30000;
for (int j = 0; j < 3; ++j)
for (int j = 0; j < MAX_EFFECT_INDEX; ++j)
{
if (spellInfo->Effect[j] == SPELL_EFFECT_APPLY_AURA && (
spellInfo->EffectApplyAuraName[j] == SPELL_AURA_PERIODIC_DAMAGE ||
@ -198,7 +198,7 @@ SpellSpecific GetSpellSpecific(uint32 spellId)
{
bool food = false;
bool drink = false;
for(int i = 0; i < 3; ++i)
for(int i = 0; i < MAX_EFFECT_INDEX; ++i)
{
switch(spellInfo->EffectApplyAuraName[i])
{
@ -550,7 +550,7 @@ bool IsPositiveEffect(uint32 spellId, uint32 effIndex)
if(spellTriggeredProto)
{
// non-positive targets of main spell return early
for(int i = 0; i < 3; ++i)
for(int i = 0; i < MAX_EFFECT_INDEX; ++i)
{
// if non-positive trigger cast targeted to positive target this main cast is non-positive
// this will place this spell auras as debuffs
@ -685,7 +685,7 @@ bool IsPositiveSpell(uint32 spellId)
// spells with atleast one negative effect are considered negative
// some self-applied spells have negative effects but in self casting case negative check ignored.
for (int i = 0; i < 3; ++i)
for (int i = 0; i < MAX_EFFECT_INDEX; ++i)
if (!IsPositiveEffect(spellId, i))
return false;
return true;
@ -831,7 +831,7 @@ void SpellMgr::LoadSpellTargetPositions()
}
bool found = false;
for(int i = 0; i < 3; ++i)
for(int i = 0; i < MAX_EFFECT_INDEX; ++i)
{
if( spellInfo->EffectImplicitTargetA[i]==TARGET_TABLE_X_Y_Z_COORDINATES || spellInfo->EffectImplicitTargetB[i]==TARGET_TABLE_X_Y_Z_COORDINATES )
{
@ -1282,7 +1282,7 @@ bool SpellMgr::canStackSpellRanks(SpellEntry const *spellInfo)
return false;
// All stance spells. if any better way, change it.
for (int i = 0; i < 3; ++i)
for (int i = 0; i < MAX_EFFECT_INDEX; ++i)
{
switch(spellInfo->SpellFamilyName)
{
@ -1758,7 +1758,7 @@ bool SpellMgr::IsNoStackSpellDueToSpell(uint32 spellId_1, uint32 spellId_2) cons
spellInfo_1->SpellIconID != 0 && spellInfo_2->SpellIconID != 0)
{
bool isModifier = false;
for (int i = 0; i < 3; ++i)
for (int i = 0; i < MAX_EFFECT_INDEX; ++i)
{
if (spellInfo_1->EffectApplyAuraName[i] == SPELL_AURA_ADD_FLAT_MODIFIER ||
spellInfo_1->EffectApplyAuraName[i] == SPELL_AURA_ADD_PCT_MODIFIER ||
@ -1781,7 +1781,7 @@ bool SpellMgr::IsNoStackSpellDueToSpell(uint32 spellId_1, uint32 spellId_2) cons
return false;
bool dummy_only = true;
for (int i = 0; i < 3; ++i)
for (int i = 0; i < MAX_EFFECT_INDEX; ++i)
{
if (spellInfo_1->Effect[i] != spellInfo_2->Effect[i] ||
spellInfo_1->EffectItemType[i] != spellInfo_2->EffectItemType[i] ||
@ -2089,7 +2089,7 @@ void SpellMgr::LoadSpellLearnSkills()
if(!entry)
continue;
for(int i = 0; i < 3; ++i)
for(int i = 0; i < MAX_EFFECT_INDEX; ++i)
{
if(entry->Effect[i]==SPELL_EFFECT_SKILL)
{
@ -2178,7 +2178,7 @@ void SpellMgr::LoadSpellLearnSpells()
if (!entry)
continue;
for(int i = 0; i < 3; ++i)
for(int i = 0; i < MAX_EFFECT_INDEX; ++i)
{
if(entry->Effect[i]==SPELL_EFFECT_LEARN_SPELL)
{
@ -2261,7 +2261,7 @@ void SpellMgr::LoadSpellScriptTarget()
}
bool targetfound = false;
for (int i = 0; i < 3; ++i)
for (int i = 0; i < MAX_EFFECT_INDEX; ++i)
{
if( spellProto->EffectImplicitTargetA[i] == TARGET_SCRIPT ||
spellProto->EffectImplicitTargetB[i] == TARGET_SCRIPT ||
@ -2565,7 +2565,7 @@ void SpellMgr::LoadPetDefaultSpells()
if(!spellEntry)
continue;
for(int k = 0; k < 3; ++k)
for(int k = 0; k < MAX_EFFECT_INDEX; ++k)
{
if(spellEntry->Effect[k]==SPELL_EFFECT_SUMMON || spellEntry->Effect[k]==SPELL_EFFECT_SUMMON_PET)
{