mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-16 07:30:42 +01:00
Core/Spells: Allow spell effects to have multiple destinations. Spells like: 49814, 10869 and similar are now properly selecting destination targets.
This commit is contained in:
@@ -323,7 +323,7 @@ SpellInfo const* SpellScript::GetSpellInfo()
|
||||
WorldLocation const* SpellScript::GetTargetDest()
|
||||
{
|
||||
if (m_spell->m_targets.HasDst())
|
||||
return m_spell->m_targets.GetDst();
|
||||
return m_spell->m_targets.GetDstPos();
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@@ -403,6 +403,16 @@ GameObject* SpellScript::GetHitGObj()
|
||||
return m_spell->gameObjTarget;
|
||||
}
|
||||
|
||||
WorldLocation const* SpellScript::GetHitDest()
|
||||
{
|
||||
if (!IsInEffectHook())
|
||||
{
|
||||
sLog->outError("TSCR: Script: `%s` Spell: `%u`: function SpellScript::GetHitGObj was called, but function has no effect in current hook!", m_scriptName->c_str(), m_scriptSpellId);
|
||||
return NULL;
|
||||
}
|
||||
return m_spell->destTarget;
|
||||
}
|
||||
|
||||
int32 SpellScript::GetHitDamage()
|
||||
{
|
||||
if (!IsInTargetHook())
|
||||
@@ -468,11 +478,6 @@ void SpellScript::PreventHitAura()
|
||||
m_spell->m_spellAura->Remove();
|
||||
}
|
||||
|
||||
void SpellScript::GetSummonPosition(uint32 i, Position &pos, float radius = 0.0f, uint32 count = 0)
|
||||
{
|
||||
m_spell->GetSummonPosition(i, pos, radius, count);
|
||||
}
|
||||
|
||||
void SpellScript::PreventHitEffect(SpellEffIndex effIndex)
|
||||
{
|
||||
if (!IsInHitPhase() && !IsInEffectHook())
|
||||
|
||||
Reference in New Issue
Block a user