Esempio n. 1
0
        public static void BossEscaped(Mobile from, string region)
        {
            if (from.Backpack.FindItemByType(typeof(QuestTome)) != null)
            {
                Item      item = from.Backpack.FindItemByType(typeof(QuestTome));
                QuestTome book = (QuestTome)item;

                if (book.QuestTomeGoals > 2 && book.QuestTomeDungeon == region && book.QuestTomeOwner == from)
                {
                    ArrayList targets = new ArrayList();
                    foreach (Mobile creature in World.Mobiles.Values)
                    {
                        if (creature.Name == book.VillainName && creature.Title == book.VillainTitle)
                        {
                            targets.Add(creature);
                        }
                    }
                    for (int i = 0; i < targets.Count; ++i)
                    {
                        Mobile creature = ( Mobile )targets[i];

                        Effects.SendLocationParticles(EffectItem.Create(creature.Location, creature.Map, EffectItem.DefaultDuration), 0x3728, 10, 10, 2023);
                        creature.PlaySound(0x1FE);

                        creature.Delete();
                    }
                }
            }
        }
Esempio n. 2
0
        public static string TellRumor(Mobile player, Mobile citizen)
        {
            string rumor = "";

            if (citizen.Fame == 0 && player.Backpack.FindItemByType(typeof(QuestTome)) != null)
            {
                QuestTome book = ( QuestTome )(player.Backpack.FindItemByType(typeof(QuestTome)));

                if (book.QuestTomeOwner == player)
                {
                    if (Utility.RandomMinMax(1, 10) > 1)
                    {
                        citizen.Fame = 1;
                    }

                    if (citizen.Fame == 0 && book.QuestTomeCitizen == "" && book.QuestTomeGoals < 4)
                    {
                        citizen.Fame = 1;
                        SetRumor(citizen, book);
                        rumor = GetRumor(book, true);
                    }
                }
            }

            return(rumor);
        }
Esempio n. 3
0
        public static string GetRumor(QuestTome book, bool talk)
        {
            int    goal   = book.QuestTomeType;
            string locate = "held by a powerful creature";

            if (goal == 2)
            {
                locate = "lost somewhere";
            }
            if (book.QuestTomeGoals == 3)
            {
                locate = "found"; goal = 3;
            }

            string world   = book.QuestTomeLand;
            string dungeon = book.QuestTomeDungeon;
            string from    = book.QuestTomeCitizen;
            string item    = book.GoalItem1;

            if (book.QuestTomeGoals == 1)
            {
                item = book.GoalItem2;
            }
            else if (book.QuestTomeGoals == 2)
            {
                item = book.GoalItem3;
            }
            else if (book.QuestTomeGoals == 3)
            {
                item = book.VillainName + " " + book.VillainTitle;
            }

            if (talk)
            {
                string who = "I heard";
                switch (Utility.RandomMinMax(0, 5))
                {
                case 0: who = "I heard";                                                                                                                                                                                                break;

                case 1: who = "I learned";                                                                                                                                                                                              break;

                case 2: who = "I found out";                                                                                                                                                                                    break;

                case 3: who = "The " + RandomThings.GetRandomJob() + " in " + RandomThings.GetRandomCity() + " told me";                                break;

                case 4: who = "I overheard some " + RandomThings.GetRandomJob() + " say";                                                                                               break;

                case 5: who = "My friend told me";                                                                                                                                                                              break;
                }
                return(who + " that " + item + " may be " + locate + " within " + dungeon + " in " + world + ".");
            }

            if (world != "")
            {
                return("" + from + " has told you that " + item + " may be " + locate + " within " + dungeon + " in " + world + ".");
            }

            return("");
        }
Esempio n. 4
0
        public static bool FoundItem(Mobile player, int type, MajorItemOnCorpse chest)
        {
            Item      item = player.Backpack.FindItemByType(typeof(QuestTome));
            QuestTome book = (QuestTome)item;

            if (type == book.QuestTomeType && book.QuestTomeDungeon == Server.Misc.Worlds.GetRegionName(player.Map, player.Location) && book.QuestTomeOwner == player && book.QuestTomeGoals < 3)
            {
                if (Utility.RandomMinMax(1, 3) != 1)
                {
                    string relic = book.GoalItem1;
                    if (book.QuestTomeGoals == 1)
                    {
                        relic = book.GoalItem2;
                    }
                    else if (book.QuestTomeGoals == 2)
                    {
                        relic = book.GoalItem3;
                    }

                    player.LocalOverheadMessage(MessageType.Emote, 1150, true, "You found " + relic + ".");
                    player.SendSound(0x5B4);
                    book.QuestTomeCitizen = "";
                    book.QuestTomeDungeon = "";
                    book.QuestTomeLand    = "";
                    book.QuestTomeType    = 0;
                    book.QuestTomeGoals++;

                    return(true);
                }
                else
                {
                    player.LocalOverheadMessage(MessageType.Emote, 1150, true, book.QuestTomeCitizen + " was either wrong or they lied.");
                    player.SendSound(0x5B3);
                    book.QuestTomeCitizen = "";
                    book.QuestTomeDungeon = "";
                    book.QuestTomeLand    = "";
                    book.QuestTomeType    = 0;

                    return(false);
                }
            }
            else if (chest != null && book.VillainName == chest.VillainName && book.VillainTitle == chest.VillainTitle && book.QuestTomeOwner == player && book.QuestTomeGoals >= 3)
            {
                ApproachObsidian.TitanRiches(player);
                player.LocalOverheadMessage(MessageType.Emote, 1150, true, "You found " + book.GoalItem4 + ".");
                book.QuestTomeGoals++;
                return(true);
            }
            return(false);
        }
Esempio n. 5
0
        public void NPCGood(Mobile m, QuestTome book)
        {
            int  c      = 0;
            bool picked = false;

            while (!picked)
            {
                ArrayList npcs = new ArrayList();
                foreach (Mobile msg in World.Mobiles.Values)
                {
                    if (msg is EpicCharacter && msg.Name != "the Great Earth Serpent")
                    {
                        if (((EpicCharacter)msg).MyAlignment == "good")
                        {
                            npcs.Add(msg); c++;
                        }
                    }
                }

                int o = Utility.RandomMinMax(0, c);

                for (int i = 0; i < npcs.Count; ++i)
                {
                    EpicCharacter dude = ( EpicCharacter )npcs[i];

                    if (i == o)
                    {
                        Point3D WhoLoc = new Point3D(dude.MyX, dude.MyY, 0);
                        Map     WhoMap = dude.MyWorld;

                        string my_location = "";

                        int  xLong = 0, yLat = 0;
                        int  xMins = 0, yMins = 0;
                        bool xEast = false, ySouth = false;

                        if (Sextant.Format(WhoLoc, WhoMap, ref xLong, ref yLat, ref xMins, ref yMins, ref xEast, ref ySouth))
                        {
                            my_location = String.Format("{0}° {1}'{2}, {3}° {4}'{5}", yLat, yMins, ySouth ? "S" : "N", xLong, xMins, xEast ? "E" : "W");
                        }

                        book.QuestTomeWorldGood  = Server.Misc.Worlds.GetMyWorld(WhoMap, WhoLoc, dude.MyX, dude.MyY);
                        book.QuestTomeNPCGood    = dude.Name + " " + dude.Title;
                        book.QuestTomeLocateGood = my_location;
                        picked = true;
                    }
                }
            }
        }
Esempio n. 6
0
 public override void OnDoubleClick(Mobile from)
 {
     if (QuestTome.FoundItem(from, 1, this))
     {
         this.Delete();
     }
     else if (from.InRange(this.GetWorldLocation(), 5))
     {
         from.SendMessage("The chest appears to be empty.");
     }
     else
     {
         from.SendLocalizedMessage(502138);                   // That is too far away for you to use
     }
 }
Esempio n. 7
0
        public static void DropChest(Mobile m)
        {
            if (m.Fame == 0 && m.Karma == 0 && m.Title != "" && ((BaseCreature)m).Home.X == 0 && ((BaseCreature)m).Home.Y == 0)
            {
                bool      BookExists = false;
                QuestTome book       = null;

                foreach (Item item in World.Items.Values)
                {
                    if (item is QuestTome)
                    {
                        if (((QuestTome)item).VillainName == m.Name && ((QuestTome)item).VillainTitle == m.Title)
                        {
                            BookExists = true;
                            book       = ((QuestTome)item);
                        }
                    }
                }

                if (BookExists)
                {
                    MajorItemOnCorpse majorChest = new MajorItemOnCorpse();
                    majorChest.Name         = "Chest of " + m.Name;
                    majorChest.VillainName  = m.Name;
                    majorChest.VillainTitle = m.Title;
                    majorChest.MoveToWorld(m.Location, m.Map);
                    Server.Misc.IntelligentAction.BurnAway(m);
                    book.QuestTomeCitizen = "";
                    book.QuestTomeDungeon = "";
                    book.QuestTomeLand    = "";
                    book.QuestTomeType    = 0;
                    if (m.Corpse != null)
                    {
                        m.Corpse.Delete();
                    }
                }
            }
        }
Esempio n. 8
0
        public static void SetRumor(Mobile m, QuestTome book)
        {
            book.QuestTomeType = Utility.RandomMinMax(1, 2);

            if (book.QuestTomeGoals > 2)
            {
                book.QuestTomeType = 3;
            }

            string searchLocation = "the Land of Sosaria";

            switch (Utility.RandomMinMax(0, 10))
            {
            case 0:         searchLocation = "the Land of Sosaria";                 break;

            case 1:         searchLocation = "the Land of Lodoria";                 break;

            case 2:         searchLocation = "the Serpent Island";                  break;

            case 3:         searchLocation = "the Land of Sosaria";                 break;

            case 4:         searchLocation = "the Land of Lodoria";                 break;

            case 5:         searchLocation = "the Serpent Island";                  break;

            case 6:         searchLocation = "the Island of Umber Veil";    break;

            case 7:         searchLocation = "the Land of Ambrosia";                break;

            case 8:         searchLocation = "the Isles of Dread";                  break;

            case 9:         searchLocation = "the Savaged Empire";                  break;

            case 10:        searchLocation = "the Bottle World of Kuldar";  break;
            }

            string dungeon = "the Dungeon of Doom";

            int aCount = 0;

            ArrayList targets = new ArrayList();

            if (book.QuestTomeType == 1)
            {
                foreach (Mobile target in World.Mobiles.Values)
                {
                    if (target.Region is DungeonRegion && target.Fame >= 18000 && !(target is Exodus || target is CodexGargoyleA || target is CodexGargoyleB || target is Syth))
                    {
                        if (Server.Misc.Worlds.GetMyWorld(target.Map, target.Location, target.X, target.Y) == searchLocation)
                        {
                            targets.Add(target);
                            aCount++;
                        }
                    }
                }
            }
            else
            {
                foreach (Item target in World.Items.Values)
                {
                    if (target is SearchBase || target is StealBase)
                    {
                        if (Server.Misc.Worlds.GetMyWorld(target.Map, target.Location, target.X, target.Y) == searchLocation)
                        {
                            targets.Add(target);
                            aCount++;
                        }
                    }
                }
            }

            aCount = Utility.RandomMinMax(1, aCount);

            int xCount = 0;

            for (int i = 0; i < targets.Count; ++i)
            {
                xCount++;

                if (xCount == aCount)
                {
                    if (book.QuestTomeType == 1)
                    {
                        Mobile finding = ( Mobile )targets[i];
                        dungeon = Server.Misc.Worlds.GetRegionName(finding.Map, finding.Location);
                    }
                    else
                    {
                        Item finding = ( Item )targets[i];
                        dungeon = Server.Misc.Worlds.GetRegionName(finding.Map, finding.Location);
                    }
                }
            }

            book.QuestTomeLand    = searchLocation;
            book.QuestTomeDungeon = dungeon;
            book.QuestTomeCitizen = "" + m.Name + " " + m.Title + "";
        }
Esempio n. 9
0
            public QuestTomeGump(QuestTome book, Mobile from, int page) : base(25, 25)
            {
                m_Book = book;

                this.Closable   = true;
                this.Disposable = true;
                this.Dragable   = true;
                this.Resizable  = false;

                AddPage(0);

                int    theme = 153;
                string hue   = "#33DA1C";
                string story = m_Book.QuestTomeStoryGood;
                string locat = m_Book.QuestTomeLocateGood;
                string world = m_Book.QuestTomeWorldGood;
                string names = m_Book.QuestTomeNPCGood;

                if (((PlayerMobile)from).KarmaLocked)                   // THEY ARE ON AN EVIL PATH
                {
                    theme = 154;
                    hue   = "#FF0000";
                    story = m_Book.QuestTomeStoryEvil;
                    locat = m_Book.QuestTomeLocateEvil;
                    world = m_Book.QuestTomeWorldEvil;
                    names = m_Book.QuestTomeNPCEvil;
                }

                string dead = m_Book.Name; if (dead.Contains("Journal of "))

                {
                    dead = dead.Replace("Journal of ", "");
                }

                if (story.Contains("DDDDD"))
                {
                    story = story.Replace("DDDDD", dead);
                }

                AddImage(0, 0, theme);
                AddImage(300, 0, theme);
                AddImage(0, 300, theme);
                AddImage(300, 300, theme);
                AddImage(600, 0, theme);
                AddImage(600, 300, theme);
                AddImage(2, 2, 129);
                AddImage(298, 2, 129);
                AddImage(598, 2, 129);
                AddImage(2, 298, 129);
                AddImage(298, 298, 129);
                AddImage(598, 298, 129);
                AddImage(192, 534, 130);
                AddImage(230, 46, 132);
                AddImage(479, 46, 132);
                AddImage(488, 363, 136);
                AddImage(678, 7, 134);
                AddImage(67, 534, 130);
                AddImage(29, 334, 137);
                AddImage(7, 7, 133);
                AddImage(64, 369, 162);
                AddImage(54, 369, 162);
                AddImage(42, 369, 162);
                AddImage(31, 378, 162);
                AddImage(51, 383, 162);
                AddImage(43, 381, 162);
                AddImage(30, 389, 162);
                AddImage(40, 396, 162);
                AddImage(29, 399, 162);
                AddImage(53, 398, 162);
                AddImage(46, 408, 162);
                AddImage(32, 406, 162);
                AddImage(29, 413, 162);
                AddImage(27, 426, 162);
                AddImage(26, 437, 162);
                AddImage(27, 447, 162);
                AddImage(46, 417, 162);
                AddImage(37, 418, 162);
                AddImage(553, 104, 144);
                AddImage(489, 104, 129);
                AddImage(784, 267, 162);
                AddImage(784, 256, 162);
                AddImage(771, 251, 159);
                AddImage(514, 80, 10899);

                if (page > 0)
                {
                    AddHtml(100, 80, 400, 20, @"<BODY><BASEFONT Color=#FBFBFB><BIG>" + m_Book.Name + "</BIG></BASEFONT></BODY>", (bool)false, (bool)false);
                    AddButton(860, 9, 4017, 4017, 2, GumpButtonType.Reply, 0);
                    AddHtml(106, 120, 376, 406, @"<BODY><BASEFONT Color=" + hue + "><BIG>There are many times when adventurers are given a grand quest to obtain a magical item by slaying a powerful creature and thus using the item for good or evil. You have found the journal of one of these adventurers. What fate became of them, you will never know. Did they lose their journal? Did they perish in their search for " + m_Book.GoalItem4 + "?<br><br>Now you possess the journal and you can pursue this quest as it is yours alone. The quest has two forks that you may go down. If your karma is locked, the goal will lead you down the vile path of " + m_Book.QuestTomeNPCEvil + ". Otherwise, your quest will service good for " + m_Book.QuestTomeNPCGood + ".<br><br>You may only have a single journal quest at any one time. If you find another journal, and choose to take it while you currently have a journal, then you will get a new journal with the same unfinished quest you had before.<br><br>To defeat " + m_Book.VillainName + " " + m_Book.VillainTitle + " and claim " + m_Book.GoalItem4 + ", you will have to find 3 unique items to aid you. You have no idea where these items are, so you will have to speak to citizens (orange names) to see if they have heard rumors that can help you. If a citizen does not initially mention anything about your quest, you will have to seek out another. When you finally get a clue, a small tune will play and your journal will be updated with that rumor they gave you. It could be true or it could be false. You won’t know until you pursue it. Sometimes the item may be in a chest or bag on a pedestal in a dungeon, or held by one of the more powerful creatures within that dungeon.<br><br>Once you collect the required relics, you must then figure out where " + m_Book.VillainName + " is. Again, talking to citizens may reveal a hint. Once you learn where " + m_Book.VillainName + " is, make haste to that location and face them in battle. Once you enter the area, find a strategic place you wish to combat them and then open the journal to call them forth to face you. The battle will surely be harsh so you best be prepared. Be sure to slay them so you can take " + m_Book.GoalItem4 + " from them. Making them vanish by other means will rob you of your goal, as would leaving the area they are in. If they do manage to escape, you will have to seek out rumors again to determine where " + m_Book.VillainName + " has fled to.<br><br>Slaying " + m_Book.VillainName + " will reveal an abundance of wealth they have taken from other adventurers that failed to be victorious. Feel free to take this treasure for yourself, as " + m_Book.VillainName + " " + m_Book.VillainTitle + " will no longer need it. Once you have acquired " + m_Book.GoalItem4 + ", seek out " + m_Book.QuestTomeNPCGood + " or " + m_Book.QuestTomeNPCEvil + " and hand them the journal. Your morality and fame will be affected by your choice of ethics and you will be rewarded with an item of your choosing. When you select your reward, the item will appear in your pack. Each item will appear with a number of points you can spend to enhance your item. This allows you to tailor the item to suit your style. To begin, single click the items and select 'Status'. A menu will appear that you can choose which attributes you want the item to have. Be careful, as you cannot change an attribute once you select it.</BIG></BASEFONT></BODY>", (bool)false, (bool)true);
                }
                else
                {
                    if (m_Book.QuestTomeCitizen != "")
                    {
                        story = GetRumor(m_Book, false) + "<br><br>" + story;
                    }

                    AddHtml(100, 80, 400, 20, @"<BODY><BASEFONT Color=#FBFBFB><BIG>" + m_Book.Name + "</BIG></BASEFONT></BODY>", (bool)false, (bool)false);
                    AddButton(840, 9, 3610, 3610, 1, GumpButtonType.Reply, 0);
                    AddHtml(106, 120, 391, 237, @"<BODY><BASEFONT Color=" + hue + "><BIG>" + story + "</BIG></BASEFONT></BODY>", (bool)false, (bool)true);
                    AddHtml(525, 403, 230, 20, @"<BODY><BASEFONT Color=#FBFBFB><BIG><CENTER>Quest for " + from.Name + "</CENTER></BIG></BASEFONT></BODY>", (bool)false, (bool)false);

                    TextInfo cultInfo = new CultureInfo("en-US", false).TextInfo;

                    if (m_Book.QuestTomeGoals < 4)
                    {
                        string culr = "#FCFF00"; if (m_Book.QuestTomeGoals > 0)
                        {
                            AddItem(65, 367, 20413); culr = "#FFA200";
                        }
                        AddHtml(120, 381, 400, 20, @"<BODY><BASEFONT Color=" + culr + "><BIG>" + cultInfo.ToTitleCase(m_Book.GoalItem1) + "</BIG></BASEFONT></BODY>", (bool)false, (bool)false);

                        culr = "#FCFF00"; if (m_Book.QuestTomeGoals > 1)
                        {
                            AddItem(65, 417, 20413); culr = "#FFA200";
                        }
                        AddHtml(120, 431, 400, 20, @"<BODY><BASEFONT Color=" + culr + "><BIG>" + cultInfo.ToTitleCase(m_Book.GoalItem2) + "</BIG></BASEFONT></BODY>", (bool)false, (bool)false);

                        culr = "#FCFF00"; if (m_Book.QuestTomeGoals > 2)
                        {
                            AddItem(65, 467, 20413); culr = "#FFA200";
                        }
                        AddHtml(120, 481, 400, 20, @"<BODY><BASEFONT Color=" + culr + "><BIG>" + cultInfo.ToTitleCase(m_Book.GoalItem3) + "</BIG></BASEFONT></BODY>", (bool)false, (bool)false);
                    }
                    else
                    {
                        AddItem(65, 367, 20413);
                        AddHtml(120, 381, 400, 20, @"<BODY><BASEFONT Color=#FFA200><BIG>" + cultInfo.ToTitleCase(m_Book.GoalItem4) + "</BIG></BASEFONT></BODY>", (bool)false, (bool)false);
                    }
                }
            }
