protected override void OnTick() { int z = m_Map.GetAverageZ(m_X, m_Y); bool canFit = m_Map.CanFit(m_X, m_Y, z, 6, false, false); for (int i = -3; !canFit && i <= 3; ++i) { canFit = m_Map.CanFit(m_X, m_Y, z + i, 6, false, false); if (canFit) { z += i; } } if (!canFit) { return; } Item g = new Gold(100, 200); g.Delete(); int r1 = (int)(Utility.RandomMinMax(80, 160) * (MyServerSettings.GetGoldCutRate() * .01)); int r2 = (int)(Utility.RandomMinMax(200, 400) * (MyServerSettings.GetGoldCutRate() * .01)); int r3 = (int)(Utility.RandomMinMax(400, 800) * (MyServerSettings.GetGoldCutRate() * .01)); int r4 = (int)(Utility.RandomMinMax(800, 1200) * (MyServerSettings.GetGoldCutRate() * .01)); int r5 = (int)(Utility.RandomMinMax(1200, 1600) * (MyServerSettings.GetGoldCutRate() * .01)); switch (Utility.Random(21)) { case 0: g = new Crystals(r1); break; case 1: g = new DDGemstones(r2); break; case 2: g = new DDJewels(r2); break; case 3: g = new DDGoldNuggets(r3); break; case 4: g = new Gold(r3); break; case 5: g = new Gold(r3); break; case 6: g = new Gold(r3); break; case 7: g = new DDSilver(r4); break; case 8: g = new DDSilver(r4); break; case 9: g = new DDSilver(r4); break; case 10: g = new DDSilver(r4); break; case 11: g = new DDSilver(r4); break; case 12: g = new DDSilver(r4); break; case 13: g = new DDCopper(r5); break; case 14: g = new DDCopper(r5); break; case 15: g = new DDCopper(r5); break; case 16: g = new DDCopper(r5); break; case 17: g = new DDCopper(r5); break; case 18: g = new DDCopper(r5); break; case 19: g = new DDCopper(r5); break; case 20: g = new DDCopper(r5); break; } g.MoveToWorld(new Point3D(m_X, m_Y, z), m_Map); if (0.5 >= Utility.RandomDouble()) { switch (Utility.Random(3)) { case 0: // Fire column { Effects.SendLocationParticles(EffectItem.Create(g.Location, g.Map, EffectItem.DefaultDuration), 0x3709, 10, 30, 5052); Effects.PlaySound(g, g.Map, 0x208); break; } case 1: // Explosion { Effects.SendLocationParticles(EffectItem.Create(g.Location, g.Map, EffectItem.DefaultDuration), 0x36BD, 20, 10, 5044); Effects.PlaySound(g, g.Map, 0x307); break; } case 2: // Ball of fire { Effects.SendLocationParticles(EffectItem.Create(g.Location, g.Map, EffectItem.DefaultDuration), 0x36FE, 10, 10, 5052); break; } } } }
protected override void OnTick() { int z = m_Map.GetAverageZ(m_X, m_Y); bool canFit = m_Map.CanFit(m_X, m_Y, z, 6, false, false); for (int i = -3; !canFit && i <= 3; ++i) { canFit = m_Map.CanFit(m_X, m_Y, z + i, 6, false, false); if (canFit) { z += i; } } if (!canFit) { return; } Item g = new Gold(100, 200); g.Delete(); switch (Utility.Random(4)) { case 0: g = new DDJewels(50, 100); break; case 1: g = new Gold(100, 200); break; case 2: g = new DDSilver(200, 300); break; case 3: g = new DDSilver(200, 300); break; } g.MoveToWorld(new Point3D(m_X, m_Y, z), m_Map); if (0.5 >= Utility.RandomDouble()) { switch (Utility.Random(3)) { case 0: // Fire column { Effects.SendLocationParticles(EffectItem.Create(g.Location, g.Map, EffectItem.DefaultDuration), 0x3709, 10, 30, 5052); Effects.PlaySound(g, g.Map, 0x208); break; } case 1: // Explosion { Effects.SendLocationParticles(EffectItem.Create(g.Location, g.Map, EffectItem.DefaultDuration), 0x36BD, 20, 10, 5044); Effects.PlaySound(g, g.Map, 0x307); break; } case 2: // Ball of fire { Effects.SendLocationParticles(EffectItem.Create(g.Location, g.Map, EffectItem.DefaultDuration), 0x36FE, 10, 10, 5052); break; } } } }
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)); } }