[8687] Fixes in TARGET_FOCUS_OR_SCRIPTED_GAMEOBJECT.

* Removed my too script check on data load.
* Allow looking up fo DB target also if spell has required focus set.
* Makes DB targets optional not required.

Signed-off-by: ApoC <apoc@nymfe.net>
This commit is contained in:
ApoC 2009-10-20 23:12:38 +02:00
parent 5bae4fccf8
commit 58139610eb
3 changed files with 13 additions and 33 deletions

View file

@ -4124,8 +4124,7 @@ SpellCastResult Spell::CheckCast(bool strict)
(m_spellInfo->EffectImplicitTargetB[j] == TARGET_SCRIPT && m_spellInfo->EffectImplicitTargetA[j] != TARGET_SELF) ||
m_spellInfo->EffectImplicitTargetA[j] == TARGET_SCRIPT_COORDINATES ||
m_spellInfo->EffectImplicitTargetB[j] == TARGET_SCRIPT_COORDINATES ||
// Check possible in DB targets only for spells with no implicit spell focus
(m_spellInfo->EffectImplicitTargetA[j] == TARGET_FOCUS_OR_SCRIPTED_GAMEOBJECT && !m_spellInfo->RequiresSpellFocus))
m_spellInfo->EffectImplicitTargetA[j] == TARGET_FOCUS_OR_SCRIPTED_GAMEOBJECT)
{
SpellScriptTargetBounds bounds = spellmgr.GetSpellScriptTargetBounds(m_spellInfo->Id);
@ -4241,6 +4240,11 @@ SpellCastResult Spell::CheckCast(bool strict)
}
//Missing DB Entry or targets for this spellEffect.
else
{
/* For TARGET_FOCUS_OR_SCRIPTED_GAMEOBJECT makes DB targets optional not required for now
* TODO: Makes more research for this target type
*/
if (m_spellInfo->EffectImplicitTargetA[j] != TARGET_FOCUS_OR_SCRIPTED_GAMEOBJECT)
{
// not report target not existence for triggered spells
if(m_triggeredByAuraSpell || m_IsTriggeredSpell)
@ -4251,6 +4255,7 @@ SpellCastResult Spell::CheckCast(bool strict)
}
}
}
}
if(!m_IsTriggeredSpell)
{

View file

@ -2205,31 +2205,6 @@ void SpellMgr::LoadSpellScriptTarget()
continue;
}
// More checks on TARGET_FOCUS_OR_SCRIPTED_GAMEOBJECT
bool ok = true;
for (int i = 0; i < 3; ++i)
{
if (spellProto->EffectImplicitTargetA[i] == TARGET_FOCUS_OR_SCRIPTED_GAMEOBJECT ||
spellProto->EffectImplicitTargetB[i] == TARGET_FOCUS_OR_SCRIPTED_GAMEOBJECT)
{
if (spellProto->RequiresSpellFocus)
{
sLog.outErrorDb("Table `spell_script_target`: spellId %u for TargetEnty %u of type TARGET_FOCUS_OR_SCRIPTED_GAMEOBJECT is wrong because spell has implicit ReqSpellFocus %u.", spellId, targetEntry, spellProto->RequiresSpellFocus);
ok = false;
break;
}
if (type != SPELL_TARGET_TYPE_GAMEOBJECT)
{
sLog.outErrorDb("Table `spell_script_target`: spellId %u has target type TARGET_FOCUS_OR_SCRIPTED_GAMEOBJECT but target in table is creature (must be gameobject).", spellId);
ok = false;
break;
}
}
}
if (!ok)
continue;
// Checks by target type
switch (type)
{

View file

@ -1,4 +1,4 @@
#ifndef __REVISION_NR_H__
#define __REVISION_NR_H__
#define REVISION_NR "8686"
#define REVISION_NR "8687"
#endif // __REVISION_NR_H__