Ejemplo n.º 1
0
        /// <summary>
        /// Starts the next world
        /// </summary>
        public static void GotoNextWorld(object nothing)
        {
            CurrentlyLoadedWorld++;

              if ((int)CurrentlyLoadedWorld >= Enum.GetNames(typeof(Worlds)).Length)
            CurrentlyLoadedWorld = Worlds.Splash;

              GotoWorld(CurrentlyLoadedWorld);
        }
Ejemplo n.º 2
0
 internal static String GetTextureName(Worlds.TileType tiletype)
 {
     switch (tiletype)
     {
         case Worlds.TileType.Ground:
         default:
             return TextureNames.GROUND;
         case Worlds.TileType.Wall:
             return TextureNames.WALL;
     }
 }
Ejemplo n.º 3
0
        public override bool OnMoveOver(Mobile m)
        {
            if (m is PlayerMobile)
            {
                string world = Worlds.GetMyWorld(m.Map, m.Location, m.X, m.Y);

                if (m is PlayerMobile && world == "the Bottle World of Kuldar" && !(Server.Items.CharacterDatabase.GetKeys(m, "VordoKey")))
                {
                    m.SendMessage("This magical gate doesn't seem to do anything.");
                }
                else if (Worlds.AllowEscape(m, m.Map, m.Location, m.X, m.Y) == false && Worlds.GetMyWorld(m.Map, m.Location, m.X, m.Y) != "the Bottle World of Kuldar")
                {
                    m.SendMessage("This magical gate doesn't seem to do anything.");
                }
                else if (Worlds.RegionAllowedRecall(m.Map, m.Location, m.X, m.Y) == false && Worlds.GetMyWorld(m.Map, m.Location, m.X, m.Y) != "the Land of Ambrosia" && Worlds.GetMyWorld(m.Map, m.Location, m.X, m.Y) != "the Bottle World of Kuldar")
                {
                    m.SendMessage("This magical gate doesn't seem to do anything.");
                }
                else
                {
                    Timer.DelayCall(TimeSpan.FromSeconds(0.5), (delegate
                    {
                        foreach (Mobile pet in World.Mobiles.Values)
                        {
                            if (pet is BaseCreature)
                            {
                                BaseCreature bc = (BaseCreature)pet;
                                if (bc.Controlled && bc.ControlMaster == m)
                                {
                                    pet.Hidden = true;
                                }
                            }
                        }
                        m.Hidden = true;
                    }));

                    m.PlaySound(0x20E);
                    m.CloseGump(typeof(MoonGateGump));
                    m.SendGump(new MoonGateGump(m, false));
                    m.SendMessage("Choose a destination.");
                }
            }
            return(true);
        }
Ejemplo n.º 4
0
        void ApplyTabWorlds()
        {
            if (rankNameList == null)
            {
                rankNameList = new BindingList <string> {
                    WorldListEntry.DefaultRankOption
                };
                foreach (Rank rank in RankManager.Ranks)
                {
                    rankNameList.Add(ToComboBoxOption(rank));
                }
                dgvcAccess.DataSource = rankNameList;
                dgvcBuild.DataSource  = rankNameList;
                dgvcBackup.DataSource = WorldListEntry.BackupEnumNames;

                LoadWorldList();
                dgvWorlds.DataSource = Worlds;
            }
            else
            {
                //dgvWorlds.DataSource = null;
                rankNameList.Clear();
                rankNameList.Add(WorldListEntry.DefaultRankOption);
                foreach (Rank rank in RankManager.Ranks)
                {
                    rankNameList.Add(ToComboBoxOption(rank));
                }
                foreach (WorldListEntry world in Worlds)
                {
                    world.ReparseRanks();
                }
                Worlds.ResetBindings();
                //dgvWorlds.DataSource = worlds;
            }

            FillRankList(cDefaultBuildRank, "(default rank)");
            if (ConfigKey.DefaultBuildRank.IsBlank())
            {
                cDefaultBuildRank.SelectedIndex = 0;
            }
            else
            {
                RankManager.DefaultBuildRank    = Rank.Parse(ConfigKey.DefaultBuildRank.GetString());
                cDefaultBuildRank.SelectedIndex = RankManager.GetIndex(RankManager.DefaultBuildRank);
            }

            if (IsDefaultMapPath(ConfigKey.MapPath.GetString()))
            {
                tMapPath.Text    = Paths.MapPathDefault;
                xMapPath.Checked = false;
            }
            else
            {
                tMapPath.Text    = ConfigKey.MapPath.GetString();
                xMapPath.Checked = true;
            }

            xWoMEnableEnvExtensions.Checked = ConfigKey.WoMEnableEnvExtensions.Enabled();

            tDefaultTerrain.Text = ConfigKey.DefaultTerrain.GetString();
        }
Ejemplo n.º 5
0
 public World FindWorld(string name)
 {
     return(Worlds.Find((x) => x.Name == name));
 }
Ejemplo n.º 6
0
        public static int GetBoardAvatar(Mobile m, Map map, Point3D location, int x, int y)
        {
            int face = 0x478;

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

            int mX     = 0;
            int mY     = 0;
            int mZ     = 0;
            Map mWorld = null;

            string sPublicDoor = DB.CharacterPublicDoor;

            if (sPublicDoor != null)
            {
                if (sPublicDoor.Length > 0)
                {
                    string[] sPublicDoors = sPublicDoor.Split('#');
                    int      nEntry       = 1;
                    foreach (string exits in sPublicDoors)
                    {
                        if (nEntry == 1)
                        {
                            mX = Convert.ToInt32(exits);
                        }
                        else if (nEntry == 2)
                        {
                            mY = Convert.ToInt32(exits);
                        }
                        else if (nEntry == 3)
                        {
                            mZ = Convert.ToInt32(exits);
                        }
                        else if (nEntry == 4)
                        {
                            try { mWorld = Map.Parse(exits); } catch {} if (mWorld == null)
                            {
                                mWorld = Map.Sosaria;
                            }
                        }
                        nEntry++;
                    }

                    location = new Point3D(mX, mY, mZ);
                    map      = mWorld;
                    x        = mX;
                    y        = mY;
                }
            }

            string world = Worlds.GetMyWorld(map, location, x, y);
            Region reg   = Region.Find(location, map);

            if (world == "the Bottle World of Kuldar")
            {
                face = 0x479;
            }
            else if (world == "the Land of Lodoria")
            {
                face = 0x4DC;
            }
            else if (world == "the Serpent Island")
            {
                face = 0x46A;
            }
            else if (world == "the Isles of Dread")
            {
                face = 0x469;
            }
            else if (world == "the Savaged Empire")
            {
                face = 0x468;
            }
            else if (world == "the Island of Umber Veil")
            {
                face = 0x4DD;
            }
            else if (world == "the Moon of Luna")
            {
                face = 0x47A;
            }
            else if (world == "the Underworld")
            {
                face = 0x4DE;
            }

            return(face);
        }
Ejemplo n.º 7
0
        public override void CraftInit(Mobile from)
        {
            Map map = from.Map;

            double skillValue = from.Skills[SkillName.Cartography].Value;
            int    dist = 0; int size = 0;

            MapWorld = Worlds.GetMyWorld(map, from.Location, from.X, from.Y);

            if (MapWorld == "the Land of Lodoria")
            {
                dist = 60 + (int)(skillValue * 4); size = 32 + (int)(skillValue * 2);
            }
            else if (MapWorld == "the Serpent Island")
            {
                dist = 50 + (int)(skillValue * 2); size = 32 + (int)(skillValue * 2);
            }
            else if (MapWorld == "the Savaged Empire")
            {
                dist = 40 + (int)(skillValue * 1.5); size = 32 + (int)(skillValue * 2);
            }
            else if (MapWorld == "the Isles of Dread")
            {
                dist = 40 + (int)(skillValue * 1.7); size = 32 + (int)(skillValue * 2);
            }
            else if (MapWorld == "the Land of Ambrosia")
            {
                dist = 40 + (int)(skillValue * 1.5); size = 32 + (int)(skillValue * 2);
            }
            else if (MapWorld == "the Bottle World of Kuldar")
            {
                dist = 40 + (int)(skillValue * 1.5); size = 32 + (int)(skillValue * 2);
            }
            else if (MapWorld == "the Island of Umber Veil")
            {
                dist = 40 + (int)(skillValue * 1.5); size = 32 + (int)(skillValue * 2);
            }
            else if (MapWorld == "the Moon of Luna")
            {
                dist = 40 + (int)(skillValue * 1.5); size = 32 + (int)(skillValue * 2);
            }
            else if (MapWorld == "the Underworld")
            {
                dist = 50 + (int)(skillValue * 2); size = 32 + (int)(skillValue * 2);
            }
            else
            {
                dist     = 60 + (int)(skillValue * 4); size = 32 + (int)(skillValue * 2);
                MapWorld = "the Land of Sosaria";
            }

            if (dist < 150)
            {
                dist = 150;
            }

            if (size < 200)
            {
                size = 200;
            }
            else if (size > 400)
            {
                size = 400;
            }

            SetDisplay(from.X - dist, from.Y - dist, from.X + dist, from.Y + dist, size, size, from.Map, from.X, from.Y);
        }
Ejemplo n.º 8
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;
            }
        }
Ejemplo n.º 9
0
 public override void OnAfterSpawn()
 {
     base.OnAfterSpawn();
     Worlds.MoveToRandomOcean(this);
 }
