Example #1
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);
        }
Example #2
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();
                    }
                }
            }
        }