Ejemplo n.º 1
0
        public static void PickSearchLocation(CourierMail scroll, string DungeonNow, Mobile from, string alignment, string homeworld)
        {
            string QuestItem = Server.Misc.QuestCharacters.QuestItems();

            scroll.SearchItem = QuestItem;

            string QuestStory = Server.Misc.QuestCharacters.EpicQuestStory(QuestItem, alignment);

            string thisWorld = "the Land of Sosaria";
            string thisPlace = "the Dungeon of Doom";
            Map    thisMap   = Map.Trammel;

            int       aCount  = 0;
            ArrayList targets = new ArrayList();

            foreach (Item target in World.Items.Values)
            {
                if (target is SearchBase && (DifficultyLevel.GetDifficultyLevel(target.Location, target.Map) <= GetPlayerInfo.GetPlayerDifficulty(from)))
                {
                    string tWorld = Worlds.GetMyWorld(target.Map, target.Location, target.X, target.Y);
                    if (tWorld == "the Land of Sosaria")
                    {
                        targets.Add(target); aCount++;
                    }
                    else if (CharacterDatabase.GetDiscovered(from, tWorld))
                    {
                        targets.Add(target); aCount++;
                    }
                }
            }

            aCount = Utility.RandomMinMax(1, aCount);

            int xCount = 0;

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

                if (xCount == aCount)
                {
                    Item finding = ( Item )targets[i];
                    thisWorld          = Worlds.GetMyWorld(finding.Map, finding.Location, finding.X, finding.Y);
                    thisMap            = finding.Map;
                    thisPlace          = Server.Misc.Worlds.GetRegionName(finding.Map, finding.Location);
                    scroll.MsgComplete = 0;
                    scroll.MsgReward   = Server.Misc.DifficultyLevel.GetDifficultyLevel(finding.Location, finding.Map) + 2;
                    if (scroll.MsgReward < 2)
                    {
                        scroll.MsgReward = 2;
                    }
                }
            }

            string Word1 = "Legends";

            switch (Utility.RandomMinMax(1, 4))
            {
            case 1: Word1 = "Rumors"; break;

            case 2: Word1 = "Myths"; break;

            case 3: Word1 = "Tales"; break;

            case 4: Word1 = "Stories"; break;
            }
            string Word2 = "lost";

            switch (Utility.RandomMinMax(1, 4))
            {
            case 1: Word2 = "kept"; break;

            case 2: Word2 = "seen"; break;

            case 3: Word2 = "taken"; break;

            case 4: Word2 = "hidden"; break;
            }
            string Word3 = "deep in";

            switch (Utility.RandomMinMax(1, 4))
            {
            case 1: Word3 = "within"; break;

            case 2: Word3 = "somewhere in"; break;

            case 3: Word3 = "somehow in"; break;

            case 4: Word3 = "far in"; break;
            }
            string Word4 = "centuries ago";

            switch (Utility.RandomMinMax(1, 4))
            {
            case 1: Word4 = "thousands of years ago"; break;

            case 2: Word4 = "decades ago"; break;

            case 3: Word4 = "millions of years ago"; break;

            case 4: Word4 = "many years ago"; break;
            }

            scroll.SearchDungeon = thisPlace;
            scroll.SearchWorld   = thisWorld;
            scroll.DungeonMap    = thisMap;

            string gold = (scroll.MsgReward * 1000).ToString();

            if (alignment == "neutral")
            {
                gold = (scroll.MsgReward * 1500).ToString();
            }
            string heard  = "I have heard that you could perhaps help me with something of the utmost importance.";
            string reward = "Do this for me, and I can reward you " + gold + " gold.";

            if (alignment != "evil")
            {
                switch (Utility.RandomMinMax(0, 5))
                {
                case 0: heard = "I have heard that you could perhaps help me with something of the utmost importance.";         break;

                case 1: heard = RandomThings.GetRandomName() + " has told me about you, and that maybe you can help.";          break;

                case 2: heard = "After speaking to my friend, " + RandomThings.GetRandomName() + ", they mentioned that maybe you can assist me with something.";       break;

                case 3: heard = "I hear that you are one I could trust for this important task ahead.";         break;

                case 4: heard = "The " + RandomThings.GetRandomJob() + " in " + RandomThings.GetRandomCity() + " mentioned that you could perhaps help me with something.";     break;

                case 5: heard = "There is a dire situation I think you may be able to help with.";      break;
                }
            }
            else if (alignment == "evil")
            {
                reward = "I think that " + gold + " gold will make this worth your time.";
                switch (Utility.RandomMinMax(0, 5))
                {
                case 0: heard = "I have heard that you are one that can serve me in my purposes.";      break;

                case 1: heard = RandomThings.GetRandomName() + " has told me about you, and that you would serve me well.";             break;

                case 2: heard = "After speaking to my servant, " + RandomThings.GetRandomName() + ", they mentioned that maybe you would do my bidding.";       break;

                case 3: heard = "I hear whispers of your ambitions, and that maybe we can both benefit from what I am about to ask.";   break;

                case 4: heard = "Those in " + RandomThings.GetRandomCity() + " sometimes speak your name in hush curses, which is why I have sent this message to you.";        break;

                case 5: heard = "There is an item I need for my plans, and I think you are one that can obtain it with little notice by others.";       break;
                }
            }

            string intro = from.Name + ",<br><br>" + heard;

            string EntranceLocation = Worlds.GetAreaEntrance(scroll.SearchDungeon, scroll.DungeonMap);

            scroll.SearchMessage = intro + " " + reward + " " + QuestStory + " " + Word1 + " tell of " + QuestItem + " being " + Word2 + " " + Word3;

            scroll.SearchMessage = scroll.SearchMessage + " " + scroll.SearchDungeon + " " + Word4 + " in " + scroll.SearchWorld + " at the below sextant coordinates.<br><br>" + EntranceLocation;

            scroll.SearchMessage = scroll.SearchMessage + "<br><br>When you find it, bring this message back to me. I am in " + homeworld + " at the below sextant coordinates.<br><br>" + scroll.ForWhere;

            scroll.SearchMessage = scroll.SearchMessage + "<br><br>- " + scroll.ForWho;

            scroll.InvalidateProperties();
        }
Ejemplo n.º 2
0
        public void FindMessage(Mobile m)
        {
            if (Deleted || !m.Alive)
            {
                return;
            }

            CharacterDatabase DB = Server.Items.CharacterDatabase.GetDB(m);

            string msgQuest = DB.MessageQuest;

            string myHomeWorld = "the Land of Sosaria";

            bool GiveMail = true;

            if (msgQuest != "" && msgQuest != null)
            {
                ArrayList targets = new ArrayList();
                foreach (Item item in World.Items.Values)
                {
                    if (item is CourierMail)
                    {
                        if (((CourierMail)item).owner == m)
                        {
                            GiveMail = false;
                            m.AddToBackpack(item);
                            m.PlaySound(0x249);
                            SayTo(m, "Hmmm...I already gave you a message from " + msgQuest + ". Here is a another if you lost it.");
                        }
                    }
                }
            }

            if (GiveMail)
            {
                CourierMail envelope = new CourierMail(m);
                envelope.owner = m;
                string alignment = "good";

                int c = 0;

                ArrayList npcs = new ArrayList();
                foreach (Mobile msg in World.Mobiles.Values)
                {
                    if (msg is EpicCharacter && msg.Name != "the Great Earth Serpent")
                    {
                        string tWorld = Worlds.GetMyWorld(msg.Map, msg.Location, msg.X, msg.Y);

                        if ((((EpicCharacter)msg).MyAlignment == "neutral" || ((EpicCharacter)msg).MyAlignment == "evil") && (m.Karma < 0 || ((PlayerMobile)m).KarmaLocked == true))
                        {
                            if (tWorld == "the Land of Sosaria")
                            {
                                npcs.Add(msg); c++;
                            }
                            else if (CharacterDatabase.GetDiscovered(m, tWorld))
                            {
                                npcs.Add(msg); c++;
                            }
                        }
                        else if ((((EpicCharacter)msg).MyAlignment == "neutral" || ((EpicCharacter)msg).MyAlignment == "good") && m.Karma >= 0)
                        {
                            if (tWorld == "the Land of Sosaria")
                            {
                                npcs.Add(msg); c++;
                            }
                            else if (CharacterDatabase.GetDiscovered(m, tWorld))
                            {
                                npcs.Add(msg); c++;
                            }
                        }
                        else
                        {
                            if (tWorld == "the Land of Sosaria")
                            {
                                npcs.Add(msg); c++;
                            }
                            else if (CharacterDatabase.GetDiscovered(m, tWorld))
                            {
                                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");
                        }

                        myHomeWorld           = Server.Misc.Worlds.GetMyWorld(WhoMap, WhoLoc, dude.MyX, dude.MyY);
                        envelope.ForWho       = dude.Name + " " + dude.Title;
                        envelope.ForWhere     = my_location;
                        envelope.ForAlignment = dude.MyAlignment;
                        alignment             = dude.MyAlignment;
                        DB.MessageQuest       = dude.Name;
                    }
                }

                PickSearchLocation(envelope, "No Dungeon Yet", m, alignment, myHomeWorld);

                m.AddToBackpack(envelope);
                m.PlaySound(0x249);
                SayTo(m, "Hmmm...I do have a message for you. Here you go.");
            }
        }