Ejemplo n.º 10
0
 public static IEnumerable <World> ListHaxOffWorlds()
 {
     return(Worlds.Where(world => !world.Hax));
 }
Ejemplo n.º 11
0
        public DeathKnightSpellbookGump(Mobile from, DeathKnightSpellbook book, int page) : base(100, 100)
        {
            m_Book = book;

            this.Closable   = true;
            this.Disposable = true;
            this.Dragable   = true;
            this.Resizable  = false;

            AddPage(0);
            AddImage(41, 42, 1100);

            int PriorPage = page - 1;

            if (PriorPage < 1)
            {
                PriorPage = 19;
            }
            int NextPage = page + 1;

            string sGrave = "";

            AddButton(115, 54, 1057, 1057, PriorPage, GumpButtonType.Reply, 0);
            AddButton(521, 54, 1058, 1058, NextPage, GumpButtonType.Reply, 0);

            AddHtml(172, 61, 345, 31, @"<BODY><BASEFONT Color=Black><BIG><CENTER>Death Magic                 Death Magic</CENTER></BIG></BASEFONT></BODY>", (bool)false, (bool)false);

            if (page == 1)
            {
                int    SpellsInBook = 14;
                int    SpellsListed = 749;
                string SpellName    = "";

                int nHTMLx = 146;
                int nHTMLy = 108;

                int nBUTTONx = 124;
                int nBUTTONy = 112;

                while (SpellsInBook > 0)
                {
                    SpellsInBook--;
                    SpellsListed++;

                    if (this.HasSpell(from, SpellsListed))
                    {
                        if (SpellsListed == 750)
                        {
                            SpellName = "Banish";
                        }
                        else if (SpellsListed == 751)
                        {
                            SpellName = "Demonic Touch";
                        }
                        else if (SpellsListed == 752)
                        {
                            SpellName = "Devil Pact";
                        }
                        else if (SpellsListed == 753)
                        {
                            SpellName = "Grim Reaper";
                        }
                        else if (SpellsListed == 754)
                        {
                            SpellName = "Hag Hand";
                        }
                        else if (SpellsListed == 755)
                        {
                            SpellName = "Hellfire";
                        }
                        else if (SpellsListed == 756)
                        {
                            SpellName = "Lucifer's Bolt";
                        }
                        else if (SpellsListed == 757)
                        {
                            SpellName = "Orb of Orcus";
                        }
                        else if (SpellsListed == 758)
                        {
                            SpellName = "Shield of Hate";
                        }
                        else if (SpellsListed == 759)
                        {
                            SpellName = "Soul Reaper";
                        }
                        else if (SpellsListed == 760)
                        {
                            SpellName = "Strength of Steel";
                        }
                        else if (SpellsListed == 761)
                        {
                            SpellName = "Strike";
                        }
                        else if (SpellsListed == 762)
                        {
                            SpellName = "Succubus Skin";
                        }
                        else if (SpellsListed == 763)
                        {
                            SpellName = "Wrath";
                        }

                        AddHtml(nHTMLx, nHTMLy, 182, 26, @"<BODY><BASEFONT Color=Black><BIG>" + SpellName + "</BIG></BASEFONT></BODY>", (bool)false, (bool)false);
                        AddButton(nBUTTONx, nBUTTONy, 30008, 30008, SpellsListed, GumpButtonType.Reply, 0);

                        nHTMLy = nHTMLy + 30;
                        if (SpellsInBook == 7)
                        {
                            nHTMLx = 382; nHTMLy = 108;
                        }

                        nBUTTONy = nBUTTONy + 30;
                        if (SpellsInBook == 7)
                        {
                            nBUTTONx = 360; nBUTTONy = 112;
                        }
                    }
                }
            }

            else if (page == 2)
            {
                sGrave = Worlds.GetAreaEntrance("Dungeon Despise", Map.Felucca);
                AddHtml(128, 99, 201, 223, @"<BODY><BASEFONT Color=Black><BIG>Banish<BR><BR>Souls: 56<BR><BR>Skill: 40<BR><BR>Mana: 36<BR><BR>Sir Oslan Knarren<BR>Land of Lodoria<BR>Dungeon Despise<BR>" + sGrave + "</BIG></BASEFONT></BODY>", (bool)false, (bool)false);
                AddHtml(361, 99, 201, 223, @"<BODY><BASEFONT Color=Black><BIG>Banish summoned creatures back to their realm, demons back to hell, or elementals back to their plane of existence.</BIG></BASEFONT></BODY>", (bool)false, (bool)false);
                AddImage(280, 102, 0x5010, 2405);
            }
            else if (page == 3)
            {
                sGrave = Worlds.GetAreaEntrance("Dungeon Doom", Map.Trammel);
                AddHtml(128, 99, 201, 223, @"<BODY><BASEFONT Color=Black><BIG>Demonic Touch<BR><BR>Souls: 21<BR><BR>Skill: 15<BR><BR>Mana: 16<BR><BR>Lady Kath of Naelex<BR>Land of Sosaria<BR>Dungeon Doom<BR>" + sGrave + "</BIG></BASEFONT></BODY>", (bool)false, (bool)false);
                AddHtml(361, 99, 201, 223, @"<BODY><BASEFONT Color=Black><BIG>The death knight's target is healed by demonic forces for a significant amount.</BIG></BASEFONT></BODY>", (bool)false, (bool)false);
                AddImage(280, 102, 0x5009, 2405);
            }
            else if (page == 4)
            {
                sGrave = Worlds.GetAreaEntrance("Dungeon Hythloth", Map.Felucca);
                AddHtml(128, 99, 201, 223, @"<BODY><BASEFONT Color=Black><BIG>Devil Pact<BR><BR>Souls: 98<BR><BR>Skill: 90<BR><BR>Mana: 60<BR><BR>Lord Khayven of Rax<BR>Land of Lodoria<BR>Dungeon Hythloth<BR>" + sGrave + "</BIG></BASEFONT></BODY>", (bool)false, (bool)false);
                AddHtml(361, 99, 201, 223, @"<BODY><BASEFONT Color=Black><BIG>Summons the devil to battle with the death knight.</BIG></BASEFONT></BODY>", (bool)false, (bool)false);
                AddImage(280, 102, 0x5005, 2405);
            }
            else if (page == 5)
            {
                sGrave = Worlds.GetAreaEntrance("City of the Dead", Map.Trammel);
                AddHtml(128, 99, 201, 223, @"<BODY><BASEFONT Color=Black><BIG>Grim Reaper<BR><BR>Souls: 42<BR><BR>Skill: 30<BR><BR>Mana: 28<BR><BR>Sir Farian of Lirtham<BR>Land of Ambrosia<BR>City of the Dead<BR>" + sGrave + "</BIG></BASEFONT></BODY>", (bool)false, (bool)false);
                AddHtml(361, 99, 201, 223, @"<BODY><BASEFONT Color=Black><BIG>The next target hit becomes marked by the grim reaper. All damage dealt to it is increased, but the death knight takes extra damage from other kinds of creatures.</BIG></BASEFONT></BODY>", (bool)false, (bool)false);
                AddImage(280, 102, 0x402, 2405);
            }
            else if (page == 6)
            {
                sGrave = Worlds.GetAreaEntrance("Ancient Pyramid", Map.Trammel);
                AddHtml(128, 99, 201, 223, @"<BODY><BASEFONT Color=Black><BIG>Hag Hand<BR><BR>Souls: 7<BR><BR>Skill: 5<BR><BR>Mana: 8<BR><BR>Saint Kargoth<BR>Land of Sosaria<BR>Ancient Pyramid<BR>" + sGrave + "</BIG></BASEFONT></BODY>", (bool)false, (bool)false);
                AddHtml(361, 99, 201, 223, @"<BODY><BASEFONT Color=Black><BIG>Your hand holds the powers of a hag, where it can remove curses from items and others.</BIG></BASEFONT></BODY>", (bool)false, (bool)false);
                AddImage(280, 102, 0x5002, 2405);
            }
            else if (page == 7)
            {
                sGrave = Worlds.GetAreaEntrance("Dungeon Shame", Map.Felucca);
                AddHtml(128, 99, 201, 223, @"<BODY><BASEFONT Color=Black><BIG>Hellfire<BR><BR>Souls: 84<BR><BR>Skill: 70<BR><BR>Mana: 52<BR><BR>Duke Urkar of Torquann<BR>Land of Lodoria<BR>Dungeon Shame<BR>" + sGrave + "</BIG></BASEFONT></BODY>", (bool)false, (bool)false);
                AddHtml(361, 99, 201, 223, @"<BODY><BASEFONT Color=Black><BIG>The death knights's enemy is scorched by a hellfire that continues to burn the enemy for a short duration.</BIG></BASEFONT></BODY>", (bool)false, (bool)false);
                AddImage(280, 102, 0x3E9, 2405);
            }
            else if (page == 8)
            {
                sGrave = Worlds.GetAreaEntrance("Dungeon Exodus", Map.Trammel);
                AddHtml(128, 99, 201, 223, @"<BODY><BASEFONT Color=Black><BIG>Lucifer's Bolt<BR><BR>Souls: 35<BR><BR>Skill: 25<BR><BR>Mana: 24<BR><BR>Sir Maeril of Naelax<BR>Land of Sosaria<BR>Dungeon Exodus<BR>" + sGrave + "</BIG></BASEFONT></BODY>", (bool)false, (bool)false);
                AddHtml(361, 99, 201, 223, @"<BODY><BASEFONT Color=Black><BIG>Calls down a bolt of energy from Lucifer himself, and temporarily stuns the enemy.</BIG></BASEFONT></BODY>", (bool)false, (bool)false);
                AddImage(280, 102, 0x5DC0, 2405);
            }
            else if (page == 9)
            {
                sGrave = Worlds.GetAreaEntrance("the City of Embers", Map.Felucca);
                AddHtml(128, 99, 201, 223, @"<BODY><BASEFONT Color=Black><BIG>Orb of Orcus<BR><BR>Souls: 200<BR><BR>Skill: 80<BR><BR>Mana: 56<BR><BR>Sir Luren the Boar<BR>Land of Lodoria<BR>the City of Embers<BR>" + sGrave + "</BIG></BASEFONT></BODY>", (bool)false, (bool)false);
                AddHtml(361, 99, 201, 223, @"<BODY><BASEFONT Color=Black><BIG>The forces of Orcus surround the knight and refelec a certain amount of magical effects back at the caster.</BIG></BASEFONT></BODY>", (bool)false, (bool)false);
                AddImage(280, 102, 0x1B, 2405);
            }
            else if (page == 10)
            {
                sGrave = Worlds.GetAreaEntrance("Lodoria Catacombs", Map.Felucca);
                AddHtml(128, 99, 201, 223, @"<BODY><BASEFONT Color=Black><BIG>Shield of Hate<BR><BR>Souls: 77<BR><BR>Skill: 60<BR><BR>Mana: 48<BR><BR>Sir Minar of Darmen<BR>Land of Lodoria<BR>Lodoria Catacombs<BR>" + sGrave + "</BIG></BASEFONT></BODY>", (bool)false, (bool)false);
                AddHtml(361, 99, 201, 223, @"<BODY><BASEFONT Color=Black><BIG>Channels hatred to form a barrier around the target, shielding them from physical harm.</BIG></BASEFONT></BODY>", (bool)false, (bool)false);
                AddImage(280, 102, 0x3EE, 2405);
            }
            else if (page == 11)
            {
                sGrave = Worlds.GetAreaEntrance("Dungeon Deceit", Map.Felucca);
                AddHtml(128, 99, 201, 223, @"<BODY><BASEFONT Color=Black><BIG>Soul Reaper<BR><BR>Souls: 63<BR><BR>Skill: 45<BR><BR>Mana: 40<BR><BR>Sir Rezinar of Haxx<BR>Land of Lodoria<BR>Dungeon Deceit<BR>" + sGrave + "</BIG></BASEFONT></BODY>", (bool)false, (bool)false);
                AddHtml(361, 99, 201, 223, @"<BODY><BASEFONT Color=Black><BIG>Drains the enemy of their soul, reducing their mana for a short period of time.</BIG></BASEFONT></BODY>", (bool)false, (bool)false);
                AddImage(280, 102, 0x5006, 2405);
            }
            else if (page == 12)
            {
                sGrave = Worlds.GetAreaEntrance("Fires of Hell", Map.Trammel);
                AddHtml(128, 99, 201, 223, @"<BODY><BASEFONT Color=Black><BIG>Strength of Steel<BR><BR>Souls: 28<BR><BR>Skill: 20<BR><BR>Mana: 20<BR><BR>Prince Myrhal of Rax<BR>Land of Sosaria<BR>Fires of Hell<BR>" + sGrave + "</BIG></BASEFONT></BODY>", (bool)false, (bool)false);
                AddHtml(361, 99, 201, 223, @"<BODY><BASEFONT Color=Black><BIG>Greatly increases the target's strength for a short period.</BIG></BASEFONT></BODY>", (bool)false, (bool)false);
                AddImage(280, 102, 0x2B, 2405);
            }
            else if (page == 13)
            {
                sGrave = Worlds.GetAreaEntrance("Dungeon Clues", Map.Trammel);
                AddHtml(128, 99, 201, 223, @"<BODY><BASEFONT Color=Black><BIG>Strike<BR><BR>Souls: 14<BR><BR>Skill: 10<BR><BR>Mana: 12<BR><BR>Lord Monduiz Dephaar<BR>Land of Sosaria<BR>Dungeon Clues<BR>" + sGrave + "</BIG></BASEFONT></BODY>", (bool)false, (bool)false);
                AddHtml(361, 99, 201, 223, @"<BODY><BASEFONT Color=Black><BIG>The death knight's enemy is damaged by a demonic energy from the nine hells.</BIG></BASEFONT></BODY>", (bool)false, (bool)false);
                AddImage(280, 102, 0x12, 2405);
            }
            else if (page == 14)
            {
                sGrave = Worlds.GetAreaEntrance("Catacomb", Map.Trammel);
                AddHtml(128, 99, 201, 223, @"<BODY><BASEFONT Color=Black><BIG>Succubus Skin<BR><BR>Souls: 49<BR><BR>Skill: 35<BR><BR>Mana: 32<BR><BR>Lord Androma of Gara<BR>Island of Umber Veil<BR>Catacomb<BR>" + sGrave + "</BIG></BASEFONT></BODY>", (bool)false, (bool)false);
                AddHtml(361, 99, 201, 223, @"<BODY><BASEFONT Color=Black><BIG>The death knight's target has their skin regenerate health over time.</BIG></BASEFONT></BODY>", (bool)false, (bool)false);
                AddImage(280, 102, 0x500C, 2405);
            }
            else if (page == 15)
            {
                sGrave = Worlds.GetAreaEntrance("Dungeon Wrong", Map.Felucca);
                AddHtml(128, 99, 201, 223, @"<BODY><BASEFONT Color=Black><BIG>Wrath<BR><BR>Souls: 70<BR><BR>Skill: 50<BR><BR>Mana: 44<BR><BR>Lord Thyrian of Naelax<BR>Land of Lodoria<BR>Dungeon Wrong<BR>" + sGrave + "</BIG></BASEFONT></BODY>", (bool)false, (bool)false);
                AddHtml(361, 99, 201, 223, @"<BODY><BASEFONT Color=Black><BIG>The death knight unleashes the forces of hell unto his nearby enemies, causing much damage.</BIG></BASEFONT></BODY>", (bool)false, (bool)false);
                AddImage(280, 102, 0x2E, 2405);
            }

            else if (page == 16)
            {
                AddHtml(128, 99, 201, 223, @"<BODY><BASEFONT Color=Black><BIG>In order to learn the ways of the Death Knight, you must master the art of Chivalry while spreading evil deeds throughout the land, avoiding Karmic influences. One must seek out the 14 Disciple Knights of Kas, and learn the power they each mastered. Find their resting places, speak their names, and claim their</BIG></BASEFONT></BODY>", (bool)false, (bool)false);
                AddHtml(361, 99, 201, 223, @"<BODY><BASEFONT Color=Black><BIG>skulls which contains the knowledge they had. Placing the skulls onto this book will increase its spell potential, but be quick about it. Anyone that calls forth their skull will cause it to appear no matter where it is in the land, taking it from another that may possess it. You will need the power of souls to use such magic.</BIG></BASEFONT></BODY>", (bool)false, (bool)false);
            }
            else if (page == 17)
            {
                AddHtml(128, 99, 201, 223, @"<BODY><BASEFONT Color=Black><BIG>Find humanoid creatures like brigands, orcs, titans, goblins, or trolls...those that carry gold, and slay them while holding the lantern in your left hand. Although their gold will turn to dust, your lantern will increase in power that will drain as you use this magic. You do not need to hold the lantern while unleashing this power,</BIG></BASEFONT></BODY>", (bool)false, (bool)false);
                AddHtml(361, 99, 201, 223, @"<BODY><BASEFONT Color=Black><BIG>but only when collecting souls. The lantern does not need to be in your possession either, as death magic will claim the souls from the lantern wherever it is. Magic from lower reagent properties can affect the amount of souls needed to invoke the magic. Although most magic relies on your Chivalry skill alone, there</BIG></BASEFONT></BODY>", (bool)false, (bool)false);
            }
            else if (page == 18)
            {
                AddHtml(128, 99, 201, 223, @"<BODY><BASEFONT Color=Black><BIG>are also some elements that will have greater effect the lower your Karma is. Go forth Death Knight, and bring our order back to this world.<br><br>Magic Toolbars: Here are the commands you can use (include the bracket) to manage magic toolbars that might help you play better.</BIG></BASEFONT></BODY>", (bool)false, (bool)false);
                AddHtml(361, 99, 201, 223, @"<BODY><BASEFONT Color=Black><BIG>[deathspell1 - Opens the 1st death knight spell bar editor.<br>[deathspell2 - Opens the 2nd death knight spell bar editor.<br><br><br>[deathtool1 - Opens the 1st death knight spell bar.<br>[deathtool2 - Opens the 2nd death knight spell bar.</BIG></BASEFONT></BODY>", (bool)false, (bool)false);
            }
            else if (page == 19)
            {
                AddHtml(128, 99, 201, 223, @"<BODY><BASEFONT Color=Black><BIG>[deathclose1 - Closes the 1st death knight spell bar.<br>[deathclose2 - Closes the 2nd death knight spell bar.</BIG></BASEFONT></BODY>", (bool)false, (bool)false);
                AddHtml(361, 99, 201, 223, @"<BODY><BASEFONT Color=Black><BIG>Beware, Death Knight. Powerful Death Knights are often not tolerated in the city streets and may be attacked on site.</BIG></BASEFONT></BODY>", (bool)false, (bool)false);
            }
        }
