Exemple #1
0
        public static void MoralityCheck(Item rune, Mobile from)
        {
            if (rune != null && from is PlayerMobile)
            {
                if (rune is RuneOfVirtue)
                {
                    RuneOfVirtue stone = (RuneOfVirtue)rune;

                    if (stone.ItemSide > 0 && from.Karma > 0)
                    {
                        from.LocalOverheadMessage(MessageType.Emote, 0xB1F, true, "Your morality is too virtuous to wield that rune!");
                        from.AddToBackpack(rune);
                        from.InvalidateProperties();
                    }
                    else if (stone.ItemSide < 1 && from.Karma < 0)
                    {
                        from.LocalOverheadMessage(MessageType.Emote, 0xB1F, true, "Your morality is too corrupt to wield that rune!");
                        from.AddToBackpack(rune);
                        from.InvalidateProperties();
                    }
                }
            }
        }
Exemple #2
0
        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));
            }
        }
Exemple #3
0
        public static void RuneLook(RuneOfVirtue rune)
        {
            rune.Hue = 0;
            if (rune.ItemID == 0x53C4)
            {
                rune.Name = "Rune of Honesty";                    rune.ItemID = 0x5304;   if (rune.ItemSide > 0)
                {
                    rune.Name = "Rune of Deceit";
                }
            }
            else if (rune.ItemID == 0x5304)
            {
                rune.Name = "Rune of Honor";                 rune.ItemID = 0x5305;   if (rune.ItemSide > 0)
                {
                    rune.Name = "Rune of Scorn";
                }
            }
            else if (rune.ItemID == 0x5305)
            {
                rune.Name = "Rune of Humility";              rune.ItemID = 0x5307;   if (rune.ItemSide > 0)
                {
                    rune.Name = "Rune of Arrogance";
                }
            }
            else if (rune.ItemID == 0x5307)
            {
                rune.Name = "Rune of Justice";               rune.ItemID = 0x5306;   if (rune.ItemSide > 0)
                {
                    rune.Name = "Rune of Oppression";
                }
            }
            else if (rune.ItemID == 0x5306)
            {
                rune.Name = "Rune of Sacrifice";             rune.ItemID = 0x53C2;   if (rune.ItemSide > 0)
                {
                    rune.Name = "Rune of Neglect";
                }
            }
            else if (rune.ItemID == 0x53C2)
            {
                rune.Name = "Rune of Spirituality";  rune.ItemID = 0x5302;   if (rune.ItemSide > 0)
                {
                    rune.Name = "Rune of Sacrilege";
                }
            }
            else if (rune.ItemID == 0x53C3)
            {
                rune.Name = "Rune of Valor";                 rune.ItemID = 0x53C3;   if (rune.ItemSide > 0)
                {
                    rune.Name = "Rune of Fear";
                }
            }
            else
            {
                rune.Name = "Rune of Compassion";                                                                rune.ItemID = 0x53C4;   if (rune.ItemSide > 0)
                {
                    rune.Name = "Rune of Cruelty";
                }
            }

            if (rune.ItemSide > 0)
            {
                rune.Hue = 0xB20;
            }
        }