Exemple #1
0
 public static void ConfigureAllThiefQuestItems()
 {
     foreach (Item item in World.Items.Values)
     {
         if (item is Coffer)
         {
             Coffer coffer = (Coffer)item;
             Server.Items.Coffer.SetupCoffer(coffer);
             if (coffer.CofferTown == null || coffer.CofferTown == "")
             {
                 Server.Items.Coffer.GetNearbyTown(coffer);
             }
         }
         else if (item is HayCrate)
         {
             HayCrate hay = (HayCrate)item;
             if (hay.HayTown == null || hay.HayTown == "")
             {
                 Server.Items.HayCrate.GetNearbyTown(hay);
             }
         }
         else if (item is HollowStump)
         {
             HollowStump stump = (HollowStump)item;
             if (stump.StumpTown == null || stump.StumpTown == "")
             {
                 Server.Items.HollowStump.GetNearbyTown(stump);
             }
         }
     }
 }
Exemple #2
0
        public static bool GetSnooper(Coffer coffer, Mobile from)
        {
            bool AlreadySnooped = false;

            if (coffer.CofferSnooperA == from)
            {
                AlreadySnooped = true;
            }
            else if (coffer.CofferSnooperB == from)
            {
                AlreadySnooped = true;
            }
            else if (coffer.CofferSnooperC == from)
            {
                AlreadySnooped = true;
            }
            else if (coffer.CofferSnooperD == from)
            {
                AlreadySnooped = true;
            }
            else if (coffer.CofferSnooperE == from)
            {
                AlreadySnooped = true;
            }

            return(AlreadySnooped);
        }
Exemple #3
0
        public static void SetupCoffer(Coffer coffer)
        {
            if ((coffer.Name).Contains(" coffer"))
            {
                coffer.CofferType = (coffer.Name).Replace(" coffer", "");
            }
            coffer.Name = "coffer";

            coffer.Hue = 0x6A5;
            if (Utility.RandomMinMax(0, 13) != 13)
            {
                coffer.Hue = Server.Misc.RandomThings.GetRandomWoodColor();
            }

            int money1 = 30;
            int money2 = 120;

            double w1 = money1 * (MyServerSettings.GetGoldCutRate() * .01);
            double w2 = money2 * (MyServerSettings.GetGoldCutRate() * .01);

            money1 = (int)w1;
            money2 = (int)w2;

            coffer.CofferGold     = Utility.RandomMinMax(money1, money2);
            coffer.CofferRobber   = "";
            coffer.CofferRobbed   = 0;
            coffer.CofferSnooperA = null;
            coffer.CofferSnooperB = null;
            coffer.CofferSnooperC = null;
            coffer.CofferSnooperD = null;
            coffer.CofferSnooperE = null;
        }
Exemple #4
0
 public static void AssignSnooper(Coffer coffer, Mobile from)
 {
     coffer.CofferSnooperE = coffer.CofferSnooperD;
     coffer.CofferSnooperD = coffer.CofferSnooperC;
     coffer.CofferSnooperC = coffer.CofferSnooperB;
     coffer.CofferSnooperB = coffer.CofferSnooperA;
     coffer.CofferSnooperA = from;
 }
