Esempio n. 1
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));
            }
        }
Esempio n. 2
0
        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", true);
                    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.");
                    from.CloseGump(typeof(Server.Gumps.ClueGump));
                    from.SendGump(new Server.Gumps.ClueGump("You notice a magical gate is open nearby. You better hurry or you will remain trapped here.", "Final Escape!"));

                    LootChest MyChest = new LootChest(6);
                    MyChest.Name = "Mangar's Vault";
                    MyChest.Hue  = 0x497;

                    Item arty = ArtifactBuilder.CreateArtifact("random");
                    MyChest.DropItem(arty);

                    DDRelicPainting painting = new DDRelicPainting();
                    painting.RelicGoldValue = Utility.RandomMinMax(100, 200) * 50;
                    painting.Name           = "Painting of Mangar the Dark";
                    painting.Hue            = 0;
                    painting.ItemID         = 0x52FE;
                    MyChest.DropItem(painting);

                    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", true);
                        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
            }
        }