Ejemplo n.º 12
0
 public ref T GetComponent <T>() where T : struct => ref Worlds.GetComponent <T>(WorldId, Id);
Ejemplo n.º 13
0
 public bool HasComponent <T>() where T : struct => Worlds.HasComponent <T>(WorldId, Id);
Ejemplo n.º 14
0
 public void RemoveComponent <T>() where T : struct => Worlds.RemoveComponent <T>(WorldId, Id);
Ejemplo n.º 15
0
 public void AddComponent <T>() where T : struct => Worlds.AddComponent <T>(WorldId, Id);
Ejemplo n.º 16
0
 /// <summary>
 /// Gets a texture.
 /// </summary>
 /// <param name="tiletype">The type of tile to get the texture of.</param>
 /// <returns>The requested texture.</returns>
 public static Texture2D GetTexture(Worlds.TileType tiletype)
 {
     return GetTexture(GetTextureName(tiletype));
 }
Ejemplo n.º 17
0
 public static Color[,] GetColors(Worlds.TileType tiletype)
 {
     return GetColors(GetTextureName(tiletype));
 }
Ejemplo n.º 18
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.");
            }
        }
Ejemplo n.º 19
0
 public World FindWorld(string name)
 {
     return(Worlds.Find((World x) => {
         return x.Name == name;
     }));
 }
