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:
QAston
2012-03-03 00:19:00 +01:00
parent b0985b4d5f
commit a08fe16d69
8 changed files with 223 additions and 194 deletions

View File

@@ -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())