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,86 +1,87 @@
|
|||
using Server.Targeting;
|
||||
using Server.Network;
|
||||
using Server.Items;
|
||||
using Server.Multis;
|
||||
using Server.Network;
|
||||
using Server.Targeting;
|
||||
|
||||
namespace Server.Spells.Third
|
||||
{
|
||||
public class MagicLockSpell : MagerySpell
|
||||
{
|
||||
private static SpellInfo m_Info = new SpellInfo(
|
||||
"Magic Lock", "An Por",
|
||||
215,
|
||||
9001,
|
||||
Reagent.Garlic,
|
||||
Reagent.Bloodmoss,
|
||||
Reagent.SulfurousAsh
|
||||
);
|
||||
public class MagicLockSpell : MagerySpell
|
||||
{
|
||||
private static SpellInfo m_Info = new SpellInfo(
|
||||
"Magic Lock", "An Por",
|
||||
215,
|
||||
9001,
|
||||
Reagent.Garlic,
|
||||
Reagent.Bloodmoss,
|
||||
Reagent.SulfurousAsh
|
||||
);
|
||||
|
||||
public override SpellCircle Circle => SpellCircle.Third;
|
||||
public MagicLockSpell(Mobile caster, Item scroll) : base(caster, scroll, m_Info)
|
||||
{
|
||||
}
|
||||
|
||||
public MagicLockSpell( Mobile caster, Item scroll ) : base( caster, scroll, m_Info )
|
||||
{
|
||||
}
|
||||
public override SpellCircle Circle => SpellCircle.Third;
|
||||
|
||||
public override void OnCast()
|
||||
{
|
||||
Caster.Target = new InternalTarget( this );
|
||||
}
|
||||
public override void OnCast()
|
||||
{
|
||||
Caster.Target = new InternalTarget(this);
|
||||
}
|
||||
|
||||
public void Target( LockableContainer targ )
|
||||
{
|
||||
if ( Multis.BaseHouse.CheckLockedDownOrSecured( targ ) )
|
||||
{
|
||||
// You cannot cast this on a locked down item.
|
||||
Caster.LocalOverheadMessage( MessageType.Regular, 0x22, 501761 );
|
||||
}
|
||||
else if ( targ.Locked || targ.LockLevel == 0 || targ is ParagonChest )
|
||||
{
|
||||
// Target must be an unlocked chest.
|
||||
Caster.SendLocalizedMessage( 501762 );
|
||||
}
|
||||
else if ( CheckSequence() )
|
||||
{
|
||||
SpellHelper.Turn( Caster, targ );
|
||||
public void Target(LockableContainer targ)
|
||||
{
|
||||
if (BaseHouse.CheckLockedDownOrSecured(targ))
|
||||
{
|
||||
// You cannot cast this on a locked down item.
|
||||
Caster.LocalOverheadMessage(MessageType.Regular, 0x22, 501761);
|
||||
}
|
||||
else if (targ.Locked || targ.LockLevel == 0 || targ is ParagonChest)
|
||||
{
|
||||
// Target must be an unlocked chest.
|
||||
Caster.SendLocalizedMessage(501762);
|
||||
}
|
||||
else if (CheckSequence())
|
||||
{
|
||||
SpellHelper.Turn(Caster, targ);
|
||||
|
||||
Point3D loc = targ.GetWorldLocation();
|
||||
Point3D loc = targ.GetWorldLocation();
|
||||
|
||||
Effects.SendLocationParticles(
|
||||
EffectItem.Create( loc, targ.Map, EffectItem.DefaultDuration ),
|
||||
0x376A, 9, 32, 5020 );
|
||||
Effects.SendLocationParticles(
|
||||
EffectItem.Create(loc, targ.Map, EffectItem.DefaultDuration),
|
||||
0x376A, 9, 32, 5020);
|
||||
|
||||
Effects.PlaySound( loc, targ.Map, 0x1FA );
|
||||
Effects.PlaySound(loc, targ.Map, 0x1FA);
|
||||
|
||||
// The chest is now locked!
|
||||
Caster.LocalOverheadMessage( MessageType.Regular, 0x3B2, 501763 );
|
||||
// The chest is now locked!
|
||||
Caster.LocalOverheadMessage(MessageType.Regular, 0x3B2, 501763);
|
||||
|
||||
targ.LockLevel = -255; // signal magic lock
|
||||
targ.Locked = true;
|
||||
}
|
||||
targ.LockLevel = -255; // signal magic lock
|
||||
targ.Locked = true;
|
||||
}
|
||||
|
||||
FinishSequence();
|
||||
}
|
||||
FinishSequence();
|
||||
}
|
||||
|
||||
private class InternalTarget : Target
|
||||
{
|
||||
private MagicLockSpell m_Owner;
|
||||
private class InternalTarget : Target
|
||||
{
|
||||
private MagicLockSpell m_Owner;
|
||||
|
||||
public InternalTarget( MagicLockSpell owner ) : base( Core.ML ? 10 : 12, false, TargetFlags.None )
|
||||
{
|
||||
m_Owner = owner;
|
||||
}
|
||||
public InternalTarget(MagicLockSpell owner) : base(Core.ML ? 10 : 12, false, TargetFlags.None)
|
||||
{
|
||||
m_Owner = owner;
|
||||
}
|
||||
|
||||
protected override void OnTarget( Mobile from, object o )
|
||||
{
|
||||
if ( o is LockableContainer )
|
||||
m_Owner.Target( (LockableContainer)o );
|
||||
else
|
||||
from.SendLocalizedMessage( 501762 ); // Target must be an unlocked chest.
|
||||
}
|
||||
protected override void OnTarget(Mobile from, object o)
|
||||
{
|
||||
if (o is LockableContainer)
|
||||
m_Owner.Target((LockableContainer)o);
|
||||
else
|
||||
from.SendLocalizedMessage(501762); // Target must be an unlocked chest.
|
||||
}
|
||||
|
||||
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