Exemple #1
0
        //发送飞鸽信息
        private void Send(PigeonInfo info)
        {
            short msgLen = 28;

            msgLen += (short)(Coding.GetDefauleCoding().GetBytes(info.name).Length + 1);
            msgLen += 17;
            msgLen += (short)(Coding.GetDefauleCoding().GetBytes(info.text).Length + 1);
            GameBase.Network.PacketOut outpack = new GameBase.Network.PacketOut();
            outpack.WriteInt16(msgLen);
            outpack.WriteInt16(1004);
            outpack.WriteInt32(0xffffff);
            outpack.WriteInt32(2017);
            outpack.WriteInt32(1419);
            outpack.WriteInt32(-1);
            outpack.WriteInt32(0);
            outpack.WriteByte(4); //四个字符串数组
            outpack.WriteString(info.name);
            outpack.WriteString("ALLUSERS");
            outpack.WriteString("1241350");
            outpack.WriteString(info.text);
            outpack.WriteByte(0);
            outpack.WriteByte(0);
            outpack.WriteByte(0);
            UserEngine.Instance().BrocatBuffer(outpack.Flush());
        }
Exemple #2
0
        //怪物是以typeid为主键
        //  public void AddObject(MonsterObject obj)
        // {
        // mDicObject[obj.GetTypeId()] = obj;
        // obj.mGameMap = this;
        //switch (obj.type)
        //{
        //    case OBJECTTYPE.MONSTER:
        //        {
        //            GameStruct.Action action = new GameStruct.Action(GameStruct.Action.MOVE, null);
        //            obj.PushAction(action);
        //            break;
        //        }
        // }
        //  }

        public void SendWeatherInfo(PlayerObject play)
        {
            //下雪天气-
            //if (obj.type == OBJECTTYPE.PLAYER)
            //{

            //下雪天气
            GameBase.Network.PacketOut outpack = new GameBase.Network.PacketOut();
            outpack.WriteInt16(20);
            outpack.WriteInt16(1110);
            outpack.WriteUInt32(this.GetMapInfo().id);
            outpack.WriteUInt32(this.GetMapInfo().id);

            if (this.GetMapInfo().issnows)
            {
                byte[] data3 = { 0, 0, 32, 0, 128, 0, 18, 0 };
                outpack.WriteBuff(data3);
            }
            else
            {
                outpack.WriteInt32(0);
                outpack.WriteInt32(0);
            }
            play.SendData(outpack.Flush(), true);
            //}
        }
Exemple #3
0
        public void SendGuanJueInfo(PlayerObject play)
        {
            //  byte[] data1 = { 25, 0, 247, 3, 0, 0, 0, 0, 113, 0, 1, 12, 49, 32, 45, 49, 32, 51, 48, 48, 48, 48, 48, 48, 0 };
            //捐献的
            ulong guanjue = play.GetBaseAttr().guanjue;

            byte[] byte_ = Coding.GetDefauleCoding().GetBytes(guanjue.ToString());
            GameBase.Network.PacketOut outpack = new GameBase.Network.PacketOut(play.GetGamePackKeyEx());
            outpack.WriteUInt16((ushort)(byte_.Length + 4 + 14));
            outpack.WriteUInt16(1015);
            outpack.WriteUInt32(0);
            outpack.WriteUInt16(113);
            outpack.WriteByte(1);

            //长度--
            outpack.WriteByte((byte)(byte_.Length + 5));
            String sjuewei = ((byte)play.GetGuanJue()).ToString();

            byte[] jueweibyte_ = Coding.GetDefauleCoding().GetBytes(sjuewei);
            outpack.WriteByte(jueweibyte_[0]); //爵位
            outpack.WriteByte(32);             //分隔符
            outpack.WriteByte(45);
            outpack.WriteByte(49);
            outpack.WriteByte(32); //分隔符
            outpack.WriteBuff(byte_);
            outpack.WriteByte(0);


            play.SendData(outpack.Flush());
        }
Exemple #4
0
        public void SendInfo(PlayerObject play = null)
        {
            //  byte[] data2 = {  100, 0, 1, 4, 210, 193, 183, 227, 0, 0, 0 };
            GameStruct.MonsterInfo info = ConfigManager.Instance().GetMonsterInfo(id);
            if (info == null)
            {
                Log.Instance().WriteLog("获取守护骑士信息失败!!!" + id.ToString());
                return;
            }
            GameBase.Network.PacketOut outpack = null;
            if (play == null)
            {
                outpack = new GameBase.Network.PacketOut();
            }
            else
            {
                outpack = new GameBase.Network.PacketOut(play.GetGamePackKeyEx());
            }
            outpack.WriteUInt16(81);
            outpack.WriteUInt16(2069);
            outpack.WriteUInt32(GetTypeId());
            outpack.WriteUInt32(play.GetTypeId());
            byte[] data = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
            outpack.WriteBuff(data);
            outpack.WriteUInt32(info.lookface);
            outpack.WriteInt16(GetCurrentX());
            outpack.WriteInt16(GetCurrentY());
            outpack.WriteInt16(0); //未知
            outpack.WriteUInt16(info.level);
            outpack.WriteUInt32(info.id);
            outpack.WriteInt32(attr.life);
            outpack.WriteInt32(info.life);
            outpack.WriteInt16(GetDir());
            byte[] data1 = { 100, 0, 1, 4, 210, 193, 183, 227, 0, 0, 0 };
            outpack.WriteBuff(data1);

            if (play != null)
            {
                play.SendData(outpack.Flush());
            }
            else
            {
                //广播
                data = outpack.Flush();
                this.BrocatBuffer(data);
            }
        }
        public void SendInfo(PlayerObject play = null)
        {
            //  byte[] data2 = {  100, 0, 1, 4, 210, 193, 183, 227, 0, 0, 0 };
            GameStruct.MonsterInfo info = ConfigManager.Instance().GetMonsterInfo(id);
            if (info == null)
            {
                Log.Instance().WriteLog("获取守护骑士信息失败!!!" + id.ToString());
                return;
            }
            GameBase.Network.PacketOut outpack = null;
            if (play == null)
            {
                outpack = new GameBase.Network.PacketOut();
            }else
            {
                outpack = new GameBase.Network.PacketOut(play.GetGamePackKeyEx());
            }
            outpack.WriteUInt16(81);
            outpack.WriteUInt16(2069);
            outpack.WriteUInt32(GetTypeId());
            outpack.WriteUInt32(play.GetTypeId());
            byte[] data = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
            outpack.WriteBuff(data);
            outpack.WriteUInt32(info.lookface);
            outpack.WriteInt16(GetCurrentX());
            outpack.WriteInt16(GetCurrentY());
            outpack.WriteInt16(0); //未知
            outpack.WriteUInt16(info.level);
            outpack.WriteUInt32(info.id);
            outpack.WriteInt32(attr.life);
            outpack.WriteInt32(info.life);
            outpack.WriteInt16(GetDir());
            byte[] data1 = { 100, 0, 1, 4, 210, 193, 183, 227, 0, 0, 0 };
            outpack.WriteBuff(data1);

            if (play != null)
            {
                play.SendData(outpack.Flush());
            }
            else
            {
                //广播
                data = outpack.Flush();
                this.BrocatBuffer(data);
            }
        }
