public static void RandomMastery(CommandEventArgs e) { e.Mobile.BeginTarget(-1, false, TargetFlags.None, (mobile, targeted) => { Item mastery = SkillMasteryPrimer.GetRandom(); if (targeted is Mobile) { Mobile m = targeted as Mobile; m.Backpack.DropItem(mastery); e.Mobile.SendMessage("A mastery has been added to your pack!"); } else if (targeted is IPoint3D) { IPoint3D p = targeted as IPoint3D; mastery.MoveToWorld(new Point3D(p.X, p.Y, p.Z), e.Mobile.Map); } else { mastery.Delete(); } }); }
public override void OnDeath(Container c) { base.OnDeath(c); int drop = Utility.RandomMinMax(2, 5); for (int i = 0; i < drop; i++) { Type pieType = m_Pies[Utility.Random(m_Pies.Length)]; Item pie = Loot.Construct(pieType); if (pie != null) { c.DropItem(pie); } } drop = Utility.RandomMinMax(2, 5); for (int i = 0; i < drop; i++) { Type steakType = m_Steaks[Utility.Random(m_Steaks.Length)]; Item steak = Loot.Construct(steakType); if (steak != null) { c.DropItem(steak); } } c.DropItem(new MessageInABottle(c.Map)); c.DropItem(new SpecialFishingNet()); c.DropItem(new SpecialFishingNet()); c.DropItem(new SpecialFishingNet()); c.DropItem(new SpecialFishingNet()); FishingPole pole = new FishingPole(); BaseRunicTool.ApplyAttributesTo(pole, false, 0, Utility.RandomMinMax(2, 5), 50, 100); c.DropItem(pole); #region TOL if (Core.TOL) { SkillMasteryPrimer.CheckPrimerDrop(this); } #endregion }
public override void Complete() { base.Complete(); From.SendLocalizedMessage(1156342); // You have proven your prowess on the battlefield and have completed the first step on the path of the Master! From.SendLocalizedMessage(1156209); // You have received a mastery primer! From.SendLocalizedMessage(1152339, "#1028794"); // A reward of ~1_ITEM~ has been placed in your backpack. From.AddToBackpack(new BookOfMasteries()); SkillMasteryPrimer primer = new SkillMasteryPrimer(Mastery, 1); From.AddToBackpack(primer); }
public override void OnDeath(Container c) { base.OnDeath(c); FishingPole pole = new FishingPole(); BaseRunicTool.ApplyAttributesTo(pole, false, 0, Utility.RandomMinMax(2, 5), 50, 100); c.DropItem(pole); c.DropItem(new MessageInABottle(c.Map)); c.DropItem(new SpecialFishingNet()); c.DropItem(new SpecialFishingNet()); SkillMasteryPrimer.CheckPrimerDrop(this); }
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 override void OnDeath(Container c) { base.OnDeath(c); if (DropPrimer) { SkillMasteryPrimer primer = SkillMasteryPrimer.GetRandom(); List <DamageStore> rights = GetLootingRights(); if (rights.Count > 0) { Mobile m = rights[Utility.Random(rights.Count)].m_Mobile; m.SendLocalizedMessage(1156209); // You have received a mastery primer! if (m.Backpack == null || !m.Backpack.TryDropItem(m, primer, false)) { m.BankBox.DropItem(primer); } } else { c.DropItem(primer); } } if (GivesMLMinorArtifact && 0.5 > Utility.RandomDouble()) { MondainsLegacy.DropPeerlessMinor(c); } if (this.m_Altar != null) { this.m_Altar.OnPeerlessDeath(); } }
public override void OnDeath(Container c) { base.OnDeath(c); if (DropPrimer) { SkillMasteryPrimer primer = SkillMasteryPrimer.GetRandom(); List <DamageStore> rights = GetLootingRights(); if (rights.Count > 0) { Mobile m = rights[Utility.Random(rights.Count)].m_Mobile; m.SendLocalizedMessage(1156209); // You have received a mastery primer! if (m.Backpack == null || !m.Backpack.TryDropItem(m, primer, false)) { m.BankBox.DropItem(primer); } } else { c.DropItem(primer); } } if (GivesMLMinorArtifact && 0.5 > Utility.RandomDouble()) { MondainsLegacy.DropPeerlessMinor(c); } if (GiveMLSpecial) { if (Utility.RandomDouble() < 0.10) { c.DropItem(new HumanFeyLeggings()); } if (Utility.RandomDouble() < 0.025) { c.DropItem(new CrimsonCincture()); } if (0.05 > Utility.RandomDouble()) { switch (Utility.Random(32)) { case 0: c.DropItem(new AssassinChest()); break; case 1: c.DropItem(new AssassinArms()); break; case 2: c.DropItem(new AssassinLegs()); break; case 3: c.DropItem(new AssassinGloves()); break; case 4: c.DropItem(new DeathChest()); break; case 5: c.DropItem(new DeathArms()); break; case 6: c.DropItem(new DeathLegs()); break; case 7: c.DropItem(new DeathBoneHelm()); break; case 8: c.DropItem(new DeathGloves()); break; case 9: c.DropItem(new MyrmidonArms()); break; case 10: c.DropItem(new MyrmidonLegs()); break; case 11: c.DropItem(new MyrmidonGorget()); break; case 12: c.DropItem(new MyrmidonChest()); break; case 13: c.DropItem(new LeafweaveGloves()); break; case 14: c.DropItem(new LeafweaveLegs()); break; case 15: c.DropItem(new LeafweavePauldrons()); break; case 16: c.DropItem(new PaladinGloves()); break; case 17: c.DropItem(new PaladinGorget()); break; case 18: c.DropItem(new PaladinArms()); break; case 19: c.DropItem(new PaladinLegs()); break; case 20: c.DropItem(new PaladinHelm()); break; case 21: c.DropItem(new PaladinChest()); break; case 22: c.DropItem(new HunterArms()); break; case 23: c.DropItem(new HunterGloves()); break; case 24: c.DropItem(new HunterLegs()); break; case 25: c.DropItem(new HunterChest()); break; case 26: c.DropItem(new GreymistArms()); break; case 27: c.DropItem(new GreymistGloves()); break; case 28: c.DropItem(new GreymistLegs()); break; case 29: c.DropItem(new MalekisHonor()); break; case 30: c.DropItem(new Feathernock()); break; case 31: c.DropItem(new Swiftflight()); break; } } } if (m_Altar != null) { m_Altar.OnPeerlessDeath(); } }
public virtual SkillMasteryPrimer CreateRandomPrimer() { return(SkillMasteryPrimer.GetRandom()); }
public virtual void GivePowerScrolls() { if (Map == null || (RestrictedToFelucca && Map.Rules != MapRules.FeluccaRules)) { return; } List <Mobile> toGive = new List <Mobile>(); List <DamageStore> rights = GetLootingRights(); for (int i = rights.Count - 1; i >= 0; --i) { DamageStore ds = rights[i]; if (ds.m_HasRight && InRange(ds.m_Mobile, 100) && ds.m_Mobile.Map == Map) { toGive.Add(ds.m_Mobile); } } if (toGive.Count == 0) { return; } for (int i = 0; i < toGive.Count; i++) { Mobile m = toGive[i]; if (!(m is PlayerMobile)) { continue; } bool gainedPath = false; int pointsToGain = 800; if (VirtueHelper.Award(m, VirtueName.Valor, pointsToGain, ref gainedPath)) { if (gainedPath) { m.SendLocalizedMessage(1054032); // You have gained a path in Valor! } else { m.SendLocalizedMessage(1054030); // You have gained in Valor! } //No delay on Valor gains } } // Randomize - PowerScrolls for (int i = 0; i < toGive.Count; ++i) { int rand = Utility.Random(toGive.Count); Mobile hold = toGive[i]; toGive[i] = toGive[rand]; toGive[rand] = hold; } for (int i = 0; i < PowerScrollAmount; ++i) { Mobile m = toGive[i % toGive.Count]; var ps = CreateRandomPowerScroll(); GiveItemMessage(m, ps); GivePowerScrollTo(m, ps); } // Randomize - Primers for (int i = 0; i < toGive.Count; ++i) { int rand = Utility.Random(toGive.Count); Mobile hold = toGive[i]; toGive[i] = toGive[rand]; toGive[rand] = hold; } for (int i = 0; i < PowerScrollAmount; ++i) { Mobile m = toGive[i % toGive.Count]; SkillMasteryPrimer p = CreateRandomPrimer(); GiveItemMessage(m, p); GivePowerScrollTo(m, p); } ColUtility.Free(toGive); }
private static SkillMasteryPrimer CreateRandomPrimer() { return(SkillMasteryPrimer.GetRandom()); }
public virtual void GivePowerScrolls() { if (this.Map != Map.Felucca) { return; } List <Mobile> toGive = new List <Mobile>(); List <DamageStore> rights = GetLootingRights(); for (int i = rights.Count - 1; i >= 0; --i) { DamageStore ds = rights[i]; if (ds.m_HasRight && InRange(ds.m_Mobile, 100) && ds.m_Mobile.Map == this.Map) { toGive.Add(ds.m_Mobile); } } if (toGive.Count == 0) { return; } for (int i = 0; i < toGive.Count; i++) { Mobile m = toGive[i]; if (!(m is PlayerMobile)) { continue; } bool gainedPath = false; int pointsToGain = 800; if (VirtueHelper.Award(m, VirtueName.Valor, pointsToGain, ref gainedPath)) { if (gainedPath) { m.SendLocalizedMessage(1054032); // You have gained a path in Valor! } else { m.SendLocalizedMessage(1054030); // You have gained in Valor! } //No delay on Valor gains } } // Randomize - PowerScrolls for (int i = 0; i < toGive.Count; ++i) { int rand = Utility.Random(toGive.Count); Mobile hold = toGive[i]; toGive[i] = toGive[rand]; toGive[rand] = hold; } for (int i = 0; i < ChampionSystem.PowerScrollAmount; ++i) { Mobile m = toGive[i % toGive.Count]; PowerScroll ps = CreateRandomPowerScroll(); m.SendLocalizedMessage(1049524); // You have received a scroll of power! GivePowerScrollTo(m, ps, this); } if (Core.TOL) { // Randomize - Primers for (int i = 0; i < toGive.Count; ++i) { int rand = Utility.Random(toGive.Count); Mobile hold = toGive[i]; toGive[i] = toGive[rand]; toGive[rand] = hold; } for (int i = 0; i < ChampionSystem.PowerScrollAmount; ++i) { Mobile m = toGive[i % toGive.Count]; SkillMasteryPrimer p = CreateRandomPrimer(); m.SendLocalizedMessage(1156209); // You have received a mastery primer! GivePowerScrollTo(m, p, this); } } ColUtility.Free(toGive); }