Exemple #5
0
        public static void RunThis(bool DoAction)
        {
            ///// PLANT THE GARDENS //////////////////////////////////////
            Farms.PlantGardens();

            LoggingFunctions.LogServer("Done - Planting Gardens");

            ///// ADD RANDOM CITIZENS IN SETTLEMENTS /////////////////////
            Server.Mobiles.Citizen.PopulateCities();

            ///// RECONFIGURE SOME LAND SPAWNS AND OTHER ITEMS ///////////

            ArrayList spawns = new ArrayList();

            foreach (Item item in World.Items.Values)
            {
                if (item is PremiumSpawner)
                {
                    PremiumSpawner spawner = (PremiumSpawner)item;

                    if (spawner.SpawnID == 8888)
                    {
                        bool reconfigure = true;

                        foreach (NetState state in NetState.Instances)
                        {
                            Mobile m = state.Mobile;

                            if (m is PlayerMobile && m.InRange(spawner.Location, (spawner.HomeRange + 20)))
                            {
                                reconfigure = false;
                            }
                        }

                        if (reconfigure)
                        {
                            spawns.Add(item);
                        }
                    }
                }
                else if (item is Coffer)
                {
                    Coffer coffer = (Coffer)item;
                    Server.Items.Coffer.SetupCoffer(coffer);
                }
                else if (item is HayCrate || item is HollowStump)
                {
                    item.Stackable = false;
                }
            }

            for (int i = 0; i < spawns.Count; ++i)
            {
                PremiumSpawner spawners = ( PremiumSpawner )spawns[i];
                Server.Mobiles.PremiumSpawner.Reconfigure(spawners, DoAction);
            }
        }
Exemple #6
0
 public static void GetNearbyTown(Coffer coffer)
 {
     foreach (Mobile citizen in coffer.GetMobilesInRange(20))
     {
         if (citizen is BaseVendor)
         {
             coffer.CofferTown = Server.Misc.Worlds.GetRegionName(citizen.Map, citizen.Location);
         }
     }
 }
Exemple #7
0
        public static void RunThis(bool DoAction)
        {
            ArrayList spawns = new ArrayList();

            foreach (Item item in World.Items.Values)
            {
                if (item is PremiumSpawner)
                {
                    PremiumSpawner spawner = (PremiumSpawner)item;

                    if (spawner.SpawnID == 8888)
                    {
                        bool reconfigure = true;

                        foreach (NetState state in NetState.Instances)
                        {
                            Mobile m = state.Mobile;

                            if (m is PlayerMobile && m.InRange(spawner.Location, (spawner.HomeRange + 20)))
                            {
                                reconfigure = false;
                            }
                        }

                        if (reconfigure)
                        {
                            spawns.Add(item);
                        }
                    }
                }
                else if (item is Coffer)
                {
                    Coffer coffer = (Coffer)item;
                    Server.Items.Coffer.SetupCoffer(coffer);
                }
                else if (item is HayCrate || item is HollowStump)
                {
                    item.Stackable = false;
                }
            }

            for (int i = 0; i < spawns.Count; ++i)
            {
                PremiumSpawner spawners = ( PremiumSpawner )spawns[i];
                Server.Mobiles.PremiumSpawner.Reconfigure(spawners, DoAction);
            }
            Server.Items.WorkingSpots.PopulateVillages();
        }