Ejemplo n.º 20
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.º 21
0
 private void Coords_VillageSelected(object sender, Worlds.Events.Impls.VillageEventArgs e)
 {
     if (!_settingControlValues)
     {
         Plan.Target = e.FirstVillage;
         SetControlProperties();
         World.Default.Map.EventPublisher.AttackUpdateTarget(this, AttackUpdateEventArgs.Update());
     }
 }
Ejemplo n.º 22
0
        public void Effect(Point3D loc, Map map, bool checkMulti)
        {
            if (!map.CanSpawnMobile(loc.X, loc.Y, loc.Z))
            {
                Caster.SendLocalizedMessage(501942);                   // That location is blocked.
            }
            else if (Worlds.AllowEscape(Caster, Caster.Map, Caster.Location, Caster.X, Caster.Y) == false)
            {
                Caster.SendMessage("That spell does not seem to work in this place.");
            }
            else if (Worlds.RegionAllowedRecall(Caster.Map, Caster.Location, Caster.X, Caster.Y) == false)
            {
                Caster.SendMessage("That potion does not seem to work in this place.");
            }
            else if (Worlds.RegionAllowedTeleport(map, loc, loc.X, loc.Y) == false)
            {
                Caster.SendMessage("The destination seems magically unreachable with this potion.");
            }
            else if ((checkMulti && SpellHelper.CheckMulti(loc, map)))
            {
                Caster.SendLocalizedMessage(501942);                   // That location is blocked.
            }
            else if (CheckSequence())
            {
                Caster.SendMessage("You open a mystical portal in a mushroom circle");                   // You open a magical gate to another location

                Effects.PlaySound(Caster.Location, Caster.Map, 0x1);
                int          mushx;
                int          mushy;
                int          mushz;
                InternalItem firstGatea = new InternalItem(loc, map);
                mushx             = Caster.X;
                mushy             = Caster.Y;
                mushz             = Caster.Z;
                firstGatea.ItemID = 0xD10;
                Point3D mushxyz = new Point3D(mushx, mushy, mushz);
                firstGatea.MoveToWorld(mushxyz, Caster.Map);
                InternalItem firstGateb = new InternalItem(loc, map);
                mushx             = Caster.X;
                mushy             = Caster.Y;
                firstGateb.ItemID = 0x373A;
                mushz             = Caster.Z + 1;
                Point3D mushxyza = new Point3D(mushx, mushy, mushz);
                firstGateb.MoveToWorld(mushxyza, Caster.Map);
                InternalItem firstGatec = new InternalItem(loc, map);
                mushx             = Caster.X - 1;
                firstGatec.ItemID = 0xD11;
                mushy             = Caster.Y + 1;
                mushz             = Caster.Z;
                Point3D mushxyzb = new Point3D(mushx, mushy, mushz);
                firstGatec.MoveToWorld(mushxyzb, Caster.Map);
                InternalItem firstGated = new InternalItem(loc, map);
                firstGated.ItemID = 0xD0C;
                mushx             = Caster.X;
                mushy             = Caster.Y + 2;
                mushz             = Caster.Z;
                Point3D mushxyzc = new Point3D(mushx, mushy, mushz);
                firstGated.MoveToWorld(mushxyzc, Caster.Map);
                InternalItem firstGatee = new InternalItem(loc, map);
                mushx             = Caster.X + 1;
                firstGatee.ItemID = 0xD0D;
                mushy             = Caster.Y + 1;
                mushz             = Caster.Z;
                Point3D mushxyzd = new Point3D(mushx, mushy, mushz);
                firstGatee.MoveToWorld(mushxyzd, Caster.Map);
                InternalItem firstGatef = new InternalItem(loc, map);
                firstGatef.ItemID = 0xD0E;
                mushx             = Caster.X + 2;
                mushy             = Caster.Y;
                mushz             = Caster.Z;
                Point3D mushxyze = new Point3D(mushx, mushy, mushz);
                firstGatef.MoveToWorld(mushxyze, Caster.Map);
                InternalItem firstGateg = new InternalItem(loc, map);
                mushx             = Caster.X + 1;
                firstGateg.ItemID = 0xD0F;
                mushy             = Caster.Y - 1;
                mushz             = Caster.Z;
                Point3D mushxyzf = new Point3D(mushx, mushy, mushz);
                firstGateg.MoveToWorld(mushxyzf, Caster.Map);

                if (Worlds.RegionAllowedTeleport(Caster.Map, Caster.Location, Caster.X, Caster.Y) == true)
                {
                    Effects.PlaySound(loc, map, 0x1);
                    InternalItem secondGatea = new InternalItem(Caster.Location, Caster.Map);
                    mushx = loc.X;
                    mushy = loc.Y;
                    mushz = loc.Z;
                    secondGatea.ItemID = 0xD10;
                    Point3D mushaxyz = new Point3D(mushx, mushy, mushz);
                    secondGatea.MoveToWorld(mushaxyz, map);
                    InternalItem secondGateb = new InternalItem(Caster.Location, Caster.Map);
                    mushx = loc.X;
                    mushy = loc.Y;
                    secondGateb.ItemID = 0x373A;
                    mushz = loc.Z + 1;
                    Point3D mushaxyza = new Point3D(mushx, mushy, mushz);
                    secondGateb.MoveToWorld(mushaxyza, map);
                    InternalItem secondGatec = new InternalItem(Caster.Location, Caster.Map);
                    mushx = loc.X - 1;
                    secondGatec.ItemID = 0xD11;
                    mushy = loc.Y + 1;
                    mushz = loc.Z - 1;
                    Point3D mushaxyzb = new Point3D(mushx, mushy, mushz);
                    secondGatec.MoveToWorld(mushaxyzb, map);
                    InternalItem secondGated = new InternalItem(Caster.Location, Caster.Map);
                    mushx = loc.X;
                    mushy = loc.Y + 2;
                    secondGated.ItemID = 0xD0C;
                    mushz = loc.Z;
                    Point3D mushaxyzc = new Point3D(mushx, mushy, mushz);
                    secondGated.MoveToWorld(mushaxyzc, map);
                    InternalItem secondGatee = new InternalItem(Caster.Location, Caster.Map);
                    mushx = loc.X + 1;
                    mushy = loc.Y + 1;
                    mushz = loc.Z;
                    secondGatee.ItemID = 0xD0D;
                    Point3D mushaxyzd = new Point3D(mushx, mushy, mushz);
                    secondGatee.MoveToWorld(mushaxyzd, map);
                    InternalItem secondGatef = new InternalItem(Caster.Location, Caster.Map);
                    mushx = loc.X + 2;
                    mushy = loc.Y;
                    mushz = loc.Z;
                    secondGatef.ItemID = 0xD0E;
                    Point3D mushaxyze = new Point3D(mushx, mushy, mushz);
                    secondGatef.MoveToWorld(mushaxyze, map);
                    InternalItem secondGateg = new InternalItem(Caster.Location, Caster.Map);
                    mushx = loc.X + 1;
                    secondGateg.ItemID = 0xD0F;
                    mushy = loc.Y - 1;
                    mushz = loc.Z;
                    Point3D mushaxyzf = new Point3D(mushx, mushy, mushz);
                    secondGateg.MoveToWorld(mushaxyzf, map);
                }
            }

            FinishSequence();
        }
Ejemplo n.º 23
0
 public override void OnAfterSpawn()
 {
     base.OnAfterSpawn();
     this.Location = Worlds.GetRandomLocation(Worlds.GetMyWorld(this.Map, this.Location, this.X, this.Y), "land");
 }
Ejemplo n.º 24
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();
            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 (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.DifficultyLevel.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;
                }

                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.DifficultyLevel.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;
            }

            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();
        }
Ejemplo n.º 25
0
 public World FindWorld(int id)
 {
     return(Worlds.Find((x) => x._id == id));
 }
