diff options
-rw-r--r-- | src/game/Spell.cpp | 6 | ||||
-rw-r--r-- | src/game/SpellMgr.cpp | 79 |
2 files changed, 70 insertions, 15 deletions
diff --git a/src/game/Spell.cpp b/src/game/Spell.cpp index 88085bd99fe..b1fa3016cd0 100644 --- a/src/game/Spell.cpp +++ b/src/game/Spell.cpp @@ -1624,7 +1624,7 @@ WorldObject* Spell::SearchNearbyTarget(float range, SpellTargets TargetType) SpellScriptTarget::const_iterator upper = spellmgr.GetEndSpellScriptTarget(m_spellInfo->Id); if(lower == upper) { - sLog.outErrorDb("Spell (ID: %u) (caster Entry: %u) does not have record in `spell_script_target`", m_spellInfo->Id, m_caster->GetEntry()); + sLog.outDebug("Spell (ID: %u) (caster Entry: %u) does not have record in `spell_script_target`", m_spellInfo->Id, m_caster->GetEntry()); if(IsPositiveSpell(m_spellInfo->Id)) return SearchNearbyTarget(range, SPELL_TARGETS_ALLY); else @@ -2000,7 +2000,7 @@ void Spell::SetTargetMap(uint32 i, uint32 cur) } else { - sLog.outError( "SPELL: unknown target coordinates for spell ID %u", m_spellInfo->Id ); + sLog.outDebug( "SPELL: unknown target coordinates for spell ID %u", m_spellInfo->Id ); Unit *target = NULL; if(uint64 guid = m_caster->GetUInt64Value(UNIT_FIELD_TARGET)) target = ObjectAccessor::GetUnit(*m_caster, guid); @@ -2170,7 +2170,7 @@ void Spell::SetTargetMap(uint32 i, uint32 cur) SpellScriptTarget::const_iterator upper = spellmgr.GetEndSpellScriptTarget(m_spellInfo->Id); if(lower == upper) { - sLog.outErrorDb("Spell (ID: %u) (caster Entry: %u) does not have record in `spell_script_target`", m_spellInfo->Id, m_caster->GetEntry()); + sLog.outDebug("Spell (ID: %u) (caster Entry: %u) does not have record in `spell_script_target`", m_spellInfo->Id, m_caster->GetEntry()); if(IsPositiveEffect(m_spellInfo->Id, i)) SearchAreaTarget(unitList, radius, pushType, SPELL_TARGETS_ALLY); diff --git a/src/game/SpellMgr.cpp b/src/game/SpellMgr.cpp index 14aa7ea3787..7e16b325290 100644 --- a/src/game/SpellMgr.cpp +++ b/src/game/SpellMgr.cpp @@ -974,6 +974,42 @@ void SpellMgr::LoadSpellTargetPositions() } while( result->NextRow() ); + // Check all spells + for(uint32 i = 1; i < sSpellStore.GetNumRows(); ++i) + { + SpellEntry const * spellInfo = sSpellStore.LookupEntry(i); + if(!spellInfo) + continue; + + bool found = false; + for(int j = 0; j < 3; ++j) + { + switch(spellInfo->EffectImplicitTargetA[j]) + { + case TARGET_DST_DB: + found = true; + break; + } + if(found) + break; + switch(spellInfo->EffectImplicitTargetB[j]) + { + case TARGET_DST_DB: + found = true; + break; + } + if(found) + break; + } + if(found) + { + SpellScriptTarget::const_iterator lower = spellmgr.GetBeginSpellScriptTarget(i); + SpellScriptTarget::const_iterator upper = spellmgr.GetEndSpellScriptTarget(i); + if(lower == upper) + sLog.outDetail("Spell (ID: %u) does not have record in `spell_target_position`", i); + } + } + delete result; sLog.outString(); @@ -1796,29 +1832,48 @@ void SpellMgr::LoadSpellScriptTarget() delete result; // Check all spells - /* Disabled (lot errors at this moment) - for(uint32 i = 1; i < sSpellStore.nCount; ++i) + for(uint32 i = 1; i < sSpellStore.GetNumRows(); ++i) { SpellEntry const * spellInfo = sSpellStore.LookupEntry(i); if(!spellInfo) continue; bool found = false; - for(int j=0; j<3; ++j) + for(int j = 0; j < 3; ++j) { - if( spellInfo->EffectImplicitTargetA[j] == TARGET_UNIT_NEARBY_ENTRY || spellInfo->EffectImplicitTargetA[j] != TARGET_UNIT_CASTER && spellInfo->EffectImplicitTargetB[j] == TARGET_UNIT_NEARBY_ENTRY ) + switch(spellInfo->EffectImplicitTargetA[j]) { - SpellScriptTarget::const_iterator lower = spellmgr.GetBeginSpellScriptTarget(spellInfo->Id); - SpellScriptTarget::const_iterator upper = spellmgr.GetEndSpellScriptTarget(spellInfo->Id); - if(lower==upper) - { - sLog.outErrorDb("Spell (ID: %u) has effect EffectImplicitTargetA/EffectImplicitTargetB = %u (TARGET_UNIT_NEARBY_ENTRY), but does not have record in `spell_script_target`",spellInfo->Id,TARGET_UNIT_NEARBY_ENTRY); - break; // effects of spell - } + case TARGET_UNIT_AREA_ENTRY_SRC: + case TARGET_UNIT_AREA_ENTRY_DST: + case TARGET_UNIT_NEARBY_ENTRY: + case TARGET_DST_NEARBY_ENTRY: + case TARGET_UNIT_CONE_ENTRY: + found = true; + break; } + if(found) + break; + switch(spellInfo->EffectImplicitTargetB[j]) + { + case TARGET_UNIT_AREA_ENTRY_SRC: + case TARGET_UNIT_AREA_ENTRY_DST: + case TARGET_UNIT_NEARBY_ENTRY: + case TARGET_DST_NEARBY_ENTRY: + case TARGET_UNIT_CONE_ENTRY: + found = true; + break; + } + if(found) + break; + } + if(found) + { + SpellScriptTarget::const_iterator lower = spellmgr.GetBeginSpellScriptTarget(i); + SpellScriptTarget::const_iterator upper = spellmgr.GetEndSpellScriptTarget(i); + if(lower == upper) + sLog.outDetail("Spell (ID: %u) does not have record in `spell_script_target`", i); } } - */ sLog.outString(); sLog.outString(">> Loaded %u Spell Script Targets", count); |