public override void OnDoubleClick(Mobile from) { if (from.InRange(this.GetWorldLocation(), 2)) { from.SendSound(0x3D); from.PrivateOverheadMessage(MessageType.Regular, 1150, false, "You have pulled Vulcrum's Vault toward you.", from.NetState); LootChest MyChest = new LootChest(6); MyChest.Name = "Vulcrum's Vault"; MyChest.Hue = 0x4EA; if (from is PlayerMobile) { if (GetPlayerInfo.LuckyKiller(from.Luck)) { Item arty = ArtifactBuilder.CreateArtifact("random"); MyChest.DropItem(arty); } if (GetPlayerInfo.LuckyKiller(from.Luck) && !Server.Items.CharacterDatabase.GetSpecialsKilled(from, "Vulcrum")) { Server.Items.CharacterDatabase.SetSpecialsKilled(from, "Vulcrum", true); ManualOfItems lexicon = new ManualOfItems(); lexicon.Hue = 0x4EA; lexicon.Name = "Tome of Vulcrum Relics"; lexicon.m_Charges = 1; lexicon.m_Skill_1 = 0; lexicon.m_Skill_2 = 0; lexicon.m_Skill_3 = 0; lexicon.m_Skill_4 = 0; lexicon.m_Skill_5 = 0; lexicon.m_Value_1 = 0.0; lexicon.m_Value_2 = 0.0; lexicon.m_Value_3 = 0.0; lexicon.m_Value_4 = 0.0; lexicon.m_Value_5 = 0.0; lexicon.m_Slayer_1 = 19; lexicon.m_Slayer_2 = 0; lexicon.m_Owner = from; lexicon.m_Extra = "of Vulcrum of the Flame"; lexicon.m_FromWho = "Taken from Vulcrum"; lexicon.m_HowGiven = "Acquired by"; lexicon.m_Points = 200; lexicon.m_Hue = 0x4EA; MyChest.DropItem(lexicon); } } MyChest.MoveToWorld(from.Location, from.Map); LoggingFunctions.LogGenericQuest(from, "defeated Vulcrum of the Flame"); this.Delete(); } else { from.SendLocalizedMessage(502138); // That is too far away for you to use } }
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(); } }
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) { if (from.InRange(this.GetWorldLocation(), 2)) { if (CharacterDatabase.GetBardsTaleQuest(from, "BardsTaleWin")) { from.PrivateOverheadMessage(MessageType.Regular, 1150, false, "You find nothing of interest.", from.NetState); from.SendMessage("A gate is open nearby. You better hurry or you will remain trapped here."); } else { CharacterDatabase.SetBardsTaleQuest(from, "BardsTaleWin"); from.SendSound(0x3D); from.PrivateOverheadMessage(MessageType.Regular, 1150, false, "You have pulled Mangar's Vault toward you.", from.NetState); from.SendMessage("A gate is open nearby. You better hurry or you will remain trapped here."); LootChest MyChest = new LootChest(6); MyChest.Name = "Mangar's Vault"; MyChest.Hue = 0x497; Item arty = ArtifactBuilder.CreateArtifact("random"); MyChest.DropItem(arty); int IamNecro = 0; int IamMage = 0; int IamBard = 0; if (from.Skills[SkillName.Necromancy].Base > 0) { IamNecro = (int)from.Skills[SkillName.Necromancy].Base; } if (from.Skills[SkillName.Magery].Base > 0) { IamMage = (int)from.Skills[SkillName.Magery].Base; } if (from.Skills[SkillName.Musicianship].Base > 0) { IamBard = (int)from.Skills[SkillName.Musicianship].Base; } if (!Server.Items.CharacterDatabase.GetSpecialsKilled(from, "Mangar")) { Server.Items.CharacterDatabase.SetSpecialsKilled(from, "Mangar"); ManualOfItems lexicon = new ManualOfItems(); lexicon.Hue = 0x497; lexicon.Name = "Tome of Mangar Relics"; lexicon.m_Charges = 1; lexicon.m_Skill_1 = 17; lexicon.m_Skill_2 = 31; lexicon.m_Skill_3 = 32; lexicon.m_Skill_4 = 33; lexicon.m_Skill_5 = 36; lexicon.m_Value_1 = 5.0; lexicon.m_Value_2 = 5.0; lexicon.m_Value_3 = 5.0; lexicon.m_Value_4 = 5.0; lexicon.m_Value_5 = 5.0; lexicon.m_Slayer_1 = 0; lexicon.m_Slayer_2 = 0; lexicon.m_Owner = from; lexicon.m_Extra = "of Mangar the Dark"; lexicon.m_FromWho = "Taken from Mangar"; lexicon.m_HowGiven = "Acquired by"; lexicon.m_Points = 250; lexicon.m_Hue = 0x497; MyChest.DropItem(lexicon); } if (IamBard > IamMage && IamBard > IamNecro && IamBard > 0) { MyChest.DropItem(new BardicFeatheredHat()); MySongbook newBook = new MySongbook(); newBook.Name = "Songs of Skara Brae"; newBook.Content = 0xFFFF; MyChest.DropItem(newBook); } else if (IamMage > IamBard && IamMage > IamNecro && IamMage > 0) { MyChest.DropItem(new MangarsRobe()); MySpellbook newBook = new MySpellbook(); newBook.Hue = 0x497; string book = newBook.Name; string[] eachWord = book.Split('\''); int nLine = 1; foreach (string eachWords in eachWord) { if (nLine != 1) { newBook.Name = "Mangar'" + eachWords; } else { nLine = 2; } } MyChest.DropItem(newBook); } else if (IamNecro > IamBard && IamNecro > IamMage && IamNecro > 0) { MyChest.DropItem(new MangarsNecroRobe()); MyNecromancerSpellbook newBook = new MyNecromancerSpellbook(); newBook.Hue = 0x497; string book = newBook.Name; string[] eachWord = book.Split('\''); int nLine = 1; foreach (string eachWords in eachWord) { if (nLine != 1) { newBook.Name = "Mangar'" + eachWords; } else { nLine = 2; } } MyChest.DropItem(newBook); } else if (IamMage > 0) { MyChest.DropItem(new MangarsRobe()); MySpellbook newBook = new MySpellbook(); newBook.Hue = 0x497; string book = newBook.Name; string[] eachWord = book.Split('\''); int nLine = 1; foreach (string eachWords in eachWord) { if (nLine != 1) { newBook.Name = "Mangar'" + eachWords; } else { nLine = 2; } } MyChest.DropItem(newBook); } else if (IamNecro > 0) { MyChest.DropItem(new MangarsNecroRobe()); MyNecromancerSpellbook newBook = new MyNecromancerSpellbook(); newBook.Hue = 0x497; string book = newBook.Name; string[] eachWord = book.Split('\''); int nLine = 1; foreach (string eachWords in eachWord) { if (nLine != 1) { newBook.Name = "Mangar'" + eachWords; } else { nLine = 2; } } MyChest.DropItem(newBook); } else if (IamBard > 0) { MyChest.DropItem(new BardicFeatheredHat()); MySongbook newBook = new MySongbook(); newBook.Name = "Songs of Skara Brae"; newBook.Content = 0xFFFF; MyChest.DropItem(newBook); } MyChest.MoveToWorld(from.Location, from.Map); LoggingFunctions.LogGenericQuest(from, "defeated Mangar and escaped Skara Brae"); } } else { from.SendLocalizedMessage(502138); // That is too far away for you to use } }