public static void OtherQuestContent(Map map) { if (map.FindItem <Static>(new Point3D(1721, 1554, 54)) == null) { Static st = new Static(0x42BF) { Hue = 1910, Name = "The Fellowship Tome" }; st.MoveToWorld(new Point3D(1721, 1554, 54), map); } if (map.FindItem <Static>(new Point3D(1721, 1555, 59)) == null) { Static st = new Static(0x2F60) { Hue = 1912, Name = "The Fellowship Coin" }; st.MoveToWorld(new Point3D(1721, 1555, 59), map); } if (map.FindItem <Static>(new Point3D(1721, 1555, 49)) == null) { Static st = new Static(0x3155) { Hue = 1912, Name = "The Fellowship Icon" }; st.MoveToWorld(new Point3D(1721, 1555, 49), map); } if (map.FindItem <Static>(new Point3D(1719, 1554, 49)) == null) { Candelabra st = new Candelabra() { Hue = 1105 }; st.MoveToWorld(new Point3D(1719, 1554, 49), map); } if (map.FindItem <Static>(new Point3D(1722, 1554, 49)) == null) { Candelabra st = new Candelabra() { Hue = 1105 }; st.MoveToWorld(new Point3D(1722, 1554, 49), map); } }
public override Item Construct(Type type, Mobile from) { if (type == typeof(TreasureMap)) { int level; if (from is PlayerMobile && ((PlayerMobile)from).Young && from.Map == Map.Trammel && TreasureMap.IsInHavenIsland(from)) { level = 0; } else { level = 1; } return(new TreasureMap(level, from.Map == Map.Felucca ? Map.Felucca : Map.Trammel)); } else if (type == typeof(MessageInABottle)) { return(new MessageInABottle(from.Map == Map.Felucca ? Map.Felucca : Map.Trammel)); } 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)) { Item preLoot = null; switch (Utility.Random(8)) { 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: // Paintings and portraits { preLoot = new ShipwreckedItem(Utility.Random(0xE9F, 10)); break; } case 3: // Pillows { preLoot = new ShipwreckedItem(Utility.Random(0x13A4, 11)); break; } case 4: // Shells { preLoot = new ShipwreckedItem(Utility.Random(0xFC4, 9)); break; } case 5: //Hats { if (Utility.RandomBool()) { preLoot = new SkullCap(); } else { preLoot = new TricorneHat(); } break; } case 6: // Misc { int[] list = new int[] { 0x1EB5, // unfinished barrel 0xA2A, // stool 0xC1F, // broken clock 0x1047, 0x1048, // globe 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.Max(4, sos.Level))); if (sos.IsAncient) { chest.DropItem(new FabledFishingNet()); } else { chest.DropItem(new SpecialFishingNet()); } chest.Movable = true; chest.Locked = false; chest.TrapType = TrapType.None; chest.TrapPower = 0; chest.TrapLevel = 0; sos.Delete(); return(chest); } } } return(base.Construct(type, from)); }
public override Item Construct(Type type, Mobile from, Item tool) { // Searing Weapon Support, handled elsewhere if (type == typeof(BaseWeapon)) { return(null); } if (type == typeof(TreasureMap)) { return(new TreasureMap(0, from.Map == Map.Felucca ? Map.Felucca : Map.Trammel)); } else if (type == typeof(MessageInABottle)) { return(new MessageInABottle(from.Map == Map.Felucca ? Map.Felucca : Map.Trammel)); } else if (type == typeof(WhitePearl)) { return(new WhitePearl()); } 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 == Map.Felucca || from.Map == Map.Trammel) && from.InRange(sos.TargetLocation, 60)) { Item preLoot = null; bool dredge = HasTypeHook(tool, HookType.Dredging); switch (Utility.Random(17)) { case 0: // Body parts case 1: { int[] list = new int[] { 0x1CDD, 0x1CE5, // arm 0x1CE0, 0x1CE8, // torso 0x1CE1, 0x1CE9, // head 0x1CE2, 0x1CEC // leg }; preLoot = new ShipwreckedItem(Utility.RandomList(list), dredge); break; } case 2: // Bone parts case 3: { 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), dredge); break; } case 4: // Paintings and portraits case 5: { preLoot = new ShipwreckedItem(Utility.Random(0xE9F, 10), dredge); break; } case 6: // Pillows case 7: { preLoot = new ShipwreckedItem(Utility.Random(0x13A4, 11), dredge); break; } case 8: // Shells case 9: { preLoot = new ShipwreckedItem(Utility.Random(0xFC4, 9), dredge); break; } case 10: //Hats case 11: { if (Utility.RandomBool()) { preLoot = new SkullCap(); } else { preLoot = new TricorneHat(); } break; } case 12: // Misc case 13: { int[] list = new int[] { 0x1EB5, // unfinished barrel 0xA2A, // stool 0xC1F, // broken clock 0x1047, 0x1048, // globe 0x1EB1, 0x1EB2, 0x1EB3, 0x1EB4 // barrel staves }; if (Utility.Random(list.Length + 1) == 0) { preLoot = new Candelabra(); } else { preLoot = new ShipwreckedItem(Utility.RandomList(list), dredge); } break; } #region High Seas case 14: { int[] list = new int[] { 0x1E19, 0x1E1A, 0x1E1B, //Fish heads 0x1E2A, 0x1E2B, //Oars 0x1E71, 0x1E7A, //Unfinished drawers 0x1E75, //Unfinished legs }; double ran = Utility.RandomDouble(); if (ran < 0.05) { preLoot = new YellowPolkaDotBikini(); } else if (ran < 0.25) { preLoot = new ShipwreckedItem(list[Utility.RandomMinMax(3, 7)], dredge); } else { preLoot = new ShipwreckedItem(list[Utility.Random(3)], dredge); } break; } #endregion } if (preLoot != null) { if (preLoot is IShipwreckedItem) { ((IShipwreckedItem)preLoot).IsShipwreckedItem = true; } return(preLoot); } LockableContainer chest; if (0.01 > Utility.RandomDouble()) { chest = new ShipsStrongbox(sos.Level); } else { switch (sos.Level) { case 0: chest = new SOSChest(Utility.RandomBool() ? 0xE43 : 0xE41); break; case 1: chest = new SOSChest(0xA306); break; case 2: chest = new SOSChest(Utility.RandomBool() ? 0xE43 : 0xE41); break; case 3: chest = new SOSChest(0xA308); break; default: if (.33 > Utility.RandomDouble()) { chest = new SOSChest(0xA30A); } else { chest = new SOSChest(Utility.RandomBool() ? 0xE41 : 0xE43); chest.Hue = 0x481; } break; } } TreasureMapChest.Fill(from, chest, Math.Max(1, Math.Min(4, sos.Level)), true); sos.OnSOSComplete(chest); if (sos.IsAncient) { chest.DropItem(new FabledFishingNet()); } else { chest.DropItem(new SpecialFishingNet()); } chest.Movable = true; chest.Locked = false; chest.TrapType = TrapType.None; chest.TrapPower = 0; chest.TrapLevel = 0; chest.IsShipwreckedItem = true; sos.Delete(); return(chest); } } } return(base.Construct(type, from, tool)); }
public override Item Construct(Type type, Mobile from) { if (type == typeof(TreasureMap)) { int level; //if ( from is PlayerMobile && ((PlayerMobile)from).Young && from.Map == Map.Trammel && TreasureMap.IsInHavenIsland( from ) ) // level = 0; //else level = 1; return(new TreasureMap(level, /*from.Map == Map.Felucca ?*/ Map.Felucca /* : Map.Trammel*/)); } else if (type == typeof(MessageInABottle)) { return(new MessageInABottle(/*from.Map == Map.Felucca ?*/ Map.Felucca /* : Map.Trammel*/)); } 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)) { Item preLoot = null; switch (Utility.Random(8)) { 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: // Paintings and portraits { preLoot = new ShipwreckedItem(Utility.Random(0xE9F, 10)); break; } case 3: // Pillows { preLoot = new ShipwreckedItem(Utility.Random(0x13A4, 11)); break; } case 4: // Shells { preLoot = new ShipwreckedItem(Utility.Random(0xFC4, 9)); break; } case 5: //Hats { if (Utility.RandomBool()) { preLoot = new SkullCap(); } else { preLoot = new TricorneHat(); } break; } case 6: // Misc { int[] list = new int[] { 0x1EB5, // unfinished barrel 0xA2A, // stool 0xC1F, // broken clock 0x1047, 0x1048, // globe 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 = null; switch (Utility.Random(3)) { case 0: chest = new MetalGoldenChest(); break; case 1: chest = new MetalChest(); break; default: case 2: chest = new WoodenChest(); break; } if (sos.IsAncient) { int hue = 1150; if (0.20 > Utility.RandomDouble()) { switch (Utility.Random((chest is WoodenChest) ? 6 : 14)) { case 0: hue = 1193; break; case 1: hue = 1281; break; case 2: hue = 1190; break; case 3: hue = 1165; break; case 4: hue = 1160; break; case 5: hue = 1126; break; case 6: hue = CraftResources.GetInfo(CraftResource.Valorite).Hue; break; case 7: hue = CraftResources.GetInfo(CraftResource.Verite).Hue; break; case 8: hue = CraftResources.GetInfo(CraftResource.Agapite).Hue; break; case 9: hue = CraftResources.GetInfo(CraftResource.Gold).Hue; break; case 10: hue = CraftResources.GetInfo(CraftResource.Bronze).Hue; break; case 11: hue = CraftResources.GetInfo(CraftResource.Copper).Hue; break; case 12: hue = CraftResources.GetInfo(CraftResource.ShadowIron).Hue; break; case 13: hue = CraftResources.GetInfo(CraftResource.DullCopper).Hue; break; } } chest.Hue = hue; } else if ((chest is MetalChest || chest is MetalGoldenChest) && (0.5 * sos.Level) >= Utility.RandomDouble()) { int randhue = Utility.Random(120); CraftResource resource = CraftResource.None; if (randhue >= 118) { resource = CraftResource.Valorite; } else if (randhue >= 115) { resource = CraftResource.Verite; } else if (randhue >= 110) { resource = CraftResource.Agapite; } else if (randhue >= 100) { resource = CraftResource.Gold; } else if (randhue >= 90) { resource = CraftResource.Bronze; } else if (randhue >= 70) { resource = CraftResource.Copper; } else if (randhue >= 40) { resource = CraftResource.ShadowIron; } else { resource = CraftResource.DullCopper; } chest.Hue = CraftResources.GetInfo(resource).Hue; } int soslevel = Math.Max(1, Math.Max(4, sos.Level)); TreasureMapChest.Fill(chest, soslevel); if (sos.IsAncient) { chest.DropItem(new FabledFishingNet()); } else { chest.DropItem(new SpecialFishingNet()); } chest.Movable = true; chest.Locked = false; chest.Name = "treasure chest"; chest.IsShipwreckedItem = true; if (sos.Level > 0) { chest.TrapType = TrapType.ExplosionTrap; chest.TrapPower = soslevel * Utility.RandomMinMax(5, 15); chest.TrapLevel = 0; } else { chest.TrapType = TrapType.None; chest.TrapPower = 0; chest.TrapLevel = 0; } sos.Delete(); return(chest); } } } return(base.Construct(type, from)); }
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)); }