diff options
Diffstat (limited to 'src/server/game/Conditions/ConditionMgr.cpp')
-rwxr-xr-x | src/server/game/Conditions/ConditionMgr.cpp | 56 |
1 files changed, 28 insertions, 28 deletions
diff --git a/src/server/game/Conditions/ConditionMgr.cpp b/src/server/game/Conditions/ConditionMgr.cpp index beeb06baca8..aca10df1ebe 100755 --- a/src/server/game/Conditions/ConditionMgr.cpp +++ b/src/server/game/Conditions/ConditionMgr.cpp @@ -854,7 +854,7 @@ bool ConditionMgr::isSourceTypeValid(Condition* cond) return false; } - SpellEntry const* spellProto = sSpellStore.LookupEntry(cond->mSourceEntry); + SpellInfo const* spellProto = sSpellMgr->GetSpellInfo(cond->mSourceEntry); if (!spellProto) { sLog->outErrorDb("SourceEntry %u in `condition` table, does not exist in `spell.dbc`, ignoring.", cond->mSourceEntry); @@ -864,22 +864,22 @@ bool ConditionMgr::isSourceTypeValid(Condition* cond) bool targetfound = false; for (uint8 i = 0; i < MAX_SPELL_EFFECTS; ++i) { - if (spellProto->EffectImplicitTargetA[i] == TARGET_UNIT_AREA_ENTRY_SRC || - spellProto->EffectImplicitTargetB[i] == TARGET_UNIT_AREA_ENTRY_SRC || - spellProto->EffectImplicitTargetA[i] == TARGET_UNIT_AREA_ENTRY_DST || - spellProto->EffectImplicitTargetB[i] == TARGET_UNIT_AREA_ENTRY_DST || - spellProto->EffectImplicitTargetA[i] == TARGET_UNIT_NEARBY_ENTRY || - spellProto->EffectImplicitTargetB[i] == TARGET_UNIT_NEARBY_ENTRY || - spellProto->EffectImplicitTargetA[i] == TARGET_GAMEOBJECT_NEARBY_ENTRY || - spellProto->EffectImplicitTargetB[i] == TARGET_GAMEOBJECT_NEARBY_ENTRY || - spellProto->EffectImplicitTargetA[i] == TARGET_GAMEOBJECT_AREA_SRC || - spellProto->EffectImplicitTargetB[i] == TARGET_GAMEOBJECT_AREA_SRC || - spellProto->EffectImplicitTargetA[i] == TARGET_GAMEOBJECT_AREA_DST || - spellProto->EffectImplicitTargetB[i] == TARGET_GAMEOBJECT_AREA_DST || - spellProto->EffectImplicitTargetA[i] == TARGET_DST_NEARBY_ENTRY || - spellProto->EffectImplicitTargetB[i] == TARGET_DST_NEARBY_ENTRY || - spellProto->EffectImplicitTargetA[i] == TARGET_UNIT_CONE_ENTRY || - spellProto->EffectImplicitTargetB[i] == TARGET_UNIT_CONE_ENTRY) + if (spellProto->Effects[i].TargetA == TARGET_UNIT_AREA_ENTRY_SRC || + spellProto->Effects[i].TargetB == TARGET_UNIT_AREA_ENTRY_SRC || + spellProto->Effects[i].TargetA == TARGET_UNIT_AREA_ENTRY_DST || + spellProto->Effects[i].TargetB == TARGET_UNIT_AREA_ENTRY_DST || + spellProto->Effects[i].TargetA == TARGET_UNIT_NEARBY_ENTRY || + spellProto->Effects[i].TargetB == TARGET_UNIT_NEARBY_ENTRY || + spellProto->Effects[i].TargetA == TARGET_GAMEOBJECT_NEARBY_ENTRY || + spellProto->Effects[i].TargetB == TARGET_GAMEOBJECT_NEARBY_ENTRY || + spellProto->Effects[i].TargetA == TARGET_GAMEOBJECT_AREA_SRC || + spellProto->Effects[i].TargetB == TARGET_GAMEOBJECT_AREA_SRC || + spellProto->Effects[i].TargetA == TARGET_GAMEOBJECT_AREA_DST || + spellProto->Effects[i].TargetB == TARGET_GAMEOBJECT_AREA_DST || + spellProto->Effects[i].TargetA == TARGET_DST_NEARBY_ENTRY || + spellProto->Effects[i].TargetB == TARGET_DST_NEARBY_ENTRY || + spellProto->Effects[i].TargetA == TARGET_UNIT_CONE_ENTRY || + spellProto->Effects[i].TargetB == TARGET_UNIT_CONE_ENTRY) { targetfound = true; //break; @@ -899,7 +899,7 @@ bool ConditionMgr::isSourceTypeValid(Condition* cond) "TARGET_GAMEOBJECT_AREA_SRC(51), TARGET_GAMEOBJECT_AREA_DST(52)", cond->mSourceEntry); return false; } - if ((cond->mConditionValue1 == SPELL_TARGET_TYPE_DEAD) && !IsAllowingDeadTargetSpell(spellProto)) + if ((cond->mConditionValue1 == SPELL_TARGET_TYPE_DEAD) && !spellProto->IsAllowingDeadTarget()) { sLog->outErrorDb("SourceEntry %u in `condition` table does have SPELL_TARGET_TYPE_DEAD specified but spell does not have SPELL_ATTR2_ALLOW_DEAD_TARGET", cond->mSourceEntry); return false; @@ -917,7 +917,7 @@ bool ConditionMgr::isSourceTypeValid(Condition* cond) } case CONDITION_SOURCE_TYPE_SPELL: { - SpellEntry const* spellProto = sSpellStore.LookupEntry(cond->mSourceEntry); + SpellInfo const* spellProto = sSpellMgr->GetSpellInfo(cond->mSourceEntry); if (!spellProto) { sLog->outErrorDb("SourceEntry %u in `condition` table, does not exist in `spell.dbc`, ignoring.", cond->mSourceEntry); @@ -943,7 +943,7 @@ bool ConditionMgr::isSourceTypeValid(Condition* cond) bool bIsItemSpellValid = false; for (uint8 i = 0; i < MAX_ITEM_PROTO_SPELLS; ++i) { - if (SpellEntry const* pSpellInfo = sSpellStore.LookupEntry(pItemProto->Spells[i].SpellId)) + if (SpellInfo const* pSpellInfo = sSpellMgr->GetSpellInfo(pItemProto->Spells[i].SpellId)) { if (pItemProto->Spells[i].SpellTrigger == ITEM_SPELLTRIGGER_ON_USE || pItemProto->Spells[i].SpellTrigger == ITEM_SPELLTRIGGER_ON_NO_DELAY_USE) @@ -954,10 +954,10 @@ bool ConditionMgr::isSourceTypeValid(Condition* cond) for (int j = 0; j < MAX_SPELL_EFFECTS; ++j) { - if (pSpellInfo->EffectImplicitTargetA[j] == TARGET_UNIT_TARGET_ENEMY || - pSpellInfo->EffectImplicitTargetB[j] == TARGET_UNIT_TARGET_ENEMY || - pSpellInfo->EffectImplicitTargetA[j] == TARGET_UNIT_TARGET_ANY || - pSpellInfo->EffectImplicitTargetB[j] == TARGET_UNIT_TARGET_ANY) + if (pSpellInfo->Effects[j].TargetA == TARGET_UNIT_TARGET_ENEMY || + pSpellInfo->Effects[j].TargetB == TARGET_UNIT_TARGET_ENEMY || + pSpellInfo->Effects[j].TargetA == TARGET_UNIT_TARGET_ANY || + pSpellInfo->Effects[j].TargetB == TARGET_UNIT_TARGET_ANY) { bIsItemSpellValid = true; break; @@ -1005,7 +1005,7 @@ bool ConditionMgr::isSourceTypeValid(Condition* cond) sLog->outErrorDb("SourceEntry %u in `condition` table, does not exist in `creature_template`, ignoring.", cond->mSourceGroup); return false; } - SpellEntry const* spellProto = sSpellStore.LookupEntry(cond->mSourceEntry); + SpellInfo const* spellProto = sSpellMgr->GetSpellInfo(cond->mSourceEntry); if (!spellProto) { sLog->outErrorDb("SourceEntry %u in `condition` table, does not exist in `spell.dbc`, ignoring.", cond->mSourceEntry); @@ -1034,7 +1034,7 @@ bool ConditionMgr::isConditionTypeValid(Condition* cond) { case CONDITION_AURA: { - if (!sSpellStore.LookupEntry(cond->mConditionValue1)) + if (!sSpellMgr->GetSpellInfo(cond->mConditionValue1)) { sLog->outErrorDb("Aura condition has non existing spell (Id: %d), skipped", cond->mConditionValue1); return false; @@ -1151,7 +1151,7 @@ bool ConditionMgr::isConditionTypeValid(Condition* cond) } case CONDITION_NO_AURA: { - if (!sSpellStore.LookupEntry(cond->mConditionValue1)) + if (!sSpellMgr->GetSpellInfo(cond->mConditionValue1)) { sLog->outErrorDb("Aura condition has non existing spell (Id: %d), skipped", cond->mConditionValue1); return false; @@ -1320,7 +1320,7 @@ bool ConditionMgr::isConditionTypeValid(Condition* cond) } case CONDITION_SPELL: { - if (!sSpellStore.LookupEntry(cond->mConditionValue1)) + if (!sSpellMgr->GetSpellInfo(cond->mConditionValue1)) { sLog->outErrorDb("Spell condition has non existing spell (Id: %d), skipped", cond->mConditionValue1); return false; |