Exemple #6
0
        //发送对象信息
        //play 要发送给对象的信息
        //bClear 是否是清除信息
        public void SendInfo(PlayerObject play = null, bool bClear = false)
        {
            GameBase.Network.PacketOut outpack = null;
            if (play != null)
            {
                outpack = new GameBase.Network.PacketOut(play.GetGamePackKeyEx());
            }
            else
            {
                outpack = new GameBase.Network.PacketOut();
            }
            outpack.WriteUInt16(32);
            outpack.WriteUInt16(1101);
            outpack.WriteUInt32(this.GetTypeId());
            outpack.WriteInt32(mnEffID);
            outpack.WriteInt16(this.GetCurrentX());
            outpack.WriteInt16(this.GetCurrentY());
            outpack.WriteInt32(0);
            if (!bClear)
            {
                outpack.WriteInt32(mnParam);
                outpack.WriteInt32(0);
                outpack.WriteInt32(mnParam1);
            }
            else
            {
                outpack.WriteInt32(12); //清除特效标识
                outpack.WriteInt32(0);
                outpack.WriteInt32(mnParam1);
            }

            if (play != null)
            {
                play.SendData(outpack.Flush());
            }
            else
            {
                byte[] data = outpack.Flush();
                this.BrocatBuffer(data);
            }
        }
Exemple #7
0
        public void GetFriendInfo(int playerid)
        {
            PlayerObject obj = UserEngine.Instance().FindPlayerObjectToPlayerId(playerid);

            if (obj == null)
            {
                return;
            }

            GameBase.Network.PacketOut outpack = new GameBase.Network.PacketOut(play.GetGamePackKeyEx());
            outpack.WriteUInt16(52);
            outpack.WriteUInt16(2033);
            outpack.WriteInt32(playerid);
            outpack.WriteUInt32(obj.GetBaseAttr().lookface);
            outpack.WriteByte(obj.GetBaseAttr().level);
            outpack.WriteByte(obj.GetBaseAttr().profession); //职业
            outpack.WriteInt32(0);
            outpack.WriteInt16(0);
            outpack.WriteByte(206);
            outpack.WriteByte(222);
            byte[] data = new byte[30];
            outpack.WriteBuff(data);
            play.SendData(outpack.Flush());
        }
