mirror of
https://github.com/mangosfour/server.git
synced 2025-12-14 16:37:01 +00:00
[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:
parent
5bae4fccf8
commit
58139610eb
3 changed files with 13 additions and 33 deletions
|
|
@ -4124,8 +4124,7 @@ SpellCastResult Spell::CheckCast(bool strict)
|
||||||
(m_spellInfo->EffectImplicitTargetB[j] == TARGET_SCRIPT && m_spellInfo->EffectImplicitTargetA[j] != TARGET_SELF) ||
|
(m_spellInfo->EffectImplicitTargetB[j] == TARGET_SCRIPT && m_spellInfo->EffectImplicitTargetA[j] != TARGET_SELF) ||
|
||||||
m_spellInfo->EffectImplicitTargetA[j] == TARGET_SCRIPT_COORDINATES ||
|
m_spellInfo->EffectImplicitTargetA[j] == TARGET_SCRIPT_COORDINATES ||
|
||||||
m_spellInfo->EffectImplicitTargetB[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->EffectImplicitTargetA[j] == TARGET_FOCUS_OR_SCRIPTED_GAMEOBJECT && !m_spellInfo->RequiresSpellFocus))
|
|
||||||
{
|
{
|
||||||
|
|
||||||
SpellScriptTargetBounds bounds = spellmgr.GetSpellScriptTargetBounds(m_spellInfo->Id);
|
SpellScriptTargetBounds bounds = spellmgr.GetSpellScriptTargetBounds(m_spellInfo->Id);
|
||||||
|
|
@ -4242,11 +4241,17 @@ SpellCastResult Spell::CheckCast(bool strict)
|
||||||
//Missing DB Entry or targets for this spellEffect.
|
//Missing DB Entry or targets for this spellEffect.
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// not report target not existence for triggered spells
|
/* For TARGET_FOCUS_OR_SCRIPTED_GAMEOBJECT makes DB targets optional not required for now
|
||||||
if(m_triggeredByAuraSpell || m_IsTriggeredSpell)
|
* TODO: Makes more research for this target type
|
||||||
return SPELL_FAILED_DONT_REPORT;
|
*/
|
||||||
else
|
if (m_spellInfo->EffectImplicitTargetA[j] != TARGET_FOCUS_OR_SCRIPTED_GAMEOBJECT)
|
||||||
return SPELL_FAILED_BAD_TARGETS;
|
{
|
||||||
|
// not report target not existence for triggered spells
|
||||||
|
if(m_triggeredByAuraSpell || m_IsTriggeredSpell)
|
||||||
|
return SPELL_FAILED_DONT_REPORT;
|
||||||
|
else
|
||||||
|
return SPELL_FAILED_BAD_TARGETS;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -2205,31 +2205,6 @@ void SpellMgr::LoadSpellScriptTarget()
|
||||||
continue;
|
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
|
// Checks by target type
|
||||||
switch (type)
|
switch (type)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
#ifndef __REVISION_NR_H__
|
#ifndef __REVISION_NR_H__
|
||||||
#define __REVISION_NR_H__
|
#define __REVISION_NR_H__
|
||||||
#define REVISION_NR "8686"
|
#define REVISION_NR "8687"
|
||||||
#endif // __REVISION_NR_H__
|
#endif // __REVISION_NR_H__
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue