示例#1
0
        //发送幻兽信息
        //info 幻兽信息
        //tag 是否发送休息标记
        //brank 是否发送排行榜信息
        public void SendEudemonInfo(RoleData_Eudemon info, bool tag = true,bool bRank = true)
        {
            if (tag)
            {
                //要设置一个标记才可以出征,,目前不知道这个消息是干什么用的为何 应该是状态之类的吧。。。(*^__^*) 嘻2015.9.28
                NetMsg.MsgEudemonTag eudemontag = new NetMsg.MsgEudemonTag();

                eudemontag.playerid = play.GetTypeId();
                eudemontag.eudemonid = info.GetTypeID();
                eudemontag.SetBreakTag();
                play.SendData(eudemontag.GetBuffer(), true);
            }

            //所有幻兽都为至尊圣兽
            if (bRank && info.quality > 0)
            {
                byte[] data1 = { 12, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 37, 38, 0, 0 };
                PacketOut outpack = new PacketOut();
                outpack.WriteInt16(28);
                outpack.WriteInt16(1010);
                outpack.WriteUInt32(info.typeid);
                outpack.WriteUInt32(play.GetTypeId());
                outpack.WriteBuff(data1);
                play.SendData(outpack.Flush(),true);
            }
            NetMsg.MsgEudemonInfo msg = new NetMsg.MsgEudemonInfo();

            msg.id = info.GetTypeID();
            msg.AddAttribute(GameStruct.EudemonAttribute.Atk_Max, info.atk_max);
            msg.AddAttribute(GameStruct.EudemonAttribute.Atk_Min, info.atk_min);
            msg.AddAttribute(GameStruct.EudemonAttribute.MagicAtk_Max, info.magicatk_max);
            msg.AddAttribute(GameStruct.EudemonAttribute.MagicAtk_Min, info.magicatk_min);
            msg.AddAttribute(GameStruct.EudemonAttribute.Defense, info.defense);
            msg.AddAttribute(GameStruct.EudemonAttribute.Magic_Defense, info.magicdef);
            msg.AddAttribute(GameStruct.EudemonAttribute.Life, info.life);
            msg.AddAttribute(GameStruct.EudemonAttribute.Life_Max, info.life_max);
            msg.AddAttribute(GameStruct.EudemonAttribute.Intimacy, info.intimacy);
            msg.AddAttribute(GameStruct.EudemonAttribute.Level, info.level);
            msg.AddAttribute(GameStruct.EudemonAttribute.WuXing, info.wuxing);
            msg.AddAttribute(GameStruct.EudemonAttribute.Luck, info.luck);
            msg.AddAttribute(GameStruct.EudemonAttribute.Recall_Count, info.recall_count);
            msg.AddAttribute(EudemonAttribute.Card, info.card);
            msg.AddAttribute(EudemonAttribute.Exp, info.exp);
            msg.AddAttribute(EudemonAttribute.Quality, info.quality);
            msg.AddAttribute(EudemonAttribute.Init_Atk, info.GetInitAtk());
            msg.AddAttribute(EudemonAttribute.Init_Magic_Atk, info.GetInitMagicAtk());
            msg.AddAttribute(EudemonAttribute.Init_Defense, info.GetInitDefense());
            msg.AddAttribute(EudemonAttribute.Init_Life, info.init_life);
            msg.AddAttribute(EudemonAttribute.Life_Grow_Rate, ConvertGrowRate(info.life_grow_rate));
            msg.AddAttribute(EudemonAttribute.Atk_Min_Grow_Rate, ConvertGrowRate(info.phyatk_grow_rate));
            msg.AddAttribute(EudemonAttribute.Atk_Max_Grow_Rate, ConvertGrowRate(info.phyatk_grow_rate_max ));
            msg.AddAttribute(EudemonAttribute.MagicAtk_Min_Grow_Rate, ConvertGrowRate(info.magicatk_grow_rate));
            msg.AddAttribute(EudemonAttribute.MagicAtk_Max_Grow_Rate, ConvertGrowRate(info.magicatk_grow_rate_max));
            msg.AddAttribute(EudemonAttribute.Defense_Grow_Rate, ConvertGrowRate(info.defense_grow_rate ));
            msg.AddAttribute(EudemonAttribute.MagicDefense_Grow_Rate, ConvertGrowRate(info.magicdef_grow_rate));

            GameStruct.MonsterInfo _info = EudemonObject.GetMonsterInfo(play, info.itemid);
            if (_info != null)
            {
                msg.AddAttribute(EudemonAttribute.Riding, _info.eudemon_type);
            }

            play.SendData(msg.GetBuffer(),true);
        }
示例#2
0
        //召回幻兽
        public void ReCall()
        {
            //  this.ClearThis();
            //幻兽召回的特效
            PacketOut outpack = new PacketOut();
            outpack.WriteUInt16(28);
            outpack.WriteUInt16(1009);
            outpack.WriteUInt32(this.GetTypeId());
            outpack.WriteUInt32(this.GetTypeId());
            outpack.WriteInt32(32);
            outpack.WriteInt32(0);
            outpack.WriteInt32(0);
            outpack.WriteInt32(0);
            this.BrocatBuffer(outpack.Flush());
              //  play.SendData(outpack.Flush());

            //按钮要变回出征
            NetMsg.MsgEudemonTag eudemontag = new NetMsg.MsgEudemonTag();
               // eudemontag.Create(null, play.GetGamePackKeyEx());
            eudemontag.playerid = play.GetTypeId();
            eudemontag.eudemonid = this.GetTypeId();
            eudemontag.SetReCallTag();
            this.BrocatBuffer(eudemontag.GetBuffer());
             //   play.SendData(eudemontag.GetBuffer());
            //公告
            //play.LeftNotice("幻兽" + mInfo.name + "被召回!");
            this.SetState(EUDEMONSTATE.NROMAL);
        }