public BuriedBody(int level, string who, Mobile digger) : base(0xe40) { string sCorpse = ContainerFunctions.GetOwner("Body"); if (who != "" && who != null) { sCorpse = "bones"; switch (Utility.RandomMinMax(0, 3)) { case 0: sCorpse = "bones"; break; case 1: sCorpse = "body"; break; case 2: sCorpse = "skeletal remains"; break; case 3: sCorpse = "skeletal bones"; break; } sCorpse = "The " + sCorpse + " of " + who; } Name = sCorpse; Movable = true; Weight = 5; GumpID = 9; ItemID = 3786 + Utility.Random(8); ContainerFunctions.FillTheContainer(level, this, digger); if (level > 4) { ContainerFunctions.FillTheContainer(level, this, digger); } if (level > 8) { ContainerFunctions.FillTheContainer(level, this, digger); } if (GetPlayerInfo.LuckyPlayer(digger.Luck)) { ContainerFunctions.FillTheContainer(level, this, digger); } int xTraCash = Utility.RandomMinMax((level * 300), (level * 500)); ContainerFunctions.AddGoldToContainer(xTraCash, this, 0, digger); if (Utility.RandomMinMax(0, 500) < (level)) { Item arty = ArtifactBuilder.CreateArtifact("random"); DropItem(arty); BaseContainer.DropItemFix(arty, digger, ItemID, GumpID); } TrapType = TrapType.None; TrapPower = 0; TrapLevel = 0; Locked = false; LockLevel = 0; MaxLockLevel = 0; RequiredSkill = 0; }
public override void OnHit(Mobile attacker, Mobile defender, int damage) { if (!Validate(attacker)) { return; } ClearCurrentAbility(attacker); Item toDisrobe = defender.FindItemOnLayer(Layer.InnerTorso); if (toDisrobe == null || !toDisrobe.Movable) { toDisrobe = defender.FindItemOnLayer(Layer.OuterTorso); } Container pack = defender.Backpack; if (pack == null || toDisrobe == null || !toDisrobe.Movable) { attacker.SendLocalizedMessage(1004001); // You cannot disarm your opponent. } else if (CheckMana(attacker, true)) { //attacker.SendLocalizedMessage( 1060092 ); // You disarm their weapon! defender.SendLocalizedMessage(1062002); // You can no longer wear your ~1_ARMOR~ defender.PlaySound(0x3B9); //defender.FixedParticles( 0x37BE, 232, 25, 9948, EffectLayer.InnerTorso ); pack.DropItem(toDisrobe); BaseContainer.DropItemFix(toDisrobe, defender, pack.ItemID, pack.GumpID); BaseWeapon.BlockEquip(defender, BlockEquipDuration); } }
public override void Open(Mobile from) { int amount = 50; if (this.Weight > 2.0) { Item i = null; i = new BlackPearl(amount); DropItem(i); BaseContainer.DropItemFix(i, from, ItemID, GumpID); i = new Bloodmoss(amount); DropItem(i); BaseContainer.DropItemFix(i, from, ItemID, GumpID); i = new Garlic(amount); DropItem(i); BaseContainer.DropItemFix(i, from, ItemID, GumpID); i = new Ginseng(amount); DropItem(i); BaseContainer.DropItemFix(i, from, ItemID, GumpID); i = new MandrakeRoot(amount); DropItem(i); BaseContainer.DropItemFix(i, from, ItemID, GumpID); i = new Nightshade(amount); DropItem(i); BaseContainer.DropItemFix(i, from, ItemID, GumpID); i = new SulfurousAsh(amount); DropItem(i); BaseContainer.DropItemFix(i, from, ItemID, GumpID); i = new SpidersSilk(amount); DropItem(i); BaseContainer.DropItemFix(i, from, ItemID, GumpID); i = new Brimstone(amount); DropItem(i); BaseContainer.DropItemFix(i, from, ItemID, GumpID); i = new ButterflyWings(amount); DropItem(i); BaseContainer.DropItemFix(i, from, ItemID, GumpID); i = new EyeOfToad(amount); DropItem(i); BaseContainer.DropItemFix(i, from, ItemID, GumpID); i = new FairyEgg(amount); DropItem(i); BaseContainer.DropItemFix(i, from, ItemID, GumpID); i = new GargoyleEar(amount); DropItem(i); BaseContainer.DropItemFix(i, from, ItemID, GumpID); i = new BeetleShell(amount); DropItem(i); BaseContainer.DropItemFix(i, from, ItemID, GumpID); i = new MoonCrystal(amount); DropItem(i); BaseContainer.DropItemFix(i, from, ItemID, GumpID); i = new PixieSkull(amount); DropItem(i); BaseContainer.DropItemFix(i, from, ItemID, GumpID); i = new RedLotus(amount); DropItem(i); BaseContainer.DropItemFix(i, from, ItemID, GumpID); i = new SeaSalt(amount); DropItem(i); BaseContainer.DropItemFix(i, from, ItemID, GumpID); i = new SilverWidow(amount); DropItem(i); BaseContainer.DropItemFix(i, from, ItemID, GumpID); i = new SwampBerries(amount); DropItem(i); BaseContainer.DropItemFix(i, from, ItemID, GumpID); this.Weight = 2.0; } base.Open(from); }
public static void From(Mobile m) { CharacterDatabase DB = Server.Items.CharacterDatabase.GetDB(m); if (m.Backpack == null) { return; } int key = m.Serial.Value; if (Config.AllowPlayerToggle && DB.CharacterSheath != 1) { return; } Item weapon = m.FindItemOnLayer(Layer.OneHanded); if (weapon == null || !weapon.Movable) { weapon = m.FindItemOnLayer(Layer.TwoHanded); } Item lastWeapon = null; if (PlayerWeapons.ContainsKey(key)) { lastWeapon = PlayerWeapons[key]; } if (m.Warmode) { if ((weapon == null || AllowedToKeep(weapon)) && lastWeapon != null && lastWeapon.IsChildOf(m.Backpack) && lastWeapon.Movable && lastWeapon.Visible && !lastWeapon.Deleted) { m.EquipItem(lastWeapon); if (Config.SendOverheadMessage) { m.LocalOverheadMessage(Network.MessageType.Emote, m.EmoteHue, false, "*Unsheathes Weapon*"); } } } else { if (weapon != null && !AllowedToKeep(weapon)) { m.Backpack.DropItem(weapon); BaseContainer.DropItemFix(weapon, m, m.Backpack.ItemID, m.Backpack.GumpID); PlayerWeapons[key] = weapon; if (Config.SendOverheadMessage) { m.LocalOverheadMessage(Network.MessageType.Emote, m.EmoteHue, false, "*Sheathes Weapon*"); } } } }
public override void OnDoubleClick(Mobile from) { if (from.InRange(GetWorldLocation(), 2)) { if (m_Held > 0) { Container pack = from.Backpack; if (pack != null && ((IsJarPotion(m_Type) && pack.ConsumeTotal(typeof(Jar), 1)) || (!IsJarPotion(m_Type) && pack.ConsumeTotal(typeof(Bottle), 1)))) { from.SendLocalizedMessage(502242); // You pour some of the keg's contents into an empty bottle... BasePotion pot = FillBottle(); if (pack.TryDropItem(from, pot, false)) { BaseContainer.DropItemFix(pot, from, from.Backpack.ItemID, from.Backpack.GumpID); from.SendLocalizedMessage(502243); // ...and place it into your backpack. from.PlaySound(0x240); if (--Held == 0) { from.SendLocalizedMessage(502245); // The keg is now empty. } } else { from.SendLocalizedMessage(502244); // ...but there is no room for the bottle in your backpack. pot.Delete(); } } else { // TODO: Target a bottle } } else { from.SendLocalizedMessage(502246); // The keg is empty. } SetColorKeg(this, this); } else { from.LocalOverheadMessage(Network.MessageType.Regular, 0x3B2, 1019045); // I can't reach that. } }
public override void OnDoubleClick(Mobile from) { if (!Movable) { return; } if (from.InRange(this.GetWorldLocation(), 1)) { if (!RequireFreeHand || HasFreeHand(from)) { if (this is BaseExplosionPotion && Amount > 1) { BasePotion pot = (BasePotion)Activator.CreateInstance(this.GetType()); if (pot != null) { Amount--; if (from.Backpack != null && !from.Backpack.Deleted) { from.Backpack.DropItem(pot); BaseContainer.DropItemFix(pot, from, from.Backpack.ItemID, from.Backpack.GumpID); } else { pot.MoveToWorld(from.Location, from.Map); } pot.Drink(from); } } else { this.Drink(from); } } else { from.SendLocalizedMessage(502172); // You must have a free hand to drink a potion. } } else { from.SendLocalizedMessage(502138); // That is too far away for you to use } }
public override void Open(Mobile from) { int amount = 50; if (this.Weight > 2.0) { Item i = null; i = new BatWing(amount); DropItem(i); BaseContainer.DropItemFix(i, from, ItemID, GumpID); i = new GraveDust(amount); DropItem(i); BaseContainer.DropItemFix(i, from, ItemID, GumpID); i = new DaemonBlood(amount); DropItem(i); BaseContainer.DropItemFix(i, from, ItemID, GumpID); i = new NoxCrystal(amount); DropItem(i); BaseContainer.DropItemFix(i, from, ItemID, GumpID); i = new PigIron(amount); DropItem(i); BaseContainer.DropItemFix(i, from, ItemID, GumpID); this.Weight = 2.0; } base.Open(from); }
public BuriedChest(int level, string who, Mobile digger) : base(0xe40) { if (who == "") { who = ContainerFunctions.GetOwner("Chest"); } else { string[] vAdj = new string[] { "Exotic", "Mysterious", "Marvelous", "Amazing", "Astonishing", "Mystical", "Astounding", "Magnificent", "Phenomenal", "Fantastic", "Incredible", "Extraordinary", "Fabulous", "Wondrous", "Glorious", "Lost", "Fabled", "Legendary", "Mythical", "Missing", "Ancestral", "Ornate", "Wonderful", "Sacred", "Unspeakable", "Unknown", "Forgotten" }; string sAdj = vAdj[Utility.RandomMinMax(0, (vAdj.Length - 1))]; who = "The " + sAdj + " Chest of " + who; } ContainerFunctions.BuildContainer(this, 0, Utility.RandomList(1, 2), 0, 0); Name = who; ContainerFunctions.FillTheContainer(level, this, digger); if (GetPlayerInfo.LuckyPlayer(digger.Luck)) { ContainerFunctions.FillTheContainer(level, this, digger); } if (level > 4) { ContainerFunctions.FillTheContainer(level, this, digger); } if (level > 8) { ContainerFunctions.FillTheContainer(level, this, digger); } ContainerFunctions.LockTheContainer(level, this, 1); int xTraCash = Utility.RandomMinMax((level * 300), (level * 500)); ContainerFunctions.AddGoldToContainer(xTraCash, this, 0, digger); if (Utility.RandomMinMax(0, 500) < (level)) { Item arty = ArtifactBuilder.CreateArtifact("random"); DropItem(arty); BaseContainer.DropItemFix(arty, digger, ItemID, GumpID); } }
public override void Open(Mobile from) { int amount = 50; if (this.Weight > 2.0) { Item i = null; i = new BlackPearl(amount); DropItem(i); BaseContainer.DropItemFix(i, from, ItemID, GumpID); i = new Bloodmoss(amount); DropItem(i); BaseContainer.DropItemFix(i, from, ItemID, GumpID); i = new Garlic(amount); DropItem(i); BaseContainer.DropItemFix(i, from, ItemID, GumpID); i = new Ginseng(amount); DropItem(i); BaseContainer.DropItemFix(i, from, ItemID, GumpID); i = new MandrakeRoot(amount); DropItem(i); BaseContainer.DropItemFix(i, from, ItemID, GumpID); i = new Nightshade(amount); DropItem(i); BaseContainer.DropItemFix(i, from, ItemID, GumpID); i = new SulfurousAsh(amount); DropItem(i); BaseContainer.DropItemFix(i, from, ItemID, GumpID); i = new SpidersSilk(amount); DropItem(i); BaseContainer.DropItemFix(i, from, ItemID, GumpID); this.Weight = 2.0; } base.Open(from); }
public override void OnHit(Mobile attacker, Mobile defender, int damage) { if (!Validate(attacker)) { return; } ClearCurrentAbility(attacker); Item toDisarm = defender.FindItemOnLayer(Layer.OneHanded); if (toDisarm == null || !toDisarm.Movable) { toDisarm = defender.FindItemOnLayer(Layer.TwoHanded); } Container pack = defender.Backpack; if (pack == null || (toDisarm != null && !toDisarm.Movable)) { attacker.SendLocalizedMessage(1004001); // You cannot disarm your opponent. } else if (toDisarm == null || toDisarm is BaseShield || toDisarm is Spellbook && !Core.ML) { attacker.SendLocalizedMessage(1060849); // Your target is already unarmed! } else if (CheckMana(attacker, true)) { attacker.SendLocalizedMessage(1060092); // You disarm their weapon! defender.SendLocalizedMessage(1060093); // Your weapon has been disarmed! defender.PlaySound(0x3B9); defender.FixedParticles(0x37BE, 232, 25, 9948, EffectLayer.LeftHand); pack.DropItem(toDisarm); BaseContainer.DropItemFix(toDisarm, defender, pack.ItemID, pack.GumpID); BaseWeapon.BlockEquip(defender, BlockEquipDuration); } }
public override void OnDoubleClick(Mobile from) { if (from.Blessed && from != m_Owner) { from.SendMessage("You cannot look through the corpse while in this state."); } else { if (from.Hidden && from is PlayerMobile && from.Skills[SkillName.Hiding].Value < Utility.RandomMinMax(1, 125)) { from.RevealingAction(); } if (from is PlayerMobile && Weight > 0) { CharacterDatabase DB = Server.Items.CharacterDatabase.GetDB(from); int interfaces = DB.Hue; if (interfaces == 3) { Weight = 0.0; GumpID = 10913; List <Item> belongings = new List <Item>(); foreach (Item i in this.Items) { belongings.Add(i); } foreach (Item stuff in belongings) { BaseContainer.DropItemFix(stuff, from, 999999, GumpID); } } } Open(from, Core.AOS); } }
public override void Open(Mobile from) { if (this.Weight > 50) { int FillMeUpLevel = Utility.RandomList(5, 4, 4, 3, 3, 3, 2, 2, 2, 2, 1, 1, 1, 1, 1); if (GetPlayerInfo.LuckyPlayer(from.Luck)) { FillMeUpLevel = FillMeUpLevel + Utility.RandomMinMax(1, 2); } if (Utility.RandomBool()) { int[] list = new int[] { 0xECA, 0xECB, 0xECC, 0xECD, 0xECE, 0xECF, 0xED0, 0xED1, 0xED2, 0x1B09, 0x1B0A, 0x1B0B, 0x1B0C, 0x1B0D, 0x1B0E, 0x1B0F, 0x1B10, }; Item bones = new BodyPart(Utility.RandomList(list)); bones.Name = ContainerFunctions.GetOwner("BodySailor"); this.DropItem(bones); BaseContainer.DropItemFix(bones, from, ItemID, GumpID); } ContainerFunctions.FillTheContainer(FillMeUpLevel, this, from); this.Weight = 5.0; LoggingFunctions.LogLoot(from, this.Name, "boat"); } base.Open(from); Server.Items.CharacterDatabase.LootContainer(from, this); }
public TreasureMapChest(Mobile owner, int level, bool temporary) : base(0xE40) { level = level + 4; if (level > 10) { level = 10; } m_Owner = owner; m_Level = level; m_DeleteTime = DateTime.Now + TimeSpan.FromHours(3.0); m_Temporary = temporary; m_Guardians = new List <Mobile>(); m_Timer = new DeleteTimer(this, m_DeleteTime); m_Timer.Start(); Movable = false; Locked = true; if (level > 0) { ContainerFunctions.FillTheContainer(level, this, owner); } if (level > 3) { ContainerFunctions.FillTheContainer(level, this, owner); } if (level > 7) { ContainerFunctions.FillTheContainer(level, this, owner); } if (GetPlayerInfo.LuckyPlayer(owner.Luck)) { ContainerFunctions.FillTheContainer(level, this, owner); } ContainerFunctions.LockTheContainer(level, this, 1); int xTraCash = Utility.RandomMinMax((level * 700), (level * 1000)); ContainerFunctions.AddGoldToContainer(xTraCash, this, 0, owner); string sChest = "grand treasure chest"; switch (level) { case 0: sChest = "meager treasure chest"; break; case 1: sChest = "simple treasure chest"; break; case 2: sChest = "good treasure chest"; break; case 3: sChest = "great treasure chest"; break; case 4: sChest = "excellent treasure chest"; break; case 5: sChest = "superb treasure chest"; break; } Name = ContainerFunctions.GetOwner("Treasure Chest"); Name = "the " + sChest + " of " + Name; // = SCROLL OF TRANCENDENCE if (level >= 4 && Utility.RandomDouble() > 0.9) { DropItem(ScrollofTranscendence.CreateRandom(level, level * 5)); } // = ARTIFACTS int artychance = GetPlayerInfo.LuckyPlayerArtifacts(owner.Luck); if (Utility.RandomMinMax(0, 100) < ((level * 17) + artychance)) { Item arty = ArtifactBuilder.CreateArtifact("random"); DropItem(arty); BaseContainer.DropItemFix(arty, owner, ItemID, GumpID); } // = SCROLL OF ALACRITY or POWERSCROLL if (level > 1) { if (Utility.RandomDouble() < (0.02 + (level / 200))) { SkillName WhatS = (SkillName)Utility.Random(SkillInfo.Table.Length); DropItem(PowerScroll.CreateRandomNoCraft(5, 5)); } else if (Utility.RandomDouble() < 0.075) { SkillName WhatS = (SkillName)Utility.Random(SkillInfo.Table.Length); DropItem(new ScrollofAlacrity(WhatS)); } } int giveRelics = level; Item relic = Loot.RandomRelic(); while (giveRelics > 0) { relic = Loot.RandomRelic(); ContainerFunctions.RelicValueIncrease(level, relic); DropItem(relic); BaseContainer.DropItemFix(relic, owner, ItemID, GumpID); giveRelics = giveRelics - 1; } }
public override void OnDoubleClick(Mobile from) { if (from.Blessed) { from.SendMessage("You cannot look through that while in this state."); } else if (!from.InRange(GetWorldLocation(), 3)) { from.SendMessage("You will have to get closer to it!"); } else if (m_Uses < 5) { m_Uses++; if (Server.Misc.GetPlayerInfo.LuckyPlayer(from.Luck) && Utility.RandomBool()) { m_Uses--; } from.PlaySound(0x2E5); from.SendMessage("You pull something from the treasure hoard!"); Item item = null; switch (Utility.Random(17)) { case 0: item = Loot.RandomArty(); break; case 1: item = DungeonLoot.RandomSlayer(); break; case 2: item = Loot.RandomSArty(); break; case 3: if (Server.Misc.GetPlayerInfo.EvilPlay(from) == true && Utility.RandomMinMax(0, 10) == 10) { item = DungeonLoot.RandomEvil(); } else { item = Loot.RandomRelic(); if (item is DDRelicWeapon && Server.Misc.GetPlayerInfo.OrientalPlay(from) == true) { Server.Items.DDRelicWeapon.MakeOriental(item); } else if (item is DDRelicStatue && Server.Misc.GetPlayerInfo.OrientalPlay(from) == true) { Server.Items.DDRelicStatue.MakeOriental(item); } else if (item is DDRelicBanner && item.ItemID != 0x2886 && item.ItemID != 0x2887 && Server.Misc.GetPlayerInfo.OrientalPlay(from) == true) { Server.Items.DDRelicBanner.MakeOriental(item); } } break; case 4: item = DungeonLoot.RandomRare(); if (item.Stackable == true) { item.Amount = Utility.RandomMinMax(5, 20); } break; case 5: item = DungeonLoot.RandomLoreBooks(); break; case 6: if (Utility.Random(4) != 1) { item = Loot.RandomScroll(0, 7, SpellbookType.Regular); } else { item = Loot.RandomScroll(0, 17, SpellbookType.Necromancer); } break; case 7: int luckMod = from.Luck; if (luckMod > 2000) { luckMod = 2000; } if ((Region.Find(from.Location, from.Map)).IsPartOf("the Ancient Crash Site") || (Region.Find(from.Location, from.Map)).IsPartOf("the Ancient Sky Ship")) { item = new DDXormite((luckMod + Utility.RandomMinMax(333, 666))); } else if (Worlds.GetMyWorld(from.Map, from.Location, from.X, from.Y) == "the Mines of Morinia") { item = new Crystals((luckMod + Utility.RandomMinMax(200, 400))); } else if (Worlds.GetMyWorld(from.Map, from.Location, from.X, from.Y) == "the Underworld") { item = new DDJewels((luckMod + Utility.RandomMinMax(500, 1000))); } else { item = new Gold((luckMod + Utility.RandomMinMax(1000, 2000))); } break; case 8: case 9: case 10: case 11: item = Loot.RandomArmorOrShieldOrWeaponOrJewelry(Server.LootPackEntry.IsInIslesDread(from)); ContainerFunctions.LootMutate(from, Server.LootPack.GetRegularLuckChance(from), item, from.Backpack, Utility.RandomMinMax(5, 10)); break; case 12: item = Loot.RandomInstrument(); int attributeCount; int min, max; Server.Misc.ContainerFunctions.GetRandomAOSStats(out attributeCount, out min, out max, 6); BaseInstrument instr = (BaseInstrument)item; int cHue = 0; int cUse = 0; switch (instr.Resource) { case CraftResource.AshTree: cHue = MaterialInfo.GetMaterialColor("ash", "", 0); cUse = 20; break; case CraftResource.CherryTree: cHue = MaterialInfo.GetMaterialColor("cherry", "", 0); cUse = 40; break; case CraftResource.EbonyTree: cHue = MaterialInfo.GetMaterialColor("ebony", "", 0); cUse = 60; break; case CraftResource.GoldenOakTree: cHue = MaterialInfo.GetMaterialColor("gold", "", 0); cUse = 80; break; case CraftResource.HickoryTree: cHue = MaterialInfo.GetMaterialColor("hickory", "", 0); cUse = 100; break; case CraftResource.MahoganyTree: cHue = MaterialInfo.GetMaterialColor("mahogany", "", 0); cUse = 120; break; case CraftResource.DriftwoodTree: cHue = MaterialInfo.GetMaterialColor("driftwood", "", 0); cUse = 120; break; case CraftResource.OakTree: cHue = MaterialInfo.GetMaterialColor("oak", "", 0); cUse = 140; break; case CraftResource.PineTree: cHue = MaterialInfo.GetMaterialColor("pine", "", 0); cUse = 160; break; case CraftResource.RosewoodTree: cHue = MaterialInfo.GetMaterialColor("rosewood", "", 0); cUse = 180; break; case CraftResource.WalnutTree: cHue = MaterialInfo.GetMaterialColor("walnute", "", 0); cUse = 200; break; } if (!(Server.Misc.Worlds.IsOnSpaceship(from.Location, from.Map))) { if (cHue > 0) { item.Hue = cHue; } else if (Utility.RandomMinMax(1, 4) == 1) { item.Hue = Utility.RandomColor(0); } Server.Misc.MorphingTime.MakeOrientalItem(item, from); item.Name = LootPackEntry.MagicItemName(item, from, Region.Find(from.Location, from.Map)); } else { string newName = "odd alien"; switch (Utility.RandomMinMax(0, 6)) { case 0: newName = "odd"; break; case 1: newName = "unusual"; break; case 2: newName = "bizarre"; break; case 3: newName = "curious"; break; case 4: newName = "peculiar"; break; case 5: newName = "strange"; break; case 6: newName = "weird"; break; } switch (Utility.RandomMinMax(1, 4)) { case 1: item = new Pipes(); item.Name = newName + " " + Server.Misc.RandomThings.GetRandomAlienRace() + " pipes"; break; case 2: item = new Pipes(); item.Name = newName + " " + Server.Misc.RandomThings.GetRandomAlienRace() + " pan flute"; break; case 3: item = new Fiddle(); item.Name = newName + " " + Server.Misc.RandomThings.GetRandomAlienRace() + " violin"; break; case 4: item = new Fiddle(); item.Name = newName + " " + Server.Misc.RandomThings.GetRandomAlienRace() + " fiddle"; break; } BaseInstrument lute = (BaseInstrument)item; lute.Resource = CraftResource.None; item.Hue = Utility.RandomColor(0); } instr.UsesRemaining = instr.UsesRemaining + cUse; BaseRunicTool.ApplyAttributesTo((BaseInstrument)item, attributeCount, min, max); SlayerName slayer = BaseRunicTool.GetRandomSlayer(); instr.Quality = InstrumentQuality.Regular; if (Utility.RandomMinMax(1, 4) == 1) { instr.Quality = InstrumentQuality.Exceptional; } if (Utility.RandomMinMax(1, 4) == 1) { instr.Slayer = slayer; } break; case 13: item = Loot.RandomGem(); break; case 14: item = Loot.RandomPotion(); break; case 15: item = Loot.RandomWand(); Server.Misc.MaterialInfo.ColorMetal(item, 0); string wandOwner = ""; if (Utility.RandomMinMax(1, 3) == 1) { wandOwner = Server.LootPackEntry.MagicWandOwner() + " "; } item.Name = wandOwner + item.Name; break; case 16: m_Uses = 6; // STOP GIVING LOOT WHEN THEY GET A CONTAINER int chestLuck = Server.Misc.GetPlayerInfo.LuckyPlayerArtifacts(from.Luck); if (chestLuck < 3) { chestLuck = 3; } if (chestLuck > 8) { chestLuck = 8; } item = new LootChest(Utility.RandomMinMax(3, chestLuck)); item.ItemID = Utility.RandomList(0x9AB, 0xE40, 0xE41, 0xE7C); item.Hue = Utility.RandomList(0x961, 0x962, 0x963, 0x964, 0x965, 0x966, 0x967, 0x968, 0x969, 0x96A, 0x96B, 0x96C, 0x96D, 0x96E, 0x96F, 0x970, 0x971, 0x972, 0x973, 0x974, 0x975, 0x976, 0x977, 0x978, 0x979, 0x97A, 0x97B, 0x97C, 0x97D, 0x97E, 0x4AA); Region reg = Region.Find(from.Location, from.Map); string box = "hoard chest"; switch (Utility.RandomMinMax(0, 7)) { case 0: box = "hoard chest"; break; case 1: box = "treasure chest"; break; case 2: box = "secret chest"; break; case 3: box = "fabled chest"; break; case 4: box = "legendary chest"; break; case 5: box = "mythical chest"; break; case 6: box = "lost chest"; break; case 7: box = "stolen chest"; break; } if (Server.Misc.Worlds.IsOnSpaceship(from.Location, from.Map)) { Server.Misc.ContainerFunctions.MakeSpaceCrate(((LockableContainer)item)); box = item.Name; } switch (Utility.RandomMinMax(0, 1)) { case 0: item.Name = box + " from " + Server.Misc.Worlds.GetRegionName(from.Map, from.Location); break; case 1: item.Name = box + " of " + HoardName; break; } int xTraCash = Utility.RandomMinMax(5000, 8000); int zone = 0; if (Worlds.IsOnSpaceship(from.Location, from.Map)) { zone = 1; } else if (Worlds.GetMyWorld(from.Map, from.Location, from.X, from.Y) == "the Underworld") { zone = 2; } ContainerFunctions.AddGoldToContainer(xTraCash, (LootChest)item, zone, from); int artychance = GetPlayerInfo.LuckyPlayerArtifacts(from.Luck) + 10; if (Utility.RandomMinMax(0, 100) < artychance) { Item artys = Loot.RandomArty(); ((LootChest)item).DropItem(artys); BaseContainer.DropItemFix(artys, from, ((LootChest)item).ItemID, ((LootChest)item).GumpID); } break; } if (item != null) { if (Worlds.IsOnSpaceship(from.Location, from.Map)) { Server.Misc.MorphingTime.MakeSpaceAceItem(item, from); } if (item is Container) { item.MoveToWorld(from.Location, from.Map); } else { from.AddToBackpack(item); } } else { if (Worlds.IsOnSpaceship(from.Location, from.Map)) { item = new DDXormite((from.Luck + Utility.RandomMinMax(333, 666))); } else if (Worlds.GetMyWorld(from.Map, from.Location, from.X, from.Y) == "the Underworld") { item = new DDJewels((from.Luck + Utility.RandomMinMax(500, 1000))); } else { item = new Gold((from.Luck + Utility.RandomMinMax(1000, 2000))); } if (item != null) { from.AddToBackpack(item); } } } else { from.SendMessage("There is nothing else worth taking from this pile!"); this.Delete(); } }
protected override void OnTarget(Mobile from, object targeted) { if (m_Bag.Deleted) { return; } if (from.Region.IsPartOf(typeof(Regions.Jail))) { from.SendMessage("You may not do that in jail."); } else if (!m_Bag.IsChildOf(from.Backpack)) { MessageHelper.SendLocalizedMessageTo(m_Bag, from, 1062334, 0x59); // The bag of sending must be in your backpack. 1054107 is gone from client, using generic response } else if (m_Bag.Charges == 0) { MessageHelper.SendLocalizedMessageTo(m_Bag, from, 1042544, 0x59); // This item is out of charges. } else if (targeted is Item) { Item item = (Item)targeted; int reqCharges = (int)Math.Max(1, Math.Ceiling(item.TotalWeight / 10.0)); if (!item.IsChildOf(from.Backpack)) { MessageHelper.SendLocalizedMessageTo(m_Bag, from, 1054152, 0x59); // You may only send items from your backpack to your bank box. } else if (item is BagOfSending || item is Container) { from.Send(new AsciiMessage(m_Bag.Serial, m_Bag.ItemID, MessageType.Regular, 0x3B2, 3, "", "You cannot send a container through the bag of sending.")); } else if (item.LootType == LootType.Cursed) { MessageHelper.SendLocalizedMessageTo(m_Bag, from, 1054108, 0x59); // The bag of sending rejects the cursed item. } else if (!item.VerifyMove(from) || item is Server.Engines.Quests.QuestItem) { MessageHelper.SendLocalizedMessageTo(m_Bag, from, 1054109, 0x59); // The bag of sending rejects that item. } else if (Spells.SpellHelper.IsDoomGauntlet(from.Map, from.Location)) { from.SendLocalizedMessage(1062089); // You cannot use that here. } else if (!from.BankBox.TryDropItem(from, item, false)) { BaseContainer.DropItemFix(item, from, from.BankBox.ItemID, from.BankBox.GumpID); MessageHelper.SendLocalizedMessageTo(m_Bag, from, 1054110, 0x59); // Your bank box is full. } else if (Core.ML && reqCharges > m_Bag.Charges) { from.SendLocalizedMessage(1079932); //You don't have enough charges to send that much weight } else { m_Bag.Charges -= (Core.ML ? reqCharges : 1); MessageHelper.SendLocalizedMessageTo(m_Bag, from, 1054150, 0x59); // The item was placed in your bank box. } } }
public SunkenChest(int level, Mobile digger, int ancient) : base(0x455) { level = level + 4; if (level > 10) { level = 10; } ContainerFunctions.BuildContainer(this, 0, Utility.RandomList(1, 2), 0, 0); int xTraCash = Utility.RandomMinMax((level * 500), (level * 800)); ContainerFunctions.AddGoldToContainer(xTraCash, this, 0, digger); if (level > 0) { ContainerFunctions.FillTheContainer(level, this, digger); } if (level > 3) { ContainerFunctions.FillTheContainer(level, this, digger); } if (level > 7) { ContainerFunctions.FillTheContainer(level, this, digger); } if (GetPlayerInfo.LuckyPlayer(digger.Luck)) { ContainerFunctions.FillTheContainer(level, this, digger); } ContainerOwner = ContainerFunctions.GetOwner("Sunken"); ContainerDigger = digger.Name; Name = "sunken chest"; // = ARTIFACTS int artychance = GetPlayerInfo.LuckyPlayerArtifacts(digger.Luck) + 10; if (Utility.RandomMinMax(0, 100) < ((level * 10) + artychance)) { Item arty = ArtifactBuilder.CreateArtifact("random"); switch (Utility.RandomMinMax(1, 20)) { case 1: arty = ArtifactBuilder.CreateArtifact("driftwood"); break; case 2: arty = ArtifactBuilder.CreateArtifact("kelp"); break; case 3: arty = ArtifactBuilder.CreateArtifact("barnacle"); break; case 4: arty = ArtifactBuilder.CreateArtifact("neptune"); break; case 5: arty = ArtifactBuilder.CreateArtifact("bronzed"); break; } DropItem(arty); BaseContainer.DropItemFix(arty, digger, ItemID, GumpID); } int giveRelics = level; Item relic = Loot.RandomRelic(); while (giveRelics > 0) { relic = Loot.RandomRelic(); ContainerFunctions.RelicValueIncrease(level, relic); DropItem(relic); BaseContainer.DropItemFix(relic, digger, ItemID, GumpID); giveRelics = giveRelics - 1; } if (ancient > 0) { Name = "ancient sunken chest"; Hue = Utility.RandomList(0xB8E, 0xB8F, 0xB90, 0xB91, 0xB92, 0xB89, 0xB8B); Item net = new FabledFishingNet(); DropItem(net); BaseContainer.DropItemFix(net, digger, ItemID, GumpID); } else { Item net = new FishingNet(); if (Utility.RandomMinMax(1, 3) == 1) { net = new SpecialFishingNet(); } DropItem(net); BaseContainer.DropItemFix(net, digger, ItemID, GumpID); ItemID = Utility.RandomList(0x52E2, 0x52E3, 0x507E, 0x507F, 0x4910, 0x4911, 0x3332, 0x3333, 0x4FF4, 0x4FF5); Hue = 0; } }
public ParagonChest(string name, string title, int level, Mobile from) : base(Utility.RandomList(m_ItemIDs)) { int tMapLevel = level; level = level + 4; if (level > 7) { level = 7; } m_Name = name; if (title != "" && title != null) { m_Name = name + " " + title; } Hue = Utility.RandomList(m_Hues); if (level > 0) { ContainerFunctions.FillTheContainer(level, this, from); } if (level > 3) { ContainerFunctions.FillTheContainer(level, this, from); } if (level > 7) { ContainerFunctions.FillTheContainer(level, this, from); } ContainerFunctions.LockTheContainer(level, this, 1); int xTraCash = Utility.RandomMinMax((level * 600), (level * 900)); ContainerFunctions.AddGoldToContainer(xTraCash, this, 0, from); if (Utility.RandomMinMax(0, 100) < (level * 5)) { Item arty = ArtifactBuilder.CreateArtifact("random"); DropItem(arty); BaseContainer.DropItemFix(arty, from, ItemID, GumpID); } Map tMap = Map.Sosaria; switch (Utility.RandomMinMax(0, 4)) { case 0: tMap = Map.Sosaria; break; case 1: tMap = Map.Lodor; break; case 2: tMap = Map.SerpentIsland; break; case 3: tMap = Map.IslesDread; break; case 4: tMap = Map.SavagedEmpire; break; case 5: tMap = Map.Underworld; break; } Point3D loc = new Point3D(200, 200, 0); Item map = new TreasureMap(tMapLevel, tMap, loc, 200, 200); DropItem(map); BaseContainer.DropItemFix(map, from, ItemID, GumpID); int giveRelics = level; Item relic = Loot.RandomRelic(); while (giveRelics > 0) { relic = Loot.RandomRelic(); ContainerFunctions.RelicValueIncrease(level, relic); BaseContainer.DropItemFix(relic, from, ItemID, GumpID); DropItem(relic); giveRelics = giveRelics - 1; } }
public override void OnComponentUsed(AddonComponent ac, Mobile from) { if (from.Blessed) { from.SendMessage("You cannot drink from the pool while in this state."); } else if (!from.InRange(GetWorldLocation(), 3)) { from.SendMessage("You will have to get closer to drink from the magical pool!"); } else if (m_Uses > 0) { if (m_Pool == 1) // GAIN STATS { if (from.StatCap > (from.RawStatTotal)) { from.PlaySound(Utility.RandomList(0x30, 0x2D6)); int water = Utility.RandomMinMax(1, 3); int up = 1; int chance = Utility.RandomMinMax(1, 100); if (chance >= 98) { up = AvailPoints(from, 5); } else if (chance >= 87) { up = AvailPoints(from, 4); } else if (chance >= 75) { up = AvailPoints(from, 3); } else if (chance >= 50) { up = AvailPoints(from, 2); } if (water == 1) { from.RawInt = from.RawInt + up; from.SendMessage("You drink from the pool and you feel much smarter!"); } else if (water == 2) { from.RawStr = from.RawStr + up; from.SendMessage("You drink from the pool and you feel much stronger!"); } else { from.RawDex = from.RawDex + up; from.SendMessage("You drink from the pool and you feel much quicker!"); } this.m_Uses = 0; } else { from.PlaySound(Utility.RandomList(0x30, 0x2D6)); from.SendMessage("You drink from the pool and nothing happens!"); this.m_Uses = this.m_Uses - 1; } } else if (m_Pool == 2) // CURE { from.PlaySound(Utility.RandomList(0x30, 0x2D6)); if (from.Poisoned) { from.FixedParticles(0x373A, 10, 15, 5012, EffectLayer.Waist); from.CurePoison(from); from.SendMessage("You feel much better after drinking from the pool!"); this.m_Uses = this.m_Uses - 1; } else { from.PlaySound(Utility.RandomList(0x30, 0x2D6)); from.SendMessage("You drink from the pool and nothing happens!"); this.m_Uses = this.m_Uses - 1; } } else if (m_Pool == 3) // HEAL { from.PlaySound(Utility.RandomList(0x30, 0x2D6)); if (from.Hits < from.HitsMax) { if (from.Poisoned || MortalStrike.IsWounded(from)) { from.SendMessage("You drink from the pool and nothing happens!"); this.m_Uses = this.m_Uses - 1; } else { from.FixedParticles(0x373A, 10, 15, 5012, EffectLayer.Waist); int min = 50; int max = 75; if (m_Bonus > 8) { min = 125; max = 175; } else if (m_Bonus > 5) { min = 75; max = 125; } from.Heal(Utility.RandomMinMax(min, max)); from.SendMessage("You drink from the pool and your wounds magically heal!"); this.m_Uses = this.m_Uses - 1; } } else { from.PlaySound(Utility.RandomList(0x30, 0x2D6)); from.SendMessage("You drink from the pool and nothing happens!"); this.m_Uses = this.m_Uses - 1; } } else if (m_Pool == 4) // WATER ELEMENTAL { from.PlaySound(Utility.RandomList(0x30, 0x2D6)); try { Map map = this.Map; BaseCreature bc = (BaseCreature)Activator.CreateInstance(typeof(WaterElemental)); Point3D spawnLoc = this.Location; for (int i = 0; i < 10; i++) { int x = Location.X + Utility.Random(4); int y = Location.Y + Utility.Random(4); int z = Map.GetAverageZ(x, y); if (Map.CanSpawnMobile(new Point2D(x, y), this.Z)) { spawnLoc = new Point3D(x, y, this.Z); } else if (Map.CanSpawnMobile(new Point2D(x, y), z)) { spawnLoc = new Point3D(x, y, z); } } Timer.DelayCall(TimeSpan.FromSeconds(1), delegate() { bc.Home = Location; bc.RangeHome = 5; bc.FightMode = FightMode.Closest; bc.MoveToWorld(spawnLoc, map); bc.ForceReacquire(); }); } catch { } from.SendMessage("A water elemental emerges from the pool!"); this.m_Uses = this.m_Uses - 1; } else if (m_Pool == 5) // GOLD TO LEAD { from.PlaySound(Utility.RandomList(0x30, 0x2D6)); Container cont = from.Backpack; int nDull = 0; int m_gAmount = from.Backpack.GetAmount(typeof(Gold)); int m_cAmount = from.Backpack.GetAmount(typeof(DDCopper)); int m_sAmount = from.Backpack.GetAmount(typeof(DDSilver)); int m_xAmount = from.Backpack.GetAmount(typeof(DDXormite)); if (cont.ConsumeTotal(typeof(Gold), m_gAmount)) { from.AddToBackpack(new LeadCoin(m_gAmount)); nDull = 1; } if (cont.ConsumeTotal(typeof(DDCopper), m_cAmount)) { from.AddToBackpack(new LeadCoin(m_cAmount)); nDull = 1; } if (cont.ConsumeTotal(typeof(DDSilver), m_sAmount)) { from.AddToBackpack(new LeadCoin(m_sAmount)); nDull = 1; } if (cont.ConsumeTotal(typeof(DDXormite), m_xAmount)) { from.AddToBackpack(new LeadCoin(m_xAmount)); nDull = 1; } if (nDull > 0) { from.SendMessage("After drinking from the pool, you notice all of your coins has turned to lead!"); Effects.SendLocationParticles(EffectItem.Create(from.Location, from.Map, EffectItem.DefaultDuration), 0x3728, 10, 10, 5023); LoggingFunctions.LogGenericQuest(from, "had all of their coins turn to lead after drinking from a strange pool"); } else { from.PlaySound(Utility.RandomList(0x30, 0x2D6)); from.SendMessage("You drink from the pool and nothing happens!"); } this.m_Uses = this.m_Uses - 1; } else if (m_Pool == 6) // EQUIPPED ITEM DISAPPEARS { from.PlaySound(Utility.RandomList(0x30, 0x2D6)); this.m_Uses = this.m_Uses - 1; int mReturn = 0; Item ILost = HiddenTrap.GetMyItem(from); if (ILost != null) { ILost.Delete(); mReturn = 1; } if (mReturn != 1) { from.SendMessage("After drinking from the pool, you notice one of your equipped items disappears!"); Effects.SendLocationParticles(EffectItem.Create(from.Location, from.Map, EffectItem.DefaultDuration), 0x3728, 10, 10, 5023); LoggingFunctions.LogGenericQuest(from, "had an item vanish after drinking from a strange pool"); } } else if (m_Pool == 7) // LOSE A STAT POINT { from.PlaySound(Utility.RandomList(0x30, 0x2D6)); this.m_Uses = this.m_Uses - 1; int mCurse = 1; if (m_Bonus > 8) { if (from.RawStr > 10) { from.RawStr = from.RawStr - 1; from.SendMessage("You feel weaker after drinking from the pool!"); } else { from.SendMessage("You drink from the pool and nothing happens!"); mCurse = 0; } } else if (m_Bonus > 5) { if (from.RawDex > 10) { from.RawDex = from.RawDex - 1; from.SendMessage("You feel sluggish after drinking from the pool!"); } else { from.SendMessage("You drink from the pool and nothing happens!"); mCurse = 0; } } else { if (from.RawInt > 10) { from.RawInt = from.RawInt - 1; from.SendMessage("Your mind is foggy after drinking from the pool!"); } else { from.SendMessage("You drink from the pool and nothing happens!"); mCurse = 0; } } if (mCurse == 1) { from.FixedParticles(0x3779, 1, 15, 9905, 32, 2, EffectLayer.Head); from.FixedParticles(0x37B9, 1, 14, 9502, 32, 5, (EffectLayer)255); } } else if (m_Pool == 8) // TREASURE CHEST { from.PlaySound(0x364); from.SendMessage("You pull a mystical chest out from the pool!"); this.m_Uses = 0; LootChest MyChest = new LootChest(6); MyChest.ItemID = Utility.RandomList(0x2823, 0x2824, 0x4FE6, 0x4FE7, 0x281F, 0x2820); MyChest.Hue = Utility.RandomList(0x961, 0x962, 0x963, 0x964, 0x965, 0x966, 0x967, 0x968, 0x969, 0x96A, 0x96B, 0x96C, 0x96D, 0x96E, 0x96F, 0x970, 0x971, 0x972, 0x973, 0x974, 0x975, 0x976, 0x977, 0x978, 0x979, 0x97A, 0x97B, 0x97C, 0x97D, 0x97E, 0x4AA); Region reg = Region.Find(from.Location, from.Map); MyChest.Name = "mystical chest from " + Server.Misc.Worlds.GetRegionName(from.Map, from.Location); int xTraCash = Utility.RandomMinMax(5000, 8000); ContainerFunctions.AddGoldToContainer(xTraCash, MyChest, 0, from); int artychance = GetPlayerInfo.LuckyPlayerArtifacts(from.Luck) + 10; if (Utility.RandomMinMax(0, 100) < artychance) { Item arty = ArtifactBuilder.CreateArtifact("random"); MyChest.DropItem(arty); BaseContainer.DropItemFix(arty, from, MyChest.ItemID, MyChest.GumpID); } from.AddToBackpack(MyChest); LoggingFunctions.LogGenericQuest(from, "found a chest full of treasure in some strange pool"); } else if (m_Pool == 9) // COPPER SILVER TO GOLD { from.PlaySound(Utility.RandomList(0x30, 0x2D6)); Container cont = from.Backpack; int nShine = 0; int m_cAmount = from.Backpack.GetAmount(typeof(DDCopper)); int m_sAmount = from.Backpack.GetAmount(typeof(DDSilver)); int m_dAmount = from.Backpack.GetAmount(typeof(LeadCoin)); if (cont.ConsumeTotal(typeof(DDCopper), m_cAmount)) { from.AddToBackpack(new Gold(m_cAmount)); nShine = 1; } if (cont.ConsumeTotal(typeof(DDSilver), m_sAmount)) { from.AddToBackpack(new Gold(m_sAmount)); nShine = 1; } if (cont.ConsumeTotal(typeof(LeadCoin), m_dAmount)) { from.AddToBackpack(new Gold(m_dAmount)); nShine = 1; } if (nShine > 0) { from.SendMessage("After drinking from the pool, you notice your meager coins turn to gold!"); Effects.SendLocationParticles(EffectItem.Create(from.Location, from.Map, EffectItem.DefaultDuration), 0x3728, 10, 10, 5023); LoggingFunctions.LogGenericQuest(from, "had all of their meager coins turn to gold after drinking from a strange pool"); } else { from.SendMessage("You drink from the pool and nothing happens!"); } this.m_Uses = 0; } else // POISON { if (from.Poisoned) { from.SendMessage("You are too sick to drink from this pool!"); } else { Effects.SendLocationParticles(EffectItem.Create(from.Location, from.Map, EffectItem.DefaultDuration), 0x36B0, 1, 14, 63, 7, 9915, 0); from.PlaySound(Utility.RandomList(0x30, 0x2D6)); if (m_Bonus > 9) { from.ApplyPoison(from, Poison.Deadly); } else if (m_Bonus > 7) { from.ApplyPoison(from, Poison.Greater); } else if (m_Bonus > 4) { from.ApplyPoison(from, Poison.Regular); } else { from.ApplyPoison(from, Poison.Lesser); } from.SendMessage("You feel more sick after drinking from the pool!"); this.m_Uses = this.m_Uses - 1; } } } else { from.SendMessage("The magic from the pool seems to be drained!"); } }
public override void OnDoubleClick(Mobile from) { int runes = HasCompassion + HasHonesty + HasHonor + HasHumility + HasJustice + HasSacrifice + HasSpirituality + HasValor; bool inVirtues = (from.Map == Map.Sosaria && from.X >= 2587 && from.Y >= 3846 && from.X <= 2604 && from.Y <= 3863); bool inCorrupt = (from.Map == Map.Sosaria && from.X >= 2858 && from.Y >= 3463 && from.X <= 2875 && from.Y <= 3478); if (!IsChildOf(from.Backpack)) { from.SendLocalizedMessage(1060640); // The item must be in your backpack to use it. } else if (RuneBoxOwner != from) { from.SendMessage("This chest does not belong to you so it vanishes!"); bool remove = true; foreach (Account a in Accounts.GetAccounts()) { if (a == null) { break; } int index = 0; for (int i = 0; i < a.Length; ++i) { Mobile m = a[i]; if (m == null) { continue; } if (m == RuneBoxOwner) { m.AddToBackpack(this); remove = false; } ++index; } } if (remove) { this.Delete(); } } else if ((inVirtues || inCorrupt) && runes > 7) { string side = "good"; int morality = 0; int color = 0; int tint = 0; string virtue1 = "Compassion"; string virtue2 = "Honesty"; string virtue3 = "Honor"; string virtue4 = "Humility"; string virtue5 = "Justice"; string virtue6 = "Sacrifice"; string virtue7 = "Spirituality"; string virtue8 = "Valor"; VirtueStoneChest box = new VirtueStoneChest(); if (inVirtues) { from.Fame = 15000; from.Karma = 15000; from.LocalOverheadMessage(MessageType.Emote, 1150, true, "You have cleansed the Runes in the Chamber of Virtue."); from.FixedParticles(0x3709, 10, 30, 5052, 0x480, 0, EffectLayer.LeftFoot); from.PlaySound(0x208); CharacterDatabase.SetKeys(from, "Virtue", true); from.Kills = 0; from.Criminal = false; if (((PlayerMobile)from).Profession == 1) { ((PlayerMobile)from).Profession = 0; from.Profile = ""; CharacterDatabase DB = Server.Items.CharacterDatabase.GetDB(from); DB.BardsTaleQuest = "0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#"; } from.SendMessage("You have gained a really large amount of fame and karma."); } else { from.Fame = 15000; from.Karma = -15000; side = "evil"; morality = 1; color = 0xB20; tint = 0x8B3; from.LocalOverheadMessage(MessageType.Emote, 1150, true, "You have corrupted the Runes of Virtue."); Effects.SendLocationEffect(from.Location, from.Map, 0x2A4E, 30, 10, 0xB00, 0); from.PlaySound(0x029); CharacterDatabase.SetKeys(from, "Corrupt", true); box.Name = "chest of corruption"; box.Hue = color; from.SendMessage("You have gain a really large amount of fame and lost a really large amount of karma."); virtue1 = "Cruelty"; virtue2 = "Deceit"; virtue3 = "Scorn"; virtue4 = "Arrogance"; virtue5 = "Oppression"; virtue6 = "Neglect"; virtue7 = "Sacrilege"; virtue8 = "Fear"; } QuestSouvenir.GiveReward(from, "Rune of " + virtue1, color, 0x5319); QuestSouvenir.GiveReward(from, "Rune of " + virtue2, color, 0x530F); QuestSouvenir.GiveReward(from, "Rune of " + virtue3, color, 0x531B); QuestSouvenir.GiveReward(from, "Rune of " + virtue4, color, 0x5313); QuestSouvenir.GiveReward(from, "Rune of " + virtue5, color, 0x5311); QuestSouvenir.GiveReward(from, "Rune of " + virtue6, color, 0x5315); QuestSouvenir.GiveReward(from, "Rune of " + virtue7, color, 0x530D); QuestSouvenir.GiveReward(from, "Rune of " + virtue8, color, 0x5317); List <Item> belongings = new List <Item>(); foreach (Item i in from.Backpack.Items) { if (i is QuestSouvenir && (i.Name).Contains("Rune of")) { belongings.Add(i); } } foreach (Item stuff in belongings) { box.DropItem(stuff); BaseContainer.DropItemFix(stuff, from, box.ItemID, box.GumpID); } DDRelicPainting tapestry1 = new DDRelicPainting(); tapestry1.Name = "Tapestry of " + virtue1; tapestry1.ItemID = 0x49A8; tapestry1.RelicGoldValue = Utility.RandomMinMax(10, 20) * 50; tapestry1.Hue = tint; box.DropItem(tapestry1); BaseContainer.DropItemFix(tapestry1, from, box.ItemID, box.GumpID); DDRelicPainting tapestry2 = new DDRelicPainting(); tapestry2.Name = "Tapestry of " + virtue2; tapestry2.ItemID = 0x49A2; tapestry2.RelicGoldValue = Utility.RandomMinMax(10, 20) * 50; tapestry2.Hue = tint; box.DropItem(tapestry2); BaseContainer.DropItemFix(tapestry2, from, box.ItemID, box.GumpID); DDRelicPainting tapestry3 = new DDRelicPainting(); tapestry3.Name = "Tapestry of " + virtue3; tapestry3.ItemID = 0x49B2; tapestry3.RelicGoldValue = Utility.RandomMinMax(10, 20) * 50; tapestry3.Hue = tint; box.DropItem(tapestry3); BaseContainer.DropItemFix(tapestry3, from, box.ItemID, box.GumpID); DDRelicPainting tapestry4 = new DDRelicPainting(); tapestry4.Name = "Tapestry of " + virtue4; tapestry4.ItemID = 0x49A3; tapestry4.RelicGoldValue = Utility.RandomMinMax(10, 20) * 50; tapestry4.Hue = tint; box.DropItem(tapestry4); BaseContainer.DropItemFix(tapestry4, from, box.ItemID, box.GumpID); DDRelicPainting tapestry5 = new DDRelicPainting(); tapestry5.Name = "Tapestry of " + virtue5; tapestry5.ItemID = 0x49A7; tapestry5.RelicGoldValue = Utility.RandomMinMax(10, 20) * 50; tapestry5.Hue = tint; box.DropItem(tapestry5); BaseContainer.DropItemFix(tapestry5, from, box.ItemID, box.GumpID); DDRelicPainting tapestry6 = new DDRelicPainting(); tapestry6.Name = "Tapestry of " + virtue6; tapestry6.ItemID = 0x49A0; tapestry6.RelicGoldValue = Utility.RandomMinMax(10, 20) * 50; tapestry6.Hue = tint; box.DropItem(tapestry6); BaseContainer.DropItemFix(tapestry6, from, box.ItemID, box.GumpID); DDRelicPainting tapestry7 = new DDRelicPainting(); tapestry7.Name = "Tapestry of " + virtue7; tapestry7.ItemID = 0x49A1; tapestry7.RelicGoldValue = Utility.RandomMinMax(10, 20) * 50; tapestry7.Hue = tint; box.DropItem(tapestry7); BaseContainer.DropItemFix(tapestry7, from, box.ItemID, box.GumpID); DDRelicPainting tapestry8 = new DDRelicPainting(); tapestry8.Name = "Tapestry of " + virtue8; tapestry8.ItemID = 0x49B3; tapestry8.RelicGoldValue = Utility.RandomMinMax(10, 20) * 50; tapestry8.Hue = tint; box.DropItem(tapestry8); BaseContainer.DropItemFix(tapestry8, from, box.ItemID, box.GumpID); RuneOfVirtue reward = new RuneOfVirtue(); reward.ItemOwner = from; reward.ItemSide = morality; RuneOfVirtue.RuneLook(reward); box.DropItem(reward); BaseContainer.DropItemFix(reward, from, box.ItemID, box.GumpID); Item crystals = new Crystals(Utility.RandomMinMax(1000, 2000)); box.DropItem(crystals); BaseContainer.DropItemFix(crystals, from, box.ItemID, box.GumpID); Item jewels = new DDJewels(Utility.RandomMinMax(2000, 4000)); box.DropItem(jewels); BaseContainer.DropItemFix(jewels, from, box.ItemID, box.GumpID); Item gold = new Gold(Utility.RandomMinMax(4000, 6000)); box.DropItem(gold); BaseContainer.DropItemFix(gold, from, box.ItemID, box.GumpID); Item silver = new DDSilver(Utility.RandomMinMax(6000, 8000)); box.DropItem(silver); BaseContainer.DropItemFix(silver, from, box.ItemID, box.GumpID); Item copper = new DDCopper(Utility.RandomMinMax(8000, 10000)); box.DropItem(copper); BaseContainer.DropItemFix(copper, from, box.ItemID, box.GumpID); Item gemstones = new DDGemstones(Utility.RandomMinMax(1000, 2000)); box.DropItem(gemstones); BaseContainer.DropItemFix(gemstones, from, box.ItemID, box.GumpID); Item goldnuggets = new DDGoldNuggets(Utility.RandomMinMax(2000, 30000)); box.DropItem(goldnuggets); BaseContainer.DropItemFix(goldnuggets, from, box.ItemID, box.GumpID); from.AddToBackpack(box); LoggingFunctions.LogRuneOfVirtue(from, side); this.Delete(); } else { from.SendSound(0x5AA); from.CloseGump(typeof(RuneBoxGump)); from.SendGump(new RuneBoxGump(this, from)); } }
public override TimeSpan OnSwing(Mobile attacker, Mobile defender) { if (attacker.StunReady) { if (attacker.CanBeginAction(typeof(Fists))) { if (attacker.Skills[SkillName.Anatomy].Value >= 80.0 && attacker.Skills[SkillName.Wrestling].Value >= 80.0) { if (attacker.Stam >= 15) { attacker.Stam -= 15; if (CheckMove(attacker, SkillName.Anatomy)) { StartMoveDelay(attacker); attacker.StunReady = false; attacker.SendLocalizedMessage(1004013); // You successfully stun your opponent! defender.SendLocalizedMessage(1004014); // You have been stunned! defender.Freeze(TimeSpan.FromSeconds(4.0)); } else { attacker.SendLocalizedMessage(1004010); // You failed in your attempt to stun. defender.SendLocalizedMessage(1004011); // Your opponent tried to stun you and failed. } } else { attacker.SendLocalizedMessage(1004009); // You are too fatigued to attempt anything. } } else { attacker.SendLocalizedMessage(1004008); // You are not skilled enough to stun your opponent. attacker.StunReady = false; } } } else if (attacker.DisarmReady) { if (attacker.CanBeginAction(typeof(Fists))) { if (defender.Player || defender.Body.IsHuman) { if (attacker.Skills[SkillName.ArmsLore].Value >= 80.0 && attacker.Skills[SkillName.Wrestling].Value >= 80.0) { if (attacker.Stam >= 15) { Item toDisarm = defender.FindItemOnLayer(Layer.OneHanded); if (toDisarm == null || !toDisarm.Movable) { toDisarm = defender.FindItemOnLayer(Layer.TwoHanded); } Container pack = defender.Backpack; if (pack == null || toDisarm == null || !toDisarm.Movable) { attacker.SendLocalizedMessage(1004001); // You cannot disarm your opponent. } else if (CheckMove(attacker, SkillName.ArmsLore)) { StartMoveDelay(attacker); attacker.Stam -= 15; attacker.DisarmReady = false; attacker.SendLocalizedMessage(1004006); // You successfully disarm your opponent! defender.SendLocalizedMessage(1004007); // You have been disarmed! pack.DropItem(toDisarm); BaseContainer.DropItemFix(toDisarm, defender, pack.ItemID, pack.GumpID); } else { attacker.Stam -= 15; attacker.SendLocalizedMessage(1004004); // You failed in your attempt to disarm. defender.SendLocalizedMessage(1004005); // Your opponent tried to disarm you but failed. } } else { attacker.SendLocalizedMessage(1004003); // You are too fatigued to attempt anything. } } else { attacker.SendLocalizedMessage(1004002); // You are not skilled enough to disarm your opponent. attacker.DisarmReady = false; } } else { attacker.SendLocalizedMessage(1004001); // You cannot disarm your opponent. } } } return(base.OnSwing(attacker, defender)); }
public override void Open(Mobile from) { if (this.Weight > 10.0) { int nStolen = Utility.RandomMinMax(1, 3); if (nStolen == 1) { Item i = Loot.RandomArty(); DropItem(i); BaseContainer.DropItemFix(i, from, ItemID, GumpID); } else if (nStolen == 2) { Item i = DungeonLoot.RandomSlayer(); DropItem(i); BaseContainer.DropItemFix(i, from, ItemID, GumpID); } else if (nStolen < 5) { Item i = Loot.RandomSArty(); DropItem(i); BaseContainer.DropItemFix(i, from, ItemID, GumpID); } else if (nStolen < 9) { Item i = Loot.RandomRelic(); DropItem(i); BaseContainer.DropItemFix(i, from, ItemID, GumpID); } else { Item idropped = DungeonLoot.RandomRare(); if (idropped is OilLeather || idropped is OilMetal) { idropped.Amount = Utility.RandomMinMax(1, 8); } else if (idropped is MagicalDyes) { idropped.Amount = Utility.RandomMinMax(3, 10); } else if (idropped.Stackable == true) { idropped.Amount = Utility.RandomMinMax(5, 20); } DropItem(idropped); BaseContainer.DropItemFix(idropped, from, ItemID, GumpID); } int money = Utility.RandomMinMax(1000, 4000); double w = money * (MyServerSettings.GetGoldCutRate() * .01); money = (int)w; Item g = new Gold(money); DropItem(g); BaseContainer.DropItemFix(g, from, ItemID, GumpID); this.Weight = 10.0; } base.Open(from); }