Cleans up Spell Targeting (#36)
This commit is contained in:
parent
de50bc9e43
commit
472b84f5ff
99 changed files with 653 additions and 2192 deletions
|
|
@ -3,7 +3,7 @@ using Server.Targeting;
|
|||
|
||||
namespace Server.Spells.Mysticism
|
||||
{
|
||||
public class EagleStrikeSpell : MysticSpell
|
||||
public class EagleStrikeSpell : MysticSpell, ISpellTargetingMobile
|
||||
{
|
||||
private static SpellInfo m_Info = new SpellInfo(
|
||||
"Eagle Strike", "Kal Por Xen",
|
||||
|
|
@ -27,11 +27,14 @@ namespace Server.Spells.Mysticism
|
|||
|
||||
public override void OnCast()
|
||||
{
|
||||
Caster.Target = new InternalTarget(this);
|
||||
Caster.Target = new SpellTargetMobile(this, TargetFlags.Harmful);
|
||||
}
|
||||
|
||||
public void Target(Mobile m)
|
||||
{
|
||||
if (m == null)
|
||||
return;
|
||||
|
||||
if (CheckHSequence(m))
|
||||
{
|
||||
/* Conjures a magical eagle that assaults the Target with
|
||||
|
|
@ -62,27 +65,5 @@ namespace Server.Spells.Mysticism
|
|||
|
||||
to.PlaySound(0x64D);
|
||||
}
|
||||
|
||||
private class InternalTarget : Target
|
||||
{
|
||||
private EagleStrikeSpell m_Owner;
|
||||
|
||||
public InternalTarget(EagleStrikeSpell owner)
|
||||
: base(12, false, TargetFlags.Harmful)
|
||||
{
|
||||
m_Owner = owner;
|
||||
}
|
||||
|
||||
protected override void OnTarget(Mobile from, object o)
|
||||
{
|
||||
if (o is Mobile mobile)
|
||||
m_Owner.Target(mobile);
|
||||
}
|
||||
|
||||
protected override void OnTargetFinish(Mobile from)
|
||||
{
|
||||
m_Owner.FinishSequence();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue