Пример #1
0
        public void HeroesClick(object sender, EventArgs e)
        {
            if (Univers.Worlds.Length > 0)
            {
                PageInfo.World = Univers.Worlds[0];
            }
            if (PageInfo.World == null)
            {
                return;
            }
            if (PageInfo.World.Maps.Length > 0)
            {
                PageInfo.Map = PageInfo.World.Maps[0];
            }
            if (PageInfo.Map == null)
            {
                return;
            }

            string name   = "Personnage";
            Mobile entity = PageInfo.Map.FindEntity(name) as Mobile;

            if (entity == null)
            {
                entity      = new PlayerMobile();
                entity.Name = entity.ID = name;
                //entity.Move.Speed = 1000;
                entity.Add(new Core.Utility.Container("Sac", entity.ID, 4, 4));
                entity.CanMove   = true;
                entity.CanTarget = true;
                entity.Cross     = true;
                ((PlayerMobile)entity).Add(new Power_Aggro());
                ((PlayerMobile)entity).Add(new Power_Melee());
                ((PlayerMobile)entity).Add(new Power_Archery());
                ((PlayerMobile)entity).Add(new Power_Heal());
                ((PlayerMobile)entity).Add(new Power_Jump());
                ((PlayerMobile)entity).Add(new Power_Throw());
                entity.MoveToMap(0, 0, 0, PageInfo.Map);
            }
            PageInfo.Players = new string[] { name };

            Rectangle3D rec = new Rectangle3D(0, 0, 0, 10, 10, 3);

            //Rectangle3D rec = new Rectangle3D(4, 4, 0, 6, 6, 3);
            PageInfo.Map.Add(rec);

            Response.Redirect("~/PageHeroes.aspx");
        }