Exemple #8
0
        public static void SetupNote(ThiefNote note, Mobile m)
        {
            note.Hue    = Utility.RandomList(0x95E, 0x95D, 0x95B, 0x952, 0x957, 0x94D, 0x944, 0x945, 0x940, 0x93D, 0xB79);
            note.ItemID = Utility.RandomList(0x2DD, 0x201A);

            note.NoteOwner = m;

            note.NoteItemCategory = "";
            note.NoteItem         = QuestCharacters.QuestItems(true);
            note.NoteItemGot      = 0;
            note.NoteItemPerson   = ContainerFunctions.GetOwner("Pilfer");
            note.NoteDeliverType  = Utility.RandomMinMax(1, 2);

            if (Utility.RandomBool())               // STEAL FROM TOWN
            {
                int    rewardMod      = 1;
                string searchLocation = "the Land of Sosaria";
                switch (Utility.RandomMinMax(0, 13))
                {
                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";                 rewardMod = 2;  if (!(CharacterDatabase.GetDiscovered(m, "the Land of Lodoria")))
                    {
                        searchLocation = "the Land of Sosaria";
                    }
                    break;

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

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

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

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

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

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

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

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

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

                case 13:        searchLocation = "the Bottle World of Kuldar";  rewardMod = 4;  if (!(CharacterDatabase.GetDiscovered(m, "the Bottle World of Kuldar")))
                    {
                        searchLocation = "the Land of Sosaria";
                    }
                    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";
                    }
                }

                if (searchLocation == "the Land of Sosaria")
                {
                    rewardMod = 1;
                }

                int       aCount  = 0;
                ArrayList targets = new ArrayList();
                foreach (Item target in World.Items.Values)
                {
                    if (target is Coffer && 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)
                    {
                        Item   finding = ( Item )targets[i];
                        Coffer coffer  = (Coffer)finding;
                        note.NoteItemArea     = coffer.CofferTown;
                        note.NoteItemCategory = coffer.CofferType;
                        note.NoteReward       = (rewardMod * 500) + (Utility.RandomMinMax(0, 10) * 50);
                        note.NoteReward       = (int)((Server.Misc.MyServerSettings.QuestRewardModifier() * 0.01) * note.NoteReward);
                    }
                }
            }
            else             // STEAL FROM DUNGEON
            {
                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;
                }

                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;
                ArrayList targets = new ArrayList();
                foreach (Item target in World.Items.Values)
                {
                    if (target is StealBase && 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)
                    {
                        Item finding = ( Item )targets[i];
                        note.NoteItemArea = Server.Misc.Worlds.GetRegionName(finding.Map, finding.Location);
                        int difficult = Server.Misc.Worlds.GetDifficultyLevel(finding.Location, finding.Map) + 2;
                        if (difficult < 2)
                        {
                            difficult = 2;
                        }
                        note.NoteReward = (difficult * 500) + (Utility.RandomMinMax(0, 10) * 50);
                    }
                }
            }

            string dropLocation = "the Land of Sosaria";

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

            int       dCount = 0;
            ArrayList drops  = new ArrayList();

            foreach (Item target in World.Items.Values)
            {
                if (((note.NoteDeliverType == 1 && target is HollowStump) || (note.NoteDeliverType == 2 && target is HayCrate)) && Worlds.GetMyWorld(target.Map, target.Location, target.X, target.Y) == dropLocation)
                {
                    drops.Add(target); dCount++;
                }
            }

            dCount = Utility.RandomMinMax(1, dCount);

            int sCount = 0;

            for (int i = 0; i < drops.Count; ++i)
            {
                sCount++;

                if (sCount == dCount)
                {
                    Item finding = ( Item )drops[i];

                    if (finding is HayCrate)
                    {
                        HayCrate hay = (HayCrate)finding;
                        note.NoteDeliverTo = hay.HayTown;
                    }
                    else if (finding is HollowStump)
                    {
                        HollowStump stump = (HollowStump)finding;
                        note.NoteDeliverTo = stump.StumpTown;
                    }
                }
            }

            string action = "recover";

            switch (Utility.RandomMinMax(0, 4))
            {
            case 0: action = "recover"; break;

            case 1: action = "steal"; break;

            case 2: action = "acquire"; break;

            case 3: action = "find"; break;

            case 4: action = "get"; break;
            }

            string drop = "drop";

            switch (Utility.RandomMinMax(0, 4))
            {
            case 0: drop = "leave"; break;

            case 1: drop = "place"; break;

            case 2: drop = "set"; break;

            case 3: drop = "put"; break;

            case 4: drop = "drop"; break;
            }

            string container = "crate of hay in";

            if (note.NoteDeliverType == 1)
            {
                container = "hollow stump near";
            }

            string location = note.NoteItemArea;

            if (note.NoteItemCategory != "" && note.NoteItemCategory != null)
            {
                location = "the " + note.NoteItemCategory + " in " + note.NoteItemArea;
            }

            note.NoteStory = note.NoteItemPerson + " wants you to " + action + " " + note.NoteItem + " from " + location + ".";
            note.NoteStory = note.NoteStory + " Once you have it, " + drop + " it in the " + container + " " + note.NoteDeliverTo + ".";
            note.NoteStory = note.NoteStory + " There you will also find your payment of " + note.NoteReward + " gold and instructions for your next job.";

            note.InvalidateProperties();
        }