Ejemplo n.º 26
0
        void LoadWorldList()
        {
            if (Worlds.Count > 0)
            {
                Worlds.Clear();
            }
            if (!File.Exists(Paths.WorldListFileName))
            {
                return;
            }

            try {
                XDocument doc  = XDocument.Load(Paths.WorldListFileName);
                XElement  root = doc.Root;
                if (root == null)
                {
                    MessageBox.Show("Worlds.xml is empty or corrupted.");
                    return;
                }

                string errorLog = "";
                using (LogRecorder logRecorder = new LogRecorder()) {
                    foreach (XElement el in root.Elements("World"))
                    {
                        try {
                            Worlds.Add(new WorldListEntry(el));
                        } catch (Exception ex) {
                            errorLog += ex + Environment.NewLine;
                        }
                    }
                    if (logRecorder.HasMessages)
                    {
                        MessageBox.Show(logRecorder.MessageString, "World list loading warnings.");
                    }
                }
                if (errorLog.Length > 0)
                {
                    MessageBox.Show(
                        "Some errors occurred while loading the world list:" + Environment.NewLine + errorLog,
                        "Warning");
                }

                FillWorldList();
                XAttribute mainWorldAttr = root.Attribute("main");
                if (mainWorldAttr != null)
                {
                    foreach (WorldListEntry world in Worlds)
                    {
                        if (world.Name.ToLower() == mainWorldAttr.Value.ToLower())
                        {
                            cMainWorld.SelectedItem = world.Name;
                            break;
                        }
                    }
                }
            } catch (Exception ex) {
                MessageBox.Show("Error occurred while loading the world list: " + Environment.NewLine + ex, "Warning");
            }

            Worlds.ListChanged += SomethingChanged;
        }
Ejemplo n.º 27
0
        public void Parse(Internal.CommunicationStream message)
        {
            if (OpenTibiaUnity.GameManager.ClientVersion >= 1010)
            {
                byte worlds = message.ReadUnsignedByte();
                for (int i = 0; i < worlds; i++)
                {
                    var world = new World {
                        _id      = message.ReadUnsignedByte(),
                        Name     = message.ReadString(),
                        HostName = message.ReadString(),
                        Port     = message.ReadUnsignedShort(),
                        Preview  = message.ReadBoolean()
                    };
                    Worlds.Add(world);
                }

                byte characters = message.ReadUnsignedByte();
                for (int i = 0; i < characters; i++)
                {
                    Character character = new Character {
                        WorldId = message.ReadUnsignedByte(),
                        Name    = message.ReadString()
                    };
                    Characters.Add(character);
                }
            }
            else
            {
                byte characters = message.ReadUnsignedByte();
                for (int i = 0; i < characters; i++)
                {
                    var characterName = message.ReadString();
                    var worldName     = message.ReadString();
                    var worldIpLong   = message.ReadUnsignedInt();
                    var worldPort     = message.ReadUnsignedShort();

                    var world     = GetOrCreateWorld(worldName, worldIpLong, worldPort);
                    var character = new Character {
                        Name    = characterName,
                        WorldId = world._id
                    };
                    Characters.Add(character);
                }
            }

            uint now = (uint)System.DateTime.Now.Second;

            if (OpenTibiaUnity.GameManager.ClientVersion >= 1077)
            {
                AccountState     = message.ReadUnsignedByte();
                IsPremium        = message.ReadBoolean();
                PremiumTimeStamp = message.ReadUnsignedInt();
                if (PremiumTimeStamp > now)
                {
                    PremiumDays = (ushort)((PremiumTimeStamp - now) / 86400U);
                }
                else
                {
                    PremiumDays = 0;
                }

                InfinitePremium = (IsPremium && PremiumTimeStamp == 0);
            }
            else
            {
                AccountState = 0;
                PremiumDays  = message.ReadUnsignedShort();
                if (PremiumDays > 0)
                {
                    PremiumTimeStamp = now + PremiumDays * 86400U;
                }
                else
                {
                    PremiumTimeStamp = 0;
                }

                IsPremium       = PremiumDays > 0;
                InfinitePremium = PremiumDays == 65535;
            }
        }
Ejemplo n.º 28
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;
            }

            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);
                    string tWorld = Worlds.GetMyWorld(target.Map, target.Location, target.X, target.Y);

                    if (target.EmoteHue != 123 && target.Karma < 0 && target.Fame < fee && (Worlds.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.MyServerSettings.QuestRewardModifier() * 0.01) * nFee)).ToString();

                        string killName  = theone.Name;
                        string killTitle = theone.Title;
                        if (theone is Wyrms)
                        {
                            killName = "a wyrm"; killTitle = "";
                        }
                        if (theone is Daemon)
                        {
                            killName = "a daemon"; killTitle = "";
                        }
                        if (theone is Balron)
                        {
                            killName = "a balron"; killTitle = "";
                        }
                        if (theone is RidingDragon || 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.MyServerSettings.QuestRewardModifier() * 0.01) * nFee)).ToString();

                        string ItemToFind = QuestCharacters.QuestItems(true);

                        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);
                    }
                }
            }
        }
Ejemplo n.º 29
0
 public override void OnAfterSpawn()
 {
     base.OnAfterSpawn();
     Worlds.MoveToRandomDungeon(this);
     Server.Misc.IntelligentAction.BurnAway(this);
 }
Ejemplo n.º 30
0
 public static int CountLoadedWorlds()
 {
     return(Worlds.Count(world => world.IsLoaded));
 }
Ejemplo n.º 31
0
        public static string GetGateName(int gate, Mobile m)
        {
            PlayerMobile pm = (PlayerMobile)m;

            string world = Worlds.GetMyWorld(m.Map, m.Location, m.X, m.Y);

            string sGate = "";

            if (world == "the Bottle World of Kuldar" && !(CharacterDatabase.GetDiscovered(m, "the Bottle World of Kuldar")))
            {
            }
            else if (gate == 1 && CharacterDatabase.GetDiscovered(m, "the Land of Sosaria"))
            {
                sGate = "Sosaria - Central";
            }
            else if (gate == 2 && CharacterDatabase.GetDiscovered(m, "the Land of Sosaria"))
            {
                sGate = "Sosaria - Clues";
            }
            else if (gate == 3 && CharacterDatabase.GetDiscovered(m, "the Land of Sosaria"))
            {
                sGate = "Sosaria - Devil Guard";
            }
            else if (gate == 4 && CharacterDatabase.GetDiscovered(m, "the Land of Sosaria"))
            {
                sGate = "Sosaria - East";
            }
            else if (gate == 5 && CharacterDatabase.GetDiscovered(m, "the Land of Sosaria"))
            {
                sGate = "Sosaria - Frozen Isles";
            }
            else if (gate == 6 && CharacterDatabase.GetDiscovered(m, "the Land of Sosaria"))
            {
                sGate = "Sosaria - Lost Glade";
            }
            else if (gate == 7 && CharacterDatabase.GetDiscovered(m, "the Land of Sosaria"))
            {
                sGate = "Sosaria - Montor";
            }
            else if (gate == 8 && CharacterDatabase.GetDiscovered(m, "the Land of Sosaria"))
            {
                sGate = "Sosaria - Moon";
            }
            else if (gate == 9 && CharacterDatabase.GetDiscovered(m, "the Land of Sosaria"))
            {
                sGate = "Sosaria - West";
            }
            else if (gate == 10 && CharacterDatabase.GetDiscovered(m, "the Land of Sosaria"))
            {
                sGate = "Sosaria - Yew";
            }

            else if (gate == 11 && CharacterDatabase.GetDiscovered(m, "the Land of Ambrosia"))
            {
                sGate = "Isle of Fire";
            }
            else if (gate == 12 && CharacterDatabase.GetDiscovered(m, "the Island of Umber Veil"))
            {
                sGate = "Lost Isle";
            }

            else if (gate == 13 && CharacterDatabase.GetDiscovered(m, "the Land of Ambrosia"))
            {
                sGate = "Land of Ambrosia";
            }
            else if (gate == 14 && CharacterDatabase.GetDiscovered(m, "the Island of Umber Veil"))
            {
                sGate = "Island of Umber Veil";
            }
            else if (gate == 15 && CharacterDatabase.GetDiscovered(m, "the Isles of Dread"))
            {
                sGate = "Isles of Dread";
            }

            else if (gate == 16 && CharacterDatabase.GetDiscovered(m, "the Land of Lodoria"))
            {
                sGate = "Lodoria - Greensky";
            }
            else if (gate == 17 && CharacterDatabase.GetDiscovered(m, "the Land of Lodoria"))
            {
                sGate = "Lodoria - Islegem";
            }
            else if (gate == 18 && CharacterDatabase.GetDiscovered(m, "the Land of Lodoria"))
            {
                sGate = "Lodoria - Portshine";
            }
            else if (gate == 19 && CharacterDatabase.GetDiscovered(m, "the Land of Lodoria"))
            {
                sGate = "Lodoria - South";
            }
            else if (gate == 20 && CharacterDatabase.GetDiscovered(m, "the Land of Lodoria"))
            {
                sGate = "Lodoria - Springvale";
            }
            else if (gate == 21 && CharacterDatabase.GetDiscovered(m, "the Land of Lodoria"))
            {
                sGate = "Lodoria - Whisper";
            }
            else if (gate == 22 && CharacterDatabase.GetDiscovered(m, "the Land of Lodoria"))
            {
                sGate = "Lodoria - Winterlands";
            }

            else if (gate == 23 && CharacterDatabase.GetDiscovered(m, "the Serpent Island"))
            {
                sGate = "Serpent Island - North";
            }
            else if (gate == 24 && CharacterDatabase.GetDiscovered(m, "the Serpent Island"))
            {
                sGate = "Serpent Island - South";
            }
            else if (gate == 25 && CharacterDatabase.GetDiscovered(m, "the Serpent Island"))
            {
                sGate = "Serpent Island - West";
            }

            else if (gate == 26 && CharacterDatabase.GetDiscovered(m, "the Savaged Empire"))
            {
                sGate = "Savaged Empire - North";
            }
            else if (gate == 27 && CharacterDatabase.GetDiscovered(m, "the Savaged Empire"))
            {
                sGate = "Savaged Empire - South";
            }
            else if (gate == 28 && CharacterDatabase.GetDiscovered(m, "the Savaged Empire"))
            {
                sGate = "Savaged Empire - West";
            }

            else if (gate == 29 && CharacterDatabase.GetDiscovered(m, "the Bottle World of Kuldar"))
            {
                sGate = "Bottle World of Kuldar";
            }
            else if (gate == 30 && CharacterDatabase.GetDiscovered(m, "the Bottle World of Kuldar"))
            {
                sGate = "Black Knight's Vault";
            }

            return(sGate);
        }
