public override void OnResponse(NetState sender, RelayInfo info) { Mobile from = sender.Mobile; switch (info.ButtonID) { case 1: int doubloonsInBank = Banker.GetUniqueCurrencyBalance(from, typeof(Doubloon)); if (doubloonsInBank >= m_BaseBoatDeed.DoubloonCost) { if (Banker.WithdrawUniqueCurrency(m_Player, typeof(Doubloon), m_BaseBoatDeed.DoubloonCost)) { Doubloon doubloonPile = new Doubloon(m_BaseBoatDeed.DoubloonCost); from.SendSound(doubloonPile.GetDropSound()); doubloonPile.Delete(); m_BaseBoatDeed.PlayerClassOwner = m_Player; m_Player.SendMessage("You claim the boat as your own."); } else { m_Player.SendMessage("You no longer have the required doubloons in your bank box to claim this boat."); } } else { m_Player.SendMessage("You no longer have the required doubloons in your bank box to claim this boat."); } break; } }
public override void OnDoubleClick(Mobile from) { int amount = 5000; if (Banker.DepositUniqueCurrency(from, typeof(Doubloon), amount)) { Doubloon doubloonPile = new Doubloon(amount); from.SendSound(doubloonPile.GetDropSound()); doubloonPile.Delete(); from.SendMessage(amount.ToString() + " doubloons have been placed in your bank box."); } else { from.SendMessage("There was no available space to place the doubloons in your bank box."); } }
public void FindDoubloons(Mobile from) { if (from == null) { return; } int minDoubloons = 5; int maxDoubloons = 10; switch (m_Rarity) { case AquariumItem.Rarity.Common: minDoubloons = 25; maxDoubloons = 50; break; case AquariumItem.Rarity.Uncommon: minDoubloons = 50; maxDoubloons = 100; break; case AquariumItem.Rarity.Rare: minDoubloons = 100; maxDoubloons = 250; break; case AquariumItem.Rarity.UltraRare: minDoubloons = 250; maxDoubloons = 500; break; } PlayerMobile player = from as PlayerMobile; if (player == null) { return; } if (player != null) { if (!player.Deleted && player.ShipOccupied != null) { int doubloonValue = Utility.RandomMinMax(minDoubloons, maxDoubloons); if (player.ShipOccupied.DepositDoubloons(doubloonValue)) { Doubloon doubloonPile = new Doubloon(doubloonValue); player.SendSound(doubloonPile.GetDropSound()); doubloonPile.Delete(); //player.ShipOccupied.doubloonsEarned += doubloonValue; player.SendMessage("You have recovered " + doubloonValue.ToString() + " doubloons from the cargo! The coins have been placed in your ship's hold."); } else { player.SendMessage("You have earned doubloons, but alas there was not enough room in your ship's hold to place them all!"); } } } }
public override Item Construct(Type type, Mobile from, Item _i, HarvestDefinition _d, HarvestBank _b, HarvestResource _r) { if (type == typeof(TreasureMap)) { int level = 1; return(new TreasureMap(level, Map.Felucca)); } else if (type == typeof(MessageInABottle)) { return(new MessageInABottle(Map.Felucca)); } Container pack = from.Backpack; if (pack != null) { List <SOS> messages = pack.FindItemsByType <SOS>(); for (int i = 0; i < messages.Count; ++i) { SOS sos = messages[i]; if (from.Map == sos.TargetMap && from.InRange(sos.TargetLocation, 60) && !sos.Completed) { Item preLoot = null; switch (Utility.Random(7)) { case 0: // Body parts { int[] list = new int[] { 0x1CDD, 0x1CE5, // arm 0x1CE0, 0x1CE8, // torso 0x1CE1, 0x1CE9, // head 0x1CE2, 0x1CEC // leg }; preLoot = new ShipwreckedItem(Utility.RandomList(list)); break; } case 1: // Bone parts { int[] list = new int[] { 0x1AE0, 0x1AE1, 0x1AE2, 0x1AE3, 0x1AE4, // skulls 0x1B09, 0x1B0A, 0x1B0B, 0x1B0C, 0x1B0D, 0x1B0E, 0x1B0F, 0x1B10, // bone piles 0x1B15, 0x1B16 // pelvis bones }; preLoot = new ShipwreckedItem(Utility.RandomList(list)); break; } case 2: // Pillows { preLoot = new ShipwreckedItem(Utility.Random(0x13A4, 11)); break; } case 3: // Shells { preLoot = new ShipwreckedItem(Utility.Random(0xFC4, 9)); break; } case 4: //Hats { if (Utility.RandomBool()) { preLoot = new SkullCap(); } else { preLoot = new TricorneHat(); } break; } case 5: // Misc { int[] list = new int[] { 0x1EB5, // unfinished barrel 0xA2A, // stool 0xC1F, // broken clock 0x1EB1, 0x1EB2, 0x1EB3, 0x1EB4 // barrel staves }; if (Utility.Random(list.Length + 1) == 0) { preLoot = new Candelabra(); } else { preLoot = new ShipwreckedItem(Utility.RandomList(list)); } break; } } if (preLoot != null) { if (preLoot is IShipwreckedItem) { ((IShipwreckedItem)preLoot).IsShipwreckedItem = true; } return(preLoot); } LockableContainer chest; if (Utility.RandomBool()) { chest = new MetalGoldenChest(); } else { chest = new WoodenChest(); } if (sos.IsAncient) { chest.Hue = 0x481; } TreasureMapChest.Fill(chest, Math.Max(1, Math.Min(3, (sos.Level + 1)))); if (sos.IsAncient) { chest.DropItem(new FabledFishingNet()); } else { chest.DropItem(new SpecialFishingNet()); } if (Utility.Random(500) == 0) { Item mask = new HornedTribalMask(); mask.Hue = 2715; mask.Name = "Mask of Cthulu"; chest.DropItem(mask); } switch (Utility.Random(300)) { case 0: { Item rustedchest = new PlateChest(); rustedchest.Hue = 2718; rustedchest.Name = "a rusted platemail chest recovered from a shipwreck"; chest.DropItem(rustedchest); break; } case 1: { Item rustedarms = new PlateArms(); rustedarms.Hue = 2718; rustedarms.Name = "rusted platemail arms recovered from a shipwreck"; chest.DropItem(rustedarms); break; } case 2: { Item rustedlegs = new PlateLegs(); rustedlegs.Hue = 2718; rustedlegs.Name = "rusted platemail legguards recovered from a shipwreck"; chest.DropItem(rustedlegs); break; } case 3: { Item rustedgloves = new PlateGloves(); rustedgloves.Hue = 2718; rustedgloves.Name = "rusted platemail gloves recovered from a shipwreck"; chest.DropItem(rustedgloves); break; } case 4: { Item rustedgorget = new PlateGorget(); rustedgorget.Hue = 2718; rustedgorget.Name = "rusted platemail gorget recovered from a shipwreck"; chest.DropItem(rustedgorget); break; } case 5: { Item rustedhelm = new PlateHelm(); rustedhelm.Hue = 2718; rustedhelm.Name = "a rusted platemail helmet recovered from a shipwreck"; chest.DropItem(rustedhelm); break; } } switch (Utility.Random(400)) { case 0: { Item lamp = new LampPost1(); lamp.Name = "Britannia Head Light"; lamp.Hue = 2601; chest.DropItem(lamp); break; } case 1: { Item lantern = new HangingLantern(); lantern.Name = "Fog Lamp"; lantern.Hue = 2601; lantern.Movable = true; chest.DropItem(lantern); break; } } chest.Movable = true; chest.Locked = false; chest.TrapType = TrapType.None; chest.TrapPower = 0; chest.TrapLevel = 0; sos.Completed = true; BaseBoat ownerBoat = BaseBoat.FindBoatAt(from.Location, from.Map); PlayerMobile player = from as PlayerMobile; if (ownerBoat != null && player != null) { if (ownerBoat.IsFriend(player) || ownerBoat.IsOwner(player) || ownerBoat.IsCoOwner(player)) { double doubloonValue = Utility.RandomMinMax(25, 50); int finalDoubloonAmount = (int)doubloonValue; bool shipOwner = ownerBoat.IsOwner(player); bool bankDoubloonsValid = false; bool holdPlacementValid = false; //Deposit Half In Player's Bank if (Banker.DepositUniqueCurrency(player, typeof(Doubloon), finalDoubloonAmount)) { Doubloon doubloonPile = new Doubloon(finalDoubloonAmount); player.SendSound(doubloonPile.GetDropSound()); doubloonPile.Delete(); bankDoubloonsValid = true; } //Deposit Other Half in Ship if (ownerBoat.DepositDoubloons(finalDoubloonAmount)) { Doubloon doubloonPile = new Doubloon(finalDoubloonAmount); player.SendSound(doubloonPile.GetDropSound()); doubloonPile.Delete(); holdPlacementValid = true; } if (shipOwner) { player.PirateScore += finalDoubloonAmount; //ownerBoat.doubloonsEarned += finalDoubloonAmount * 2; if (bankDoubloonsValid && holdPlacementValid) { player.SendMessage("You've received " + (finalDoubloonAmount * 2).ToString() + " doubloons for completing a message in a bottle! They have been evenly split between your bank box and your ship's hold."); } else if (bankDoubloonsValid && !holdPlacementValid) { player.SendMessage("You've earned " + (finalDoubloonAmount * 2).ToString() + " doubloons, however there was not enough room to place all of them in your ship's hold."); } else if (!bankDoubloonsValid && holdPlacementValid) { player.SendMessage("You've earned " + (finalDoubloonAmount * 2).ToString() + " doubloons, however there was not enough room to place all of them in your bank box."); } } else { //ownerBoat.doubloonsEarned += finalDoubloonAmount; player.PirateScore += finalDoubloonAmount; if (bankDoubloonsValid) { player.SendMessage("You've earned " + finalDoubloonAmount.ToString() + " doubloons for completing a message in a bottle! They have been placed in your bank box."); } else { player.SendMessage("You've earned doubloons, but there was not enough room to place all of them in your bank box."); } } } } return(chest); } } } return(base.Construct(type, from, _i, _d, _b, _r)); }