Esempio n. 10
0
        public override void OnComponentUsed(AddonComponent ac, Mobile from)
        {
            int monsters = 0;

            foreach (Mobile monster in this.GetMobilesInRange(5))
            {
                if (monster is BaseCreature)
                {
                    Mobile leader = ((BaseCreature)monster).GetMaster();
                    if (leader is PlayerMobile)
                    {
                    }
                    else
                    {
                        ++monsters;
                    }
                }
            }

            if (from.Blessed)
            {
                from.SendMessage("You cannot open that while in this state.");
            }
            else if (!from.InRange(GetWorldLocation(), 2))
            {
                from.SendMessage("You will have to get closer to open that.");
            }
            else if (monsters > 0)
            {
                from.SendMessage("You cannot open this with too many creatures around.");
            }
            else if (from.Backpack.FindItemByType(typeof(SearchPage)) != null ||
                     from.Backpack.FindItemByType(typeof(DDRelicTablet)) != null ||
                     from.Backpack.FindItemByType(typeof(VortexCube)) != null ||
                     from.Backpack.FindItemByType(typeof(AlienEgg)) != null ||
                     from.Backpack.FindItemByType(typeof(ResearchBag)) != null ||
                     from.Backpack.FindItemByType(typeof(DragonEgg)) != null ||
                     from.Backpack.FindItemByType(typeof(DracolichSkull)) != null ||
                     from.Backpack.FindItemByType(typeof(MuseumBook)) != null ||
                     from.Backpack.FindItemByType(typeof(QuestTome)) != null ||
                     from.Backpack.FindItemByType(typeof(DemonPrison)) != null ||
                     from.Backpack.FindItemByType(typeof(CourierMail)) != null)
            {
                int EmptyBox = 1;

                if (from.Backpack.FindItemByType(typeof(MuseumBook)) != null)
                {
                    if (MuseumBook.FoundItem(from, 2))
                    {
                        EmptyBox = 0;
                    }
                }

                if (from.Backpack.FindItemByType(typeof(QuestTome)) != null)
                {
                    if (QuestTome.FoundItem(from, 2, null))
                    {
                        EmptyBox = 0;
                    }
                }

                if (from.Backpack.FindItemByType(typeof(CourierMail)) != null)
                {
                    Item        mail     = from.Backpack.FindItemByType(typeof(CourierMail));
                    CourierMail envelope = (CourierMail)mail;

                    if (envelope.SearchDungeon == Server.Misc.Worlds.GetRegionName(from.Map, from.Location) && envelope.owner == from && envelope.DungeonMap == from.Map && envelope.MsgComplete == 0)
                    {
                        envelope.MsgComplete = 1;
                        from.LocalOverheadMessage(MessageType.Emote, 1150, true, "You found the " + envelope.SearchItem + ".");
                        from.SendSound(0x3D);
                        EmptyBox = 0;
                    }
                }

                if (from.Backpack.FindItemByType(typeof(ResearchBag)) != null)
                {
                    ResearchBag bag = (ResearchBag)from.Backpack.FindItemByType(typeof(ResearchBag));

                    if (bag.BagOwner == from)
                    {
                        if (Server.Misc.Research.SearchResult(from, bag))
                        {
                            EmptyBox = 0;
                        }
                    }
                }

                if (from.Backpack.FindItemByType(typeof(VortexCube)) != null)
                {
                    Item       cubes = from.Backpack.FindItemByType(typeof(VortexCube));
                    VortexCube cube  = (VortexCube)cubes;

                    if (cube.CubeOwner == from)
                    {
                        if (cube.LocationKeyLaw == Server.Misc.Worlds.GetRegionName(from.Map, from.Location) && cube.HasKeyLaw == 0)
                        {
                            cube.HasKeyLaw = 1;
                            from.LocalOverheadMessage(MessageType.Emote, 1150, true, "You found the Key of Law!");
                            from.SendSound(0x3D);
                            LoggingFunctions.LogGeneric(from, "has found the Key of Law.");
                            EmptyBox = 0;
                        }
                        if (cube.LocationKeyBalance == Server.Misc.Worlds.GetRegionName(from.Map, from.Location) && cube.HasKeyBalance == 0)
                        {
                            cube.HasKeyBalance = 1;
                            from.LocalOverheadMessage(MessageType.Emote, 1150, true, "You found the Key of Balance!");
                            from.SendSound(0x3D);
                            LoggingFunctions.LogGeneric(from, "has found the Key of Balance.");
                            EmptyBox = 0;
                        }
                        if (cube.LocationKeyChaos == Server.Misc.Worlds.GetRegionName(from.Map, from.Location) && cube.HasKeyChaos == 0)
                        {
                            cube.HasKeyChaos = 1;
                            from.LocalOverheadMessage(MessageType.Emote, 1150, true, "You found the Key of Chaos!");
                            from.SendSound(0x3D);
                            LoggingFunctions.LogGeneric(from, "has found the Key of Chaos.");
                            EmptyBox = 0;
                        }

                        int crystals = cube.HasCrystalRed + cube.HasCrystalBlue + cube.HasCrystalGreen + cube.HasCrystalYellow + cube.HasCrystalWhite + cube.HasCrystalPurple;

                        if (crystals < 6 && cube.LocationCrystal == Server.Misc.Worlds.GetRegionName(from.Map, from.Location))
                        {
                            if (cube.HasCrystalRed == 0)
                            {
                                cube.HasCrystalRed = 1;
                                from.LocalOverheadMessage(MessageType.Emote, 1150, true, "You found the red Void Crystal!");
                                from.SendSound(0x3D);
                                LoggingFunctions.LogGeneric(from, "has found the red Void Crystal.");
                                EmptyBox = 0;
                            }
                            else if (cube.HasCrystalBlue == 0)
                            {
                                cube.HasCrystalBlue = 1;
                                from.LocalOverheadMessage(MessageType.Emote, 1150, true, "You found the blue Void Crystal!");
                                from.SendSound(0x3D);
                                LoggingFunctions.LogGeneric(from, "has found the blue Void Crystal.");
                                EmptyBox = 0;
                            }
                            else if (cube.HasCrystalBlue == 0)
                            {
                                cube.HasCrystalBlue = 1;
                                from.LocalOverheadMessage(MessageType.Emote, 1150, true, "You found the blue Void Crystal!");
                                from.SendSound(0x3D);
                                LoggingFunctions.LogGeneric(from, "has found the blue Void Crystal.");
                                EmptyBox = 0;
                            }
                            else if (cube.HasCrystalGreen == 0)
                            {
                                cube.HasCrystalGreen = 1;
                                from.LocalOverheadMessage(MessageType.Emote, 1150, true, "You found the green Void Crystal!");
                                from.SendSound(0x3D);
                                LoggingFunctions.LogGeneric(from, "has found the green Void Crystal.");
                                EmptyBox = 0;
                            }
                            else if (cube.HasCrystalYellow == 0)
                            {
                                cube.HasCrystalYellow = 1;
                                from.LocalOverheadMessage(MessageType.Emote, 1150, true, "You found the yellow Void Crystal!");
                                from.SendSound(0x3D);
                                LoggingFunctions.LogGeneric(from, "has found the yellow Void Crystal.");
                                EmptyBox = 0;
                            }
                            else if (cube.HasCrystalWhite == 0)
                            {
                                cube.HasCrystalWhite = 1;
                                from.LocalOverheadMessage(MessageType.Emote, 1150, true, "You found the white Void Crystal!");
                                from.SendSound(0x3D);
                                LoggingFunctions.LogGeneric(from, "has found the white Void Crystal.");
                                EmptyBox = 0;
                            }
                            else if (cube.HasCrystalPurple == 0)
                            {
                                cube.HasCrystalPurple = 1;
                                from.LocalOverheadMessage(MessageType.Emote, 1150, true, "You found the purple Void Crystal!");
                                from.SendSound(0x3D);
                                LoggingFunctions.LogGeneric(from, "has found the purple Void Crystal.");
                                EmptyBox = 0;
                            }

                            cube.TextCrystal     = Server.Items.CubeOnCorpse.GetRumor();
                            cube.LocationCrystal = Server.Items.CubeOnCorpse.PickDungeon();

                            int crystal = cube.HasCrystalRed + cube.HasCrystalBlue + cube.HasCrystalGreen + cube.HasCrystalYellow + cube.HasCrystalWhite + cube.HasCrystalPurple;

                            if (crystal > 5)
                            {
                                cube.TextCrystal     = "";
                                cube.LocationCrystal = "";
                            }
                        }
                    }
                }

                if (from.Backpack.FindItemByType(typeof(AlienEgg)) != null)
                {
                    Item     eggs = from.Backpack.FindItemByType(typeof(AlienEgg));
                    AlienEgg egg  = (AlienEgg)eggs;

                    if (egg.PieceLocation == Server.Misc.Worlds.GetRegionName(from.Map, from.Location))
                    {
                        bool pickNewEggSpot = false;
                        if (egg.HaveRod < 1)
                        {
                            pickNewEggSpot = true; egg.HaveRod = 1; from.LocalOverheadMessage(MessageType.Emote, 1150, true, "You found the rod of amber!"); from.SendSound(0x3D); EmptyBox = 0;
                        }
                        else if (egg.HaveYellowCrystal < 1)
                        {
                            pickNewEggSpot = true; egg.HaveYellowCrystal = 1; from.LocalOverheadMessage(MessageType.Emote, 1150, true, "You found the sun crystal!"); from.SendSound(0x3D); EmptyBox = 0;
                        }
                        else if (egg.HaveRedCrystal < 1)
                        {
                            pickNewEggSpot = true; egg.HaveRedCrystal = 1; from.LocalOverheadMessage(MessageType.Emote, 1150, true, "You found the blood crystal!"); from.SendSound(0x3D); EmptyBox = 0;
                        }
                        else if (egg.HavePotion < 1)
                        {
                            pickNewEggSpot = true; egg.HavePotion = 1; from.LocalOverheadMessage(MessageType.Emote, 1150, true, "You found the potion of growth!"); from.SendSound(0x3D); EmptyBox = 0;
                        }

                        if (pickNewEggSpot)
                        {
                            egg.PieceRumor    = Server.Items.CubeOnCorpse.GetRumor();
                            egg.PieceLocation = Server.Items.CubeOnCorpse.PickDungeon();
                        }
                    }
                }

                if (from.Backpack.FindItemByType(typeof(DragonEgg)) != null)
                {
                    Item      eggs = from.Backpack.FindItemByType(typeof(DragonEgg));
                    DragonEgg egg  = (DragonEgg)eggs;

                    if (egg.PieceLocation == Server.Misc.Worlds.GetRegionName(from.Map, from.Location))
                    {
                        bool pickNewEggSpot = false;
                        if (egg.HavePotionA < 1)
                        {
                            pickNewEggSpot = true; egg.HavePotionA = 1; from.LocalOverheadMessage(MessageType.Emote, 1150, true, "You found the elixir of the flame!"); from.SendSound(0x3D); EmptyBox = 0;
                        }
                        else if (egg.HavePotionB < 1)
                        {
                            pickNewEggSpot = true; egg.HavePotionB = 1; from.LocalOverheadMessage(MessageType.Emote, 1150, true, "You found the potion of the earth!"); from.SendSound(0x3D); EmptyBox = 0;
                        }
                        else if (egg.HavePotionC < 1)
                        {
                            pickNewEggSpot = true; egg.HavePotionC = 1; from.LocalOverheadMessage(MessageType.Emote, 1150, true, "You found the mixture of the sea!"); from.SendSound(0x3D); EmptyBox = 0;
                        }
                        else if (egg.HavePotionD < 1)
                        {
                            pickNewEggSpot = true; egg.HavePotionD = 1; from.LocalOverheadMessage(MessageType.Emote, 1150, true, "You found the oil of the winds!"); from.SendSound(0x3D); EmptyBox = 0;
                        }

                        if (pickNewEggSpot)
                        {
                            egg.PieceRumor    = Server.Items.CubeOnCorpse.GetRumor();
                            egg.PieceLocation = Server.Items.CubeOnCorpse.PickDungeon();
                        }
                    }
                }

                if (from.Backpack.FindItemByType(typeof(DracolichSkull)) != null)
                {
                    Item           skulls = from.Backpack.FindItemByType(typeof(DracolichSkull));
                    DracolichSkull skull  = (DracolichSkull)skulls;

                    if (skull.PieceLocation == Server.Misc.Worlds.GetRegionName(from.Map, from.Location))
                    {
                        bool pickNewSpot = false;
                        if (skull.HavePotionA < 1)
                        {
                            pickNewSpot = true; skull.HavePotionA = 1; from.LocalOverheadMessage(MessageType.Emote, 1150, true, "You found the heart of the dead god!"); from.SendSound(0x3D); EmptyBox = 0;
                        }
                        else if (skull.HavePotionB < 1)
                        {
                            pickNewSpot = true; skull.HavePotionB = 1; from.LocalOverheadMessage(MessageType.Emote, 1150, true, "You found the eye of the mad king!"); from.SendSound(0x3D); EmptyBox = 0;
                        }
                        else if (skull.HavePotionC < 1)
                        {
                            pickNewSpot = true; skull.HavePotionC = 1; from.LocalOverheadMessage(MessageType.Emote, 1150, true, "You found the orb of the astral lich!"); from.SendSound(0x3D); EmptyBox = 0;
                        }
                        else if (skull.HavePotionD < 1)
                        {
                            pickNewSpot = true; skull.HavePotionD = 1; from.LocalOverheadMessage(MessageType.Emote, 1150, true, "You found the mind of the planar ghost!"); from.SendSound(0x3D); EmptyBox = 0;
                        }

                        if (pickNewSpot)
                        {
                            skull.PieceRumor    = Server.Items.CubeOnCorpse.GetRumor();
                            skull.PieceLocation = Server.Items.CubeOnCorpse.PickDungeon();
                        }
                    }
                }

                if (from.Backpack.FindItemByType(typeof(DemonPrison)) != null)
                {
                    Item        prisons = from.Backpack.FindItemByType(typeof(DemonPrison));
                    DemonPrison prison  = (DemonPrison)prisons;

                    if (prison.PieceLocation == Server.Misc.Worlds.GetRegionName(from.Map, from.Location))
                    {
                        bool pickNewprisonSpot = false;
                        if (prison.HaveShardA < 1)
                        {
                            pickNewprisonSpot = true; prison.HaveShardA = 1; from.LocalOverheadMessage(MessageType.Emote, 1150, true, "You found the shard of hellfire!"); from.SendSound(0x3D); EmptyBox = 0;
                        }
                        else if (prison.HaveShardB < 1)
                        {
                            pickNewprisonSpot = true; prison.HaveShardB = 1; from.LocalOverheadMessage(MessageType.Emote, 1150, true, "You found the shard of the abyss!"); from.SendSound(0x3D); EmptyBox = 0;
                        }
                        else if (prison.HaveShardC < 1)
                        {
                            pickNewprisonSpot = true; prison.HaveShardC = 1; from.LocalOverheadMessage(MessageType.Emote, 1150, true, "You found the shard of souls!"); from.SendSound(0x3D); EmptyBox = 0;
                        }
                        else if (prison.HaveShardD < 1)
                        {
                            pickNewprisonSpot = true; prison.HaveShardD = 1; from.LocalOverheadMessage(MessageType.Emote, 1150, true, "You found the shard of the void!"); from.SendSound(0x3D); EmptyBox = 0;
                        }

                        if (pickNewprisonSpot)
                        {
                            prison.PieceRumor    = Server.Items.CubeOnCorpse.GetRumor();
                            prison.PieceLocation = Server.Items.CubeOnCorpse.PickDungeon();
                        }
                    }
                }

                if (from.Backpack.FindItemByType(typeof(DDRelicTablet)) != null)
                {
                    Container pack = from.Backpack;

                    List <DDRelicTablet> rock = pack.FindItemsByType <DDRelicTablet>();

                    for (int i = 0; i < rock.Count; ++i)
                    {
                        DDRelicTablet stone = rock[i];

                        if (stone.SearchDungeon == Server.Misc.Worlds.GetRegionName(from.Map, from.Location))
                        {
                            if (stone.SearchReal >= Utility.RandomMinMax(1, 100))
                            {
                                Item   item     = null;
                                string itemName = stone.SearchType;
                                Type   itemType = ScriptCompiler.FindTypeByName(itemName);

                                if (itemType != null)
                                {
                                    item = (Item)Activator.CreateInstance(itemType);
                                    from.AddToBackpack(item);
                                    LoggingFunctions.LogFoundItemQuest(from, stone.SearchItem);
                                    from.LocalOverheadMessage(MessageType.Emote, 1150, true, "You found the " + stone.SearchItem + ".");
                                    from.SendSound(0x3D);
                                }
                            }
                            else if (1 == Utility.RandomMinMax(1, 2))
                            {
                                Item   item     = null;
                                string itemName = stone.SearchType;
                                Type   itemType = ScriptCompiler.FindTypeByName(itemName);

                                if (itemType != null)
                                {
                                    item = (Item)Activator.CreateInstance(itemType);
                                    Item fake = new BrokenGear();
                                    fake.ItemID = item.ItemID;
                                    fake.Hue    = item.Hue;
                                    fake.Weight = item.Weight;
                                    fake.Name   = "Fake " + stone.SearchItem;
                                    item.Delete();
                                    from.AddToBackpack(fake);
                                }
                                from.LocalOverheadMessage(MessageType.Emote, 1150, true, "The " + stone.SearchItem + " appears to be a fake.");
                                from.SendSound(0x5B3);
                            }
                            else
                            {
                                from.SendMessage("");
                                from.LocalOverheadMessage(MessageType.Emote, 0xB1F, true, "The tablet for the " + stone.SearchItem + " seems to be false.");
                                from.PlaySound(0x5B3);
                            }

                            from.SendMessage("The tablet crumbles to dust!");
                            stone.Delete();
                            EmptyBox = 0;
                        }
                    }
                }

                if (from.Backpack.FindItemByType(typeof(SearchPage)) != null)
                {
                    Item       scroll = from.Backpack.FindItemByType(typeof(SearchPage));
                    SearchPage page   = (SearchPage)scroll;

                    int LeadToAnotherSpot = 100 - page.LegendPercent;

                    if (page.SearchDungeon == Server.Misc.Worlds.GetRegionName(from.Map, from.Location) && page.owner == from && page.DungeonMap == from.Map)
                    {
                        if (LeadToAnotherSpot >= Utility.RandomMinMax(1, 100))
                        {
                            from.PlaySound(0x249);
                            SearchPage.PickSearchLocation(page, page.SearchDungeon, from);
                            from.SendMessage("You didn't find it, but you did get another clue.");
                            from.SendMessage("so you update your notes for the new place to search.");
                            EmptyBox = 0;
                        }
                        else
                        {
                            if (page.LegendReal == 1)
                            {
                                Item   item     = null;
                                string itemName = page.SearchType;
                                Type   itemType = ScriptCompiler.FindTypeByName(itemName);

                                if (itemType != null)
                                {
                                    item = (Item)Activator.CreateInstance(itemType);
                                    from.AddToBackpack(item);
                                    LoggingFunctions.LogFoundItemQuest(from, page.SearchItem);
                                    from.LocalOverheadMessage(MessageType.Emote, 1150, true, "You found the " + page.SearchItem + ".");
                                    from.SendSound(0x3D);
                                }
                            }
                            else if (page.LegendPercent >= Utility.RandomMinMax(1, 200))
                            {
                                int    nGold = page.LegendPercent * 100;
                                string sGold = nGold.ToString();
                                from.LocalOverheadMessage(MessageType.Emote, 1150, true, "The legend was false, but there was " + sGold + " gold in here.");
                                from.SendSound(0x2E6);
                                from.AddToBackpack(new Gold(nGold));
                            }
                            else if (1 == Utility.RandomMinMax(1, 2))
                            {
                                Item   item     = null;
                                string itemName = page.SearchType;
                                Type   itemType = ScriptCompiler.FindTypeByName(itemName);

                                if (itemType != null)
                                {
                                    item = (Item)Activator.CreateInstance(itemType);
                                    Item fake = new BrokenGear();
                                    fake.ItemID = item.ItemID;
                                    fake.Hue    = item.Hue;
                                    fake.Weight = item.Weight;
                                    fake.Name   = "Fake " + page.SearchItem;
                                    item.Delete();
                                    from.AddToBackpack(fake);
                                }
                                from.LocalOverheadMessage(MessageType.Emote, 1150, true, "The " + page.SearchItem + " appears to be a fake.");
                                from.SendSound(0x3D);
                            }
                            else
                            {
                                from.SendMessage("");
                                from.LocalOverheadMessage(MessageType.Emote, 0xB1F, true, "The legends of the " + page.SearchItem + " seemed to be false.");
                                from.PlaySound(0x249);
                            }
                            scroll.Delete();
                            SearchPage.ArtifactQuestTimeAllowed(from);
                            EmptyBox = 0;
                        }
                    }
                }

                if (EmptyBox == 1)
                {
                    from.SendMessage("The chest appears to be empty.");
                }
            }
            else
            {
                from.SendMessage("The chest appears to be empty.");
            }
        }
