コード例 #1
0
        public void SendEudemonInfo(PlayerObject _play = null)
        {
            if (mMonsterInfo == null) return;
            //合体状态与休息状态下不发--
            if (this.GetState() == EUDEMONSTATE.FIT || this.GetState() == EUDEMONSTATE.NROMAL) return;
            //刷新幻兽数据
            NetMsg.MsgEudemonBattleInfo battleinfo = new NetMsg.MsgEudemonBattleInfo();
            battleinfo.id = this.GetTypeId();
            GameStruct.RoleItemInfo role_item = play.GetItemSystem().FindItem(this.GetEudemonInfo().itemid);
            if (role_item == null) return;

            battleinfo.lookface = mMonsterInfo.lookface;;
            battleinfo.name = role_item.forgename;
            battleinfo.monsterid = mMonsterInfo.id;
            battleinfo.play_id = play.GetTypeId();
            battleinfo.life = mInfo.life;
            battleinfo.life_max = mInfo.life;
            battleinfo.x = this.GetCurrentX();
            battleinfo.y = this.GetCurrentY();
            battleinfo.dir = play.GetDir();
            battleinfo.wuxing =(byte) mInfo.wuxing;
            battleinfo.wuxing =(byte) EudemonWuXing.LEI;
            if (mInfo.quality == 0) //没进化的,不显示至尊圣兽
            {
                battleinfo.param4 = 0;
            }
            else
            {
                battleinfo.param4 = 69888;//0, 17, 1, 0 //至尊圣兽
            }

            int nStar = (int)(mInfo.quality / 100);
            battleinfo.star = nStar;
            //111为幻兽星级
            //186, 90, 16, 0 = 1071802 幻兽对应的物品id
            //54, 55, 191, 0
            //前面四个字节貌似与幻兽神等级有关?
            //17 幻兽单项属性
            //1 为排名
            byte[] data = {   44, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 60, 89, 16, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
            Buffer.BlockCopy(data, 0, battleinfo.param2, 0, data.Length);
            if (_play != null)
            {
                _play.SendData(battleinfo.GetBuffer(),true);
            }
            else
            {
                this.BrocatBuffer(battleinfo.GetBuffer());
            }
            PacketOut outpack = null;
            if (this.GetAttr().bDie)
            {

                outpack = new PacketOut();
                outpack.WriteInt16(20);
                outpack.WriteInt16(1017);
                outpack.WriteUInt32(this.GetTypeId());
                outpack.WriteInt32(1);
                outpack.WriteInt32(26);
                outpack.WriteInt32(6);
                this.BrocatBuffer(outpack.Flush());

            }
               // {28,0,241,3,39,31,97,5,2,32,201,122,132,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}
            byte[] data1 = { 132, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
            outpack = new PacketOut();
            outpack.WriteInt16(28);
            outpack.WriteInt16(1009);
            outpack.WriteUInt32(play.GetTypeId());
            outpack.WriteUInt32(this.GetTypeId());
            outpack.WriteBuff(data1);
            this.BrocatBuffer(outpack.Flush());
            //要有血量,不然就挂了
            //NetMsg.MsgEudemonInfo eudemoninfo = new NetMsg.MsgEudemonInfo();
            //eudemoninfo.id = mInfo.GetTypeID();
            //eudemoninfo.AddAttribute(GameStruct.EudemonAttribute.Life, mInfo.life);
            //eudemoninfo.AddAttribute(GameStruct.EudemonAttribute.Life_Max, mInfo.life);
            //this.BrocatBuffer(eudemoninfo.GetBuffer());
        }
コード例 #2
0
        //发送给玩家刷新信息
        public void SendPlayRefreshInfo(PlayerObject play)
        {
            if (play.GetGameSession() == null) return;
            if (mMonsterInfo == null) return;
            //刷新幻兽数据
            NetMsg.MsgEudemonBattleInfo battleinfo = new NetMsg.MsgEudemonBattleInfo();
            battleinfo.Create(null, play.GetGamePackKeyEx());
            battleinfo.id = mInfo.GetTypeID();
            battleinfo.lookface = mMonsterInfo.lookface;
            battleinfo.name = mInfo.name;
            battleinfo.monsterid = mMonsterInfo.id;
            battleinfo.x = play.GetCurrentX();
            battleinfo.y = play.GetCurrentY();
            battleinfo.dir = play.GetDir();
            play.SendData(battleinfo.GetBuffer());

            //要有血量,不然就挂了
            NetMsg.MsgEudemonInfo eudemoninfo = new NetMsg.MsgEudemonInfo();
            eudemoninfo.Create(null, play.GetGamePackKeyEx());
            eudemoninfo.id = mInfo.GetTypeID();
            eudemoninfo.AddAttribute(GameStruct.EudemonAttribute.Life, mInfo.life);
            eudemoninfo.AddAttribute(GameStruct.EudemonAttribute.Life_Max, mInfo.life);
            play.SendData(eudemoninfo.GetBuffer());
        }