Fixes code according to modern code style. Fixes a few expression bugs.
This commit is contained in:
parent
89eea25e5f
commit
970fd563b2
3324 changed files with 441118 additions and 433755 deletions
|
|
@ -1,87 +1,93 @@
|
|||
using Server.Targeting;
|
||||
using Server.Items;
|
||||
using Server.Targeting;
|
||||
|
||||
namespace Server.Spells.Second
|
||||
{
|
||||
public class MagicTrapSpell : MagerySpell
|
||||
{
|
||||
private static SpellInfo m_Info = new SpellInfo(
|
||||
"Magic Trap", "In Jux",
|
||||
212,
|
||||
9001,
|
||||
Reagent.Garlic,
|
||||
Reagent.SpidersSilk,
|
||||
Reagent.SulfurousAsh
|
||||
);
|
||||
public class MagicTrapSpell : MagerySpell
|
||||
{
|
||||
private static SpellInfo m_Info = new SpellInfo(
|
||||
"Magic Trap", "In Jux",
|
||||
212,
|
||||
9001,
|
||||
Reagent.Garlic,
|
||||
Reagent.SpidersSilk,
|
||||
Reagent.SulfurousAsh
|
||||
);
|
||||
|
||||
public override SpellCircle Circle => SpellCircle.Second;
|
||||
public MagicTrapSpell(Mobile caster, Item scroll) : base(caster, scroll, m_Info)
|
||||
{
|
||||
}
|
||||
|
||||
public MagicTrapSpell( Mobile caster, Item scroll ) : base( caster, scroll, m_Info )
|
||||
{
|
||||
}
|
||||
public override SpellCircle Circle => SpellCircle.Second;
|
||||
|
||||
public override void OnCast()
|
||||
{
|
||||
Caster.Target = new InternalTarget( this );
|
||||
}
|
||||
public override void OnCast()
|
||||
{
|
||||
Caster.Target = new InternalTarget(this);
|
||||
}
|
||||
|
||||
public void Target( TrappableContainer item )
|
||||
{
|
||||
if ( !Caster.CanSee( item ) )
|
||||
{
|
||||
Caster.SendLocalizedMessage( 500237 ); // Target can not be seen.
|
||||
}
|
||||
else if ( item.TrapType != TrapType.None && item.TrapType != TrapType.MagicTrap )
|
||||
{
|
||||
base.DoFizzle();
|
||||
}
|
||||
else if ( CheckSequence() )
|
||||
{
|
||||
SpellHelper.Turn( Caster, item );
|
||||
public void Target(TrappableContainer item)
|
||||
{
|
||||
if (!Caster.CanSee(item))
|
||||
{
|
||||
Caster.SendLocalizedMessage(500237); // Target can not be seen.
|
||||
}
|
||||
else if (item.TrapType != TrapType.None && item.TrapType != TrapType.MagicTrap)
|
||||
{
|
||||
base.DoFizzle();
|
||||
}
|
||||
else if (CheckSequence())
|
||||
{
|
||||
SpellHelper.Turn(Caster, item);
|
||||
|
||||
item.TrapType = TrapType.MagicTrap;
|
||||
item.TrapPower = Core.AOS ? Utility.RandomMinMax( 10, 50 ) : 1;
|
||||
item.TrapLevel = 0;
|
||||
item.TrapType = TrapType.MagicTrap;
|
||||
item.TrapPower = Core.AOS ? Utility.RandomMinMax(10, 50) : 1;
|
||||
item.TrapLevel = 0;
|
||||
|
||||
Point3D loc = item.GetWorldLocation();
|
||||
Point3D loc = item.GetWorldLocation();
|
||||
|
||||
Effects.SendLocationParticles( EffectItem.Create( new Point3D( loc.X + 1, loc.Y, loc.Z ), item.Map, EffectItem.DefaultDuration ), 0x376A, 9, 10, 9502 );
|
||||
Effects.SendLocationParticles( EffectItem.Create( new Point3D( loc.X, loc.Y - 1, loc.Z ), item.Map, EffectItem.DefaultDuration ), 0x376A, 9, 10, 9502 );
|
||||
Effects.SendLocationParticles( EffectItem.Create( new Point3D( loc.X - 1, loc.Y, loc.Z ), item.Map, EffectItem.DefaultDuration ), 0x376A, 9, 10, 9502 );
|
||||
Effects.SendLocationParticles( EffectItem.Create( new Point3D( loc.X, loc.Y + 1, loc.Z ), item.Map, EffectItem.DefaultDuration ), 0x376A, 9, 10, 9502 );
|
||||
Effects.SendLocationParticles( EffectItem.Create( new Point3D( loc.X, loc.Y, loc.Z ), item.Map, EffectItem.DefaultDuration ), 0, 0, 0, 5014 );
|
||||
Effects.SendLocationParticles(
|
||||
EffectItem.Create(new Point3D(loc.X + 1, loc.Y, loc.Z), item.Map, EffectItem.DefaultDuration), 0x376A, 9,
|
||||
10, 9502);
|
||||
Effects.SendLocationParticles(
|
||||
EffectItem.Create(new Point3D(loc.X, loc.Y - 1, loc.Z), item.Map, EffectItem.DefaultDuration), 0x376A, 9,
|
||||
10, 9502);
|
||||
Effects.SendLocationParticles(
|
||||
EffectItem.Create(new Point3D(loc.X - 1, loc.Y, loc.Z), item.Map, EffectItem.DefaultDuration), 0x376A, 9,
|
||||
10, 9502);
|
||||
Effects.SendLocationParticles(
|
||||
EffectItem.Create(new Point3D(loc.X, loc.Y + 1, loc.Z), item.Map, EffectItem.DefaultDuration), 0x376A, 9,
|
||||
10, 9502);
|
||||
Effects.SendLocationParticles(
|
||||
EffectItem.Create(new Point3D(loc.X, loc.Y, loc.Z), item.Map, EffectItem.DefaultDuration), 0, 0, 0,
|
||||
5014);
|
||||
|
||||
Effects.PlaySound( loc, item.Map, 0x1EF );
|
||||
}
|
||||
Effects.PlaySound(loc, item.Map, 0x1EF);
|
||||
}
|
||||
|
||||
FinishSequence();
|
||||
}
|
||||
FinishSequence();
|
||||
}
|
||||
|
||||
private class InternalTarget : Target
|
||||
{
|
||||
private MagicTrapSpell m_Owner;
|
||||
private class InternalTarget : Target
|
||||
{
|
||||
private MagicTrapSpell m_Owner;
|
||||
|
||||
public InternalTarget( MagicTrapSpell owner ) : base( Core.ML ? 10 : 12, false, TargetFlags.None )
|
||||
{
|
||||
m_Owner = owner;
|
||||
}
|
||||
public InternalTarget(MagicTrapSpell owner) : base(Core.ML ? 10 : 12, false, TargetFlags.None)
|
||||
{
|
||||
m_Owner = owner;
|
||||
}
|
||||
|
||||
protected override void OnTarget( Mobile from, object o )
|
||||
{
|
||||
if ( o is TrappableContainer )
|
||||
{
|
||||
m_Owner.Target( (TrappableContainer)o );
|
||||
}
|
||||
else
|
||||
{
|
||||
from.SendMessage( "You can't trap that" );
|
||||
}
|
||||
}
|
||||
protected override void OnTarget(Mobile from, object o)
|
||||
{
|
||||
if (o is TrappableContainer)
|
||||
m_Owner.Target((TrappableContainer)o);
|
||||
else
|
||||
from.SendMessage("You can't trap that");
|
||||
}
|
||||
|
||||
protected override void OnTargetFinish( Mobile from )
|
||||
{
|
||||
m_Owner.FinishSequence();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
protected override void OnTargetFinish(Mobile from)
|
||||
{
|
||||
m_Owner.FinishSequence();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue