GetRandomLevel() public static méthode

public static GetRandomLevel ( ) : int
Résultat int
Exemple #1
0
        public override void Deserialize(GenericReader reader)
        {
            base.Deserialize(reader);

            int version = reader.ReadInt();

            switch (version)
            {
            case 4:
            case 3:
            case 2:
            {
                m_Level = reader.ReadInt();
                goto case 1;
            }

            case 1:
            {
                m_TargetMap      = reader.ReadMap();
                m_TargetLocation = reader.ReadPoint3D();
                m_MessageIndex   = reader.ReadInt();

                break;
            }

            case 0:
            {
                m_TargetMap = Map;

                if (m_TargetMap == null || m_TargetMap == Map.Internal)
                {
                    m_TargetMap = Map.Trammel;
                }

                m_TargetLocation = FindLocation(m_TargetMap);
                m_MessageIndex   = Utility.Random(MessageEntry.Entries.Length);

                break;
            }
            }

            if (version < 2)
            {
                m_Level = MessageInABottle.GetRandomLevel();
            }

            if (version < 3)
            {
                UpdateHue();
            }

            if (version < 4 && m_TargetMap == Map.Tokuno)
            {
                m_TargetMap = Map.Trammel;
            }
        }
Exemple #2
0
 public SOS(Map map)
     : this(map, MessageInABottle.GetRandomLevel())
 {
 }
Exemple #3
0
        public SOS(string world, int level) : base(0x14ED)
        {
            if (level < 1)
            {
                level = MessageInABottle.GetRandomLevel();
            }

            if (world == "the Town of Skara Brae")
            {
                world = "the Land of Sosaria";
            }                                                                                      // NO SOSs IN SKARA BRAE
            else if (world == "the Moon of Luna")
            {
                world = "the Land of Sosaria";
            }                                                                                     // NO SOSs ON THE MOON
            else if (world == "the Underworld")
            {
                world = "the Land of Sosaria";
            }                                                                                   // NO SOSs IN THE UNDERWORLD

            Weight = 1.0;

            Point3D loc = Worlds.GetRandomLocation(world, "sea");
            Map     map = Worlds.GetMyDefaultMap(world);

            MapWorld    = world;
            m_Level     = level;
            m_TargetMap = map;

            m_TargetLocation = loc;

            UpdateHue();

            ShipName = RandomThings.GetRandomShipName("", 0);

            string Beast = "a sea dragon";

            switch (Utility.Random(12))
            {
            case 0: Beast = "a gigantic monster"; break;

            case 1: Beast = "a sea hag"; break;

            case 2: Beast = "a leviathan"; break;

            case 3: Beast = "a sea dragon"; break;

            case 4: Beast = "a sea giant"; break;

            case 5: Beast = "a storm giant"; break;

            case 6: Beast = "a sea serpent"; break;

            case 7: Beast = "a demon of the sea"; break;

            case 8: Beast = "a rotting squid"; break;

            case 9: Beast = "a giant beast"; break;

            case 10: Beast = "a dragon turtle"; break;

            case 11: Beast = "a huge creature"; break;
            }

            if (IsAncient)
            {
                ShipStory = "This parchment is very old and almost crumbles in your hand. You know that whoever wrote this has been dead for possibly centuries, but it reads... ";
            }

            switch (Utility.Random(5))
            {
            case 0: ShipStory = ShipStory + "We were sailing in " + MapWorld + " when " + Beast + " rose from the depths of the ocean and attacked our ship! The hull has taken alot of damage and '" + ShipName + "' is slowly sinking into the depths of the sea! Whoever finds this, send a ship to the coordinates below! Hurry! I am not sure how long we will last out here!"; break;

            case 1: ShipStory = ShipStory + "If ya never seen " + Beast + " before, consider yerself lucky. There be little warning before they hit our ship, '" + ShipName + "', while sailing in " + MapWorld + ". We thought we hit a reef but we were wrong. It tore the ship apart. Only me and " + QuestCharacters.ParchmentWriter() + " managed to survive the onslaught of the beast. Now we sit here, on some island. The coordinates I last remember is where your ship went down. We may be close to there if you can send a ship. There be gold for payment if you do."; break;

            case 2: ShipStory = ShipStory + "I am writing this with my dying strength on board '" + ShipName + "'. " + QuestCharacters.ParchmentWriter() + " the Pirate came upon us in the night while far from land in " + MapWorld + ". We didn't stand a chance. We tried to outrun er but the wind was against us to be sure. He set our ship ablaze and fled off into the distance. Now we slowly sink into the ocean. If you find this, I wrote our coordinates below. You may still get here in time to save the others. If you can, tell " + QuestCharacters.ParchmentWriter() + " my tale so they never live wondering my fate. They live somewhere in " + RandomThings.GetRandomCity() + "."; break;

            case 3: ShipStory = ShipStory + "'" + ShipName + "' be sinking far from land. What we thought was a merchant ship was actually a war ship in disguise. They be hunting us pirates on the high seas in " + MapWorld + "...and today our luck ran out. Their cannons ripped through our sails, and tore holes in our hull. They killed most of the crew, where only " + Utility.RandomMinMax(3, 16) + " of us survived. They be gone now, but the sharks started circling the wreck. I just saw " + QuestCharacters.ParchmentWriter() + " being pulled below the waves, blood gushing up from below. I be on the largest piece of flotsam and can only hope I survive till ya get here."; break;

            case 4: ShipStory = ShipStory + "I knew " + QuestCharacters.ParchmentWriter() + " weren't no good at being a captain of '" + ShipName + "'. Now this probably be our end here in " + MapWorld + ". We be under attack by " + Beast + " and we have no chance of making it to " + RandomThings.GetRandomCity() + " now. I fear that me never see me wife again. If ye find this note, please find us before we sink. I have an ancient artifact I could trade for yer help."; break;
            }
        }