public override void OnResponse(NetState sender, RelayInfo info) { Mobile from = sender.Mobile; switch (info.ButtonID) { case 0: { from.SendLocalizedMessage(1042021); // Cancelled. break; } case 1: { if (BaseBoat.HasBoat(from) && !_Table.ContainsKey(from)) { BaseBoat boat = World.Items.Values.OfType <BaseBoat>().Where(x => x.Owner == from).FirstOrDefault(); _Table[from] = new AbandonTimer(from, boat); from.SendLocalizedMessage(1150111); // Your ship has been abandoned. It will decay within five minutes. } break; } } }
public override void OnDoubleClick(Mobile from) { BaseBoat boat = BaseBoat.FindBoatAt(from, from.Map); if (from.AccessLevel < AccessLevel.GameMaster && (from.Map == Map.Ilshenar || from.Map == Map.Malas)) { from.SendLocalizedMessage(1010567, null, 0x25); // You may not place a boat from this location. } else if (Core.HS && BaseBoat.HasBoat(from) && !Boat.IsRowBoat) { from.SendLocalizedMessage(1116758); // You already have a ship deployed! } else if (from.Region.IsPartOf(typeof(HouseRegion)) || boat != null && (boat.GetType() == Boat.GetType() || !boat.IsRowBoat && !(this is RowBoatDeed))) { from.SendLocalizedMessage(1010568, null, 0x25); // You may not place a ship while on another ship or inside a house. } else if (!from.HasGump(typeof(BoatPlacementGump))) { if (Core.SE) { from.SendLocalizedMessage(502482); // Where do you wish to place the ship? } else { from.LocalOverheadMessage(MessageType.Regular, 0x3B2, 502482); // Where do you wish to place the ship? } from.SendGump(new BoatPlacementGump(this, from)); } }
public override void OnDoubleClick(Mobile from) { if (!IsChildOf(from.Backpack)) { from.SendLocalizedMessage(1042001); // That must be in your pack for you to use it. } else if (from.AccessLevel < AccessLevel.GameMaster && (from.Map == Map.Ilshenar || from.Map == Map.Malas)) { from.SendLocalizedMessage(1010567, null, 0x25); // You may not place a boat from this location. } else if (Core.HS && BaseBoat.HasBoat(from)) { from.SendLocalizedMessage(1116758); //You already have a ship deployed! } else if (!from.HasGump(typeof(BoatPlacementGump))) { if (Core.SE) { from.SendLocalizedMessage(502482); // Where do you wish to place the ship? } else { from.LocalOverheadMessage(MessageType.Regular, 0x3B2, 502482); // Where do you wish to place the ship? } from.SendGump(new BoatPlacementGump(this, from)); } }
public override void AddCustomContextEntries(Mobile from, List <ContextMenuEntry> list) { base.AddCustomContextEntries(from, list); if (Core.HS && from.Alive) { list.Add(new ShipRecallRuneEntry(from, this)); if (BaseBoat.HasBoat(from) && !_Table.ContainsKey(from)) { list.Add(new AbandonShipEntry(from, this)); } } }
public override void OnDoubleClick(Mobile from) { if (!IsChildOf(from.Backpack)) { from.SendLocalizedMessage(1042001); // That must be in your pack for you to use it. } else if (BaseBoat.HasBoat(from)) { from.SendLocalizedMessage(1116758); //You already have a ship deployed! } else if (!from.HasGump(typeof(BoatPlacementGump))) { from.SendLocalizedMessage(502482); // Where do you wish to place the ship? from.SendGump(new BoatPlacementGump(this, from)); } }
public override void OnClick() { if (m_Vendor == null || m_Vendor.Deleted) { return; } if (BaseBoat.HasBoat(m_From)) { if (Banker.Withdraw(m_From, 100, true)) { BaseBoat boat = World.Items.Values.OfType <BaseBoat>().Where(x => x.Owner == m_From).FirstOrDefault(); if (IsSpecialShip(boat)) { ShipRune newRune = new ShipRune((BaseGalleon)boat); m_From.AddToBackpack(newRune); m_Vendor.Say(1149580); // A recall rune to your ship has been placed in your backpack. } else { KeyType[] Types = Enum.GetValues(typeof(KeyType)).Cast <KeyType>().ToArray(); Key packKey = new Key(Types[Utility.Random(Types.Length)], boat.PPlank.KeyValue, boat); packKey.MaxRange = 10; packKey.Name = "a ship key"; m_From.AddToBackpack(packKey); } } else { m_Vendor.Say(500192); // Begging thy pardon, but thou canst not afford that. } } else { m_Vendor.Say(1116767); // The ship could not be located. } }