Exemple #8
0
        //添加状态
        //nStatus 状态id
        //nTime   持续时间- 秒 0为无限时间
        //bCover  是否覆盖该状态
        public void AddStatus(int nStatus, int nTime = 0, bool bCover = true)
        {
            if (this.QueryStatus(GameStruct.RoleStatus.STATUS_DIE) != null)
            {
                return;
            }
            bool bAdd       = false;
            bool bSendState = true;

            GameStruct.RoleStatus status = null;
            for (int i = 0; i < mListStatus.Count; i++)
            {
                status = mListStatus[i];
                if (status.nStatus == nStatus)
                {
                    if (bCover)
                    {
                        status.nTime     = nTime * 1000;
                        status.nLastTick = System.Environment.TickCount;
                    }
                    else
                    {
                        status.nTime += nTime * 1000;
                    }
                    bAdd = true;
                    break;
                }
            }
            if (!bAdd)
            {
                status         = new GameStruct.RoleStatus();
                status.nStatus = nStatus;
                status.nTime   = nTime * 1000;
                mListStatus.Add(status);
            }
            int nOldEff = GetEffect();

            switch (nStatus)
            {
            case GameStruct.RoleStatus.STATUS_XPFULL:     //XP爆气-- 下降
            {
                //mi64Effect  &= ~ Define.KEEPEFFECT_XPFULL;
                //play.ChangeAttribute(GameStruct.UserAttribute.STATUS1, 64,true);
                break;
            }

            case GameStruct.RoleStatus.STATUS_XPFULL_ATTACK:            //xp爆气- 技能被单击
            {
                this.DeleteStatus(GameStruct.RoleStatus.STATUS_XPFULL); //删除xp爆气buff
                mXpTime.SetInterval(Define.XP_MAX_FULL_SECS);
                mXpTime.Update();
                mi64Effect |= Define.KEEPEFFECT_XPFULL;

                break;
            }

            case GameStruct.RoleStatus.STATUS_MOLONGSHOUHU:     //魔龙守护
            {
                play.ChangeAttribute(GameStruct.UserAttribute.MOLONGSHOUHU_STATUS, 1, true);
                ushort nMagicLv = play.GetMagicSystem().GetMagicLevel(GameStruct.MagicTypeInfo.MOLONGSHOUHU);
                GameStruct.MagicTypeInfo magicInfo = ConfigManager.Instance().GetMagicTypeInfo(GameStruct.MagicTypeInfo.MOLONGSHOUHU, (byte)nMagicLv);
                if (magicInfo != null)
                {
                    //没有实际效果-- 待修正
                    //添加buff-
                    int    nDefense = (int)magicInfo.power;
                    byte[] data1    = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
                    GameBase.Network.PacketOut outpack = new GameBase.Network.PacketOut(play.GetGamePackKeyEx());
                    outpack.WriteUInt16(48);
                    outpack.WriteUInt16(1127);
                    outpack.WriteUInt32(play.GetTypeId());
                    outpack.WriteInt32(nTime);
                    outpack.WriteInt32(nDefense);
                    outpack.WriteBuff(data1);
                    play.SendData(outpack.Flush());
                }
                break;
            }

            case GameStruct.RoleStatus.STATUS_STEALTH:     //潜行
            {
                mi64Effect |= Define.KEEPEFFECT_LURKER;
                break;
            }

            case GameStruct.RoleStatus.STATUS_CRIME:     //闪蓝
            {
                mi64Effect |= Define.KEEPEFFECT_CRIME;
                break;
            }

            case GameStruct.RoleStatus.STATUS_RED:     //红名
            {
                mi64Effect |= Define.KEEPEFFECT_RED;
                break;
            }

            case GameStruct.RoleStatus.STATUS_BLOCK:     //黑名
            {
                mi64Effect |= Define.KEEPEFFECT_DEEPRED;
                break;
            }

            case GameStruct.RoleStatus.STATUS_FLY:     //雷霆万钧单独处理.要把xp满的包发下去
            {
                mi64Effect |= Define.KEEPEFFECT_FLY;

                NetMsg.MsgUserAttribute msg = new NetMsg.MsgUserAttribute();
                msg.role_id = play.GetTypeId();
                msg.Create(null, null);
                msg.AddAttribute(GameStruct.UserAttribute.STATUS, (uint)GetEffect(false));
                msg.AddAttribute(GameStruct.UserAttribute.STATUS1, (uint)GetEffect());        //这是xp满的标识


                play.BroadcastBuffer(msg.GetBuffer(), true);
                bSendState = false;
                break;
            }

            case GameStruct.RoleStatus.STATUS_HIDDEN:
            {
                mi64Effect |= Define.KEEPEFFECT_HIDDEN;
                break;
            }

            case GameStruct.RoleStatus.STATUS_HEILONGWU:
            {
                mi64Effect |= Define.KEEPEFFECT_HEILONGWU;

                break;
            }

            case GameStruct.RoleStatus.STATUS_YUANSUZHANGKONG:
            {
                //修改元素掌控状态
                play.ChangeAttribute(GameStruct.UserAttribute.YUANSUZHANGKONG, 512, true);
                //添加buff
                byte[] data1 = { 48, 0, 103, 4 };
                byte[] data2 = { 128, 81, 1, 0, 100, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0 };
                GameBase.Network.PacketOut outpack = new GameBase.Network.PacketOut(play.GetGamePackKeyEx());
                outpack.WriteBuff(data1);
                outpack.WriteUInt32(play.GetTypeId());
                outpack.WriteBuff(data2);
                play.SendData(outpack.Flush());
                bSendState = false;
                break;
            }

            case GameStruct.RoleStatus.STATUS_JUYANSHENGDUN:        //法师 巨岩圣盾
            {
                byte[] data1 = { 48, 0, 103, 4 };
                byte[] data2 = { 132, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 0, 0 };
                GameBase.Network.PacketOut outpack = new GameBase.Network.PacketOut(play.GetGamePackKeyEx());
                outpack.WriteBuff(data1);
                outpack.WriteUInt32(play.GetTypeId());
                outpack.WriteBuff(data2);
                play.SendData(outpack.Flush());
                bSendState = false;
                break;
            }

            case GameStruct.RoleStatus.STATUS_ANSHAXIELONG:    //亡灵巫师- 暗杀邪龙
            {
                if (mObject_CALL != null)
                {
                    mObject_CALL.ClearThis();
                }
                GameStruct.MonsterInfo monster = ConfigManager.Instance().GetMonsterInfo(Define.ANSHAXIELONG_MONSTER_ID);
                if (monster == null)
                {
                    Log.Instance().WriteLog("创建暗沙邪龙失败!!,无此怪物id!");
                    break;
                }

                int nx = play.GetCurrentX() + GameStruct.DIR._DELTA_X[play.GetDir()];
                int ny = play.GetCurrentY() + GameStruct.DIR._DELTA_Y[play.GetDir()];
                mObject_CALL = new AnShaXieLongObject(play, (short)nx, (short)ny, play.GetDir(), monster.id, monster.ai);
                play.GetGameMap().AddObject(mObject_CALL, null);
                mObject_CALL.RefreshVisibleObject();
                mObject_CALL.Alive(false);

                break;
            }

            case GameStruct.RoleStatus.STATUS_MINGGUOSHENGNV:     //冥国圣女
            {
                if (mObject_CALL != null)
                {
                    mObject_CALL.ClearThis();
                }
                GameStruct.MonsterInfo monster = ConfigManager.Instance().GetMonsterInfo(Define.MINGGUOSHENGNV_MONSTER_ID);
                if (monster == null)
                {
                    Log.Instance().WriteLog("创建冥国圣女失败!!,无此怪物id!");
                    break;
                }

                int nx = play.GetCurrentX() + GameStruct.DIR._DELTA_X[play.GetDir()];
                int ny = play.GetCurrentY() + GameStruct.DIR._DELTA_Y[play.GetDir()];
                mObject_CALL = new MingGuoShengNv(play, (short)nx, (short)ny, play.GetDir(), monster.id, monster.ai);
                play.GetGameMap().AddObject(mObject_CALL, null);
                mObject_CALL.RefreshVisibleObject();
                mObject_CALL.Alive(false);
                break;
            }

            case GameStruct.RoleStatus.STATUS_WANGNIANWULING:     //亡念巫灵
            {
                if (mObject_CALL != null)
                {
                    mObject_CALL.ClearThis();
                }
                GameStruct.MonsterInfo monster = ConfigManager.Instance().GetMonsterInfo(Define.WANGNIANWULONG_MONSTER_ID);
                if (monster == null)
                {
                    Log.Instance().WriteLog("创建亡念巫灵失败!!,无此怪物id!");
                    break;
                }

                int nx = play.GetCurrentX() + GameStruct.DIR._DELTA_X[play.GetDir()];
                int ny = play.GetCurrentY() + GameStruct.DIR._DELTA_Y[play.GetDir()];
                mObject_CALL = new WangNianWuLing(play, (short)nx, (short)ny, play.GetDir(), monster.id, monster.ai);
                play.GetGameMap().AddObject(mObject_CALL, null);
                mObject_CALL.RefreshVisibleObject();
                mObject_CALL.Alive(false);
                break;
            }

            case GameStruct.RoleStatus.STATUS_HUASHENWANGLING:
            {
                mi64EffectEx |= Define.KEEPEFFECT_HUASHENWULING;
                break;
            }

            case GameStruct.RoleStatus.STATUS_HUASHENWUSHI:
            {
                DeleteStatus(GameStruct.RoleStatus.STATUS_HUASHENWANGLING);
                break;
            }

            case GameStruct.RoleStatus.STATUS_ZHAOHUANWUHUAN:
            {
                mi64Effect |= Define.KEEPEFFECT_ZHAOHUANWUHUAN;
                break;
            }

            case GameStruct.RoleStatus.STATUS_MIXINSHU:         //血族 迷心术
            {
                mi64EffectEx |= Define.KEEPEFFECT_MIXINSHU;

                GameBase.Network.PacketOut outpack = new GameBase.Network.PacketOut(play.GetGamePackKeyEx());
                //buff
                byte[] data = { 120, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 32, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
                outpack.WriteUInt16(48);
                outpack.WriteUInt16(1127);
                outpack.WriteUInt32(play.GetTypeId());
                outpack.WriteBuff(data);
                play.SendData(outpack.Flush());
                break;
            }

            case GameStruct.RoleStatus.STATUS_XUEXI:     //血族 血袭
            {
                mi64EffectEx |= Define.KEEPEFFECT_XUEXI;
                GameBase.Network.PacketOut outpack = new GameBase.Network.PacketOut(play.GetGamePackKeyEx());
                byte[] data = { 60, 0, 0, 0, 35, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
                outpack.WriteUInt16(48);
                outpack.WriteUInt16(1127);
                outpack.WriteUInt32(play.GetTypeId());
                outpack.WriteBuff(data);
                play.SendData(outpack.Flush());
                break;
            }

            case GameStruct.RoleStatus.STATUS_DIE:     //死亡状态
            {
                mi64Effect |= Define.KEEPEFFECT_DIE;
                break;
            }
            }
            if (bSendState)
            {
                this.SendState();
                //    play.ChangeAttribute(state, GetEffect(state == GameStruct.UserAttribute.STATUS1),true);
            }

            //if (GetEffect() != nOldEff)
            //{
            //    play.ChangeAttribute(state, GetEffect());
            //}
        }
        //发送对象信息
        //play 要发送给对象的信息
        //bClear 是否是清除信息
        public void SendInfo(PlayerObject play = null, bool bClear = false)
        {
            GameBase.Network.PacketOut outpack = null;
            if (play != null)
            {
                outpack = new GameBase.Network.PacketOut(play.GetGamePackKeyEx());
            }
            else outpack = new GameBase.Network.PacketOut();
            outpack.WriteUInt16(32);
            outpack.WriteUInt16(1101);
            outpack.WriteUInt32(this.GetTypeId());
            outpack.WriteInt32(mnEffID);
            outpack.WriteInt16(this.GetCurrentX());
            outpack.WriteInt16(this.GetCurrentY());
            outpack.WriteInt32(0);
            if (!bClear)
            {
                outpack.WriteInt32(mnParam);
                outpack.WriteInt32(0);
                outpack.WriteInt32(mnParam1);
            }
            else
            {
                outpack.WriteInt32(12); //清除特效标识
                outpack.WriteInt32(0);
                outpack.WriteInt32(mnParam1);
            }

            if (play != null)
            {
                play.SendData(outpack.Flush());

            }
            else
            {
                byte[] data = outpack.Flush();
                this.BrocatBuffer(data);
            }
        }
Exemple #10
0
        //添加状态
        //nStatus 状态id
        //nTime   持续时间- 秒 0为无限时间
        //bCover  是否覆盖该状态
        public void AddStatus(int nStatus, int nTime = 0, bool bCover = true)
        {
            if (this.QueryStatus(GameStruct.RoleStatus.STATUS_DIE) != null)
            {
                return;
            }
            bool bAdd = false;
            bool bSendState = true;
            GameStruct.RoleStatus status = null;
            for (int i = 0; i < mListStatus.Count; i++)
            {
                status = mListStatus[i];
                if (status.nStatus == nStatus)
                {
                    if (bCover)
                    {
                        status.nTime = nTime * 1000;
                        status.nLastTick = System.Environment.TickCount;
                    }
                    else { status.nTime += nTime * 1000; }
                    bAdd = true;
                    break;
                }
            }
            if (!bAdd)
            {
                status = new GameStruct.RoleStatus();
                status.nStatus = nStatus;
                status.nTime = nTime * 1000;
                mListStatus.Add(status);
            }
            int nOldEff = GetEffect();
            switch (nStatus)
            {
                case GameStruct.RoleStatus.STATUS_XPFULL: //XP爆气-- 下降
                    {
                        //mi64Effect  &= ~ Define.KEEPEFFECT_XPFULL;
                        //play.ChangeAttribute(GameStruct.UserAttribute.STATUS1, 64,true);
                        break;
                    }
                case GameStruct.RoleStatus.STATUS_XPFULL_ATTACK: //xp爆气- 技能被单击
                    {
                        this.DeleteStatus(GameStruct.RoleStatus.STATUS_XPFULL); //删除xp爆气buff
                        mXpTime.SetInterval(Define.XP_MAX_FULL_SECS);
                        mXpTime.Update();
                        mi64Effect |= Define.KEEPEFFECT_XPFULL;

                        break;
                    }
                case GameStruct.RoleStatus.STATUS_MOLONGSHOUHU: //魔龙守护
                    {
                        play.ChangeAttribute(GameStruct.UserAttribute.MOLONGSHOUHU_STATUS, 1,true);
                        ushort nMagicLv = play.GetMagicSystem().GetMagicLevel(GameStruct.MagicTypeInfo.MOLONGSHOUHU);
                        GameStruct.MagicTypeInfo magicInfo = ConfigManager.Instance().GetMagicTypeInfo(GameStruct.MagicTypeInfo.MOLONGSHOUHU, (byte)nMagicLv);
                        if (magicInfo != null)
                        {
                            //没有实际效果-- 待修正
                            //添加buff-
                            int nDefense = (int)magicInfo.power;
                            byte[] data1 = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
                            GameBase.Network.PacketOut outpack = new GameBase.Network.PacketOut(play.GetGamePackKeyEx());
                            outpack.WriteUInt16(48);
                            outpack.WriteUInt16(1127);
                            outpack.WriteUInt32(play.GetTypeId());
                            outpack.WriteInt32(nTime);
                            outpack.WriteInt32(nDefense);
                            outpack.WriteBuff(data1);
                            play.SendData(outpack.Flush());
                        }
                        break;
                    }
                case GameStruct.RoleStatus.STATUS_STEALTH: //潜行
                    {
                        mi64Effect |= Define.KEEPEFFECT_LURKER;
                        break;
                    }
                case GameStruct.RoleStatus.STATUS_CRIME: //闪蓝
                    {
                        mi64Effect |= Define.KEEPEFFECT_CRIME;
                        break;
                    }
                case GameStruct.RoleStatus.STATUS_RED: //红名
                    {
                        mi64Effect |= Define.KEEPEFFECT_RED;
                        break;
                    }
                case GameStruct.RoleStatus.STATUS_BLOCK: //黑名
                    {
                        mi64Effect |= Define.KEEPEFFECT_DEEPRED;
                        break;
                    }
                case GameStruct.RoleStatus.STATUS_FLY: //雷霆万钧单独处理.要把xp满的包发下去
                    {
                        mi64Effect |= Define.KEEPEFFECT_FLY;

                        NetMsg.MsgUserAttribute msg = new NetMsg.MsgUserAttribute();
                        msg.role_id = play.GetTypeId();
                        msg.Create(null, null);
                        msg.AddAttribute(GameStruct.UserAttribute.STATUS, (uint)GetEffect(false));
                        msg.AddAttribute(GameStruct.UserAttribute.STATUS1, (uint)GetEffect());//这是xp满的标识

                        play.BroadcastBuffer(msg.GetBuffer(), true);
                        bSendState = false;
                        break;
                    }
                case GameStruct.RoleStatus.STATUS_HIDDEN:
                    {
                        mi64Effect |= Define.KEEPEFFECT_HIDDEN;
                        break;
                    }
                case GameStruct.RoleStatus.STATUS_HEILONGWU:
                    {
                        mi64Effect |= Define.KEEPEFFECT_HEILONGWU;

                        break;
                    }
                case GameStruct.RoleStatus.STATUS_YUANSUZHANGKONG:
                    {
                        //修改元素掌控状态
                        play.ChangeAttribute(GameStruct.UserAttribute.YUANSUZHANGKONG,512,true);
                       //添加buff
                        byte[] data1 = { 48, 0, 103, 4 };
                        byte[] data2 = { 128, 81, 1, 0, 100, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0 };
                        GameBase.Network.PacketOut outpack = new GameBase.Network.PacketOut(play.GetGamePackKeyEx());
                        outpack.WriteBuff(data1);
                        outpack.WriteUInt32(play.GetTypeId());
                        outpack.WriteBuff(data2);
                        play.SendData(outpack.Flush());
                        bSendState = false;
                        break;
                    }
                case GameStruct.RoleStatus.STATUS_JUYANSHENGDUN:    //法师 巨岩圣盾
                    {
                        byte[] data1 = { 48, 0, 103, 4 };
                        byte[] data2 = { 132, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 0, 0 };
                        GameBase.Network.PacketOut outpack = new GameBase.Network.PacketOut(play.GetGamePackKeyEx());
                        outpack.WriteBuff(data1);
                        outpack.WriteUInt32(play.GetTypeId());
                        outpack.WriteBuff(data2);
                        play.SendData(outpack.Flush());
                        bSendState = false;
                        break;
                    }
                case GameStruct.RoleStatus.STATUS_ANSHAXIELONG://亡灵巫师- 暗杀邪龙
                    {
                        if (mObject_CALL != null)
                        {
                            mObject_CALL.ClearThis();
                        }
                        GameStruct.MonsterInfo monster = ConfigManager.Instance().GetMonsterInfo(Define.ANSHAXIELONG_MONSTER_ID);
                        if (monster == null)
                        {
                            Log.Instance().WriteLog("创建暗沙邪龙失败!!,无此怪物id!");
                            break;
                        }

                        int nx = play.GetCurrentX()+GameStruct.DIR._DELTA_X[play.GetDir()];
                        int ny = play.GetCurrentY() + GameStruct.DIR._DELTA_Y[play.GetDir()];
                        mObject_CALL = new AnShaXieLongObject(play, (short)nx, (short)ny, play.GetDir(), monster.id, monster.ai);
                        play.GetGameMap().AddObject(mObject_CALL, null);
                        mObject_CALL.RefreshVisibleObject();
                        mObject_CALL.Alive(false);

                        break;
                    }
                case GameStruct.RoleStatus.STATUS_MINGGUOSHENGNV: //冥国圣女
                    {
                        if (mObject_CALL != null)
                        {
                            mObject_CALL.ClearThis();
                        }
                        GameStruct.MonsterInfo monster = ConfigManager.Instance().GetMonsterInfo(Define.MINGGUOSHENGNV_MONSTER_ID);
                        if (monster == null)
                        {
                            Log.Instance().WriteLog("创建冥国圣女失败!!,无此怪物id!");
                            break;
                        }

                        int nx = play.GetCurrentX() + GameStruct.DIR._DELTA_X[play.GetDir()];
                        int ny = play.GetCurrentY() + GameStruct.DIR._DELTA_Y[play.GetDir()];
                        mObject_CALL = new MingGuoShengNv(play, (short)nx, (short)ny, play.GetDir(), monster.id, monster.ai);
                        play.GetGameMap().AddObject(mObject_CALL, null);
                        mObject_CALL.RefreshVisibleObject();
                        mObject_CALL.Alive(false);
                        break;
                    }
                case GameStruct.RoleStatus.STATUS_WANGNIANWULING: //亡念巫灵
                    {
                        if (mObject_CALL != null)
                        {
                            mObject_CALL.ClearThis();
                        }
                        GameStruct.MonsterInfo monster = ConfigManager.Instance().GetMonsterInfo(Define.WANGNIANWULONG_MONSTER_ID);
                        if (monster == null)
                        {
                            Log.Instance().WriteLog("创建亡念巫灵失败!!,无此怪物id!");
                            break;
                        }

                        int nx = play.GetCurrentX() + GameStruct.DIR._DELTA_X[play.GetDir()];
                        int ny = play.GetCurrentY() + GameStruct.DIR._DELTA_Y[play.GetDir()];
                        mObject_CALL = new WangNianWuLing(play, (short)nx, (short)ny, play.GetDir(), monster.id, monster.ai);
                        play.GetGameMap().AddObject(mObject_CALL, null);
                        mObject_CALL.RefreshVisibleObject();
                        mObject_CALL.Alive(false);
                        break;
                    }
                case GameStruct.RoleStatus.STATUS_HUASHENWANGLING:
                    {
                        mi64EffectEx |= Define.KEEPEFFECT_HUASHENWULING;
                        break;
                    }
                case GameStruct.RoleStatus.STATUS_HUASHENWUSHI:
                    {
                        DeleteStatus(GameStruct.RoleStatus.STATUS_HUASHENWANGLING);
                        break;
                    }
                case GameStruct.RoleStatus.STATUS_ZHAOHUANWUHUAN:
                    {
                        mi64Effect |= Define.KEEPEFFECT_ZHAOHUANWUHUAN;
                        break;
                    }
                case GameStruct.RoleStatus.STATUS_MIXINSHU:     //血族 迷心术
                    {
                        mi64EffectEx |= Define.KEEPEFFECT_MIXINSHU;

                        GameBase.Network.PacketOut outpack = new GameBase.Network.PacketOut(play.GetGamePackKeyEx());
                        //buff
                        byte[] data = { 120, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 32, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
                        outpack.WriteUInt16(48);
                        outpack.WriteUInt16(1127);
                        outpack.WriteUInt32(play.GetTypeId());
                        outpack.WriteBuff(data);
                        play.SendData(outpack.Flush());
                        break;
                    }
                case GameStruct.RoleStatus.STATUS_XUEXI: //血族 血袭
                    {
                        mi64EffectEx |= Define.KEEPEFFECT_XUEXI;
                        GameBase.Network.PacketOut outpack = new GameBase.Network.PacketOut(play.GetGamePackKeyEx());
                        byte[] data = { 60, 0, 0, 0, 35, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
                        outpack.WriteUInt16(48);
                        outpack.WriteUInt16(1127);
                        outpack.WriteUInt32(play.GetTypeId());
                        outpack.WriteBuff(data);
                        play.SendData(outpack.Flush());
                        break;
                    }
                case GameStruct.RoleStatus.STATUS_DIE: //死亡状态
                    {
                        mi64Effect |= Define.KEEPEFFECT_DIE;
                        break;
                    }

            }
            if (bSendState)
            {
                this.SendState();
               //    play.ChangeAttribute(state, GetEffect(state == GameStruct.UserAttribute.STATUS1),true);
            }

            //if (GetEffect() != nOldEff)
            //{
            //    play.ChangeAttribute(state, GetEffect());
            //}
        }
        public override bool Run()
        {
            bool ret = base.Run();
            //距离超出-
            if (!this.GetPoint().CheckVisualDistance(mPlay.GetCurrentX(), mPlay.GetCurrentY(), DIS))
            {
                mPlay.GetTimerSystem().DeleteStatus(GameStruct.RoleStatus.STATUS_WANGNIANWULING);
                return false;
            }
            //刷新周围对象以便寻找目标
            if (this.GetAi().GetTargetObject() == null)
            {
                if (System.Environment.TickCount - mnRefreshTick > REFRESHTIME)
                {
                    this.RefreshVisibleObject();
                    mnRefreshTick = System.Environment.TickCount;
                }
            }

            if (mAddHP_Time.ToNextTime())
            {
                if (mPlay.GetBaseAttr().life < mPlay.GetBaseAttr().life_max)
                {
                    int nAddHP = (int)(mPlay.GetBaseAttr().life_max * 0.05);//百分之五的血量
                    mPlay.ChangeAttribute(GameStruct.UserAttribute.LIFE, nAddHP, true);
                    NetMsg.MsgMonsterMagicInjuredInfo magicattack = new NetMsg.MsgMonsterMagicInjuredInfo();
                    magicattack.roleid = this.GetTypeId();
                    magicattack.role_x = this.GetCurrentX();
                    magicattack.role_y = this.GetCurrentY();
                    magicattack.tag = 21;
                    magicattack.magicid = 6055;
                    magicattack.magiclv = 0;
                    magicattack.monsterid = mPlay.GetTypeId();
                    magicattack.injuredvalue = (uint)nAddHP;
                    this.BrocatBuffer(magicattack.GetBuffer());

                    byte[] data2 = {  0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
                    GameBase.Network.PacketOut outpack = new GameBase.Network.PacketOut();
                    outpack.WriteUInt16(88);
                    outpack.WriteUInt16(1105);
                    outpack.WriteUInt32(this.GetTypeId());
                    outpack.WriteUInt32(mPlay.GetTypeId());
                    outpack.WriteUInt16(6055);  //技能id
                    outpack.WriteUInt16(0);//技能等级
                    outpack.WriteByte(this.GetDir());
                    outpack.WriteByte(1); //类型
                    outpack.WriteUInt32(0);
                    outpack.WriteUInt32(0);
                    outpack.WriteUInt32(0);
                    outpack.WriteUInt16(0);
                    outpack.WriteUInt32(mPlay.GetTypeId());
                    outpack.WriteInt32(nAddHP);
                    outpack.WriteBuff(data2);
                    this.BrocatBuffer(outpack.Flush());
                        //NetMsg.MsgGroupM;agicAttackInfo magicattackex = new NetMsg.MsgGroupMagicAttackInfo();
                    //magicattackex.nID = this.GetTypeId();
                    //magicattackex.nX = this.GetCurrentX();
                    //magicattackex.nY = this.GetCurrentX();
                    //magicattackex.nMagicID = 6055;
                    //magicattackex.nMagicLv = 0;
                    //magicattackex.bDir = this.GetDir();
                    //this.BrocatBuffer(magicattackex.GetBuffer());
                }

            }
            return ret;
        }
Exemple #12
0
        //怪物是以typeid为主键
        //  public void AddObject(MonsterObject obj)
        // {
        // mDicObject[obj.GetTypeId()] = obj;
        // obj.mGameMap = this;
        //switch (obj.type)
        //{
        //    case OBJECTTYPE.MONSTER:
        //        {
        //            GameStruct.Action action = new GameStruct.Action(GameStruct.Action.MOVE, null);
        //            obj.PushAction(action);
        //            break;
        //        }
        // }
        //  }
        public void SendWeatherInfo(PlayerObject play)
        {
            //下雪天气-
            //if (obj.type == OBJECTTYPE.PLAYER)
            //{

            //下雪天气
            GameBase.Network.PacketOut outpack = new GameBase.Network.PacketOut();
            outpack.WriteInt16(20);
            outpack.WriteInt16(1110);
            outpack.WriteUInt32(this.GetMapInfo().id);
            outpack.WriteUInt32(this.GetMapInfo().id);

            if (this.GetMapInfo().issnows)
            {
                byte[] data3 = { 0, 0, 32, 0, 128, 0, 18, 0 };
                outpack.WriteBuff(data3);
            }
            else
            {
                outpack.WriteInt32(0);
                outpack.WriteInt32(0);
            }
            play.SendData(outpack.Flush(), true);
            //}
        }
Exemple #13
0
        public override bool Run()
        {
            bool ret = base.Run();

            //距离超出-
            if (!this.GetPoint().CheckVisualDistance(mPlay.GetCurrentX(), mPlay.GetCurrentY(), DIS))
            {
                mPlay.GetTimerSystem().DeleteStatus(GameStruct.RoleStatus.STATUS_WANGNIANWULING);
                return(false);
            }
            //刷新周围对象以便寻找目标
            if (this.GetAi().GetTargetObject() == null)
            {
                if (System.Environment.TickCount - mnRefreshTick > REFRESHTIME)
                {
                    this.RefreshVisibleObject();
                    mnRefreshTick = System.Environment.TickCount;
                }
            }

            if (mAddHP_Time.ToNextTime())
            {
                if (mPlay.GetBaseAttr().life < mPlay.GetBaseAttr().life_max)
                {
                    int nAddHP = (int)(mPlay.GetBaseAttr().life_max * 0.05);//百分之五的血量
                    mPlay.ChangeAttribute(GameStruct.UserAttribute.LIFE, nAddHP, true);
                    NetMsg.MsgMonsterMagicInjuredInfo magicattack = new NetMsg.MsgMonsterMagicInjuredInfo();
                    magicattack.roleid       = this.GetTypeId();
                    magicattack.role_x       = this.GetCurrentX();
                    magicattack.role_y       = this.GetCurrentY();
                    magicattack.tag          = 21;
                    magicattack.magicid      = 6055;
                    magicattack.magiclv      = 0;
                    magicattack.monsterid    = mPlay.GetTypeId();
                    magicattack.injuredvalue = (uint)nAddHP;
                    this.BrocatBuffer(magicattack.GetBuffer());



                    byte[] data2 = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
                    GameBase.Network.PacketOut outpack = new GameBase.Network.PacketOut();
                    outpack.WriteUInt16(88);
                    outpack.WriteUInt16(1105);
                    outpack.WriteUInt32(this.GetTypeId());
                    outpack.WriteUInt32(mPlay.GetTypeId());
                    outpack.WriteUInt16(6055); //技能id
                    outpack.WriteUInt16(0);    //技能等级
                    outpack.WriteByte(this.GetDir());
                    outpack.WriteByte(1);      //类型
                    outpack.WriteUInt32(0);
                    outpack.WriteUInt32(0);
                    outpack.WriteUInt32(0);
                    outpack.WriteUInt16(0);
                    outpack.WriteUInt32(mPlay.GetTypeId());
                    outpack.WriteInt32(nAddHP);
                    outpack.WriteBuff(data2);
                    this.BrocatBuffer(outpack.Flush());
                    //NetMsg.MsgGroupM;agicAttackInfo magicattackex = new NetMsg.MsgGroupMagicAttackInfo();
                    //magicattackex.nID = this.GetTypeId();
                    //magicattackex.nX = this.GetCurrentX();
                    //magicattackex.nY = this.GetCurrentX();
                    //magicattackex.nMagicID = 6055;
                    //magicattackex.nMagicLv = 0;
                    //magicattackex.bDir = this.GetDir();
                    //this.BrocatBuffer(magicattackex.GetBuffer());
                }
            }
            return(ret);
        }
Exemple #14
0
 //发送飞鸽信息
 private void Send(PigeonInfo info)
 {
     short msgLen = 28;
     msgLen += (short)(Coding.GetDefauleCoding().GetBytes(info.name).Length + 1);
     msgLen += 17;
     msgLen += (short)(Coding.GetDefauleCoding().GetBytes(info.text).Length + 1);
     GameBase.Network.PacketOut outpack = new GameBase.Network.PacketOut();
     outpack.WriteInt16(msgLen);
     outpack.WriteInt16(1004);
     outpack.WriteInt32(0xffffff);
     outpack.WriteInt32(2017);
     outpack.WriteInt32(1419);
     outpack.WriteInt32(-1);
     outpack.WriteInt32(0);
     outpack.WriteByte(4); //四个字符串数组
     outpack.WriteString(info.name);
     outpack.WriteString("ALLUSERS");
     outpack.WriteString("1241350");
     outpack.WriteString(info.text);
     outpack.WriteByte(0);
     outpack.WriteByte(0);
     outpack.WriteByte(0);
     UserEngine.Instance().BrocatBuffer(outpack.Flush());
 }
Exemple #15
0
        public void GetFriendInfo(int playerid)
        {
            PlayerObject obj = UserEngine.Instance().FindPlayerObjectToPlayerId(playerid);
            if (obj == null) return;

            GameBase.Network.PacketOut outpack = new GameBase.Network.PacketOut(play.GetGamePackKeyEx());
            outpack.WriteUInt16(52);
            outpack.WriteUInt16(2033);
            outpack.WriteInt32(playerid);
            outpack.WriteUInt32(obj.GetBaseAttr().lookface);
            outpack.WriteByte(obj.GetBaseAttr().level);
            outpack.WriteByte(obj.GetBaseAttr().profession); //职业
            outpack.WriteInt32(0);
            outpack.WriteInt16(0);
            outpack.WriteByte(206);
            outpack.WriteByte(222);
            byte[] data = new byte[30];
            outpack.WriteBuff(data);
            play.SendData(outpack.Flush());
        }
Exemple #16
0
        public void SendGuanJueInfo(PlayerObject play)
        {
            //  byte[] data1 = { 25, 0, 247, 3, 0, 0, 0, 0, 113, 0, 1, 12, 49, 32, 45, 49, 32, 51, 48, 48, 48, 48, 48, 48, 0 };
            //捐献的
            ulong guanjue = play.GetBaseAttr().guanjue;
            byte[] byte_ = Coding.GetDefauleCoding().GetBytes(guanjue.ToString());
            GameBase.Network.PacketOut outpack = new GameBase.Network.PacketOut(play.GetGamePackKeyEx());
            outpack.WriteUInt16((ushort)(byte_.Length + 4 + 14));
            outpack.WriteUInt16(1015);
            outpack.WriteUInt32(0);
            outpack.WriteUInt16(113);
            outpack.WriteByte(1);

            //长度--
            outpack.WriteByte((byte)(byte_.Length + 5));
            String sjuewei = ((byte)play.GetGuanJue()).ToString();
            byte[] jueweibyte_ = Coding.GetDefauleCoding().GetBytes(sjuewei);
            outpack.WriteByte(jueweibyte_[0]); //爵位
            outpack.WriteByte(32); //分隔符
            outpack.WriteByte(45);
            outpack.WriteByte(49);
            outpack.WriteByte(32); //分隔符
            outpack.WriteBuff(byte_);
            outpack.WriteByte(0);

            play.SendData(outpack.Flush());
        }