Ejemplo n.º 32
0
 public static IEnumerable <World> ListLoadedWorlds()
 {
     return(Worlds.Where(world => world.IsLoaded));
 }
Ejemplo n.º 33
0
        public override void OnDoubleClick(Mobile from)
        {
            bool inCombat = (from.Combatant != null && from.InRange(from.Combatant.Location, 20) && from.Combatant.InLOS(from));

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

            int CanUseTent = 0;

            if (from.Skills[SkillName.Camping].Value < 40)
            {
                from.SendMessage("You must be a novice explorer to use this tent.");
                return;
            }
            else if (from.Region.IsPartOf(typeof(PublicRegion)))
            {
                from.SendMessage("This is a really nice camping tent.");
                return;
            }
            else if (Server.Misc.Worlds.IsOnBoat(from))
            {
                from.SendMessage("You cannot setup this tent near a boat.");
                return;
            }
            else if (Server.Misc.Worlds.IsOnSpaceship(from.Location, from.Map))
            {
                from.SendMessage("You don't have anywhere to setup camp in this strange place.");
                return;
            }
            else if (inCombat)
            {
                from.SendMessage("You cannot setup a tent while in combat.");
                return;
            }
            else if ((from.Region.IsPartOf(typeof(BardDungeonRegion)) || from.Region.IsPartOf(typeof(DungeonRegion))) && from.Skills[SkillName.Camping].Value >= 90)
            {
                CanUseTent = 1;
            }
            else if (from.Skills[SkillName.Camping].Value < 90 &&
                     !Server.Misc.Worlds.IsMainRegion(Server.Misc.Worlds.GetRegionName(from.Map, from.Location)) &&
                     !from.Region.IsPartOf(typeof(OutDoorRegion)) &&
                     !from.Region.IsPartOf(typeof(OutDoorBadRegion)) &&
                     !from.Region.IsPartOf(typeof(VillageRegion)))
            {
                from.SendMessage("You are only skilled enough to use this tent outdoors.");
                return;
            }
            else if (from.Skills[SkillName.Camping].Value >= 90 &&
                     !from.Region.IsPartOf(typeof(DungeonRegion)) &&
                     !from.Region.IsPartOf(typeof(BardDungeonRegion)) &&
                     !Server.Misc.Worlds.IsMainRegion(Server.Misc.Worlds.GetRegionName(from.Map, from.Location)) &&
                     !from.Region.IsPartOf(typeof(OutDoorRegion)) &&
                     !from.Region.IsPartOf(typeof(OutDoorBadRegion)) &&
                     !from.Region.IsPartOf(typeof(VillageRegion)))
            {
                from.SendMessage("You can only use this tent outdoors or in dungeons.");
                return;
            }
            else
            {
                CanUseTent = 1;
            }

            if (CanUseTent > 0 && from.CheckSkill(SkillName.Camping, 0.0, 125.0))
            {
                if (IsChildOf(from.Backpack) && Charges > 0)
                {
                    from.CheckSkill(SkillName.Camping, 0, 125);
                    from.CheckSkill(SkillName.Camping, 0, 125);
                    from.CheckSkill(SkillName.Camping, 0, 125);
                    ConsumeCharge(from);

                    PlayerMobile pc    = (PlayerMobile)from;
                    string       sX    = from.X.ToString();
                    string       sY    = from.Y.ToString();
                    string       sZ    = from.Z.ToString();
                    string       sMap  = Worlds.GetMyMapString(from.Map);
                    string       sZone = "the Camping Tent";
                    if (from.Region.IsPartOf(typeof(DungeonRegion)) || from.Region.IsPartOf(typeof(BardDungeonRegion)))
                    {
                        sZone = "the Dungeon Room";
                    }

                    string doors = sX + "#" + sY + "#" + sZ + "#" + sMap + "#" + sZone;

                    DB.CharacterPublicDoor = doors;

                    Point3D loc = new Point3D(3709, 3974, 0);
                    if (from.Region.IsPartOf(typeof(DungeonRegion)))
                    {
                        loc = new Point3D(3686, 3330, 0);
                    }
                    else if (from.Region.IsPartOf(typeof(BardDungeonRegion)))
                    {
                        loc = new Point3D(3686, 3330, 0);
                    }
                    else if (from.Skills[SkillName.Camping].Value > 66)
                    {
                        loc = new Point3D(3790, 3966, 0);
                    }

                    TentTeleport(from, loc, Map.Sosaria, 0x057, sZone, "enter");
                    return;
                }
                else if (from.InRange(this.GetWorldLocation(), 3) && Charges > 0)
                {
                    from.CheckSkill(SkillName.Camping, 0, 125);
                    from.CheckSkill(SkillName.Camping, 0, 125);
                    from.CheckSkill(SkillName.Camping, 0, 125);
                    ConsumeCharge(from);

                    PlayerMobile pc    = (PlayerMobile)from;
                    string       sX    = from.X.ToString();
                    string       sY    = from.Y.ToString();
                    string       sZ    = from.Z.ToString();
                    string       sMap  = Worlds.GetMyMapString(from.Map);
                    string       sZone = "the Camping Tent";
                    if (from.Region.IsPartOf(typeof(DungeonRegion)) || from.Region.IsPartOf(typeof(BardDungeonRegion)))
                    {
                        sZone = "the Dungeon Room";
                    }

                    string doors = sX + "#" + sY + "#" + sZ + "#" + sMap + "#" + sZone;

                    DB.CharacterPublicDoor = doors;

                    Point3D loc = new Point3D(3709, 3974, 0);
                    if (from.Region.IsPartOf(typeof(DungeonRegion)))
                    {
                        loc = new Point3D(3686, 3330, 0);
                    }
                    else if (from.Region.IsPartOf(typeof(BardDungeonRegion)))
                    {
                        loc = new Point3D(3686, 3330, 0);
                    }
                    else if (from.Skills[SkillName.Camping].Value > 66)
                    {
                        loc = new Point3D(3790, 3966, 0);
                    }

                    InternalItem builtTent = new InternalItem();
                    builtTent.Name = "camping tent";
                    PublicDoor publicTent = (PublicDoor)builtTent;
                    publicTent.m_PointDest = loc;
                    publicTent.m_MapDest   = Map.Sosaria;
                    builtTent.MoveToWorld(this.Location, this.Map);
                    from.AddToBackpack(this);

                    TentTeleport(from, loc, Map.Sosaria, 0x057, sZone, "enter");
                    return;
                }
                else if (!from.InRange(this.GetWorldLocation(), 3) && Charges > 0)
                {
                    from.SendLocalizedMessage(502138);                       // That is too far away for you to use
                    return;
                }
                else
                {
                    from.SendMessage("This tent is too worn from over use, and is no longer of any good.");
                    this.Delete();
                    return;
                }
            }
            else if (CanUseTent > 0)
            {
                from.SendMessage("Your tent is a bit more worn out as you fail to set it up properly.");
                from.CheckSkill(SkillName.Camping, 0, 125);
                from.CheckSkill(SkillName.Camping, 0, 125);
                from.CheckSkill(SkillName.Camping, 0, 125);
                ConsumeCharge(from);

                if (Charges < 1)
                {
                    from.SendMessage("This tent is too worn from over use, and is no longer of any good.");
                    this.Delete();
                    return;
                }

                return;
            }
        }
