public override void OnDeath(Container c) { if (Map == Map.Felucca) { List <DamageStore> rights = GetLootingRights(); List <Mobile> toGive = new List <Mobile>(); for (int i = rights.Count - 1; i >= 0; --i) { DamageStore ds = rights[i]; if (ds.m_HasRight) { toGive.Add(ds.m_Mobile); } } if (SkullType != ChampionSkullType.None) { if (toGive.Count > 0) { toGive[Utility.Random(toGive.Count)].AddToBackpack(new ChampionSkull(SkullType)); } else { c.DropItem(new ChampionSkull(SkullType)); } } RefinementComponent.Roll(c, 3, 0.10); } base.OnDeath(c); }
public override void OnDeath(Container c) { if (this.Map == Map.Felucca) { //TODO: Confirm SE change or AoS one too? List <DamageStore> rights = GetLootingRights(); List <Mobile> toGive = new List <Mobile>(); for (int i = rights.Count - 1; i >= 0; --i) { DamageStore ds = rights[i]; if (ds.m_HasRight) { toGive.Add(ds.m_Mobile); } } if (SkullType != ChampionSkullType.None) { if (toGive.Count > 0) { toGive[Utility.Random(toGive.Count)].AddToBackpack(new ChampionSkull(this.SkullType)); } else { c.DropItem(new ChampionSkull(this.SkullType)); } } if (Core.SA) { RefinementComponent.Roll(c, 3, 0.10); } #region TOL if (Core.TOL) { SkillMasteryPrimer.CheckPrimerDrop(this); } #endregion } base.OnDeath(c); }
public static void FillHold(BaseGalleon galleon) { if (galleon == null) { return; } Container hold = galleon.GalleonHold; if (hold != null) { int cnt = Utility.RandomMinMax(7, 14); for (int i = 0; i < cnt; i++) { Item item = RunicReforging.GenerateRandomItem(galleon); if (item != null) { hold.DropItem(item); } } hold.DropItem(new Swab()); hold.DropItem(new Ramrod()); hold.DropItem(new Matches(Utility.RandomMinMax(25, 30))); hold.DropItem(new HeavyCannonball(Utility.RandomMinMax(7, 10))); hold.DropItem(new LightCannonball(Utility.RandomMinMax(7, 10))); hold.DropItem(new HeavyGrapeshot(Utility.RandomMinMax(7, 10))); hold.DropItem(new LightGrapeshot(Utility.RandomMinMax(7, 10))); hold.DropItem(new HeavyPowderCharge(Utility.RandomMinMax(7, 10))); hold.DropItem(new LightPowderCharge(Utility.RandomMinMax(7, 10))); hold.DropItem(new FuseCord(Utility.RandomMinMax(7, 10))); if (.10 >= Utility.RandomDouble()) { hold.DropItem(new SmugglersCache()); } if (.10 >= Utility.RandomDouble()) { FishSteak steaks = new FishSteak(5); switch (Utility.Random(5)) { case 0: steaks.Name = "Spiced Salmon"; steaks.Hue = 1759; break; case 1: steaks.Name = "Dried Tuna"; steaks.Hue = 2108; break; case 2: steaks.Name = "Salted Snapper"; steaks.Hue = 1864; break; case 3: steaks.Name = "Salted Herring"; steaks.Hue = 2302; break; case 4: steaks.Name = "Spiced Salmon"; steaks.Hue = 1637; break; } hold.DropItem(steaks); } hold.DropItem(new Gold(Utility.RandomMinMax(5000, 25000))); if (0.50 > Utility.RandomDouble()) { switch (Utility.Random(4)) { case 0: case 1: case 2: hold.DropItem(new IronWire(Utility.RandomMinMax(1, 5))); break; case 3: case 4: case 5: hold.DropItem(new CopperWire(Utility.RandomMinMax(1, 5))); break; case 6: case 7: hold.DropItem(new SilverWire(Utility.RandomMinMax(1, 5))); break; case 8: hold.DropItem(new GoldWire(Utility.RandomMinMax(1, 5))); break; } } switch (Utility.Random(8)) { case 0: if (Utility.RandomBool()) { hold.DropItem(new IronOre(Utility.RandomMinMax(40, 50))); } else { hold.DropItem(new IronIngot(Utility.RandomMinMax(40, 50))); } break; case 1: if (Utility.RandomBool()) { hold.DropItem(new DullCopperOre(Utility.RandomMinMax(40, 50))); } else { hold.DropItem(new DullCopperIngot(Utility.RandomMinMax(40, 50))); } break; case 2: if (Utility.RandomBool()) { hold.DropItem(new ShadowIronOre(Utility.RandomMinMax(40, 50))); } else { hold.DropItem(new ShadowIronIngot(Utility.RandomMinMax(40, 50))); } break; case 3: if (Utility.RandomBool()) { hold.DropItem(new CopperOre(Utility.RandomMinMax(40, 50))); } else { hold.DropItem(new CopperIngot(Utility.RandomMinMax(40, 50))); } break; case 4: if (Utility.RandomBool()) { hold.DropItem(new BronzeOre(Utility.RandomMinMax(40, 50))); } else { hold.DropItem(new BronzeIngot(Utility.RandomMinMax(40, 50))); } break; case 5: if (Utility.RandomBool()) { hold.DropItem(new AgapiteOre(Utility.RandomMinMax(40, 50))); } else { hold.DropItem(new AgapiteIngot(Utility.RandomMinMax(40, 50))); } break; case 6: if (Utility.RandomBool()) { hold.DropItem(new VeriteOre(Utility.RandomMinMax(40, 50))); } else { hold.DropItem(new VeriteIngot(Utility.RandomMinMax(40, 50))); } break; case 7: if (Utility.RandomBool()) { hold.DropItem(new ValoriteOre(Utility.RandomMinMax(40, 50))); } else { hold.DropItem(new ValoriteIngot(Utility.RandomMinMax(40, 50))); } break; } switch (Utility.Random(5)) { case 0: if (Utility.RandomBool()) { hold.DropItem(new Board(Utility.RandomMinMax(40, 50))); } else { hold.DropItem(new Log(Utility.RandomMinMax(40, 50))); } break; case 1: if (Utility.RandomBool()) { hold.DropItem(new OakBoard(Utility.RandomMinMax(40, 50))); } else { hold.DropItem(new OakLog(Utility.RandomMinMax(40, 50))); } break; case 2: if (Utility.RandomBool()) { hold.DropItem(new AshBoard(Utility.RandomMinMax(40, 50))); } else { hold.DropItem(new AshLog(Utility.RandomMinMax(40, 50))); } break; case 3: if (Utility.RandomBool()) { hold.DropItem(new YewBoard(Utility.RandomMinMax(40, 50))); } else { hold.DropItem(new YewLog(Utility.RandomMinMax(40, 50))); } break; case 4: if (Utility.RandomBool()) { hold.DropItem(new BloodwoodBoard(Utility.RandomMinMax(40, 50))); } else { hold.DropItem(new BloodwoodLog(Utility.RandomMinMax(40, 50))); } break; } switch (Utility.Random(4)) { case 0: if (Utility.RandomBool()) { hold.DropItem(new Leather(Utility.RandomMinMax(40, 50))); } else { hold.DropItem(new Hides(Utility.RandomMinMax(40, 50))); } break; case 1: if (Utility.RandomBool()) { hold.DropItem(new SpinedLeather(Utility.RandomMinMax(40, 50))); } else { hold.DropItem(new SpinedHides(Utility.RandomMinMax(40, 50))); } break; case 2: if (Utility.RandomBool()) { hold.DropItem(new HornedLeather(Utility.RandomMinMax(40, 50))); } else { hold.DropItem(new HornedHides(Utility.RandomMinMax(40, 50))); } break; case 3: if (Utility.RandomBool()) { hold.DropItem(new BarbedLeather(Utility.RandomMinMax(40, 50))); } else { hold.DropItem(new BarbedHides(Utility.RandomMinMax(40, 50))); } break; } switch (Utility.Random(4)) { case 0: hold.DropItem(new HeavyCannonball(Utility.RandomMinMax(5, 10))); break; case 1: hold.DropItem(new LightCannonball(Utility.RandomMinMax(5, 10))); break; case 2: hold.DropItem(new HeavyGrapeshot(Utility.RandomMinMax(5, 10))); break; case 3: hold.DropItem(new LightGrapeshot(Utility.RandomMinMax(5, 10))); break; } //Rares if (0.8 > Utility.RandomDouble()) { Item deed; if (Utility.RandomBool()) { if (Core.EJ) { deed = new CarronadeDeed(); } else { deed = new HeavyShipCannonDeed(); } } else { if (Core.EJ) { deed = new CulverinDeed(); } else { deed = new LightShipCannonDeed(); } } hold.DropItem(deed); } if (0.025 > Utility.RandomDouble()) { if (Utility.RandomBool()) { hold.DropItem(new WhiteClothDyeTub()); } else { hold.DropItem(PermanentBoatPaint.DropRandom()); } } RefinementComponent.Roll(hold, 3, 0.25); if (Points.PointsSystem.RisingTide.Enabled) { hold.DropItem(new MaritimeCargo()); hold.DropItem(new MaritimeCargo()); if (galleon is OrcishGalleon) { hold.DropItem(new MaritimeCargo()); if (Utility.RandomBool()) { hold.DropItem(new MaritimeCargo()); } } } } }
public static void FillHold(BaseGalleon galleon) { if (galleon == null) { return; } Container hold = galleon.GalleonHold; if (hold != null) { int cnt = Utility.RandomMinMax(7, 14); for (int i = 0; i < cnt; i++) { Item item = Loot.RandomArmorOrShieldOrWeaponOrJewelry(); if (item is BaseWeapon) { BaseRunicTool.ApplyAttributesTo((BaseWeapon)item, false, 0, Utility.RandomMinMax(1, 6), 10, 100); } else if (item is BaseArmor) { BaseRunicTool.ApplyAttributesTo((BaseArmor)item, false, 0, Utility.RandomMinMax(1, 6), 10, 100); } else if (item is BaseHat) { BaseRunicTool.ApplyAttributesTo((BaseHat)item, false, 0, Utility.RandomMinMax(1, 6), 10, 100); } else if (item is BaseJewel) { BaseRunicTool.ApplyAttributesTo((BaseJewel)item, false, 0, Utility.RandomMinMax(1, 6), 10, 100); } else { item.Delete(); } hold.DropItem(item); } hold.DropItem(new Swab()); hold.DropItem(new Ramrod()); hold.DropItem(new Matches(Utility.RandomMinMax(25, 30))); hold.DropItem(new HeavyCannonball(Utility.RandomMinMax(7, 10))); hold.DropItem(new LightCannonball(Utility.RandomMinMax(7, 10))); hold.DropItem(new HeavyGrapeshot(Utility.RandomMinMax(7, 10))); hold.DropItem(new LightGrapeshot(Utility.RandomMinMax(7, 10))); hold.DropItem(new HeavyPowderCharge(Utility.RandomMinMax(7, 10))); hold.DropItem(new LightPowderCharge(Utility.RandomMinMax(7, 10))); hold.DropItem(new Fusecord(Utility.RandomMinMax(7, 10))); if (.10 >= Utility.RandomDouble()) { hold.DropItem(new SmugglersCache()); } if (.10 >= Utility.RandomDouble()) { FishSteak steaks = new FishSteak(5); switch (Utility.Random(5)) { case 0: steaks.Name = "Spiced Salmon"; steaks.Hue = 1759; break; case 1: steaks.Name = "Dried Tuna"; steaks.Hue = 2108; break; case 2: steaks.Name = "Salted Snapper"; steaks.Hue = 1864; break; case 3: steaks.Name = "Salted Herring"; steaks.Hue = 2302; break; case 4: steaks.Name = "Spiced Salmon"; steaks.Hue = 1637; break; } hold.DropItem(steaks); } /*if (0.10 > Utility.RandomDouble()) * { * Item item = null; * switch (Utility.Random(6)) * { * case 0: item = new LightScatterShot(); break; * case 1: item = new HeavyScatterShot(); break; * case 2: item = new LightFragShot(); break; * case 3: item = new HeavyFragShot(); break; * case 4: item = new LightHotShot(); break; * case 5: item = new HeavyHotShot(); break; * } * * if (item != null) * { * item.Amount = Utility.RandomMinMax(2, 10); * hold.DropItem(item); * } * }*/ hold.DropItem(new Gold(Utility.RandomMinMax(5000, 25000))); if (0.50 > Utility.RandomDouble()) { switch (Utility.Random(4)) { case 0: case 1: case 2: hold.DropItem(new IronWire(Utility.RandomMinMax(1, 5))); break; case 3: case 4: case 5: hold.DropItem(new CopperWire(Utility.RandomMinMax(1, 5))); break; case 6: case 7: hold.DropItem(new SilverWire(Utility.RandomMinMax(1, 5))); break; case 8: hold.DropItem(new GoldWire(Utility.RandomMinMax(1, 5))); break; } } switch (Utility.Random(8)) { case 0: if (Utility.RandomBool()) { hold.DropItem(new IronOre(Utility.RandomMinMax(40, 50))); } else { hold.DropItem(new IronIngot(Utility.RandomMinMax(40, 50))); } break; case 1: if (Utility.RandomBool()) { hold.DropItem(new DullCopperOre(Utility.RandomMinMax(40, 50))); } else { hold.DropItem(new DullCopperIngot(Utility.RandomMinMax(40, 50))); } break; case 2: if (Utility.RandomBool()) { hold.DropItem(new ShadowIronOre(Utility.RandomMinMax(40, 50))); } else { hold.DropItem(new ShadowIronIngot(Utility.RandomMinMax(40, 50))); } break; case 3: if (Utility.RandomBool()) { hold.DropItem(new CopperOre(Utility.RandomMinMax(40, 50))); } else { hold.DropItem(new CopperIngot(Utility.RandomMinMax(40, 50))); } break; case 4: if (Utility.RandomBool()) { hold.DropItem(new BronzeOre(Utility.RandomMinMax(40, 50))); } else { hold.DropItem(new BronzeIngot(Utility.RandomMinMax(40, 50))); } break; case 5: if (Utility.RandomBool()) { hold.DropItem(new AgapiteOre(Utility.RandomMinMax(40, 50))); } else { hold.DropItem(new AgapiteIngot(Utility.RandomMinMax(40, 50))); } break; case 6: if (Utility.RandomBool()) { hold.DropItem(new VeriteOre(Utility.RandomMinMax(40, 50))); } else { hold.DropItem(new VeriteIngot(Utility.RandomMinMax(40, 50))); } break; case 7: if (Utility.RandomBool()) { hold.DropItem(new ValoriteOre(Utility.RandomMinMax(40, 50))); } else { hold.DropItem(new ValoriteIngot(Utility.RandomMinMax(40, 50))); } break; } switch (Utility.Random(5)) { case 0: if (Utility.RandomBool()) { hold.DropItem(new Board(Utility.RandomMinMax(40, 50))); } else { hold.DropItem(new Log(Utility.RandomMinMax(40, 50))); } break; case 1: if (Utility.RandomBool()) { hold.DropItem(new OakBoard(Utility.RandomMinMax(40, 50))); } else { hold.DropItem(new OakLog(Utility.RandomMinMax(40, 50))); } break; case 2: if (Utility.RandomBool()) { hold.DropItem(new AshBoard(Utility.RandomMinMax(40, 50))); } else { hold.DropItem(new AshLog(Utility.RandomMinMax(40, 50))); } break; case 3: if (Utility.RandomBool()) { hold.DropItem(new YewBoard(Utility.RandomMinMax(40, 50))); } else { hold.DropItem(new YewLog(Utility.RandomMinMax(40, 50))); } break; case 4: if (Utility.RandomBool()) { hold.DropItem(new BloodwoodBoard(Utility.RandomMinMax(40, 50))); } else { hold.DropItem(new BloodwoodLog(Utility.RandomMinMax(40, 50))); } break; } switch (Utility.Random(4)) { case 0: if (Utility.RandomBool()) { hold.DropItem(new Leather(Utility.RandomMinMax(40, 50))); } else { hold.DropItem(new Hides(Utility.RandomMinMax(40, 50))); } break; case 1: if (Utility.RandomBool()) { hold.DropItem(new SpinedLeather(Utility.RandomMinMax(40, 50))); } else { hold.DropItem(new SpinedHides(Utility.RandomMinMax(40, 50))); } break; case 2: if (Utility.RandomBool()) { hold.DropItem(new HornedLeather(Utility.RandomMinMax(40, 50))); } else { hold.DropItem(new HornedHides(Utility.RandomMinMax(40, 50))); } break; case 3: if (Utility.RandomBool()) { hold.DropItem(new BarbedLeather(Utility.RandomMinMax(40, 50))); } else { hold.DropItem(new BarbedHides(Utility.RandomMinMax(40, 50))); } break; } switch (Utility.Random(4)) { case 0: hold.DropItem(new HeavyCannonball(Utility.RandomMinMax(5, 10))); break; case 1: hold.DropItem(new LightCannonball(Utility.RandomMinMax(5, 10))); break; case 2: hold.DropItem(new HeavyGrapeshot(Utility.RandomMinMax(5, 10))); break; case 3: hold.DropItem(new LightGrapeshot(Utility.RandomMinMax(5, 10))); break; } //Rares if (0.8 > Utility.RandomDouble()) { if (Utility.RandomBool()) { hold.DropItem(new HeavyShipCannonDeed()); } else { hold.DropItem(new LightShipCannonDeed()); } } if (0.025 > Utility.RandomDouble()) { if (Utility.RandomBool()) { hold.DropItem(new WhiteClothDyeTub()); } else { hold.DropItem(PermanentBoatPaint.DropRandom()); } } RefinementComponent.Roll(hold, 3, 0.25); } }