Core: Use new SpellInfo class in core. Sadly, this commit is not compatibile with some of the custom code. To make your code work again you may need to change:
*SpellEntry is now SpellInfo *GetSpellProto is now GetSpellInfo *SpellEntry::Effect*[effIndex] is now avalible under SpellInfo.Effects[effIndex].* *sSpellStore.LookupEntry is no longer valid, use sSpellMgr->GetSpellInfo() *SpellFunctions from SpellMgr.h like DoSpellStuff(spellId) are now: spellInfo->DoStuff() *SpellMgr::CalculateEffectValue and similar functions are now avalible in SpellEffectInfo class. *GET_SPELL macro is removed, code which used it is moved to SpellMgr::LoadDbcDataCorrections *code which affected dbc data in SpellMgr::LoadSpellCustomAttr is now moved to LoadDbcDataCorrections
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -78,7 +78,7 @@ void DisableMgr::LoadDisables()
|
||||
{
|
||||
case DISABLE_TYPE_SPELL:
|
||||
{
|
||||
if (!(sSpellStore.LookupEntry(entry) || flags & SPELL_DISABLE_DEPRECATED_SPELL))
|
||||
if (!(sSpellMgr->GetSpellInfo(entry) || flags & SPELL_DISABLE_DEPRECATED_SPELL))
|
||||
{
|
||||
sLog->outErrorDb("Spell entry %u from `disables` doesn't exist in dbc, skipped.", entry);
|
||||
continue;
|
||||
|
||||
Reference in New Issue
Block a user