Ejemplo n.º 34
0
      //-------------------------------------------------------------------
      // starts up mario with the menu, if a specific amount of time passes
      // the demo will play until the user presses any key and stops the demo
      //-------------------------------------------------------------------
      public static void Intro()
      {
         int i = 0, j = 0;
         Status = Statuses.ST_NONE;
         Statuses OldStatus = Statuses.ST_NONE;
         Statuses LastStatus = Statuses.ST_NONE;
         string[] Menu = new String[5];
         uint[,] BG = new uint[FormMarioPort.MAX_PAGE + 1, 5];

         //nested procedures
         Page = (byte)FormMarioPort.formRef.CurrentPage();
         Status = Statuses.ST_NONE;
         TestVGAMode = false;
         GameNumber = -1;
         NextNumPlayers = Buffers.data.numPlayers;

         do //until IntroDone and (not TestVGAMode);
         {
            //if(FormMarioPort.formRef.TestVGAMode)
            //   FormMarioPort.InitVGA();
            TestVGAMode = false;
            IntroDone = false;
            NewData();

            Play.PlayWorld('0', '0', Worlds.Intro_0(), Worlds.Options_0(), Worlds.Options_0(),
                    Worlds.Intro_0(), Worlds.Options_0(), Worlds.Options_0(), Buffers.plMario);
            BackGr.InitBackGr(3, 0);

            //Palettes.OutPalette(0xA0, 35, 45, 50);
            //Palettes.OutPalette(0xA1, 45, 55, 60);

            //Palettes.OutPalette(0xEF, 30, 40, 30);
            //Palettes.OutPalette(0x18, 10, 15, 25);

            //Palettes.OutPalette(0x8D, 28, 38, 50);
            //Palettes.OutPalette(0x8F, 40, 50, 63);

            //for(int i = 1; i < 50; i++)
            //   Palettes.BlinkPalette();

            for(int p = 0; p < FormMarioPort.MAX_PAGE; p++)
            {
               for( i = 1; i >= 0; i--)
                  for( j = 1; j >= 0; j--)
                     for(int k = 1; k >= 0; k--)
                     {
                        FormMarioPort.formRef.DrawImage(38 + i + j, 29 + i + k, 108, 28, Resources.INTRO_000);
                        FormMarioPort.formRef.DrawImage(159 + i + j, 29 + i + k, 24, 28, Resources.INTRO_001);
                        FormMarioPort.formRef.DrawImage(198 + i + j, 29 + i + k, 84, 28, Resources.INTRO_002);
                     }
               BackGr.DrawBackGrMap(10 * Buffers.H + 6, 11 * Buffers.H - 1, 54, 0xA0);
               BackGr.DrawBackGrMap(10 * Buffers.H + 6, 11 * Buffers.H - 1, 55, 0xA1);
               BackGr.DrawBackGrMap(10 * Buffers.H + 6, 11 * Buffers.H - 1, 53, 0xA1);
               for( i = 0; i < Buffers.NH + 1; i++)
                  for( j = 0; j < Buffers.NV + 1; j++)
                     if((i == 0 || i == Buffers.NH - 1) || (j == 0 || j == Buffers.NV))
                        FormMarioPort.formRef.DrawImage(i * Buffers.W, j * Buffers.H, Buffers.W, Buffers.H, Resources.BLOCK_000);
               Players.DrawPlayer();

               FormMarioPort.formRef.PaintForm();
            }
            //UnlockPal();
            //Keyboard.Key = 0;
            //FadeUp(64);
            //ResetStack();

            //FillChar(BG, BG.Size(), 0);
            //FillChar(Menu, Menu.Size(), 0);
            //SetFont(0, Bold + Shadow);

            if(Status != Statuses.ST_OPTIONS)
            {
               OldStatus = Statuses.ST_NONE;
               LastStatus = Statuses.ST_NONE;
               Status = Statuses.ST_MENU;
               Selected = 1;
            }
            UpDate = true;
            Counter = 1;

            do //until IntroDone or (Counter = WAIT_BEFORE_DEMO);
            {
               if (UpDate || Status != OldStatus)
               {
                  if (Status != OldStatus)
                     Selected = 1;
                  switch (Status)
                  {
                     case Statuses.ST_MENU:
                        Menu[0] = "START";
                        Menu[1] = "OPTIONS";
                        Menu[2] = "END";
                        Menu[3] = "";
                        Menu[4] = "";
                        NumOptions = 3;
                        LastStatus = Statuses.ST_MENU;
                        break;
                     case Statuses.ST_OPTIONS:
                        if (Buffers.BeeperSound)
                           Menu[0] = "SOUND ON ";
                        else
                           Menu[0] = "SOUND OFF";
                        if (Play.Stat)
                           Menu[1] = "STATUSLINE OFF";
                        else
                           Menu[1] = "STATUSLINE OFF";
                        Menu[2] = "";
                        Menu[3] = "";
                        Menu[4] = "";
                        NumOptions = 2;
                        LastStatus = Statuses.ST_MENU;
                        break;
                     case Statuses.ST_START:
                        Menu[0] = "NO SAVE";
                        Menu[1] = "GAME SELECT";
                        Menu[2] = "ERASE";
                        Menu[3] = "";
                        Menu[4] = "";
                        NumOptions = 3;
                        LastStatus = Statuses.ST_MENU;
                        break;
                     case Statuses.ST_NUMPLAYERS:
                        Menu[0] = "ONE PLAYER";
                        Menu[1] = "TWO PLAYERS";
                        Menu[2] = "";
                        Menu[3] = "";
                        Menu[4] = "";
                        NumOptions = 3;
                        LastStatus = Statuses.ST_MENU;
                        break;
                     case Statuses.ST_LOAD:
                     case Statuses.ST_ERASE:
                        Menu[0] = "GAME #1 " + 7 + " ";
                        Menu[1] = "Game #2 " + 7 + " ";
                        Menu[2] = "Game #3 " + 7 + " ";
                        Menu[3] = "";
                        Menu[4] = "";

                        for ( i = 0; i < 3; i++)
                           if (Config.Games[i].progress[Buffers.plMario] == 0 &&
                              Config.Games[i].progress[Buffers.plLuigi] == 0)
                              Menu[i] = Menu[i] + "EMPTY";
                           else
                           {
                              m = Config.Games[i].progress[Buffers.plMario];
                              n = Convert.ToInt32((Config.Games[i].progress[CurPlayer] >= NUM_LEV));
                              if (n > 0)
                                 m -= NUM_LEV;
                              if (Config.Games[i].progress[Buffers.plLuigi] > m)
                              {
                                 m = Config.Games[i].progress[Buffers.plLuigi];
                                 Config.Games[i].progress[Buffers.plMario] = m;
                              }
                              Menu[i] = Menu[i] + "LEVEL " + (char)(m +
                                      Convert.ToInt32(Encoding.ASCII.GetBytes("0")) + 1) + " ";
                              if (n == 0)
                                 Menu[i] = Menu[i] + 7 + " ";
                              else
                                 Menu[i] = Menu[i] + "* ";
                              Menu[i] = Menu[i] + (char)(Config.Games[i].numPlayers +
                                      Convert.ToInt32(Encoding.ASCII.GetBytes("0"))) + 'P';
                           }
                        NumOptions = 3;
                        LastStatus = Statuses.ST_START;
                        break;
                     default:
                        break;
                  }
                  wd = 0;
                  xp = 0;

                  for ( i = 0; i < 5; i++)
                  {
                      j = TXT.TextWidth(Menu[i]);
                     if (j > wd)
                     {
                        wd = j;
                        //xp = CenterX(Menu[i]) / 4 * 4;
                     }
                     ht = 8;
                  }
                  OldStatus = Status;
                  UpDate = false;
               }
               MacroKey = '0';
               
                  if ( Keyboard.kbEsc)
                     if (Status == Statuses.ST_MENU)
                     {
                        IntroDone = true;
                        Buffers.QuitGame = true;
                     }
                     else
                        Status = LastStatus;

                  if ( Keyboard.kbUpArrow )
                     Up();

                  if ( Keyboard.kbDownArrow )
                     Down();

                  if ( Keyboard.kbSP || Keyboard.kbEnter )
                     switch (Status)
                     {
                        case Statuses.ST_MENU:
                           switch (Selected)
                           {
                              case 1:
                                 Status = Statuses.ST_START;
                                 break;
                              case 2:
                                 Status = Statuses.ST_OPTIONS;
                                 break;
                              case 3:
                                 IntroDone = true;
                                 Buffers.QuitGame = true;
                                 break;
                           }
                           break;
                        case Statuses.ST_START:
                           switch (Selected)
                           {
                              case 1:
                                 Status = Statuses.ST_NUMPLAYERS;
                                 break;
                              case 2:
                                 Status = Statuses.ST_LOAD;
                                 break;
                              case 3:
                                 Status = Statuses.ST_ERASE;
                                 break;
                           }
                           break;
                        case Statuses.ST_OPTIONS:
                           switch (Selected)
                           {
                              case 1:
                                 if (Buffers.BeeperSound)
                                    Buffers.BeeperOff();
                                 else
                                    Buffers.BeeperOn();
                                 break;
                              case 2:
                                 Play.Stat = !Play.Stat;
                                 break;
                           }
                           break;
                        case Statuses.ST_NUMPLAYERS:
                           switch (Selected)
                           {
                              case 1:
                                 NextNumPlayers = 1;
                                 IntroDone = true;
                                 break;
                              case 2:
                                 NextNumPlayers = 2;
                                 IntroDone = true;
                                 break;
                           }
                           break;
                        case Statuses.ST_LOAD:
                           GameNumber = Selected - 1;
                           Config.Games[GameNumber].numPlayers = 1;
                           if (Config.Games[GameNumber].progress[Buffers.plMario] == 0 &&
                                    Config.Games[GameNumber].progress[Buffers.plLuigi] == 0)
                              Status = Statuses.ST_NUMPLAYERS;
                           else
                           {
                              IntroDone = true;
                              NextNumPlayers = Config.Games[GameNumber].numPlayers;
                           }
                           break;
                        case Statuses.ST_ERASE:
                           NewData();
                           Config.Games[Selected - 1] = Buffers.data;
                           Config.Games[Selected - 1].numPlayers = 1;
                           GameNumber = -1;
                           break;
                     }

               //if(Keyboard.Key != 0)
               //{
               //   Counter = 0;
               //   Keyboard.Key = MacroKey;
               //   UpDate = true;
               //}

               for(int k = 0; k < 5; k++)
               {
                  if(BG[Page, k] != 0)
                     FormMarioPort.formRef.PopBackGr((ushort)BG[Page, k]);
               }

               for(int k = 0; k < 5; k++)
               {
                  if(Menu[k] != "")
                  {
                     m = xp;
                     n = 56 + 14 * k;
                     BG[Page, k] = FormMarioPort.formRef.PushBackGr(50, j, 220, ht);
                     if (k == Selected)
                        ;//TXT.WriteText(i - 12, j, 16, 5);
                     l = 15;
                     if(Menu[k].Length > 19 && Menu[k][10] == '*')
                        //l := 14 + (Counter and 1);
                        l = 14 + (Counter & l);
                     //SetPalette(14, 63, 61, 31);
                     //TXT.WriteText(i + 8, j, Menu[k], l);
                  }
               }
               // ShowPage
               //Palettes.BlinkPalette();

               System.Threading.Thread.Sleep(10);
               Counter++;
            } while(!IntroDone && Counter != WAIT_BEFORE_DEMO);

            //FadeDown(64);

            if(!IntroDone)
               Demo();
         } while(!IntroDone || TestVGAMode);

         if(GameNumber != -1)
            Buffers.data = Config.Games[GameNumber];

         Config.Games[Config.Games.Length - 1].numPlayers = NextNumPlayers;
      }
