MapServer.PlayerObject.ChangeFubenMap C# (CSharp) Méthode

ChangeFubenMap() public méthode

public ChangeFubenMap ( GameMap map, short x, short y ) : void
map GameMap
x short
y short
Résultat void
        public void ChangeFubenMap(GameMap map, short x, short y)
        {
            if (map == null) return;
            this.GetGameMap().RemoveObj(this);
            //召回所有幻兽-
            this.GetEudemonSystem().Eudemon_ReCallAll(true);
            map.AddObject(this, this.GetGameSession());

            //先清除自身对象
            this.ClearThis();

            this.SetPoint(x, y);
            //要发二个包
            NetMsg.MsgReCall1 msg = new NetMsg.MsgReCall1();
            msg.Create(null, GetGamePackKeyEx());
            msg.roleid = this.GetTypeId();
            msg.mapid = (int)this.GetGameMap().GetMapInfo().id;
            msg.x = this.GetCurrentX();
            msg.y = this.GetCurrentY();
            this.SendData(msg.GetBuffer());

            NetMsg.MsgReCall2 msg1 = new NetMsg.MsgReCall2();
            msg1.Create(null, GetGamePackKeyEx());
            msg1.roleid = this.GetTypeId();
            msg1.x = this.GetCurrentX();
            msg1.y = this.GetCurrentY();
            this.SendData(msg1.GetBuffer());

            this.GetVisibleList().Clear();

            GameStruct.Action act = new GameStruct.Action(GameStruct.Action.MOVE);
            this.PushAction(act);

            GetBaseAttr().mapid = map.GetMapInfo().id;

            this.SendJueweiNotice();
            this.SetTransmitIng(true);
        }

Usage Example

        public bool Action_Fuben_Create(ActionInfo info, PlayerObject play)
        {
            String[] option = info.param.Split(' ');
            uint mapid = Convert.ToUInt32(option[0]);
            byte type = Convert.ToByte(option[1]);
            short x = Convert.ToInt16(option[2]);
            short y = Convert.ToInt16(option[3]);
            GameMap fb_map =  MapManager.Instance().AddFubenMap(mapid);
            if (fb_map == null)
            {
                return false;
            }
            if(type == 1)//单人副本
            {
                play.ChangeFubenMap(fb_map, x, y);
            }
            else if (type == 2)//组队副本
            {

            }
            return true;
        }