Esempio n. 11
0
        public void SetupBook(Mobile from)
        {
            QuestTome tome = new QuestTome();

            tome.QuestTomeOwner = from;
            tome.ItemID         = ItemID;
            tome.Hue            = Hue;
            tome.Name           = Name;

            NPCGood(from, tome);
            NPCEvil(from, tome);

            tome.QuestTomeCitizen = "";
            tome.QuestTomeGoals   = 0;
            tome.QuestTomeDungeon = "";
            tome.QuestTomeLand    = "";
            tome.QuestTomeType    = 0;

            switch (Utility.RandomMinMax(0, 3))
            {
            case 0: tome.GoalItem1 = Server.Misc.QuestCharacters.QuestItems(false);       break;

            case 1: tome.GoalItem1 = Server.Misc.QuestCharacters.QuestItems(false);       break;

            case 2: tome.GoalItem1 = RandomHerb();                                                                          break;

            case 3: tome.GoalItem1 = RandomMagic();                                                                         break;
            }
            switch (Utility.RandomMinMax(0, 3))
            {
            case 0: tome.GoalItem2 = Server.Misc.QuestCharacters.QuestItems(false);       break;

            case 1: tome.GoalItem2 = Server.Misc.QuestCharacters.QuestItems(false);       break;

            case 2: tome.GoalItem2 = RandomHerb();                                                                          break;

            case 3: tome.GoalItem2 = RandomMagic();                                                                         break;
            }
            switch (Utility.RandomMinMax(0, 3))
            {
            case 0: tome.GoalItem3 = Server.Misc.QuestCharacters.QuestItems(false);       break;

            case 1: tome.GoalItem3 = Server.Misc.QuestCharacters.QuestItems(false);       break;

            case 2: tome.GoalItem3 = RandomHerb();                                                                          break;

            case 3: tome.GoalItem3 = RandomMagic();                                                                         break;
            }

            string heard = "heard";

            switch (Utility.RandomMinMax(0, 3))
            {
            case 1: heard = "told";         break;

            case 2: heard = "known";        break;

            case 3: heard = "shared";       break;
            }

            string legend = "legends";

            switch (Utility.RandomMinMax(0, 3))
            {
            case 1: legend = "fables";      break;

            case 2: legend = "myths";       break;

            case 3: legend = "lore";        break;
            }

            string hush = "whispered";

            switch (Utility.RandomMinMax(0, 3))
            {
            case 1: hush = "told";          break;

            case 2: hush = "sung";          break;

            case 3: hush = "spoken";        break;
            }

            string inn = "taverns";

            switch (Utility.RandomMinMax(0, 4))
            {
            case 1: inn = "camps";          break;

            case 2: inn = "cities";         break;

            case 3: inn = "villages";       break;

            case 4: inn = "inns";           break;
            }

            string takes = "seized";

            switch (Utility.RandomMinMax(0, 4))
            {
            case 1: takes = "stolen";       break;

            case 2: takes = "taken";        break;

            case 3: takes = "held";         break;

            case 4: takes = "guarded";      break;
            }

            tome.GoalItem4 = Server.Misc.QuestCharacters.QuestItems(false);

            MakeVillain(tome);

            tome.QuestTomeStoryGood = "You have found the journal of DDDDD, where they were given a quest by " + tome.QuestTomeNPCGood + " to find " + tome.GoalItem4 + " that is known to be " + takes + " by " + tome.VillainName + " " + tome.VillainTitle + ". " + tome.VillainName + " is " + tome.VillainCategory + " that has been " + heard + " in " + legend + " and " + hush + " about in " + inn + ". The goal for DDDDD was to find " + tome.GoalItem1 + ", " + tome.GoalItem2 + ", & " + tome.GoalItem3 + " to help them defeat " + tome.VillainName + " and then bring " + tome.GoalItem4 + " back to " + tome.QuestTomeNPCGood + " before " + tome.QuestTomeNPCEvil + " can use it for their nefarious plans.<br><br>This is now your quest and you will have to speak with others to find clues on the location of the relics needed, as well as where " + tome.VillainName + " dwells. Once you defeat " + tome.VillainName + " and claim " + tome.GoalItem4 + ", you can give this journal to " + tome.QuestTomeNPCGood + " in " + tome.QuestTomeWorldGood + " at the following coordinates:<br><br>" + tome.QuestTomeLocateGood + "";

            tome.QuestTomeStoryEvil = "You have found the journal of DDDDD, where they were given a quest by " + tome.QuestTomeNPCEvil + " to find " + tome.GoalItem4 + " that is known to be " + takes + " by " + tome.VillainName + " " + tome.VillainTitle + ". " + tome.VillainName + " is " + tome.VillainCategory + " that has been " + heard + " in " + legend + " and " + hush + " about in " + inn + ". The goal for DDDDD was to find " + tome.GoalItem1 + ", " + tome.GoalItem2 + ", & " + tome.GoalItem3 + " to help them defeat " + tome.VillainName + " and then bring " + tome.GoalItem4 + " back to " + tome.QuestTomeNPCEvil + " before " + tome.QuestTomeNPCGood + " can use it for their righteous pursuits.<br><br>This is now your quest and you will have to speak with others to find clues on the location of the relics needed, as well as where " + tome.VillainName + " dwells. Once you defeat " + tome.VillainName + " and claim " + tome.GoalItem4 + ", you can give this journal to " + tome.QuestTomeNPCEvil + " in " + tome.QuestTomeWorldEvil + " at the following coordinates:<br><br>" + tome.QuestTomeLocateEvil + "";

            if (Utility.RandomBool())               // TWIST THE STORY AROUND
            {
                tome.QuestTomeStoryGood = "You have found the journal of DDDDD, where they were given a quest by " + tome.QuestTomeNPCEvil + " to find " + tome.GoalItem4 + " that is known to be " + takes + " by " + tome.VillainName + " " + tome.VillainTitle + ". " + tome.VillainName + " is " + tome.VillainCategory + " that has been " + heard + " in " + legend + " and " + hush + " about in " + inn + ". The goal for DDDDD was to find " + tome.GoalItem1 + ", " + tome.GoalItem2 + ", & " + tome.GoalItem3 + " to help them defeat " + tome.VillainName + " and then bring " + tome.GoalItem4 + " back to " + tome.QuestTomeNPCEvil + " before " + tome.QuestTomeNPCGood + " can use it for their righteous pursuits.<br><br>It is now your quest to keep " + tome.QuestTomeNPCEvil + " from obtaining " + tome.GoalItem4 + ". To find it for " + tome.QuestTomeNPCGood + ", you will have to speak with others to find clues on the location of the relics needed, as well as where " + tome.VillainName + " dwells. Once you defeat " + tome.VillainName + " and claim " + tome.GoalItem4 + ", you can give this journal to " + tome.QuestTomeNPCGood + " in " + tome.QuestTomeWorldGood + " at the following coordinates:<br><br>" + tome.QuestTomeLocateGood + "";

                tome.QuestTomeStoryEvil = "You have found the journal of DDDDD, where they were given a quest by " + tome.QuestTomeNPCGood + " to find " + tome.GoalItem4 + " that is known to be " + takes + " by " + tome.VillainName + " " + tome.VillainTitle + ". " + tome.VillainName + " is " + tome.VillainCategory + " that has been " + heard + " in " + legend + " and " + hush + " about in " + inn + ". The goal for DDDDD was to find " + tome.GoalItem1 + ", " + tome.GoalItem2 + ", & " + tome.GoalItem3 + " to help them defeat " + tome.VillainName + " and then bring " + tome.GoalItem4 + " back to " + tome.QuestTomeNPCGood + " before " + tome.QuestTomeNPCEvil + " can use it for their nefarious plans.<br><br>It is now your quest to keep " + tome.QuestTomeNPCGood + " from obtaining " + tome.GoalItem4 + ". To find it for " + tome.QuestTomeNPCEvil + ", you will have to speak with others to find clues on the location of the relics needed, as well as where " + tome.VillainName + " dwells. Once you defeat " + tome.VillainName + " and claim " + tome.GoalItem4 + ", you can give this journal to " + tome.QuestTomeNPCEvil + " in " + tome.QuestTomeWorldEvil + " at the following coordinates:<br><br>" + tome.QuestTomeLocateEvil + "";
            }

            from.AddToBackpack(tome);
        }
