public BaseBoat() : base(0x4000) { m_TillerMan = new TillerMan( this ); m_Hold = new Hold( this ); m_PPlank = new Plank( this, PlankSide.Port, 0 ); m_SPlank = new Plank( this, PlankSide.Starboard, 0 ); m_PPlank.MoveToWorld( new Point3D( X + PortOffset.X, Y + PortOffset.Y, Z ), Map ); m_SPlank.MoveToWorld( new Point3D( X + StarboardOffset.X, Y + StarboardOffset.Y, Z ), Map ); Facing = Direction.North; m_NextNavPoint = -1; Movable = false; m_Instances.Add( this ); }
public BaseBoat() : base(0x4000) { m_DecayTime = DateTime.Now + BoatDecayDelay; m_TillerMan = new TillerMan( this ); m_Hold = new Hold( this ); m_PPlank = new Plank( this, PlankSide.Port, 0 ); m_SPlank = new Plank( this, PlankSide.Starboard, 0 ); m_PPlank.MoveToWorld( new Point3D( X + PortOffset.X, Y + PortOffset.Y, Z ), Map ); m_SPlank.MoveToWorld( new Point3D( X + StarboardOffset.X, Y + StarboardOffset.Y, Z ), Map ); Facing = Direction.North; Movable = false; m_UpdateDeck = Timer.DelayCall( TimeSpan.FromMinutes( 10.0 ), TimeSpan.FromMinutes( 10.0 ), new TimerCallback( UpdateDeck ) ); }
public BaseBoat() : base(0x0) { this.m_DecayTime = DateTime.Now + BoatDecayDelay; this.m_TillerMan = new TillerMan(this); this.m_Hold = new Hold(this); this.m_PPlank = new Plank(this, PlankSide.Port, 0); this.m_SPlank = new Plank(this, PlankSide.Starboard, 0); this.m_PPlank.MoveToWorld(new Point3D(this.X + this.PortOffset.X, this.Y + this.PortOffset.Y, this.Z), this.Map); this.m_SPlank.MoveToWorld(new Point3D(this.X + this.StarboardOffset.X, this.Y + this.StarboardOffset.Y, this.Z), this.Map); this.Facing = Direction.North; this.m_NextNavPoint = -1; this.Movable = false; m_Instances.Add(this); }
public override void Deserialize( GenericReader reader ) { base.Deserialize( reader ); int version = reader.ReadInt(); switch ( version ) { case 3: { m_MapItem = (MapItem) reader.ReadItem(); m_NextNavPoint = reader.ReadInt(); goto case 2; } case 2: { m_Facing = (Direction)reader.ReadInt(); goto case 1; } case 1: { m_DecayTime = reader.ReadDeltaTime(); goto case 0; } case 0: { if ( version < 3 ) m_NextNavPoint = -1; if ( version < 2 ) { if ( ItemID == NorthID ) m_Facing = Direction.North; else if ( ItemID == SouthID ) m_Facing = Direction.South; else if ( ItemID == EastID ) m_Facing = Direction.East; else if ( ItemID == WestID ) m_Facing = Direction.West; } m_Owner = reader.ReadMobile(); m_PPlank = reader.ReadItem() as Plank; m_SPlank = reader.ReadItem() as Plank; m_TillerMan = reader.ReadItem() as TillerMan; m_Hold = reader.ReadItem() as Hold; m_Anchored = reader.ReadBool(); m_ShipName = reader.ReadString(); if ( version < 1) Refresh(); break; } } m_Instances.Add( this ); }
protected override void OnTarget(Mobile from, object targeted) { if (m_Item.Deleted) { return; } if (targeted is BreakableContainer) { BreakableContainer breakableContainer = targeted as BreakableContainer; if (breakableContainer.LockpickDamageScalar > 0) { breakableContainer.Interact(from, BreakableContainer.InteractionType.Lockpick); } else { breakableContainer.Interact(from, BreakableContainer.InteractionType.None); } return; } if (targeted is BreakableStatic) { BreakableStatic breakableStatic = targeted as BreakableStatic; if (breakableStatic.LockpickDamageScalar > 0) { breakableStatic.Interact(from, BreakableStatic.InteractionType.Lockpick); } else { breakableStatic.Interact(from, BreakableStatic.InteractionType.None); } return; } if (targeted is Hold) { Hold hold = targeted as Hold; hold.LockpickHold(from, m_Item); return; } if (targeted is ILockpickable) { Item item = (Item)targeted; from.Direction = from.GetDirectionTo(item); from.BeginAction(typeof(Lockpick)); Timer.DelayCall(TimeSpan.FromSeconds(SkillCooldown.LockpickingCooldown), delegate { if (from != null) { from.EndAction(typeof(Lockpick)); } }); if (((ILockpickable)targeted).Locked) { from.PlaySound(0x241); new InternalTimer(from, (ILockpickable)targeted, m_Item).Start(); } else { // The door is not locked from.SendLocalizedMessage(502069); // This does not appear to be locked } } else { from.SendLocalizedMessage(501666); // You can't unlock that! } }
public override void Deserialize(GenericReader reader) { base.Deserialize(reader); int version = reader.ReadInt(); switch (version) { case 8: { m_Sunk = reader.ReadBool(); goto case 7; } case 7: { int numm_DamageEntries = reader.ReadInt(); for (int i = 0; i < numm_DamageEntries; i++) { Mobile mob = reader.ReadMobile(); int damage = reader.ReadInt(); DateTime expiration = DateTime.UtcNow + reader.ReadTimeSpan(); AddDamageEntry(mob, damage, expiration); } goto case 6; } case 6: { int count = reader.ReadInt(); for (int i = 0; i < count; i++) { BoatComponent component = reader.ReadItem() as BoatComponent; if (component != null) BoatComponents.Add(component); } goto case 5; } case 5: { m_Hits = reader.ReadInt(); goto case 4; } case 4: { m_RequiresWater = reader.ReadBool(); goto case 3; } case 3: { m_MapItem = (MapItem)reader.ReadItem(); m_NextNavPoint = reader.ReadInt(); goto case 2; } case 2: { m_Facing = (Direction)reader.ReadInt(); goto case 1; } case 1: { m_DecayTime = reader.ReadDeltaTime(); goto case 0; } case 0: { if (version < 3) m_NextNavPoint = -1; if (version < 2) { if (ItemID == NorthID) m_Facing = Direction.North; else if (ItemID == SouthID) m_Facing = Direction.South; else if (ItemID == EastID) m_Facing = Direction.East; else if (ItemID == WestID) m_Facing = Direction.West; } m_Owner = reader.ReadMobile(); m_PPlank = reader.ReadItem() as Plank; m_SPlank = reader.ReadItem() as Plank; m_TillerMan = reader.ReadItem() as TillerMan; m_Hold = reader.ReadItem() as Hold; m_Anchored = reader.ReadBool(); m_ShipName = reader.ReadString(); if (version < 1) Refresh(); break; } } m_Instances.Add(this); }
public override void Deserialize(GenericReader reader) { base.Deserialize(reader); int version = reader.ReadInt(); switch (version) { case 4: { if (reader.ReadInt() == 1) { m_BoatCourse = new BoatCourse(reader); m_BoatCourse.Boat = this; m_BoatCourse.Map = this.Map; } m_DockedBoat = reader.ReadItem() as BaseDockedBoat; m_VirtualMount = reader.ReadItem() as BoatMountItem; m_Decay = reader.ReadBool(); goto case 3; } case 3: { m_MapItem = (MapItem)reader.ReadItem(); m_NextNavPoint = reader.ReadInt(); goto case 2; } case 2: { m_Facing = (Direction)reader.ReadInt(); goto case 1; } case 1: { m_DecayTime = reader.ReadDeltaTime(); goto case 0; } case 0: { if (version < 3) m_NextNavPoint = -1; if (version < 2) { if (ItemID == NorthID) m_Facing = Direction.North; else if (ItemID == SouthID) m_Facing = Direction.South; else if (ItemID == EastID) m_Facing = Direction.East; else if (ItemID == WestID) m_Facing = Direction.West; } m_Owner = reader.ReadMobile(); m_PPlank = reader.ReadItem() as Plank; m_SPlank = reader.ReadItem() as Plank; if (!IsClassicBoat && !(this is RowBoat)) m_TillerMan = reader.ReadMobile() as object; else m_TillerMan = reader.ReadItem() as object; m_Hold = reader.ReadItem() as Hold; m_Anchored = reader.ReadBool(); m_ShipName = reader.ReadString(); m_Anchored = false; //No more anchors[High Seas] if (version < 1) Refresh(); break; } } m_Instances.Add(this); if (m_VirtualMount == null) m_VirtualMount = new BoatMountItem(this); if (version == 6) { if (m_MapItem != null) Timer.DelayCall(TimeSpan.FromSeconds(10), delegate { BoatCourse = new BoatCourse(this, m_MapItem); }); } }
public BaseBoat(Direction direction, bool isClassic) : base(0x0) { m_DecayTime = DateTime.UtcNow + BoatDecayDelay; m_Decay = true; Facing = direction; Layer = Layer.Mount; m_Anchored = false; m_VirtualMount = new BoatMountItem(this); if (isClassic) { m_TillerMan = new TillerMan(this); m_PPlank = new Plank(this, PlankSide.Port, 0); m_SPlank = new Plank(this, PlankSide.Starboard, 0); m_PPlank.MoveToWorld(new Point3D(X + PortOffset.X, Y + PortOffset.Y, Z), Map); m_SPlank.MoveToWorld(new Point3D(X + StarboardOffset.X, Y + StarboardOffset.Y, Z), Map); m_Hold = new Hold(this); UpdateComponents(); } m_NextNavPoint = -1; Movable = false; m_Instances.Add(this); }
public override void Deserialize( GenericReader reader ) { base.Deserialize( reader ); int version = reader.ReadInt(); switch ( version ) { case 2: { m_Facing = (Direction)reader.ReadInt(); goto case 1; } case 1: { m_DecayTime = reader.ReadDeltaTime(); goto case 0; } case 0: { if ( version < 2 ) { if ( ItemID == NorthID ) m_Facing = Direction.North; else if ( ItemID == SouthID ) m_Facing = Direction.South; else if ( ItemID == EastID ) m_Facing = Direction.East; else if ( ItemID == WestID ) m_Facing = Direction.West; } m_Owner = reader.ReadMobile(); m_PPlank = reader.ReadItem() as Plank; m_SPlank = reader.ReadItem() as Plank; m_TillerMan = reader.ReadItem() as TillerMan; m_Hold = reader.ReadItem() as Hold; m_Anchored = reader.ReadBool(); m_ShipName = reader.ReadString(); if ( version < 1) Refresh(); break; } } m_UpdateDeck = Timer.DelayCall( TimeSpan.FromMinutes( 10.0 ), TimeSpan.FromMinutes( 10.0 ), new TimerCallback( UpdateDeck ) ); }
public BaseGalleon() : base(0x0) { m_DecayTime = DateTime.Now + BoatDecayDelay; m_TillerMan = new TillerMan(this); m_Hold = new Hold(this); if (m_Ropes == null) m_Ropes = new List<BoardRope>(); //must be added at Galleon ctor Facing = Direction.North; m_NextNavPoint = -1; Movable = false; m_Instances.Add(this); }
protected override void OnTarget(Mobile from, object targeted) { if (m_Item.Deleted) { return; } if (targeted is BreakableContainer) { BreakableContainer breakableContainer = targeted as BreakableContainer; if (breakableContainer.LockpickDamageScalar > 0) { breakableContainer.Interact(from, BreakableContainer.InteractionType.Lockpick); } else { breakableContainer.Interact(from, BreakableContainer.InteractionType.None); } return; } if (targeted is BreakableStatic) { BreakableStatic breakableStatic = targeted as BreakableStatic; if (breakableStatic.LockpickDamageScalar > 0) { breakableStatic.Interact(from, BreakableStatic.InteractionType.Lockpick); } else { breakableStatic.Interact(from, BreakableStatic.InteractionType.None); } return; } if (targeted is Hold) { Hold hold = targeted as Hold; hold.LockpickHold(from, m_Item); return; } if (targeted is ILockpickable) { if (targeted is BaseTreasureChest) { PlayerMobile player = from as PlayerMobile; if (player != null) { CaptchaPersistance.CheckAndCreateCaptchaAccountEntry(player); if (!player.m_CaptchaAccountData.Attempt(player, CaptchaSourceType.DungeonChest)) { return; } } } Item item = (Item)targeted; from.Direction = from.GetDirectionTo(item); from.BeginAction(typeof(Lockpick)); Timer.DelayCall(TimeSpan.FromSeconds(SkillCooldown.LockpickingCooldown), delegate { if (from != null) { from.EndAction(typeof(Lockpick)); } }); if (((ILockpickable)targeted).Locked) { from.PlaySound(0x241); new InternalTimer(from, (ILockpickable)targeted, m_Item).Start(); } else { // The door is not locked from.SendLocalizedMessage(502069); // This does not appear to be locked } } else { from.SendLocalizedMessage(501666); // You can't unlock that! } }