protected override void OnLocationChange(Point3D oldLoc) { if( Cannon == null ) { Cannon = new CannonNorth(this); Direction = Direction.North; Cannon.MoveToWorld( new Point3D(X,Y - 3,Z), Map); } else { Direction = Direction.North; Cannon.MoveToWorld( new Point3D(X,Y - 3,Z), Map); } base.OnLocationChange(oldLoc); }
public void GetDirection() { switch (Direction) { case Direction.Up: case Direction.North: { Cannon.Delete(); Cannon = new CannonNorth(this); Cannon.MoveToWorld( new Point3D(X,Y - 3,Z), Map); Cannon.Direction = Direction; break; } case Direction.Down: case Direction.South: { Cannon.Delete(); Cannon = new CannonSouth(this); Cannon.MoveToWorld( new Point3D(X,Y + 1,Z), Map); Cannon.Direction = Direction; break; } case Direction.Right: case Direction.East: { Cannon.Delete(); Cannon = new CannonEast(this); Cannon.MoveToWorld( new Point3D(X + 1,Y,Z), Map); Cannon.Direction = Direction; break; } case Direction.Left: case Direction.West: { Cannon.Delete(); Cannon = new CannonWest(this); Cannon.MoveToWorld( new Point3D(X - 3,Y,Z), Map); Cannon.Direction = Direction; break; } } }
public WalkingCannonGuard() : base() { SpeechHue = Utility.RandomDyedHue(); Title = "the cannoneer"; Hue = Utility.RandomSkinHue(); Cannon = new CannonNorth(this); this.CantWalk = false; if ( this.Female = Utility.RandomBool() ) { Body = 0x191; Name = NameList.RandomName( "female" ); AddItem( new Skirt( Utility.RandomNeutralHue() ) ); } else { Body = 0x190; Name = NameList.RandomName( "male" ); AddItem( new ShortPants( Utility.RandomNeutralHue() ) ); } SetStr( 86, 100 ); SetDex( 81, 95 ); SetInt( 61, 75 ); SetDamage( 10, 23 ); SetSkill( SkillName.MagicResist, 25.0, 60.5 ); SetSkill( SkillName.Tactics, 65.0, 87.5 ); SetSkill( SkillName.Wrestling, 65.0, 90.5 ); Fame = 1000; Karma = 1000; AddItem( new Boots( Utility.RandomNeutralHue() ) ); AddItem( new FancyShirt()); AddItem( new Bandana()); //AddItem( Server.Items.Hair.GetRandomHair( Female ) ); }
public void UnHitch() { Mobile from = m_Owner; Mobile mount = m_Hitch; Map map = Map; Point3D p = Location; BaseCannon cn = null; switch( Direction ) { case Direction.Up: case Direction.North: { cn = new CannonNorth(m_Owner); break; } case Direction.Down: case Direction.South: { cn = new CannonSouth(m_Owner); break; } case Direction.Right: case Direction.East: { cn = new CannonEast(m_Owner); break; } case Direction.Left: case Direction.West: { cn = new CannonWest(m_Owner); break; } } cn.CCom.HitsMax = m_HitsMax; cn.CCom.Hits = m_Hits; Delete(); bool canspawn = true; if( !mount.Deleted && mount != null && !mount.IsDeadBondedPet && mount.Map != Map.Internal && from.InRange(p,5) && ((BaseCreature)m_Hitch).ControlMaster == m_Owner ) { foreach( AddonComponent ac in cn.Components ) { if( !map.CanSpawnMobile(new Point3D(p.X + ac.Offset.X,p.Y + ac.Offset.Y,p.Z + ac.Offset.Z) ) ) canspawn = false; } } if( !canspawn ) { from.SendLocalizedMessage( 1011578 ); // There is an obstacle blocking this location or part of the structure would be on invalid terrain. MovableCannon mc = new MovableCannon(from,mount); mc.HitsMax = cn.CCom.HitsMax; mc.Hits = cn.CCom.Hits; mc.Location = p; cn.Delete(); } else { from.SendMessage("The Cannon has been unhitched."); cn.MoveToWorld(p,map); } }
public void UnHitch() { Mobile from = m_Owner; Mobile mount = m_Hitch; Map map = Map; Point3D p = Location; BaseCannon cn = null; switch (Direction) { case Direction.Up: case Direction.North: { cn = new CannonNorth(m_Owner); break; } case Direction.Down: case Direction.South: { cn = new CannonSouth(m_Owner); break; } case Direction.Right: case Direction.East: { cn = new CannonEast(m_Owner); break; } case Direction.Left: case Direction.West: { cn = new CannonWest(m_Owner); break; } } Delete(); bool canspawn = true; if (!mount.Deleted && mount != null && !mount.IsDeadBondedPet && mount.Map != Map.Internal && from.InRange(p, 5) && ((BaseCreature)m_Hitch).ControlMaster == m_Owner) { foreach (AddonComponent ac in cn.Components) { if (!map.CanSpawnMobile(new Point3D(p.X + ac.Offset.X, p.Y + ac.Offset.Y, p.Z + ac.Offset.Z))) { canspawn = false; } } } if (!canspawn) { from.SendLocalizedMessage(1011578); // There is an obstacle blocking this location or part of the structure would be on invalid terrain. MovableCannon mc = new MovableCannon(from, mount); mc.Location = p; cn.Delete(); } else { from.SendMessage("The Cannon has been unhitched."); cn.MoveToWorld(p, map); } }
public override void OnThink() { if( Combatant == null ) return; Direction d = this.GetDirectionTo(Combatant); if( Direction != d ) Direction = d; if( Cannon.Direction != Direction ) { switch (Direction) { case Direction.Up: case Direction.North: { Cannon.Delete(); Cannon = new CannonNorth(this); Cannon.MoveToWorld( new Point3D(X,Y - 3,Z), Map); Cannon.Direction = Direction; break; } case Direction.Down: case Direction.South: { Cannon.Delete(); Cannon = new CannonSouth(this); Cannon.MoveToWorld( new Point3D(X,Y + 1,Z), Map); Cannon.Direction = Direction; break; } case Direction.Right: case Direction.East: { Cannon.Delete(); Cannon = new CannonEast(this); Cannon.MoveToWorld( new Point3D(X + 1,Y,Z), Map); Cannon.Direction = Direction; break; } case Direction.Left: case Direction.West: { Cannon.Delete(); Cannon = new CannonWest(this); Cannon.MoveToWorld( new Point3D(X - 3,Y,Z), Map); Cannon.Direction = Direction; break; } } } base.OnThink(); }