Ejemplo n.º 35
0
        public void LoadScreen(Worlds screen)
        {
            try
              {
            // Deregister events
            if (CurrentWorld != null)
              CurrentWorld.DeregisterEvents();

            switch (screen)
            {
              case Worlds.None:
            // Do nothing
            break;
              case Worlds.Splash:
            CurrentWorld = new Splash.World();
            break;
              case Worlds.Title:
            CurrentWorld = new Title2.World();
            break;
              case Worlds.SaveGame:
            CurrentWorld = new SaveGame2.World();
            break;
              case Worlds.CharacterSelect:
            CurrentWorld = new CharacterSelect.World();
            break;
              case Worlds.WhaleSelect:
            CurrentWorld = new WhaleSelect.World();
            break;
              case Worlds.SolarSystem:
            CurrentWorld = new SolarSystem3.World();
            break;
              case Worlds.Planet:
            CurrentWorld = new Planet4.World();
            break;
              case Worlds.Warp:
            CurrentWorld = new Warp.World();
            break;
              case Worlds.Combat:
            CurrentWorld = new Combat.World();
            break;
              case Worlds.Whale:
            // TODO: CurrentWorld = new WhaleScreen.World();
            // GO TO the next one because this world doesn't exist
            CurrentWorld = new EndCredits.World();
            break;
              case Worlds.EndCredits:
            CurrentWorld = new EndCredits.World();
            break;
              default:
            // Do nothing
            break;
            }

            CurrentlyLoadedWorld = screen;
            NextWorld = Worlds.None;
              }
              catch (Exception e)
              {
            Game1.Trace(this, "Load ERROR: " + e.Message);
              }
        }
Ejemplo n.º 36
0
      //-------------------------------------------------------------------
      // main function to drive the program, will determine if the game should
      // start in the menu or start up a world. after deciding that will initialize
      // the appropriate values 
      // finally, when the user either dies or quits the game, it will
      // clear all the buffers and stop the program.
      //-------------------------------------------------------------------
      public static void main()
      {
         try
         {
            int level = -1;

            Buffers.data.numPlayers = 1;
            //ReadConfig(args);

#if DEBUG
            do
            {
#endif
               Players.InitPlayerFigures();
               Enemies.InitEnemyFigures();

               EndGame = false;

               if (MENU)
                  Intro();

               //Randomize();

               if (Buffers.data.numPlayers == 2)
                  if (Buffers.data.progress[Buffers.plMario] > Buffers.data.progress[Buffers.plLuigi])
                     Buffers.data.progress[Buffers.plLuigi] = Buffers.data.progress[Buffers.plMario];
                  else
                     Buffers.data.progress[Buffers.plMario] = Buffers.data.progress[Buffers.plLuigi];

               Buffers.data.lives[Buffers.plMario] = 3;
               Buffers.data.lives[Buffers.plLuigi] = 3;
               Buffers.data.coins[Buffers.plMario] = 0;
               Buffers.data.coins[Buffers.plLuigi] = 0;
               Buffers.data.score[Buffers.plMario] = 0;
               Buffers.data.score[Buffers.plLuigi] = 0;
               Buffers.data.mode[Buffers.plMario] = Buffers.mdSmall;
               Buffers.data.mode[Buffers.plLuigi] = Buffers.mdSmall;

               do //until EndGame or QuitGame 
               {
                  if (Buffers.data.numPlayers == 1)
                     Buffers.data.lives[Buffers.plLuigi] = 0;
                  for (CurPlayer = Buffers.plMario; CurPlayer < Buffers.data.numPlayers; CurPlayer++)
                  {
                     if (!(EndGame || Buffers.QuitGame))
                        if (Buffers.data.lives[CurPlayer] >= 1)
                        {
                           //Turbo = (ConfigData.Games[GameNumber].progress[CurPlayer] >= NUM_LEV);
                           if (Buffers.data.progress[CurPlayer] > LAST_LEV)
                              Buffers.data.progress[CurPlayer] = NUM_LEV;
#if MENU
      						ShowPlayerName (CurPlayer);
#endif

                           if (Keyboard.kb1)
                              level = 0;
                           else if (Keyboard.kb2)
                              level = 1;
                           else if (Keyboard.kb3)
                              level = 2;
                           else if (Keyboard.kb4)
                              level = 3;
                           else if (Keyboard.kb5)
                              level = 4;
                           else if (Keyboard.kb6)
                              level = 5;
                           //else if (level == -1) return;
                           else break;

                           //switch(Buffers.data.progress[CurPlayer] % NUM_LEV)
                           switch (level)
                           {
                              case 0:
                                 Passed = Play.PlayWorld('x', '1', Worlds.Level_1a(),
                                        Worlds.Options_1a(), Worlds.Opt_1a(),
                                        Worlds.Level_1b(), Worlds.Options_1b(),
                                        Worlds.Options_1b(), Convert.ToByte(CurPlayer));
                                 break;
                              case 1:
                                 Passed = Play.PlayWorld('x', '2', Worlds.Level_2a(),
                                        Worlds.Options_2a(), Worlds.Opt_2a(),
                                        Worlds.Level_2b(), Worlds.Options_2b(),
                                        Worlds.Options_2b(), Convert.ToByte(CurPlayer));
                                 break;
                              case 2:
                                 Passed = Play.PlayWorld('x', '3', Worlds.Level_3a(),
                                        Worlds.Options_3a(), Worlds.Opt_3a(),
                                        Worlds.Level_3b(), Worlds.Options_3b(),
                                        Worlds.Options_3b(), Convert.ToByte(CurPlayer));
                                 break;
                              case 3:
                                 Passed = Play.PlayWorld('x', '4', Worlds.Level_5a(),
                                        Worlds.Options_5a(), Worlds.Opt_5a(),
                                        Worlds.Level_5b(), Worlds.Options_5b(),
                                        Worlds.Options_5b(), Convert.ToByte(CurPlayer));
                                 break;
                              case 4:
                                 Passed = Play.PlayWorld('x', '5', Worlds.Level_6a(),
                                        Worlds.Options_6a(), Worlds.Opt_6a(),
                                        Worlds.Level_6b(), Worlds.Options_6b(),
                                        Worlds.Options_6b(), Convert.ToByte(CurPlayer));
                                 break;
                              case 5:
                                 Passed = Play.PlayWorld('x', '6', Worlds.Level_4a(),
                                         Worlds.Options_4a(), Worlds.Opt_4a(),
                                        Worlds.Level_4b(), Worlds.Options_4b(),
                                        Worlds.Options_4b(), Convert.ToByte(CurPlayer));
                                 break;
                              default:
                                 EndGame = true;
                                 break;
                           }
                           //Console.WriteLine("I want to play a world");
                           if (Passed)
                              Buffers.data.progress[CurPlayer]++;
                           if (Buffers.QuitGame)
                           {
                              EndGame = true;
#if MENU
      							QuitGame = false;
#endif
                           }
                        }
                  }
                  //FormMarioPort.formRef.Invalidate();
               } while (!(EndGame || Buffers.QuitGame || (Buffers.data.lives[Buffers.plMario] +
                  Buffers.data.lives[Buffers.plLuigi] == 0)));

               if (GameNumber != -1)
                  Config.Games[GameNumber] = Buffers.data;
#if MENU
      	} while (!QuitGame)
#endif
               WriteConfig();
            } while (!Buffers.QuitGame);
         }
Ejemplo n.º 37
0
        /// <summary>
        /// Changes the current screen.
        /// This is usually registered to an event but can be 
        /// called directly.
        /// </summary>
        /// <param name="screen">The screen you want to load</param>
        public static void GotoWorld(object screen)
        {
            Worlds s = (Worlds)screen;

              try
              {
            Game1.NextWorld = s;
              }
              catch (Exception e)
              {
            Game1.Trace("Game1 | GotoWorld: ERROR: ", "" + e.Message);
              }
        }
 private void playerTribeDropdown1_PlayerSelected(object sender, Worlds.Events.Impls.PlayerEventArgs e)
 {
     var villages = playerTribeDropdown1.Player;
     villagesGridExControl1.Bind(villages);
 }