Esempio n. 12
0
        public void MakeVillain(QuestTome book)
        {
            book.VillainHue  = 0;
            book.VillainBody = 0;
            bool color = false;

            int enemy = Utility.RandomMinMax(1, 10);

            if (enemy == 1)
            {
                switch (Utility.RandomMinMax(0, 3))
                {
                case 0: book.VillainType = "ArchFiend";                 book.VillainName = NameList.RandomName("daemon");             book.VillainBody = Utility.RandomList(9, 320);        color = true;   book.VillainCategory = "a daemon";              break;

                case 1: book.VillainType = "ArchFiend";                 book.VillainName = NameList.RandomName("demonic");    book.VillainBody = Utility.RandomList(191, 427);      color = true;
                    switch (Utility.RandomMinMax(0, 2))
                    {
                    case 0: book.VillainCategory = "a balron"; break;

                    case 1: book.VillainCategory = "a balor";  break;

                    case 2: book.VillainCategory = "a balrog"; break;
                    }
                    break;

                case 2: book.VillainType = "ArchFiend";                 book.VillainName = NameList.RandomName("devil");              book.VillainBody = Utility.RandomList(765, 804, 436, 88, 138);        book.VillainCategory = "a devil";               break;

                case 3: book.VillainType = "Succubus";                  book.VillainName = NameList.RandomName("goddess");    book.VillainBody = 174; color = true;
                    switch (Utility.RandomMinMax(0, 2))
                    {
                    case 0: book.VillainCategory = "a succubus"; break;

                    case 1: book.VillainCategory = "a demoness"; break;

                    case 2: book.VillainCategory = "a daemoness"; break;
                    }
                    break;
                }
            }
            else if (enemy == 2)
            {
                book.VillainCategory = "a giant";
                book.VillainName     = NameList.RandomName("giant");

                switch (Utility.RandomMinMax(0, 17))
                {
                case 0:         book.VillainType = "AbyssGiant";                break;

                case 1:         book.VillainType = "CloudGiant";                break;

                case 2:         book.VillainType = "FireGiant";                 break;

                case 3:         book.VillainType = "ForestGiant";               break;

                case 4:         book.VillainType = "FrostGiant";                break;

                case 5:         book.VillainType = "HillGiant";                 break;

                case 6:         book.VillainType = "HillGiantShaman";   break;

                case 7:         book.VillainType = "IceGiant";                  break;

                case 8:         book.VillainType = "JungleGiant";               break;

                case 9:         book.VillainType = "LavaGiant";                 break;

                case 10:        book.VillainType = "MountainGiant";             break;

                case 11:        book.VillainType = "SandGiant";                 break;

                case 12:        book.VillainType = "StarGiant";                 break;

                case 13:        book.VillainType = "StoneGiant";                break;

                case 14:        book.VillainType = "StormGiant";                break;

                case 15:        book.VillainType = "AncientCyclops";    book.VillainName = NameList.RandomName("greek");              book.VillainCategory = "a cyclops";     break;

                case 16:        book.VillainType = "AncientEttin";              book.VillainCategory = "an ettin";      break;

                case 17:        book.VillainType = "OgreLord";                  book.VillainCategory = "an ogre";       break;
                }
            }
            else if (enemy == 3)
            {
                book.VillainCategory = "a dragon";
                book.VillainName     = NameList.RandomName("dragon");
                switch (Utility.RandomMinMax(0, 24))
                {
                case 0:         book.VillainType = "Dragon";                                    book.VillainBody = Utility.RandomList(12, 59);        color = true;   break;

                case 1:         book.VillainType = "AncientWyrm";                               break;

                case 2:         book.VillainType = "ShadowWyrm";                                break;

                case 3:         book.VillainType = "VolcanicDragon";                    break;

                case 4:         book.VillainType = "VoidDragon";                                break;

                case 5:         book.VillainType = "AshDragon";                                 break;

                case 6:         book.VillainType = "CrystalDragon";                             break;

                case 7:         book.VillainType = "ElderDragon";                               break;

                case 8:         book.VillainType = "PrimevalAmberDragon";               break;

                case 9:         book.VillainType = "VolcanicDragon";                    break;

                case 10:        book.VillainType = "PrimevalBlackDragon";               break;

                case 11:        book.VillainType = "PrimevalDragon";                    break;

                case 12:        book.VillainType = "PrimevalFireDragon";                break;

                case 13:        book.VillainType = "PrimevalGreenDragon";               break;

                case 14:        book.VillainType = "PrimevalNightDragon";               break;

                case 15:        book.VillainType = "PrimevalRedDragon";                 break;

                case 16:        book.VillainType = "PrimevalRoyalDragon";               break;

                case 17:        book.VillainType = "PrimevalRunicDragon";               break;

                case 18:        book.VillainType = "PrimevalSilverDragon";              break;

                case 19:        book.VillainType = "PrimevalStygianDragon";             break;

                case 20:        book.VillainType = "PrimevalVolcanicDragon";    break;

                case 21:        book.VillainType = "VampiricDragon";                    break;

                case 22:        book.VillainType = "PrimevalAbysmalDragon";             break;

                case 23:        book.VillainType = "AncientDrake";                              book.VillainCategory = "a drake";       break;

                case 24:        book.VillainType = "AncientWyvern";                             book.VillainCategory = "a wyvern";      break;
                }
            }
            else if (enemy == 4)
            {
                book.VillainCategory = "a beholder";
                Mobile m = new Beholder();
                book.VillainType = "Beholder";
                book.VillainName = m.Name;
                book.VillainHue  = m.Hue;
                m.Delete();
            }
            else if (enemy == 5)
            {
                if (Utility.RandomBool())
                {
                    book.VillainCategory = "a gargoyle";
                    book.VillainType     = "StygianGargoyleLord";
                    book.VillainName     = NameList.RandomName("gargoyle name");
                }
                else
                {
                    book.VillainCategory = "a sphinx";
                    book.VillainType     = "AncientSphinx";
                    book.VillainName     = NameList.RandomName("drakkul");
                }
            }
            else if (enemy == 6)
            {
                if (Utility.RandomBool())
                {
                    book.VillainCategory = "a reptilian humanoid";
                    Mobile m = new Sleestax();
                    book.VillainType = "Sleestax";
                    book.VillainName = m.Name;
                    book.VillainHue  = m.Hue;
                    m.Delete();
                }
                else
                {
                    book.VillainCategory = "a serpentoid";
                    book.VillainType     = "OphidianKnight";
                    book.VillainName     = NameList.RandomName("lizardman");
                    book.VillainBody     = 306;
                }
            }
            else if (enemy == 7)
            {
                if (Utility.RandomBool())
                {
                    book.VillainCategory = "an arachnid";
                    book.VillainType     = "AbyssCrawler";
                    book.VillainName     = NameList.RandomName("goblin");
                    book.VillainBody     = 173;
                }
                else
                {
                    book.VillainCategory = "an insectoid";
                    book.VillainType     = "AntaurKing";
                    book.VillainName     = NameList.RandomName("goblin");
                    book.VillainBody     = 784;
                }
            }
            else if (enemy == 8)
            {
                if (Utility.RandomBool())
                {
                    book.VillainCategory = "a reaper";
                    Mobile m = new EvilEnt();
                    book.VillainType = "EvilEnt";
                    book.VillainName = m.Name;
                    book.VillainHue  = m.Hue;
                    m.Delete();
                }
                else
                {
                    book.VillainCategory = "an elemental";
                    book.VillainType     = "CrystalGoliath";
                    book.VillainName     = NameList.RandomName("urk");
                    book.VillainBody     = 753;
                }
            }
            else if (enemy == 9)
            {
                switch (Utility.RandomMinMax(0, 4))
                {
                case 0:         book.VillainType = "Dracolich";                                 book.VillainName = NameList.RandomName("dragon");                     book.VillainBody = Utility.RandomList(104, 323);              book.VillainCategory = "a dracolich";           break;

                case 1:         book.VillainType = "AncientLich";                               book.VillainName = NameList.RandomName("ancient lich");       book.VillainCategory = "a lich";                        break;

                case 2:         book.VillainType = "AncientFleshGolem";                 book.VillainName = NameList.RandomName("greek");                      book.VillainBody = 999;                                                                 book.VillainCategory = "a flesh golem";         break;

                case 3:         book.VillainType = "GrundulVarg";                               book.VillainName = NameList.RandomName("ancient lich");       book.VillainBody = Utility.RandomList(768, 65, 107);  book.VillainCategory = "a dread lord";          break;

                case 4:         book.VillainType = "GrundulVarg";                               book.VillainName = NameList.RandomName("greek");                      book.VillainBody = Utility.RandomList(768, 65, 107);  book.VillainCategory = "a death knight";        break;
                }
            }
            else
            {
                switch (Utility.RandomMinMax(0, 3))
                {
                case 0:         book.VillainType = "Watcher";                                   book.VillainName = NameList.RandomName("drakkul");            book.VillainCategory = "a watcher";                     break;

                case 1:         book.VillainType = "Cerberus";                                  book.VillainName = NameList.RandomName("greek");                      book.VillainCategory = "a cerberus";            break;

                case 2:         book.VillainType = "Styguana";                                  book.VillainName = NameList.RandomName("lizardman");          book.VillainCategory = "a styguana";            break;

                case 3:         book.VillainType = "HellBeast";                                 book.VillainName = NameList.RandomName("imp");                        book.VillainCategory = "a hell beast";          break;
                }
            }

            book.VillainHue = 0; if (color)
            {
                book.VillainHue = Utility.RandomColor(0);
            }

            book.VillainTitle = RandomThings.RandomEvilTitle();
        }