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,131 +1,137 @@
|
|||
using System;
|
||||
using Server.Factions;
|
||||
using Server.Items;
|
||||
using Server.Misc;
|
||||
using Server.Mobiles;
|
||||
using Server.Regions;
|
||||
using Server.SkillHandlers;
|
||||
using Server.Targeting;
|
||||
|
||||
namespace Server.Spells.Ninjitsu
|
||||
{
|
||||
public class Shadowjump : NinjaSpell
|
||||
{
|
||||
private static SpellInfo m_Info = new SpellInfo(
|
||||
"Shadowjump", null,
|
||||
-1,
|
||||
9002
|
||||
);
|
||||
public class Shadowjump : NinjaSpell
|
||||
{
|
||||
private static SpellInfo m_Info = new SpellInfo(
|
||||
"Shadowjump", null,
|
||||
-1,
|
||||
9002
|
||||
);
|
||||
|
||||
public override TimeSpan CastDelayBase => TimeSpan.FromSeconds( 1.0 );
|
||||
public Shadowjump(Mobile caster, Item scroll) : base(caster, scroll, m_Info)
|
||||
{
|
||||
}
|
||||
|
||||
public override double RequiredSkill => 50.0;
|
||||
public override int RequiredMana => 15;
|
||||
public override TimeSpan CastDelayBase => TimeSpan.FromSeconds(1.0);
|
||||
|
||||
public override bool BlockedByAnimalForm => false;
|
||||
public override double RequiredSkill => 50.0;
|
||||
public override int RequiredMana => 15;
|
||||
|
||||
public Shadowjump( Mobile caster, Item scroll ) : base( caster, scroll, m_Info )
|
||||
{
|
||||
}
|
||||
public override bool BlockedByAnimalForm => false;
|
||||
|
||||
public override bool CheckCast()
|
||||
{
|
||||
PlayerMobile pm = Caster as PlayerMobile; // IsStealthing should be moved to Server.Mobiles
|
||||
if ( !pm.IsStealthing )
|
||||
{
|
||||
Caster.SendLocalizedMessage( 1063087 ); // You must be in stealth mode to use this ability.
|
||||
return false;
|
||||
}
|
||||
public override bool CheckCast()
|
||||
{
|
||||
PlayerMobile pm = Caster as PlayerMobile; // IsStealthing should be moved to Server.Mobiles
|
||||
if (!pm.IsStealthing)
|
||||
{
|
||||
Caster.SendLocalizedMessage(1063087); // You must be in stealth mode to use this ability.
|
||||
return false;
|
||||
}
|
||||
|
||||
return base.CheckCast();
|
||||
}
|
||||
return base.CheckCast();
|
||||
}
|
||||
|
||||
public override bool CheckDisturb( DisturbType type, bool firstCircle, bool resistable )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
public override bool CheckDisturb(DisturbType type, bool firstCircle, bool resistable)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
public override void OnCast()
|
||||
{
|
||||
Caster.SendLocalizedMessage( 1063088 ); // You prepare to perform a Shadowjump.
|
||||
Caster.Target = new InternalTarget( this );
|
||||
}
|
||||
public override void OnCast()
|
||||
{
|
||||
Caster.SendLocalizedMessage(1063088); // You prepare to perform a Shadowjump.
|
||||
Caster.Target = new InternalTarget(this);
|
||||
}
|
||||
|
||||
public void Target( IPoint3D p )
|
||||
{
|
||||
IPoint3D orig = p;
|
||||
Map map = Caster.Map;
|
||||
public void Target(IPoint3D p)
|
||||
{
|
||||
IPoint3D orig = p;
|
||||
Map map = Caster.Map;
|
||||
|
||||
SpellHelper.GetSurfaceTop( ref p );
|
||||
SpellHelper.GetSurfaceTop(ref p);
|
||||
|
||||
Point3D from = Caster.Location;
|
||||
Point3D to = new Point3D( p );
|
||||
Point3D from = Caster.Location;
|
||||
Point3D to = new Point3D(p);
|
||||
|
||||
PlayerMobile pm = Caster as PlayerMobile; // IsStealthing should be moved to Server.Mobiles
|
||||
PlayerMobile pm = Caster as PlayerMobile; // IsStealthing should be moved to Server.Mobiles
|
||||
|
||||
if ( !pm.IsStealthing )
|
||||
{
|
||||
Caster.SendLocalizedMessage( 1063087 ); // You must be in stealth mode to use this ability.
|
||||
}
|
||||
else if ( Factions.Sigil.ExistsOn( Caster ) )
|
||||
{
|
||||
Caster.SendLocalizedMessage( 1061632 ); // You can't do that while carrying the sigil.
|
||||
}
|
||||
else if ( Misc.WeightOverloading.IsOverloaded( Caster ) )
|
||||
{
|
||||
Caster.SendLocalizedMessage( 502359, "", 0x22 ); // Thou art too encumbered to move.
|
||||
}
|
||||
else if ( !SpellHelper.CheckTravel( Caster, TravelCheckType.TeleportFrom ) || !SpellHelper.CheckTravel( Caster, map, to, TravelCheckType.TeleportTo ))
|
||||
{
|
||||
}
|
||||
else if ( map == null || !map.CanSpawnMobile( p.X, p.Y, p.Z ) )
|
||||
{
|
||||
Caster.SendLocalizedMessage( 502831 ); // Cannot teleport to that spot.
|
||||
}
|
||||
else if ( SpellHelper.CheckMulti( to, map, true, 5 ) )
|
||||
{
|
||||
Caster.SendLocalizedMessage( 502831 ); // Cannot teleport to that spot.
|
||||
}
|
||||
else if ( Region.Find( to, map ).GetRegion( typeof( HouseRegion ) ) != null )
|
||||
{
|
||||
Caster.SendLocalizedMessage( 502829 ); // Cannot teleport to that spot.
|
||||
}
|
||||
else if ( CheckSequence() )
|
||||
{
|
||||
SpellHelper.Turn( Caster, orig );
|
||||
if (!pm.IsStealthing)
|
||||
{
|
||||
Caster.SendLocalizedMessage(1063087); // You must be in stealth mode to use this ability.
|
||||
}
|
||||
else if (Sigil.ExistsOn(Caster))
|
||||
{
|
||||
Caster.SendLocalizedMessage(1061632); // You can't do that while carrying the sigil.
|
||||
}
|
||||
else if (WeightOverloading.IsOverloaded(Caster))
|
||||
{
|
||||
Caster.SendLocalizedMessage(502359, "", 0x22); // Thou art too encumbered to move.
|
||||
}
|
||||
else if (!SpellHelper.CheckTravel(Caster, TravelCheckType.TeleportFrom) ||
|
||||
!SpellHelper.CheckTravel(Caster, map, to, TravelCheckType.TeleportTo))
|
||||
{
|
||||
}
|
||||
else if (map == null || !map.CanSpawnMobile(p.X, p.Y, p.Z))
|
||||
{
|
||||
Caster.SendLocalizedMessage(502831); // Cannot teleport to that spot.
|
||||
}
|
||||
else if (SpellHelper.CheckMulti(to, map, true, 5))
|
||||
{
|
||||
Caster.SendLocalizedMessage(502831); // Cannot teleport to that spot.
|
||||
}
|
||||
else if (Region.Find(to, map).GetRegion(typeof(HouseRegion)) != null)
|
||||
{
|
||||
Caster.SendLocalizedMessage(502829); // Cannot teleport to that spot.
|
||||
}
|
||||
else if (CheckSequence())
|
||||
{
|
||||
SpellHelper.Turn(Caster, orig);
|
||||
|
||||
Mobile m = Caster;
|
||||
Mobile m = Caster;
|
||||
|
||||
m.Location = to;
|
||||
m.ProcessDelta();
|
||||
m.Location = to;
|
||||
m.ProcessDelta();
|
||||
|
||||
Effects.SendLocationParticles( EffectItem.Create( from, m.Map, EffectItem.DefaultDuration ), 0x3728, 10, 10, 2023 );
|
||||
Effects.SendLocationParticles(EffectItem.Create(from, m.Map, EffectItem.DefaultDuration), 0x3728, 10, 10,
|
||||
2023);
|
||||
|
||||
m.PlaySound( 0x512 );
|
||||
m.PlaySound(0x512);
|
||||
|
||||
SkillHandlers.Stealth.OnUse( m ); // stealth check after the a jump
|
||||
}
|
||||
Stealth.OnUse(m); // stealth check after the a jump
|
||||
}
|
||||
|
||||
FinishSequence();
|
||||
}
|
||||
public class InternalTarget : Target
|
||||
{
|
||||
private Shadowjump m_Owner;
|
||||
FinishSequence();
|
||||
}
|
||||
|
||||
public InternalTarget( Shadowjump owner ) : base( 11, true, TargetFlags.None )
|
||||
{
|
||||
m_Owner = owner;
|
||||
}
|
||||
public class InternalTarget : Target
|
||||
{
|
||||
private Shadowjump m_Owner;
|
||||
|
||||
protected override void OnTarget( Mobile from, object o )
|
||||
{
|
||||
IPoint3D p = o as IPoint3D;
|
||||
public InternalTarget(Shadowjump owner) : base(11, true, TargetFlags.None)
|
||||
{
|
||||
m_Owner = owner;
|
||||
}
|
||||
|
||||
if ( p != null )
|
||||
m_Owner.Target( p );
|
||||
}
|
||||
protected override void OnTarget(Mobile from, object o)
|
||||
{
|
||||
IPoint3D p = o as IPoint3D;
|
||||
|
||||
protected override void OnTargetFinish( Mobile from )
|
||||
{
|
||||
m_Owner.FinishSequence();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (p != null)
|
||||
m_Owner.Target(p);
|
||||
}
|
||||
|
||||
protected override void OnTargetFinish(Mobile from)
|
||||
{
|
||||
m_Owner.FinishSequence();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue