Example #1
0
        public static void FindTarget(Mobile m, int fee)
        {
            string searchLocation = "the Land of Sosaria";

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

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

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

            case 3:         searchLocation = "the Land of Lodoria";                 if (!(CharacterDatabase.GetDiscovered(m, "the Land of Lodoria")))
                {
                    searchLocation = "the Land of Sosaria";
                }
                break;

            case 4:         searchLocation = "the Land of Lodoria";                 if (!(CharacterDatabase.GetDiscovered(m, "the Land of Lodoria")))
                {
                    searchLocation = "the Land of Sosaria";
                }
                break;

            case 5:         searchLocation = "the Land of Lodoria";                 if (!(CharacterDatabase.GetDiscovered(m, "the Land of Lodoria")))
                {
                    searchLocation = "the Land of Sosaria";
                }
                break;

            case 6:         searchLocation = "the Serpent Island";                  if (!(CharacterDatabase.GetDiscovered(m, "the Serpent Island")))
                {
                    searchLocation = "the Land of Sosaria";
                }
                break;

            case 7:         searchLocation = "the Serpent Island";                  if (!(CharacterDatabase.GetDiscovered(m, "the Serpent Island")))
                {
                    searchLocation = "the Land of Sosaria";
                }
                break;

            case 8:         searchLocation = "the Serpent Island";                  if (!(CharacterDatabase.GetDiscovered(m, "the Serpent Island")))
                {
                    searchLocation = "the Land of Sosaria";
                }
                break;

            case 9:         searchLocation = "the Isles of Dread";                  if (!(CharacterDatabase.GetDiscovered(m, "the Isles of Dread")))
                {
                    searchLocation = "the Land of Sosaria";
                }
                break;

            case 10:        searchLocation = "the Savaged Empire";                  if (!(CharacterDatabase.GetDiscovered(m, "the Savaged Empire")))
                {
                    searchLocation = "the Land of Sosaria";
                }
                break;

            case 11:        searchLocation = "the Savaged Empire";                  if (!(CharacterDatabase.GetDiscovered(m, "the Savaged Empire")))
                {
                    searchLocation = "the Land of Sosaria";
                }
                break;

            case 12:        searchLocation = "the Island of Umber Veil";    if (!(CharacterDatabase.GetDiscovered(m, "the Island of Umber Veil")))
                {
                    searchLocation = "the Land of Sosaria";
                }
                break;

            case 13:        searchLocation = "the Bottle World of Kuldar";  if (!(CharacterDatabase.GetDiscovered(m, "the Bottle World of Kuldar")))
                {
                    searchLocation = "the Land of Sosaria";
                }
                break;

            case 14:        searchLocation = "the Underworld";                              if (!(CharacterDatabase.GetDiscovered(m, "the Underworld")))
                {
                    searchLocation = "the Underworld";
                }
                break;

            case 15:        searchLocation = "the Land of Ambrosia";                if (!(CharacterDatabase.GetDiscovered(m, "the Land of Ambrosia")))
                {
                    searchLocation = "the Land of Sosaria";
                }
                break;
            }

            int       aCount  = 0;
            Region    reg     = null;
            ArrayList targets = new ArrayList();

            foreach (Mobile target in World.Mobiles.Values)
            {
                if (target is BaseCreature)
                {
                    reg = Region.Find(target.Location, target.Map);
                    string tWorld = Worlds.GetMyWorld(target.Map, target.Location, target.X, target.Y);

                    if (target.EmoteHue != 123 && target.Karma < 0 && target.Fame < fee && (DifficultyLevel.GetDifficultyLevel(target.Location, target.Map) <= GetPlayerInfo.GetPlayerDifficulty(m)) && reg.IsPartOf(typeof(DungeonRegion)))
                    {
                        if (searchLocation == "the Land of Sosaria" && tWorld == searchLocation)
                        {
                            targets.Add(target); aCount++;
                        }
                        else if (searchLocation == "the Land of Lodoria" && tWorld == searchLocation)
                        {
                            targets.Add(target); aCount++;
                        }
                        else if (searchLocation == "the Serpent Island" && tWorld == searchLocation)
                        {
                            targets.Add(target); aCount++;
                        }
                        else if (searchLocation == "the Isles of Dread" && tWorld == searchLocation)
                        {
                            targets.Add(target); aCount++;
                        }
                        else if (searchLocation == "the Savaged Empire" && tWorld == searchLocation)
                        {
                            targets.Add(target); aCount++;
                        }
                        else if (searchLocation == "the Island of Umber Veil" && tWorld == searchLocation)
                        {
                            targets.Add(target); aCount++;
                        }
                        else if (searchLocation == "the Bottle World of Kuldar" && tWorld == searchLocation)
                        {
                            targets.Add(target); aCount++;
                        }
                        else if (searchLocation == "the Underworld" && tWorld == searchLocation)
                        {
                            targets.Add(target); aCount++;
                        }
                    }

                    if (aCount < 1)               // SAFETY CATCH IF IT FINDS NO CREATURES AT ALL...IT WILL FIND AT LEAST ONE IN SOSARIA //
                    {
                        if (target.Karma < 0 && target.Fame < fee && reg.IsPartOf(typeof(DungeonRegion)) && tWorld == "the Land of Sosaria")
                        {
                            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 (Utility.RandomMinMax(1, 2) == 1)                         // KILL SOMETHING
                    {
                        Mobile theone = ( Mobile )targets[i];
                        string kWorld = Worlds.GetMyWorld(theone.Map, theone.Location, theone.X, theone.Y);

                        string kexplorer = theone.GetType().ToString();
                        int    nFee      = theone.Fame / 5;
                        string kDollar   = ((int)((Server.Misc.DifficultyLevel.QuestRewardModifier() * 0.01) * nFee)).ToString();

                        string killName  = theone.Name;
                        string killTitle = theone.Title;
                        if (theone is Wyrms)
                        {
                            killName = "a wyrm"; killTitle = "";
                        }
                        if (theone is Dragons)
                        {
                            killName = "a dragon"; killTitle = "";
                        }
                        if (theone is BombWorshipper)
                        {
                            killName = "a worshipper of the bomb"; killTitle = "";
                        }
                        if (theone is Psionicist)
                        {
                            killName = "a psychic of the bomb"; killTitle = "";
                        }

                        string myexplorer = kexplorer + "#" + killTitle + "#" + killName + "#" + Server.Misc.Worlds.GetRegionName(theone.Map, theone.Location) + "#0#" + kDollar + "#" + kWorld + "#Monster";
                        CharacterDatabase.SetQuestInfo(m, "StandardQuest", myexplorer);

                        string theStory = myexplorer + "#" + StandardQuestFunctions.QuestSentence(m);                           // ADD THE STORY PART

                        CharacterDatabase.SetQuestInfo(m, "StandardQuest", theStory);
                    }
                    else                     // FIND SOMETHING
                    {
                        Mobile theone = ( Mobile )targets[i];
                        string kWorld = Worlds.GetMyWorld(theone.Map, theone.Location, theone.X, theone.Y);

                        string kexplorer = theone.GetType().ToString();
                        int    nFee      = theone.Fame / 3;
                        nFee = nFee / 100;
                        nFee = nFee * 100;
                        string kDollar = ((int)((Server.Misc.DifficultyLevel.QuestRewardModifier() * 0.01) * nFee)).ToString();

                        string ItemToFind = QuestCharacters.QuestItems();

                        string myexplorer = "##" + ItemToFind + "#" + Server.Misc.Worlds.GetRegionName(theone.Map, theone.Location) + "#0#" + kDollar + "#" + kWorld + "#Item";
                        CharacterDatabase.SetQuestInfo(m, "StandardQuest", myexplorer);

                        string theStory = myexplorer + "#" + StandardQuestFunctions.QuestSentence(m);                           // ADD THE STORY PART

                        CharacterDatabase.SetQuestInfo(m, "StandardQuest", theStory);
                    }
                }
            }
        }
Example #2
0
        public static void FindTarget(Mobile m, int fee)
        {
            PlayerMobile PC = (PlayerMobile)m;

            int PirateHunt = 0;
            int WorldPick  = Utility.RandomMinMax(0, 14);

            if (Utility.RandomMinMax(1, 8) == 1 && 4000 < fee)
            {
                PirateHunt = 1; WorldPick = Utility.RandomMinMax(0, 6);
            }

            string searchLocation = "the Land of Sosaria";

            switch (WorldPick)
            {
            case 0:         searchLocation = "the Land of Sosaria";                 break;

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

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

            case 3:         searchLocation = "the Land of Lodoria";                 if (!(CharacterDatabase.GetDiscovered(m, "the Land of Lodoria")))
                {
                    searchLocation = "the Land of Sosaria";
                }
                break;

            case 4:         searchLocation = "the Land of Lodoria";                 if (!(CharacterDatabase.GetDiscovered(m, "the Land of Lodoria")))
                {
                    searchLocation = "the Land of Sosaria";
                }
                break;

            case 5:         searchLocation = "the Land of Lodoria";                 if (!(CharacterDatabase.GetDiscovered(m, "the Land of Lodoria")))
                {
                    searchLocation = "the Land of Sosaria";
                }
                break;

            case 6:         searchLocation = "the Isles of Dread";                  if (!(CharacterDatabase.GetDiscovered(m, "the Isles of Dread")))
                {
                    searchLocation = "the Land of Sosaria";
                }
                break;

            case 7:         searchLocation = "the Serpent Island";                  if (!(CharacterDatabase.GetDiscovered(m, "the Serpent Island")))
                {
                    searchLocation = "the Land of Sosaria";
                }
                break;

            case 8:         searchLocation = "the Serpent Island";                  if (!(CharacterDatabase.GetDiscovered(m, "the Serpent Island")))
                {
                    searchLocation = "the Land of Sosaria";
                }
                break;

            case 9:         searchLocation = "the Serpent Island";                  if (!(CharacterDatabase.GetDiscovered(m, "the Serpent Island")))
                {
                    searchLocation = "the Land of Sosaria";
                }
                break;

            case 10:        searchLocation = "the Savaged Empire";                  if (!(CharacterDatabase.GetDiscovered(m, "the Savaged Empire")))
                {
                    searchLocation = "the Land of Sosaria";
                }
                break;

            case 11:        searchLocation = "the Savaged Empire";                  if (!(CharacterDatabase.GetDiscovered(m, "the Savaged Empire")))
                {
                    searchLocation = "the Land of Sosaria";
                }
                break;

            case 12:        searchLocation = "the Island of Umber Veil";    if (!(CharacterDatabase.GetDiscovered(m, "the Island of Umber Veil")))
                {
                    searchLocation = "the Land of Sosaria";
                }
                break;

            case 13:        searchLocation = "the Bottle World of Kuldar";  if (!(CharacterDatabase.GetDiscovered(m, "the Bottle World of Kuldar")))
                {
                    searchLocation = "the Land of Sosaria";
                }
                break;

            case 14:        searchLocation = "the Underworld";                              if (!(CharacterDatabase.GetDiscovered(m, "the Underworld")))
                {
                    searchLocation = "the Underworld";
                }
                break;
            }

            if (!(CharacterDatabase.GetDiscovered(m, "the Land of Sosaria")) && searchLocation == "the Land of Sosaria")
            {
                if (m.Skills.Cap == 11000)
                {
                    searchLocation = "the Savaged Empire";
                }
                else
                {
                    searchLocation = "the Land of Lodoria";
                }
            }

            int       aCount  = 0;
            Region    reg     = null;
            ArrayList targets = new ArrayList();

            foreach (Mobile target in World.Mobiles.Values)
            {
                if (target is BaseCreature)
                {
                    reg = Region.Find(target.Location, target.Map);

                    if (PirateHunt == 1)
                    {
                        if (searchLocation == "the Land of Sosaria")
                        {
                            if (target is PirateCaptain && reg.IsPartOf(typeof(PirateRegion)) && target.Map == Map.Sosaria && Worlds.GetMyWorld(target.Map, target.Location, target.X, target.Y) == searchLocation)
                            {
                                targets.Add(target); aCount++;
                            }
                        }
                        else if (searchLocation == "the Land of Lodoria")
                        {
                            if ((target is AncientLich || target is ElfPirateCaptain) && reg.IsPartOf(typeof(PirateRegion)) && target.Map == Map.Lodor && Worlds.GetMyWorld(target.Map, target.Location, target.X, target.Y) == searchLocation)
                            {
                                targets.Add(target); aCount++;
                            }
                        }
                        else if (searchLocation == "the Isles of Dread")
                        {
                            if (target is PirateCaptain && reg.IsPartOf(typeof(PirateRegion)) && target.Map == Map.IslesDread && Worlds.GetMyWorld(target.Map, target.Location, target.X, target.Y) == searchLocation)
                            {
                                targets.Add(target); aCount++;
                            }
                        }
                    }
                    else
                    {
                        if (searchLocation == "the Land of Sosaria")
                        {
                            if (SkipMe(target) == true && target.Karma < 0 && target.Fame < fee && target.WhisperHue == 999 && Server.Misc.Worlds.IsMainRegion(Server.Misc.Worlds.GetRegionName(target.Map, target.Location)) && target.Map == Map.Sosaria && Worlds.GetMyWorld(target.Map, target.Location, target.X, target.Y) == searchLocation)
                            {
                                targets.Add(target); aCount++;
                            }
                        }
                        else if (searchLocation == "the Land of Lodoria")
                        {
                            if (SkipMe(target) == true && target.Karma < 0 && target.Fame < fee && target.WhisperHue == 999 && Server.Misc.Worlds.IsMainRegion(Server.Misc.Worlds.GetRegionName(target.Map, target.Location)) && target.Map == Map.Lodor && Worlds.GetMyWorld(target.Map, target.Location, target.X, target.Y) == searchLocation)
                            {
                                targets.Add(target); aCount++;
                            }
                        }
                        else if (searchLocation == "the Serpent Island")
                        {
                            if (SkipMe(target) == true && target.Karma < 0 && target.Fame < fee && target.WhisperHue == 999 && Server.Misc.Worlds.IsMainRegion(Server.Misc.Worlds.GetRegionName(target.Map, target.Location)) && target.Map == Map.SerpentIsland && Worlds.GetMyWorld(target.Map, target.Location, target.X, target.Y) == searchLocation)
                            {
                                targets.Add(target); aCount++;
                            }
                        }
                        else if (searchLocation == "the Isles of Dread")
                        {
                            if (SkipMe(target) == true && target.Karma < 0 && target.Fame < fee && target.WhisperHue == 999 && Server.Misc.Worlds.IsMainRegion(Server.Misc.Worlds.GetRegionName(target.Map, target.Location)) && target.Map == Map.IslesDread && Worlds.GetMyWorld(target.Map, target.Location, target.X, target.Y) == searchLocation)
                            {
                                targets.Add(target); aCount++;
                            }
                        }
                        else if (searchLocation == "the Savaged Empire")
                        {
                            if (SkipMe(target) == true && target.Karma < 0 && target.Fame < fee && target.WhisperHue == 999 && Server.Misc.Worlds.IsMainRegion(Server.Misc.Worlds.GetRegionName(target.Map, target.Location)) && target.Map == Map.SavagedEmpire && Worlds.GetMyWorld(target.Map, target.Location, target.X, target.Y) == searchLocation)
                            {
                                targets.Add(target); aCount++;
                            }
                        }
                        else if (searchLocation == "the Island of Umber Veil")
                        {
                            if (SkipMe(target) == true && target.Karma < 0 && target.Fame < fee && target.WhisperHue == 999 && Server.Misc.Worlds.IsMainRegion(Server.Misc.Worlds.GetRegionName(target.Map, target.Location)) && target.Map == Map.Sosaria && Worlds.GetMyWorld(target.Map, target.Location, target.X, target.Y) == searchLocation)
                            {
                                targets.Add(target); aCount++;
                            }
                        }
                        else if (searchLocation == "the Bottle World of Kuldar")
                        {
                            if (SkipMe(target) == true && target.Karma < 0 && target.Fame < fee && target.WhisperHue == 999 && Server.Misc.Worlds.IsMainRegion(Server.Misc.Worlds.GetRegionName(target.Map, target.Location)) && target.Map == Map.Sosaria && Worlds.GetMyWorld(target.Map, target.Location, target.X, target.Y) == searchLocation)
                            {
                                targets.Add(target); aCount++;
                            }
                        }
                        else if (searchLocation == "the Underworld")
                        {
                            if (SkipMe(target) == true && target.Karma < 0 && target.Fame < fee && target.WhisperHue == 999 && Server.Misc.Worlds.IsMainRegion(Server.Misc.Worlds.GetRegionName(target.Map, target.Location)) && target.Map == Map.Underworld && Worlds.GetMyWorld(target.Map, target.Location, target.X, target.Y) == searchLocation)
                            {
                                targets.Add(target); aCount++;
                            }
                        }
                    }

                    if (aCount < 1)               // SAFETY CATCH IF IT FINDS NOT CREATURES AT ALL...IT WILL FIND AT LEAST ONE IN SOSARIA //
                    {
                        if (target.Karma < 0 && target.Fame < fee && target.WhisperHue == 999 && Server.Misc.Worlds.IsMainRegion(Server.Misc.Worlds.GetRegionName(target.Map, target.Location)) && target.Map == Map.Sosaria && Worlds.GetMyWorld(target.Map, target.Location, target.X, target.Y) == "the Land of Sosaria")
                        {
                            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 (Utility.RandomMinMax(1, 3) != 1)                         // KILL SOMETHING
                    {
                        Mobile theone = ( Mobile )targets[i];
                        string kWorld = Worlds.GetMyWorld(theone.Map, theone.Location, theone.X, theone.Y);

                        int    nFee      = theone.Fame / 2;
                        string kexplorer = theone.GetType().ToString();
                        string kDollar   = nFee.ToString();

                        string killName  = theone.Name;
                        string killTitle = theone.Title;
                        if (theone is Wyrms)
                        {
                            killName = "a wyrm"; killTitle = "";
                        }
                        if (theone is RidingDragon || theone is Dragons)
                        {
                            killName = "a dragon"; killTitle = "";
                        }
                        if (theone is Daemon)
                        {
                            killName = "a daemon"; killTitle = "";
                        }
                        if (theone is Balron)
                        {
                            killName = "a balron"; killTitle = "";
                        }

                        string myexplorer = kexplorer + "#" + killTitle + "#" + killName + "#the high seas#0#" + kDollar + "#" + kWorld + "#Monster";
                        string useTitle   = killTitle;

                        if (theone is AncientLich || theone is PirateCaptain || theone is ElfPirateCaptain)
                        {
                            Region argh = Region.Find(theone.Location, theone.Map);
                            nFee = (theone.Fame / 10) * 3;
                            if (nFee > 2000)
                            {
                                nFee = 2000;
                            }
                            int nLow = (int)(nFee * 0.75);
                            nFee       = (int)(Utility.RandomMinMax(nLow, nFee) * 10);
                            kDollar    = ((int)((Server.Misc.MyServerSettings.QuestRewardModifier() * 0.01) * nFee)).ToString();
                            useTitle   = argh.Name;
                            useTitle   = useTitle.Replace("the Waters of", "of");
                            myexplorer = kexplorer + "#" + useTitle + "#the Pirate Captain#the high seas#0#" + kDollar + "#" + kWorld + "#Monster";
                        }

                        CharacterDatabase.SetQuestInfo(m, "FishingQuest", myexplorer);

                        string theStory = myexplorer + "#" + FishingQuestFunctions.QuestSentence(PC);                           // ADD THE STORY PART

                        CharacterDatabase.SetQuestInfo(m, "FishingQuest", theStory);
                    }
                    else                     // FIND SOMETHING
                    {
                        Mobile theone = ( Mobile )targets[i];
                        string kWorld = Worlds.GetMyWorld(theone.Map, theone.Location, theone.X, theone.Y);

                        string kexplorer = theone.GetType().ToString();

                        int qFame = m.Fame;
                        if (qFame < 1000)
                        {
                            qFame = 1000;
                        }
                        else if (qFame > 10000)
                        {
                            qFame = 10000;
                        }

                        int nFee = (int)(((Utility.RandomMinMax(500, qFame) / 10) * 10) / 2);

                        string kDollar = ((int)((Server.Misc.MyServerSettings.QuestRewardModifier() * 0.01) * nFee)).ToString();

                        string ItemToFind = QuestCharacters.QuestItems(true);

                        string myexplorer = "##" + ItemToFind + "#the high seas#0#" + kDollar + "#" + kWorld + "#Item";
                        CharacterDatabase.SetQuestInfo(m, "FishingQuest", myexplorer);

                        string theStory = myexplorer + "#" + FishingQuestFunctions.QuestSentence(PC);                           // ADD THE STORY PART

                        CharacterDatabase.SetQuestInfo(m, "FishingQuest", theStory);
                    }
                }
            }
        }