mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-16 07:30:42 +01:00
Core/ScriptSystem: Extend SpellScript API by spell focus targets accessors.
--HG-- branch : trunk
This commit is contained in:
@@ -2024,7 +2024,7 @@ void Spell::EffectTeleportUnits(SpellEffIndex /*effIndex*/)
|
||||
m_caster->CastSpell(m_caster, 36895, true);
|
||||
break;
|
||||
case 4:
|
||||
// Transform
|
||||
// Transform
|
||||
{
|
||||
if (m_caster->ToPlayer()->GetTeam() == ALLIANCE)
|
||||
m_caster->CastSpell(m_caster, 36897, true);
|
||||
|
||||
@@ -210,13 +210,28 @@ SpellEntry const * SpellScript::GetSpellInfo()
|
||||
return m_spell->GetSpellInfo();
|
||||
}
|
||||
|
||||
WorldLocation * SpellScript::GetDest()
|
||||
WorldLocation * SpellScript::GetTargetDest()
|
||||
{
|
||||
if (m_spell->m_targets.HasDst())
|
||||
return &m_spell->m_targets.m_dstPos;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
Unit * SpellScript::GetTargetUnit()
|
||||
{
|
||||
return m_spell->m_targets.getUnitTarget();
|
||||
}
|
||||
|
||||
GameObject * SpellScript::GetTargetGObj()
|
||||
{
|
||||
return m_spell->m_targets.getGOTarget();
|
||||
}
|
||||
|
||||
Item * SpellScript::GetTargetItem()
|
||||
{
|
||||
return m_spell->m_targets.getItemTarget();
|
||||
}
|
||||
|
||||
Unit * SpellScript::GetHitUnit()
|
||||
{
|
||||
if (!IsInHitPhase())
|
||||
|
||||
@@ -192,8 +192,19 @@ class SpellScript : public _SpellScript
|
||||
SpellEntry const * GetSpellInfo();
|
||||
|
||||
// methods useable after spell targets are set
|
||||
// returns: destination of the spell if exists, otherwise NULL
|
||||
WorldLocation * GetDest();
|
||||
// accessors to the "focus" targets of the spell
|
||||
// note: do not confuse these with spell hit targets
|
||||
// returns: WorldLocation which was selected as a spell destination or NULL
|
||||
WorldLocation * GetTargetDest();
|
||||
|
||||
// returns: Unit which was selected as a spell target or NULL
|
||||
Unit * GetTargetUnit();
|
||||
|
||||
// returns: GameObject which was selected as a spell target or NULL
|
||||
GameObject * GetTargetGObj();
|
||||
|
||||
// returns: Item which was selected as a spell target or NULL
|
||||
Item * GetTargetItem();
|
||||
|
||||
// methods useable only during spell hit on target phase:
|
||||
|
||||
|
||||
Reference in New Issue
Block a user