Beispiel #1
0
        public override bool Run()
        {
            base.Run();
            if (System.Environment.TickCount - mnTick > mnTime)
            {
                this.ClearThis();
                return(false);
            }

            //会攻击的特效-- 降灵咒雨
            if (mnEffID == Define.JIANGLINGZHOUYU)
            {
                if (System.Environment.TickCount - mnAttackTick > 1000)
                {
                    mnAttackTick = System.Environment.TickCount;

                    NetMsg.MsgMonsterMagicInjuredInfo magicattack = new NetMsg.MsgMonsterMagicInjuredInfo();
                    magicattack.roleid  = (uint)mnEffID;
                    magicattack.role_x  = this.GetCurrentX();
                    magicattack.role_y  = this.GetCurrentY();
                    magicattack.tag     = 21;
                    magicattack.magicid = (ushort)Define.JIANGLINGZHOUYU_MAGICID;
                    magicattack.magiclv = 0;

                    this.BrocatBuffer(magicattack.GetBuffer());

                    NetMsg.MsgGroupMagicAttackInfo magicattackex = new NetMsg.MsgGroupMagicAttackInfo();
                    magicattackex.nID      = mPlay.GetTypeId();
                    magicattackex.nX       = this.GetCurrentX();
                    magicattackex.nY       = this.GetCurrentY();
                    magicattackex.nMagicID = (ushort)Define.JIANGLINGZHOUYU_MAGICID;
                    magicattackex.nMagicLv = 0;
                    magicattackex.bDir     = this.GetDir();
                    NetMsg.MsgAttackInfo info = new NetMsg.MsgAttackInfo();
                    info.tag = 21;
                    //---攻击 暂时只攻击怪物
                    foreach (RefreshObject refobj in this.GetVisibleList().Values)
                    {
                        BaseObject obj = refobj.obj;
                        if (obj.type == OBJECTTYPE.MONSTER)
                        {
                            if (this.GetPoint().CheckVisualDistance(obj.GetCurrentX(), obj.GetCurrentY(), Define.JIANGLINGZHOUYU_DIS))
                            {
                                uint nValue = BattleSystem.AdjustDamage(mPlay, obj, true);
                                magicattackex.AddObject(obj.GetTypeId(), (int)nValue);

                                obj.Injured(mPlay, nValue, info);
                            }
                        }
                    }
                    this.BrocatBuffer(magicattackex.GetBuffer());
                }
            }
            return(true);
        }
Beispiel #2
0
        public override bool Run()
        {
            base.Run();
            if (System.Environment.TickCount - mnTick > mnTime)
            {
                this.ClearThis();
                return false;
            }

            //会攻击的特效-- 降灵咒雨
            if (mnEffID == Define.JIANGLINGZHOUYU)
            {
                if (System.Environment.TickCount - mnAttackTick > 1000)
                {
                    mnAttackTick = System.Environment.TickCount;

                    NetMsg.MsgMonsterMagicInjuredInfo magicattack = new NetMsg.MsgMonsterMagicInjuredInfo();
                    magicattack.roleid = (uint)mnEffID;
                    magicattack.role_x = this.GetCurrentX();
                    magicattack.role_y = this.GetCurrentY();
                    magicattack.tag = 21;
                    magicattack.magicid = (ushort)Define.JIANGLINGZHOUYU_MAGICID;
                    magicattack.magiclv = 0;

                    this.BrocatBuffer(magicattack.GetBuffer());

                    NetMsg.MsgGroupMagicAttackInfo magicattackex = new NetMsg.MsgGroupMagicAttackInfo();
                    magicattackex.nID = mPlay.GetTypeId();
                    magicattackex.nX = this.GetCurrentX();
                    magicattackex.nY = this.GetCurrentY();
                    magicattackex.nMagicID = (ushort)Define.JIANGLINGZHOUYU_MAGICID;
                    magicattackex.nMagicLv = 0;
                    magicattackex.bDir = this.GetDir();
                    NetMsg.MsgAttackInfo info = new NetMsg.MsgAttackInfo();
                    info.tag = 21;
                    //---攻击 暂时只攻击怪物
                    foreach (RefreshObject refobj in this.GetVisibleList().Values)
                    {
                        BaseObject obj = refobj.obj;
                        if (obj.type == OBJECTTYPE.MONSTER)
                        {

                            if (this.GetPoint().CheckVisualDistance(obj.GetCurrentX(), obj.GetCurrentY(), Define.JIANGLINGZHOUYU_DIS))
                            {
                                uint nValue = BattleSystem.AdjustDamage(mPlay, obj, true);
                                magicattackex.AddObject(obj.GetTypeId(), (int)nValue);

                                obj.Injured(mPlay, nValue, info);

                            }

                        }
                    }
                    this.BrocatBuffer(magicattackex.GetBuffer());
                }
            }
            return true;
        }
        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;
        }
Beispiel #4
0
        public void MagicAttack(NetMsg.MsgAttackInfo info)
        {
            if (!play.GetMagicSystem().isMagic(info.usType)) return;
            //检测施法速度
            ushort magiclv = play.GetMagicSystem().GetMagicLevel(info.usType);
            if (!play.GetMagicSystem().CheckMagicAttackSpeed((ushort)info.usType, (byte)magiclv))
            {
                return;
            }
            //--------------------------------------------------------------------------
             //暗黑龙骑--焰魂枪·裂地三段斩
            if (info.usType == GameStruct.MagicTypeInfo.YANHUNQIANG_LIEDI)
            {
                uint nMagicId = info.usType + mnYanHunQiangIndex;
                //没有下一段技能
                if (!play.GetMagicSystem().isMagic(nMagicId))
                {
                    mnYanHunQiangIndex = 0;
                    nMagicId = info.usType;
                }
                info.usType = nMagicId;
                mnYanHunQiangIndex++;
                if (mnYanHunQiangIndex >= 3) mnYanHunQiangIndex = 0;
            }
            //--------------------------------------------------------------------------
            //暗黑龙骑- 焰魂枪·流焰 四段斩
            if (info.usType == GameStruct.MagicTypeInfo.YANHUNQIANG_LIUYAN)
            {
                uint nMagicId = info.usType + mnYanHunQiangExIndex;
                //没有下一段技能
                if (!play.GetMagicSystem().isMagic(nMagicId))
                {
                    mnYanHunQiangExIndex = 0;
                    nMagicId = info.usType;
                }
                info.usType = nMagicId;
                mnYanHunQiangExIndex++;
                if (mnYanHunQiangExIndex >= 4) mnYanHunQiangExIndex = 0;
            }
            //------------------------------------------------------------------------
            GameStruct.MagicTypeInfo typeinfo = ConfigManager.Instance().GetMagicTypeInfo(info.usType);
            if (typeinfo == null) return;
            uint injured = 0;
            BaseObject targetobj = null;

            //xp技能校验-
            if (typeinfo.use_xp > 0 && play.GetTimerSystem().QueryStatus(GameStruct.RoleStatus.STATUS_XPFULL_ATTACK) == null) return;
            //加经验
            if (typeinfo.need_exp > 0 && play.GetBaseAttr().level >= typeinfo.need_level)
            {
                play.GetMagicSystem().AddMagicExp(info.usType, 1);
            }
            if (typeinfo.use_ep > 0 && play.GetBaseAttr().sp < typeinfo.use_ep)
            {
                return;
            }
            if (typeinfo.use_mp > 0 && play.GetBaseAttr().mana < typeinfo.use_mp) return;
            //消耗体力
            if (typeinfo.use_ep > 0 && play.GetBaseAttr().sp > typeinfo.use_ep)
            {
                play.ChangeAttribute(UserAttribute.SP, (int)-typeinfo.use_ep);
            }
            //消耗魔法
            if (typeinfo.use_mp > 0 && play.GetBaseAttr().mana > typeinfo.use_mp)
            {
                play.ChangeAttribute(UserAttribute.MANA, (int)-typeinfo.use_mp);
            }
            switch (typeinfo.sort)
            {
                case GameStruct.MagicTypeInfo.MAGICSORT_ATTACK:
                case GameStruct.MagicTypeInfo.MAGICSORT_JUMP_ATTACK: //跳斩单体攻击
                    {
                        targetobj = play.GetGameMap().FindObjectForID(info.idTarget);
                        if (targetobj == null)
                        {
                            return;
                        }
                        if (targetobj.IsDie()) return;
                        if (targetobj.IsLock()) return; //被锁定了
                        byte bdir = DIR.GetDirByPos(play.GetCurrentX(), play.GetCurrentY(), targetobj.GetCurrentX(), targetobj.GetCurrentY());
                        play.SetDir(bdir);
                        //距离判断,防止非法封包
                        if (Math.Abs(play.GetCurrentX() - targetobj.GetCurrentY()) > typeinfo.distance &&
                            Math.Abs(play.GetCurrentY() - targetobj.GetCurrentY()) > typeinfo.distance)
                        { return; }
                        //连击技能
                        if (!play.CanPK(targetobj)) return;
                        if (IsComboMagic(typeinfo.typeid))
                        {
                            this.ComboMagic(info, targetobj);
                            //血袭- 增加buff与状态
                            if (info.usType == GameStruct.MagicTypeInfo.XUEXI)
                            {
                                play.GetTimerSystem().AddStatus(GameStruct.RoleStatus.STATUS_XUEXI, Define.XUEXI_TIME);
                            }
                            return;
                        }
                        //单体魔法攻击
                        injured = BattleSystem.AdjustDamage(play, targetobj, true);
                        //怪物承受XP技能加倍伤害
                        if (targetobj.type == OBJECTTYPE.MONSTER &&
                            typeinfo.use_xp > 0)
                        {
                            injured = injured * Define.XP_MULTIPLE;
                        }
                        NetMsg.MsgMonsterMagicInjuredInfo magicattack = new NetMsg.MsgMonsterMagicInjuredInfo();
                        magicattack.time = System.Environment.TickCount;
                        magicattack.roleid = play.GetTypeId();
                        magicattack.role_x = play.GetCurrentX();
                        magicattack.role_y = play.GetCurrentY();

                        magicattack.monsterid = targetobj.GetTypeId();
                        magicattack.tag = 21;
                        magicattack.magicid = (ushort)info.usType;
                        magicattack.magiclv = magiclv;
                        play.BroadcastBuffer(magicattack.GetBuffer(), true);

                        NetMsg.MsgGroupMagicAttackInfo magicattackex = new NetMsg.MsgGroupMagicAttackInfo();
                        //有轨迹的魔法--
                        magicattackex.SetSigleAttack(targetobj.GetTypeId());
                        magicattackex.nID = play.GetTypeId();
                        //magicattackex.nX = (short)info.usPosX;
                        //magicattackex.nY = (short)info.usPosY;

                        magicattackex.nMagicID = (ushort)info.usType;
                        magicattackex.nMagicLv = magiclv;
                        magicattackex.bDir = play.GetDir();
                        magicattackex.AddObject(targetobj.GetTypeId(),(int) injured);
                        play.BroadcastBuffer(magicattackex.GetBuffer(),true);

                        targetobj.Injured(play, injured, info);
                        ////跳斩单体攻击
                        //位置还没计算好..2015.10.27 暂时搁置
                        //位置已解决- 2015.11.1
                        if (typeinfo.sort == GameStruct.MagicTypeInfo.MAGICSORT_JUMP_ATTACK)
                        {
                            int nNewX = targetobj.GetCurrentX() - (DIR._DELTA_X[bdir] + DIR._DELTA_X[bdir]);
                            int nNewY = targetobj.GetCurrentY() - (DIR._DELTA_Y[bdir] + DIR._DELTA_Y[bdir]);
                            play.SetPoint((short)nNewX,(short) nNewY);
                        }
                        break;
                    }
                case GameStruct.MagicTypeInfo.MAGICSORT_BOMB: //范围攻击
                case GameStruct.MagicTypeInfo.MAGICSORT_JUMPBOMB: //跳斩范围攻击
                case GameStruct.MagicTypeInfo.MAGICSORT_POINTBOMB: //指定鼠标位置攻击
                    {
                         byte bdir = DIR.GetDirByPos(play.GetCurrentX(), play.GetCurrentY(), (short)info.usPosX, (short)info.usPosY);
                        play.SetDir(bdir);
                        //亡灵巫师巫怒噬魂
                        if (typeinfo.typeid == GameStruct.MagicTypeInfo.WUNUSHIHUN)
                        {
                            if (targetobj == null)
                            {
                                return;
                            }
                            int nNewX = targetobj.GetCurrentX() - (DIR._DELTA_X[bdir] + DIR._DELTA_X[bdir]);
                            int nNewY = targetobj.GetCurrentY() - (DIR._DELTA_Y[bdir] + DIR._DELTA_Y[bdir]);
                            play.SetPoint((short)nNewX, (short)nNewY);
                            targetobj = play.GetGameMap().FindObjectForID(info.idTarget);

                        }

                        if (typeinfo.sort == GameStruct.MagicTypeInfo.MAGICSORT_JUMPBOMB)   //跳斩
                        {
                            if (Math.Abs(play.GetCurrentX() - info.usPosX) > typeinfo.distance &&
                               Math.Abs(play.GetCurrentY() - info.usPosY) > typeinfo.distance)
                            { return; }
                            play.SetPoint((short)info.usPosX, (short)info.usPosY); //跳斩嘛。先跳过去
                        }

                        NetMsg.MsgGroupMagicAttackInfo magicattackex = new NetMsg.MsgGroupMagicAttackInfo();
                        magicattackex.nID = play.GetTypeId();
                        magicattackex.nX = play.GetCurrentX();
                        magicattackex.nY = play.GetCurrentY();
                        if (typeinfo.sort == GameStruct.MagicTypeInfo.MAGICSORT_POINTBOMB)
                        {

                            magicattackex.nX = (short)info.usPosX;
                            magicattackex.nY = (short)info.usPosY;
                        }
                        magicattackex.nMagicID = (ushort)info.usType;
                        magicattackex.nMagicLv = magiclv;
                        magicattackex.bDir = play.GetDir();

                        //被攻击的对象
                        List<BaseObject> list = this.RefreshMagicVisibleObject(typeinfo.typeid,info);
                        if (list != null)
                        {
                            for (int i = 0; i < list.Count; i++)
                            {

                                injured = BattleSystem.AdjustDamage(play, list[i], true);
                                //怪物承受XP技能加倍伤害
                                if (list[i].type == OBJECTTYPE.MONSTER &&
                                    typeinfo.use_xp > 0)
                                {
                                    injured = injured * Define.XP_MULTIPLE;
                                }
                                list[i].Injured(play, injured, info);
                                magicattackex.AddObject(list[i].GetTypeId(), (int)injured);
                            }
                        }

                        byte[] msg = magicattackex.GetBuffer();

                        play.BroadcastBuffer(msg, true);
                        //血族 血雨旋涡
                        if (typeinfo.typeid == GameStruct.MagicTypeInfo.XUEYUXUANWO)
                        {
                            int nAddX = 0;
                            int nAddY = 0;
                                switch(bdir)
                                {
                                    case DIR.LEFT_DOWN:
                                    case DIR.RIGHT_UP:
                                        {
                                            nAddX = 10;
                                            nAddY = 15;
                                            break;
                                        }
                                    case DIR.LEFT:
                                    case DIR.UP:
                                    case DIR.RIGHT:
                                    case DIR.DOWN:
                                        {
                                            nAddY = 10;
                                            nAddX = 10;
                                            break;
                                        }
                                    case DIR.LEFT_UP:
                                    case DIR.RIGHT_DOWN:
                                        {
                                            nAddX = 15; nAddY = 10;
                                            break;
                                        }
                                }
                            int nNewX = play.GetCurrentX() + (DIR._DELTA_X[bdir] * nAddX);
                            int nNewY = play.GetCurrentY() + (DIR._DELTA_Y[bdir] * nAddY);
                            play.SetPoint((short)nNewX, (short)nNewY);
                        }

                        break;
                    }

                case GameStruct.MagicTypeInfo.MAGICSORT_FAN: //扇形攻击
                    {

                        byte bdir = DIR.GetDirByPos(play.GetCurrentX(), play.GetCurrentY(), (short)info.usPosX, (short)info.usPosY);
                        play.SetDir(bdir);
                        NetMsg.MsgGroupMagicAttackInfo magicattackex = new NetMsg.MsgGroupMagicAttackInfo();
                        magicattackex.nID = play.GetTypeId();
                        magicattackex.nX = play.GetCurrentX();
                        magicattackex.nY = play.GetCurrentY();
                        magicattackex.nMagicID = (ushort)info.usType;
                        magicattackex.nMagicLv = magiclv;
                        magicattackex.bDir = bdir;
                        //被攻击的对象
                        List<BaseObject> list = this.RefreshMagicVisibleObject(typeinfo.typeid, info);
                        if (list != null)
                        {
                            for (int i = 0; i < list.Count; i++)
                            {
                                injured = BattleSystem.AdjustDamage(play, list[i], true);
                                //怪物承受XP技能加倍伤害
                                if (list[i].type == OBJECTTYPE.MONSTER &&
                                    typeinfo.use_xp > 0)
                                {
                                    injured = injured * Define.XP_MULTIPLE;
                                }
                                list[i].Injured(play, injured, info);
                                magicattackex.AddObject(list[i].GetTypeId(), (int)injured);
                            }
                        }

                        byte[] msg = magicattackex.GetBuffer();
                        play.BroadcastBuffer(msg, true);
                        break;
                    }
                case GameStruct.MagicTypeInfo.MAGICSORT_LINE: //直线型攻击
                    {

                        byte bByte = DIR.GetDirByPos(play.GetCurrentX(), play.GetCurrentY(), (short)info.usPosX, (short)info.usPosY);
                        play.SetDir(bByte);

                        NetMsg.MsgMonsterMagicInjuredInfo magicattack = new NetMsg.MsgMonsterMagicInjuredInfo();
                        magicattack.roleid = play.GetTypeId();
                        magicattack.role_x = play.GetCurrentX();
                        magicattack.role_y = play.GetCurrentY();
                        magicattack.tag = 21;
                        magicattack.magicid = (ushort)info.usType;
                        magicattack.magiclv = magiclv;
                        play.BroadcastBuffer(magicattack.GetBuffer(), true);

                        NetMsg.MsgGroupMagicAttackInfo magicattackex = new NetMsg.MsgGroupMagicAttackInfo();
                        magicattackex.nID = play.GetTypeId();
                        magicattackex.nX = (short)info.usPosX;
                        magicattackex.nY = (short)info.usPosY;
                        magicattackex.nMagicID = (ushort)info.usType;
                        magicattackex.nMagicLv = magiclv;
                        magicattackex.bDir = play.GetDir();
                        List<BaseObject> list = this.RefreshMagicVisibleObject(typeinfo.typeid, info);
                        if (list != null)
                        {
                            for (int i = 0; i < list.Count; i++)
                            {
                                injured = BattleSystem.AdjustDamage(play, list[i], true);
                                //怪物承受XP技能加倍伤害
                                if (list[i].type == OBJECTTYPE.MONSTER &&
                                    typeinfo.use_xp > 0)
                                {
                                    injured = injured * Define.XP_MULTIPLE;
                                }
                                list[i].Injured(play, injured, info);
                                magicattackex.AddObject(list[i].GetTypeId(), (int)injured);
                            }
                        }
                        play.BroadcastBuffer(magicattackex.GetBuffer(), true);
                        break;
                    }
                case GameStruct.MagicTypeInfo.MAGICSORT_ATTACHSTATUS: //引诱
                    {
                        foreach (RefreshObject refobj in play.GetVisibleList().Values)
                        {
                            BaseObject obj = refobj.obj;
                            if (obj.type == OBJECTTYPE.MONSTER)
                            {
                                if ((obj as MonsterObject).GetAi().GetTargetObject() == null)
                                {
                                    (obj as MonsterObject).GetAi().SetAttackTarget(play);
                                }

                            }
                        }
                        byte dir = DIR.GetDirByPos(play.GetCurrentX(), play.GetCurrentY(), (short)info.usPosX, (short)info.usPosY);
                        play.SetDir(dir);
                        NetMsg.MsgMonsterMagicInjuredInfo magicinfo = new NetMsg.MsgMonsterMagicInjuredInfo();
                        magicinfo.roleid = play.GetTypeId();
                        magicinfo.role_x = play.GetCurrentX();
                        magicinfo.role_y = play.GetCurrentY();
                        magicinfo.injuredvalue = 0;
                        magicinfo.monsterid = play.GetTypeId();
                        magicinfo.tag = 21;
                        magicinfo.magicid = (ushort)info.usType;
                        magicinfo.magiclv = magiclv;
                        byte[] msg = magicinfo.GetBuffer();
                        play.BroadcastBuffer(msg,true);

                        NetMsg.MsgMagicAttackInfo _info = new NetMsg.MsgMagicAttackInfo();
                        _info.id = _info.targetid = play.GetTypeId();
                        _info.magicid = (ushort)info.usType;
                        _info.level = magiclv;
                        _info.dir = dir;
                        msg = _info.GetBuffer();
                        play.BroadcastBuffer(msg, true);

                        break;
                    }
                case GameStruct.MagicTypeInfo.MAGICSORT_STEALTH:    //潜行
                    {
                        byte dir = DIR.GetDirByPos(play.GetCurrentX(), play.GetCurrentY(), (short)info.usPosX, (short)info.usPosY);
                        play.SetDir(dir);
                        NetMsg.MsgMonsterMagicInjuredInfo magicinfo = new NetMsg.MsgMonsterMagicInjuredInfo();
                        magicinfo.roleid = play.GetTypeId();
                        magicinfo.role_x = play.GetCurrentX();
                        magicinfo.role_y = play.GetCurrentY();
                        magicinfo.injuredvalue = 0;
                        magicinfo.monsterid = play.GetTypeId();
                        magicinfo.tag = 21;
                        magicinfo.magicid = (ushort)info.usType;
                        magicinfo.magiclv = magiclv;
                        byte[] msg = magicinfo.GetBuffer();
                        play.BroadcastBuffer(msg, true);

                        NetMsg.MsgMagicAttackInfo _info = new NetMsg.MsgMagicAttackInfo();
                        _info.id = _info.targetid = play.GetTypeId();
                        _info.magicid = (ushort)info.usType;
                        _info.level = magiclv;
                        _info.dir = dir;
                        msg = _info.GetBuffer();
                        play.BroadcastBuffer(msg, true);

                        play.GetTimerSystem().AddStatus(GameStruct.RoleStatus.STATUS_STEALTH, Define.STEALTH_TIME);
                        break;
                    }
                case GameStruct.MagicTypeInfo.MAGICSORT_HIDEDEN://隐身
                    {
                        byte dir = DIR.GetDirByPos(play.GetCurrentX(), play.GetCurrentY(), (short)info.usPosX, (short)info.usPosY);
                        play.SetDir(dir);
                        NetMsg.MsgMonsterMagicInjuredInfo magicinfo = new NetMsg.MsgMonsterMagicInjuredInfo();
                        magicinfo.roleid = play.GetTypeId();
                        magicinfo.role_x = play.GetCurrentX();
                        magicinfo.role_y = play.GetCurrentY();
                        magicinfo.injuredvalue = 0;
                        magicinfo.monsterid = play.GetTypeId();
                        magicinfo.tag = 21;
                        magicinfo.magicid = (ushort)info.usType;
                        magicinfo.magiclv = magiclv;
                        byte[] msg = magicinfo.GetBuffer();
                        play.BroadcastBuffer(msg, true);

                        NetMsg.MsgMagicAttackInfo _info = new NetMsg.MsgMagicAttackInfo();
                        _info.id = _info.targetid = play.GetTypeId();
                        _info.magicid = (ushort)info.usType;
                        _info.level = magiclv;
                        _info.dir = dir;
                        msg = _info.GetBuffer();
                        play.BroadcastBuffer(msg, true);
                        if (play.GetTimerSystem().QueryStatus(GameStruct.RoleStatus.STATUS_HIDDEN) != null)
                        {
                            play.GetTimerSystem().DeleteStatus(GameStruct.RoleStatus.STATUS_HIDDEN);
                        }
                        else
                        {
                            play.GetTimerSystem().AddStatus(GameStruct.RoleStatus.STATUS_HIDDEN, Define.HIDEDEM_TIME);
                        }

                        break;
                    }
                case GameStruct.MagicTypeInfo.MAGICSORT_YUANSUZHANGKONG:        //法师 元素掌控
                    {
                        byte dir = DIR.GetDirByPos(play.GetCurrentX(), play.GetCurrentY(), (short)info.usPosX, (short)info.usPosY);
                        play.SetDir(dir);
                        NetMsg.MsgMonsterMagicInjuredInfo magicinfo = new NetMsg.MsgMonsterMagicInjuredInfo();
                        magicinfo.roleid = play.GetTypeId();
                        magicinfo.role_x = play.GetCurrentX();
                        magicinfo.role_y = play.GetCurrentY();
                        magicinfo.injuredvalue = 0;
                        magicinfo.monsterid = play.GetTypeId();
                        magicinfo.tag = 21;
                        magicinfo.magicid = (ushort)info.usType;
                        magicinfo.magiclv = magiclv;
                        byte[] msg = magicinfo.GetBuffer();
                        play.BroadcastBuffer(msg, true);
                        if (play.GetTimerSystem().QueryStatus(GameStruct.RoleStatus.STATUS_YUANSUZHANGKONG) != null)
                        {
                            play.GetTimerSystem().DeleteStatus(GameStruct.RoleStatus.STATUS_YUANSUZHANGKONG);
                            //流星陨火要清空
                            mnLiuXingYunHuoCount = 0;
                            play.ChangeAttribute(UserAttribute.LIUXINGYUNHUO, mnLiuXingYunHuoCount);
                        }
                        else
                        {
                            play.GetTimerSystem().AddStatus(GameStruct.RoleStatus.STATUS_YUANSUZHANGKONG, 0);
                        }

                        NetMsg.MsgMagicAttackInfo _info = new NetMsg.MsgMagicAttackInfo();
                        _info.id = _info.targetid = play.GetTypeId();
                        _info.magicid = (ushort)info.usType;
                        _info.level = magiclv;
                        _info.dir = dir;
                        msg = _info.GetBuffer();
                        play.BroadcastBuffer(msg, true);

                        break;
                    }
                case GameStruct.MagicTypeInfo.MAGICSORT_LIUXINGYUNHUO:  //法师 流星陨石
                    {
                        targetobj = play.GetGameMap().FindObjectForID(info.idTarget);
                        if (targetobj == null)
                        {
                            return;
                        }
                        byte dir = DIR.GetDirByPos(play.GetCurrentX(), play.GetCurrentY(), (short)info.usPosX, (short)info.usPosY);
                        play.SetDir(dir);
                        if (mnLiuXingYunHuoCount <= 0) break;

                        NetMsg.MsgMonsterMagicInjuredInfo magicinfo = new NetMsg.MsgMonsterMagicInjuredInfo();
                        magicinfo.roleid = play.GetTypeId();
                        magicinfo.role_x = play.GetCurrentX();
                        magicinfo.role_y = play.GetCurrentY();
                        magicinfo.injuredvalue = 0;
                        magicinfo.monsterid = play.GetTypeId();
                        magicinfo.tag = 21;
                        magicinfo.magicid = (ushort)info.usType;
                        magicinfo.magiclv = magiclv;
                        byte[] msg = magicinfo.GetBuffer();
                        play.BroadcastBuffer(msg, true);

                        for (int i = 0; i < mnLiuXingYunHuoCount; i++)
                        {
                            injured = BattleSystem.AdjustDamage(play, targetobj, true);
                            NetMsg.MsgGroupMagicAttackInfo magicattackex = new NetMsg.MsgGroupMagicAttackInfo();
                            //有轨迹的魔法--
                            magicattackex.SetSigleAttack(targetobj.GetTypeId());
                            magicattackex.nID = play.GetTypeId();

                            magicattackex.nMagicID = (ushort)info.usType;
                            magicattackex.nMagicLv = magiclv;
                            magicattackex.bDir = play.GetDir();
                            magicattackex.AddObject(targetobj.GetTypeId(), (int)injured);
                            play.BroadcastBuffer(magicattackex.GetBuffer(), true);

                            targetobj.Injured(play, injured, info);

                        }
                            mnLiuXingYunHuoCount = 0;
                        play.ChangeAttribute(UserAttribute.LIUXINGYUNHUO, mnLiuXingYunHuoCount);
                        break;
                    }
                case GameStruct.MagicTypeInfo.MAGICSORT_JUYANSHENGDUN://法师 巨岩圣盾
                    {
                        byte dir = DIR.GetDirByPos(play.GetCurrentX(), play.GetCurrentY(), (short)info.usPosX, (short)info.usPosY);
                        play.SetDir(dir);

                        NetMsg.MsgMonsterMagicInjuredInfo magicinfo = new NetMsg.MsgMonsterMagicInjuredInfo();
                        magicinfo.roleid = play.GetTypeId();
                        magicinfo.role_x = play.GetCurrentX();
                        magicinfo.role_y = play.GetCurrentY();
                        magicinfo.injuredvalue = 0;
                        magicinfo.monsterid = play.GetTypeId();
                        magicinfo.tag = 21;
                        magicinfo.magicid = (ushort)info.usType;
                        magicinfo.magiclv = magiclv;
                        byte[] msg = magicinfo.GetBuffer();
                        play.BroadcastBuffer(msg, true);

                        NetMsg.MsgMagicAttackInfo _info = new NetMsg.MsgMagicAttackInfo();
                        _info.id = _info.targetid = play.GetTypeId();
                        _info.magicid = (ushort)info.usType;
                        _info.level = magiclv;
                        _info.dir = dir;
                        msg = _info.GetBuffer();
                        play.BroadcastBuffer(msg, true);
                        play.GetTimerSystem().AddStatus(GameStruct.RoleStatus.STATUS_JUYANSHENGDUN, 0);
                        break;
                    }
                case GameStruct.MagicTypeInfo.MAGICSORT_YUANSUZHAOHUAN: //法师 元素召唤
                    {
                        if (play.IsMountState()) play.TakeOffMount(0);
                        else play.TakeMount(0,Define.YUANSUZHAOHUAN_MOUNTID);
                        break;
                    }
                case GameStruct.MagicTypeInfo.MAGICSORT_GULINGQIYUE: //亡灵巫师 骨灵契约
                    {
                        if (play.IsMountState()) play.TakeOffMount(0);
                        else play.TakeMount(0,Define.GULINGQIYUE_MOUNTID);
                        break;

                    }
                case GameStruct.MagicTypeInfo.MAGICSORT_ZHAOHUANWUHUAN:
                    {

                        NetMsg.MsgMonsterMagicInjuredInfo magicinfo = new NetMsg.MsgMonsterMagicInjuredInfo();
                        magicinfo.roleid = play.GetTypeId();
                        magicinfo.role_x = play.GetCurrentX();
                        magicinfo.role_y = play.GetCurrentY();
                        magicinfo.injuredvalue = 0;
                        magicinfo.monsterid = play.GetTypeId();
                        magicinfo.tag = 21;
                        magicinfo.magicid = (ushort)info.usType;
                        magicinfo.magiclv = magiclv;
                        byte[] msg = magicinfo.GetBuffer();
                        play.BroadcastBuffer(msg, true);

                        NetMsg.MsgMagicAttackInfo _info = new NetMsg.MsgMagicAttackInfo();
                        _info.id = _info.targetid = play.GetTypeId();
                        _info.magicid = (ushort)info.usType;
                        _info.level = magiclv;
                        _info.dir = play.GetDir();
                        msg = _info.GetBuffer();
                        play.BroadcastBuffer(msg, true);
                        if (play.GetTimerSystem().QueryStatus(GameStruct.RoleStatus.STATUS_ZHAOHUANWUHUAN) != null)
                        {
                            play.GetTimerSystem().DeleteStatus(GameStruct.RoleStatus.STATUS_ZHAOHUANWUHUAN);
                        }
                        else
                        {
                            play.GetTimerSystem().AddStatus(GameStruct.RoleStatus.STATUS_ZHAOHUANWUHUAN);
                        }
                        break;
                    }
                case GameStruct.MagicTypeInfo.MAGICSORT_JIANGLINGZHOUYU:    //亡灵巫师- 降灵咒雨
                    {
                        byte dir = DIR.GetDirByPos(play.GetCurrentX(), play.GetCurrentY(), (short)info.usPosX, (short)info.usPosY);
                        play.SetDir(dir);
                        NetMsg.MsgMonsterMagicInjuredInfo magicinfo = new NetMsg.MsgMonsterMagicInjuredInfo();
                        magicinfo.roleid = play.GetTypeId();
                        magicinfo.role_x = play.GetCurrentX();
                        magicinfo.role_y = play.GetCurrentY();
                        magicinfo.injuredvalue = 0;
                        magicinfo.monsterid = play.GetTypeId();
                        magicinfo.tag = 21;
                        magicinfo.magicid = (ushort)info.usType;
                        magicinfo.magiclv = magiclv;
                        byte[] msg = magicinfo.GetBuffer();
                        play.BroadcastBuffer(msg, true);

                        NetMsg.MsgMagicAttackInfo _info = new NetMsg.MsgMagicAttackInfo();
                        _info.id = _info.targetid = play.GetTypeId();
                        _info.magicid = (ushort)info.usType;
                        _info.level = magiclv;
                        _info.dir = dir;
                        msg = _info.GetBuffer();
                        play.BroadcastBuffer(msg, true);

                        EffectObject _effobj = new EffectObject(play, Define.JIANGLINGZHOUYU, 10, 14, Define.JIANGLINGZHOUYU_TIME, (short)info.usPosX, (short)info.usPosY);
                        play.GetGameMap().AddObject(_effobj);
                        _effobj.RefreshVisibleObject();
                        _effobj.SendInfo(play);
                        break;
                    }
                case GameStruct.MagicTypeInfo.MAGICSORT_ANSHAXIELONG:   //暗沙邪龙
                    {
                        byte dir = DIR.GetDirByPos(play.GetCurrentX(), play.GetCurrentY(), (short)info.usPosX, (short)info.usPosY);
                        play.SetDir(dir);
                        NetMsg.MsgMonsterMagicInjuredInfo magicinfo = new NetMsg.MsgMonsterMagicInjuredInfo();
                        magicinfo.roleid = play.GetTypeId();
                        magicinfo.role_x = play.GetCurrentX();
                        magicinfo.role_y = play.GetCurrentY();
                        magicinfo.injuredvalue = 0;
                        magicinfo.monsterid = play.GetTypeId();
                        magicinfo.tag = 21;
                        magicinfo.magicid = (ushort)info.usType;
                        magicinfo.magiclv = magiclv;
                        byte[] msg = magicinfo.GetBuffer();
                        play.BroadcastBuffer(msg, true);

                        NetMsg.MsgMagicAttackInfo _info = new NetMsg.MsgMagicAttackInfo();
                        _info.id = _info.targetid = play.GetTypeId();
                        _info.magicid = (ushort)info.usType;
                        _info.level = magiclv;
                        _info.dir = dir;
                        msg = _info.GetBuffer();
                        play.BroadcastBuffer(msg, true);

                        play.GetTimerSystem().AddStatus(GameStruct.RoleStatus.STATUS_ANSHAXIELONG);

                        break;
                    }
                case GameStruct.MagicTypeInfo.MAGICSORT_MINGGUOSHENGNV: //冥国圣女
                    {
                        byte dir = DIR.GetDirByPos(play.GetCurrentX(), play.GetCurrentY(), (short)info.usPosX, (short)info.usPosY);
                        play.SetDir(dir);
                        NetMsg.MsgMonsterMagicInjuredInfo magicinfo = new NetMsg.MsgMonsterMagicInjuredInfo();
                        magicinfo.roleid = play.GetTypeId();
                        magicinfo.role_x = play.GetCurrentX();
                        magicinfo.role_y = play.GetCurrentY();
                        magicinfo.injuredvalue = 0;
                        magicinfo.monsterid = play.GetTypeId();
                        magicinfo.tag = 21;
                        magicinfo.magicid = (ushort)info.usType;
                        magicinfo.magiclv = magiclv;
                        byte[] msg = magicinfo.GetBuffer();
                        play.BroadcastBuffer(msg, true);

                        NetMsg.MsgMagicAttackInfo _info = new NetMsg.MsgMagicAttackInfo();
                        _info.id = _info.targetid = play.GetTypeId();
                        _info.magicid = (ushort)info.usType;
                        _info.level = magiclv;
                        _info.dir = dir;
                        msg = _info.GetBuffer();
                        play.BroadcastBuffer(msg, true);

                        play.GetTimerSystem().AddStatus(GameStruct.RoleStatus.STATUS_MINGGUOSHENGNV);
                        break;
                    }
                case GameStruct.MagicTypeInfo.MAGICSORT_WANGNIANWULING: //亡念巫灵
                    {
                        byte dir = DIR.GetDirByPos(play.GetCurrentX(), play.GetCurrentY(), (short)info.usPosX, (short)info.usPosY);
                        play.SetDir(dir);
                        NetMsg.MsgMonsterMagicInjuredInfo magicinfo = new NetMsg.MsgMonsterMagicInjuredInfo();
                        magicinfo.roleid = play.GetTypeId();
                        magicinfo.role_x = play.GetCurrentX();
                        magicinfo.role_y = play.GetCurrentY();
                        magicinfo.injuredvalue = 0;
                        magicinfo.monsterid = play.GetTypeId();
                        magicinfo.tag = 21;
                        magicinfo.magicid = (ushort)info.usType;
                        magicinfo.magiclv = magiclv;
                        byte[] msg = magicinfo.GetBuffer();
                        play.BroadcastBuffer(msg, true);

                        NetMsg.MsgMagicAttackInfo _info = new NetMsg.MsgMagicAttackInfo();
                        _info.id = _info.targetid = play.GetTypeId();
                        _info.magicid = (ushort)info.usType;
                        _info.level = magiclv;
                        _info.dir = dir;
                        msg = _info.GetBuffer();
                        play.BroadcastBuffer(msg, true);

                        play.GetTimerSystem().AddStatus(GameStruct.RoleStatus.STATUS_WANGNIANWULING);
                        break;
                    }
                case GameStruct.MagicTypeInfo.MAGICSORT_SHENYUANELING: //深渊恶灵
                case GameStruct.MagicTypeInfo.MAGICSORT_DIYUXIEFU: //地狱邪蝠
                case GameStruct.MagicTypeInfo.MAGICSORT_SHIHUNWULING://蚀魂巫灵
                    {
                        targetobj = play.GetGameMap().FindObjectForID(info.idTarget);
                        if (targetobj == null)
                        {
                            return;
                        }
                        uint monster_id = Define.SHENYUANELING_MONSTER_ID;
                        if (typeinfo.sort == GameStruct.MagicTypeInfo.MAGICSORT_DIYUXIEFU)
                        {
                            monster_id = Define.DIYUXIEFU_MONSTER_ID;
                        }
                        else if (typeinfo.sort == GameStruct.MagicTypeInfo.MAGICSORT_SHIHUNWULING)
                        {
                            monster_id = Define.SHIHUNWULING_MONSTER_ID;
                        }
                        GameStruct.MonsterInfo monster_info = ConfigManager.Instance().GetMonsterInfo(monster_id);
                        if(monster_info == null)
                        {
                            Log.Instance().WriteLog("获取深渊恶灵怪物ID失败");
                            break;
                        }
                        byte dir = DIR.GetDirByPos(play.GetCurrentX(), play.GetCurrentY(), (short)info.usPosX, (short)info.usPosY);
                        play.SetDir(dir);
                        NetMsg.MsgMonsterMagicInjuredInfo magicinfo = new NetMsg.MsgMonsterMagicInjuredInfo();
                        magicinfo.roleid = play.GetTypeId();
                        magicinfo.role_x = play.GetCurrentX();
                        magicinfo.role_y = play.GetCurrentY();
                        magicinfo.injuredvalue = 0;
                        magicinfo.monsterid = play.GetTypeId();
                        magicinfo.tag = 21;
                        magicinfo.magicid = (ushort)info.usType;
                        magicinfo.magiclv = magiclv;
                        byte[] msg = magicinfo.GetBuffer();
                        play.BroadcastBuffer(msg, true);

                        NetMsg.MsgMagicAttackInfo _info = new NetMsg.MsgMagicAttackInfo();
                        _info.id = _info.targetid = play.GetTypeId();
                        _info.magicid = (ushort)info.usType;
                        _info.level = magiclv;
                        _info.dir = dir;
                        msg = _info.GetBuffer();
                        play.BroadcastBuffer(msg, true);
                        //play.GetTimerSystem().AddStatus(GameStruct.RoleStatus.STATUS_SHENYUANELING);

                        int nNewX = targetobj.GetCurrentX() - DIR._DELTA_X[play.GetDir()];
                        int nNewY = targetobj.GetCurrentY() - DIR._DELTA_Y[play.GetDir()];
                        MonsterObject Object_CALL = null;
                        if (typeinfo.sort == GameStruct.MagicTypeInfo.MAGICSORT_DIYUXIEFU)
                        {
                            Object_CALL = new DiYuXieFu(play, targetobj, (short)nNewX, (short)nNewY, play.GetDir(), monster_info.id, monster_info.ai);
                        }
                        else if (typeinfo.sort == GameStruct.MagicTypeInfo.MAGICSORT_SHIHUNWULING)
                        {
                            Object_CALL = new ShiHunWuLing(play, targetobj, (short)nNewX, (short)nNewY, play.GetDir(), monster_info.id, monster_info.ai);
                        }
                        else if (typeinfo.sort == GameStruct.MagicTypeInfo.MAGICSORT_SHENYUANELING)
                        {
                           Object_CALL= new ShenYuanELing(play, targetobj, (short)nNewX, (short)nNewY, play.GetDir(), monster_info.id, monster_info.ai);
                        }

                        play.GetGameMap().AddObject(Object_CALL, null);
                       // Object_CALL.RefreshVisibleObject();
                        Object_CALL.Alive(false);
                        break;
                    }
                case GameStruct.MagicTypeInfo.MAGICSORT_DRAGON_MOLONGSHOUHU: //暗黑龙骑魔龙守护
                    {
                        byte dir = DIR.GetDirByPos(play.GetCurrentX(), play.GetCurrentY(), (short)info.usPosX, (short)info.usPosY);
                        play.SetDir(dir);
                        NetMsg.MsgMonsterMagicInjuredInfo magicinfo = new NetMsg.MsgMonsterMagicInjuredInfo();
                        magicinfo.roleid = play.GetTypeId();
                        magicinfo.role_x = play.GetCurrentX();
                        magicinfo.role_y = play.GetCurrentY();
                        magicinfo.injuredvalue = 0;
                        magicinfo.monsterid = play.GetTypeId();
                        magicinfo.tag = 21;
                        magicinfo.magicid = (ushort)info.usType;
                        magicinfo.magiclv = magiclv;
                        byte[] msg = magicinfo.GetBuffer();
                        play.BroadcastBuffer(msg, true);

                        NetMsg.MsgMagicAttackInfo _info = new NetMsg.MsgMagicAttackInfo();
                        _info.id = _info.targetid = play.GetTypeId();
                        _info.magicid = (ushort)info.usType;
                        _info.level = magiclv;
                        _info.dir = dir;
                        msg = _info.GetBuffer();
                        play.BroadcastBuffer(msg, true);

                        play.GetTimerSystem().AddStatus(GameStruct.RoleStatus.STATUS_MOLONGSHOUHU, Define.STATUS_MOLONGSHOUHU_TIME, true);
                        //添加buff图标

                        break;
                    }

                case GameStruct.MagicTypeInfo.MAGICSORT_DRAGON_QISHITUANSHOUHU: //骑士团守护
                    {
                        byte dir = DIR.GetDirByPos(play.GetCurrentX(), play.GetCurrentY(), (short)info.usPosX, (short)info.usPosY);
                        play.SetDir(dir);
                        NetMsg.MsgMonsterMagicInjuredInfo magicinfo = new NetMsg.MsgMonsterMagicInjuredInfo();
                        magicinfo.roleid = play.GetTypeId();
                        magicinfo.role_x = play.GetCurrentX();
                        magicinfo.role_y = play.GetCurrentY();
                        magicinfo.injuredvalue = 0;
                        magicinfo.monsterid = play.GetTypeId();
                        magicinfo.tag = 21;
                        magicinfo.magicid = (ushort)info.usType;
                        magicinfo.magiclv = magiclv;
                        byte[] msg = magicinfo.GetBuffer();
                        play.BroadcastBuffer(msg, true);

                        NetMsg.MsgMagicAttackInfo _info = new NetMsg.MsgMagicAttackInfo();
                        _info.id = _info.targetid = play.GetTypeId();
                        _info.magicid = (ushort)info.usType;
                        _info.level = magiclv;
                        _info.dir = dir;
                        msg = _info.GetBuffer();
                        play.BroadcastBuffer(msg, true);

                        //创建四个守护骑士
                        GuardKnightObject obj = null;
                        GameStruct.MonsterInfo monster = ConfigManager.Instance().GetMonsterInfo(Define.GUARDKNIGHTID);
                        if (monster == null)
                        {
                            Log.Instance().WriteLog("创建守护骑士失败!!,无此怪物id!");
                            break;
                        }
                        if (mListQiShiTuanGuard == null)
                        {mListQiShiTuanGuard = new List<BaseObject>();}
                       // else
                       // {
                            RemoveQiShiTuanGuardEffect();
                       // }
                        short[] _x = { -5, -5, +5, +5 };
                        short[] _y = { +5, -5, -5, +5 };
                        byte[] _dir = { DIR.LEFT_DOWN, DIR.LEFT_UP, DIR.RIGHT_UP, DIR.RIGHT_DOWN };
                        for (int i = 0; i < _x.Length; i++)
                        {
                            short x = (short)(play.GetCurrentX() + _x[i]);
                            short y = (short)(play.GetCurrentY() + _y[i]);

                            obj = new GuardKnightObject(play,  x, y, _dir[i], monster.id, monster.ai);
                            play.GetGameMap().AddObject(obj,null);
                            obj.RefreshVisibleObject();
                            obj.SendInfo(play);
                            mListQiShiTuanGuard.Add(obj);

                            play.AddVisibleObject(obj, true);
                        }
                        //地面特效-
                        EffectObject _effobj = new EffectObject(play, Define.GUARDKNIGHT_EFFID, 10, 15, Define.GUARDKNIGHT_TIME, play.GetCurrentX(), play.GetCurrentY());
                        play.GetGameMap().AddObject(_effobj);
                        _effobj.RefreshVisibleObject();
                        _effobj.SendInfo(play);
                        mListQiShiTuanGuard.Add(_effobj);

                        play.AddVisibleObject(_effobj, true);

                        break;
                    }
                case GameStruct.MagicTypeInfo.MAGICSORT_DRAGON_QISHITUANCHONGFENG: //骑士团冲锋
                    {
                        byte dir = DIR.GetDirByPos(play.GetCurrentX(), play.GetCurrentY(), (short)info.usPosX, (short)info.usPosY);
                        play.SetDir(dir);
                        NetMsg.MsgMonsterMagicInjuredInfo magicinfo = new NetMsg.MsgMonsterMagicInjuredInfo();
                        magicinfo.roleid = play.GetTypeId();
                        magicinfo.role_x = play.GetCurrentX();
                        magicinfo.role_y = play.GetCurrentY();
                        magicinfo.injuredvalue = 0;
                        magicinfo.monsterid = play.GetTypeId();
                        magicinfo.tag = 21;
                        magicinfo.magicid = (ushort)info.usType;
                        magicinfo.magiclv = magiclv;
                        byte[] msg = magicinfo.GetBuffer();
                        play.BroadcastBuffer(msg, true);

                        NetMsg.MsgMagicAttackInfo _info = new NetMsg.MsgMagicAttackInfo();
                        _info.id = _info.targetid = play.GetTypeId();
                        _info.magicid = (ushort)info.usType;
                        _info.level = magiclv;
                        _info.dir = dir;
                        msg = _info.GetBuffer();
                        play.BroadcastBuffer(msg, true);
                        //创建四个冲锋骑士
                        FightKnightObject obj = null;
                        GameStruct.MonsterInfo monster = ConfigManager.Instance().GetMonsterInfo(Define.FIGHTKNIGHTID);
                        if (monster == null)
                        {
                            Log.Instance().WriteLog("创建黑暗骑士失败!!,无此怪物id!");
                            break;
                        }
                      //先不管这个技能了---烦
                        short[] _x = { -5, -5, +5, +5 };
                        short[] _y = { +5, -5, -5, +5 };
                        byte[] _dir = { DIR.LEFT_DOWN, DIR.LEFT_UP, DIR.RIGHT_UP, DIR.RIGHT_DOWN };
                        for (int i = 0; i < Define.FIGHTKNIGHT_AMOUNT; i++)
                        {

                            short x = (short)(play.GetCurrentX() + _x[i]);
                            short y = (short)(play.GetCurrentY()+ _y[i] );

                            obj = new FightKnightObject(x, y, play.GetDir(), monster.id, Define.FIGHTKNIGHT_TIME);
                            play.GetGameMap().AddObject(obj, null);
                            obj.RefreshVisibleObject();
                            obj.SendInfo(play);

                            play.AddVisibleObject(obj, true);
                        }
                        break;
                    }
                case GameStruct.MagicTypeInfo.MAGICSORT_MIXINSHU:   //血族 迷心术
                    {
                        byte dir = DIR.GetDirByPos(play.GetCurrentX(), play.GetCurrentY(), (short)info.usPosX, (short)info.usPosY);
                        play.SetDir(dir);
                        NetMsg.MsgMonsterMagicInjuredInfo magicinfo = new NetMsg.MsgMonsterMagicInjuredInfo();
                        magicinfo.roleid = play.GetTypeId();
                        magicinfo.role_x = play.GetCurrentX();
                        magicinfo.role_y = play.GetCurrentY();
                        magicinfo.injuredvalue = 0;
                        magicinfo.monsterid = play.GetTypeId();
                        magicinfo.tag = 21;
                        magicinfo.magicid = (ushort)info.usType;
                        magicinfo.magiclv = magiclv;
                        byte[] msg = magicinfo.GetBuffer();
                        play.BroadcastBuffer(msg, true);

                        NetMsg.MsgMagicAttackInfo _info = new NetMsg.MsgMagicAttackInfo();
                        _info.id = _info.targetid = play.GetTypeId();
                        _info.magicid = (ushort)info.usType;
                        _info.level = magiclv;
                        _info.dir = dir;
                        msg = _info.GetBuffer();
                        play.BroadcastBuffer(msg, true);
                        play.GetTimerSystem().AddStatus(GameStruct.RoleStatus.STATUS_MIXINSHU,Define.MIXINSHU_TIME);
                        break;
                    }
                case GameStruct.MagicTypeInfo.MAGICSORT_SINGLE_DANCING: //单人舞
                case GameStruct.MagicTypeInfo.MAGICSORT_DOUBLE_DANCING: //双人舞
                    {

                        NetMsg.MsgMonsterMagicInjuredInfo magicinfo = new NetMsg.MsgMonsterMagicInjuredInfo();
                        magicinfo.roleid = play.GetTypeId();
                        magicinfo.role_x = play.GetCurrentX();
                        magicinfo.role_y = play.GetCurrentY();
                        magicinfo.injuredvalue = 0;
                        magicinfo.monsterid = play.GetTypeId();
                        magicinfo.tag = 21;
                        magicinfo.magicid = (ushort)info.usType;
                        magicinfo.magiclv = magiclv;
                        byte[] msg = magicinfo.GetBuffer();
                        play.BroadcastBuffer(msg, true);

                        NetMsg.MsgMagicAttackInfo _info = new NetMsg.MsgMagicAttackInfo();
                        _info.id = _info.targetid = play.GetTypeId();
                        _info.magicid = (ushort)info.usType;
                        _info.level = magiclv;
                        _info.dir = play.GetDir();
                        msg = _info.GetBuffer();
                        play.BroadcastBuffer(msg, true);
                        play.SetDancing((short)info.usType);
                        break;
                    }

                    //{
                    //    break;
                    //}
                    //{
                    //    break;
                    //}
            }

               // lastattacktime = System.Environment.TickCount;
        }
Beispiel #5
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);
        }
Beispiel #6
0
        //连击技能
        private void ComboMagic(NetMsg.MsgAttackInfo info, BaseObject target)
        {
            byte[] msg = null;
            ushort magiclv = play.GetMagicSystem().GetMagicLevel(info.skillid);
            GameStruct.MagicTypeInfo baseinfo = ConfigManager.Instance().GetMagicTypeInfo(info.usType);

            //施法动作
            NetMsg.MsgMonsterMagicInjuredInfo magicinfo = new NetMsg.MsgMonsterMagicInjuredInfo();
            magicinfo.roleid = play.GetTypeId();
            magicinfo.role_x = play.GetCurrentX();
            magicinfo.role_y = play.GetCurrentY();
            magicinfo.injuredvalue = 0;
            magicinfo.monsterid = play.GetTypeId();
            magicinfo.tag = 21;
            magicinfo.magicid = (ushort)info.usType;
            magicinfo.magiclv = magiclv;
            msg = magicinfo.GetBuffer();
            play.BroadcastBuffer(msg);
            //play.GetGameMap().BroadcastBuffer(play, msg);
            int _locktime = ConfigManager.Instance().GetTrackTime(baseinfo.track_id);
            int _target_locktime = ConfigManager.Instance().GetTrackTime(baseinfo.track_id2);

            int trackcount = ConfigManager.Instance().GetTrackNumber(baseinfo.track_id);
            //锁定自己与目标
            play.Lock(_locktime);
            target.Lock(_target_locktime, target.type == OBJECTTYPE.PLAYER);
            //计算伤害值
             NetMsg.MsgMagicAttackInfo magicattack ;
            for (int i = 0; i < trackcount; i++)
            {
                ////如果是影轮回,就有几率穿透伤害
                //magicattack = new NetMsg.MsgMagicAttackInfo();
                //magicattack.id = play.GetTypeId();

                //magicattack.value = 0;
                //magicattack.magicid = (ushort)GameStruct.MagicTypeInfo.ZHENSHIDAJI;
                //magicattack.level = magiclv;
                //magicattack.targetid = target.GetTypeId();
                //msg = magicattack.GetBuffer();
                //play.BroadcastBuffer(msg, true);
               // target.Injured(play, injured, info);

                //优先攻击合体的幻兽
                uint target_id = target.GetTypeId();
                if (target.type == OBJECTTYPE.PLAYER)
                {
                    EudemonObject eudemon_obj = (target as PlayerObject).GetEudemonSystem().GetInjuredEudemon();
                    if (eudemon_obj != null)
                    {
                        target_id = eudemon_obj.GetTypeId();
                    }
                }

                magicattack = new NetMsg.MsgMagicAttackInfo();
                magicattack.id = play.GetTypeId();
                uint injured = BattleSystem.AdjustDamage(play, target);
                magicattack.value = injured;
                magicattack.magicid = (ushort)info.usType;
                magicattack.level = magiclv;
                magicattack.targetid = target_id;
                msg = magicattack.GetBuffer();
                play.BroadcastBuffer(msg, true);
                target.Injured(play, injured, info);
            }

            if (baseinfo.track_id > 0)
            {
                //取得攻击方向
                byte attackdir = GameStruct.DIR.GetDirByPos(play.GetCurrentX(), play.GetCurrentY(), target.GetCurrentX(), target.GetCurrentY());
                play.SetDir(attackdir);
                target.SetDir(attackdir);

                NetMsg.MsgCombo combo = new NetMsg.MsgCombo();
                combo.CalcTag(info.usType, play, target);
                short x = 0;
                short y = 0;
                GameStruct.TrackInfo trackinfo = ConfigManager.Instance().GetTrackInfo(baseinfo.track_id);
                GameStruct.TrackInfo track2 = ConfigManager.Instance().GetTrackInfo(baseinfo.track_id2);
                for (int i = 0; i < trackcount; i++)
                {
                    //怪物
                    if (track2.step > 0)
                    {
                        if (GameStruct.DIR.GetNexPoint(target, ref x, ref y)) { target.SetPoint(x, y); }
                    }
                    //角色
                    if (trackinfo.step > 0)
                    {
                        for (int j = 0; j < trackinfo.step;j++ )
                        {
                            if (GameStruct.DIR.GetNexPoint(play, ref x, ref y)) { play.SetPoint(x, y); }
                        }

                    }

                    combo.AddComboInfo(info.usType, play, target, trackinfo.action, track2.action);

                    trackinfo = ConfigManager.Instance().GetTrackInfo(trackinfo.id_next);
                    if (track2.id_next != 0)
                    {
                        track2 = ConfigManager.Instance().GetTrackInfo(track2.id_next);
                    }
                }
                msg = combo.GetBuffer();
                play.BroadcastBuffer(msg, true);

            }
        }
Beispiel #7
0
        public override bool Run()
        {
            bool ret = base.Run();

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

                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 = 6051;
                magicattack.magiclv = 0;
                this.BrocatBuffer(magicattack.GetBuffer());



                NetMsg.MsgGroupMagicAttackInfo magicattackex = new NetMsg.MsgGroupMagicAttackInfo();
                magicattackex.nID      = this.GetTypeId();
                magicattackex.nX       = this.GetCurrentX();
                magicattackex.nY       = this.GetCurrentY();
                magicattackex.nMagicID = 6051;
                magicattackex.nMagicLv = 0;
                magicattackex.bDir     = this.GetDir();
                foreach (RefreshObject refobj in this.GetVisibleList().Values)
                {
                    //只攻击怪物
                    if (refobj.obj.type == OBJECTTYPE.MONSTER)
                    {
                        BaseObject obj = refobj.obj;
                        if (this.GetPoint().CheckVisualDistance(obj.GetCurrentX(), obj.GetCurrentY(), 10))
                        {
                            uint injured = BattleSystem.AdjustDamage(mPlay, obj, true);
                            NetMsg.MsgAttackInfo info = new NetMsg.MsgAttackInfo();
                            info.tag = 21;
                            obj.Injured(this, injured, info);
                            magicattackex.AddObject(obj.GetTypeId(), (int)injured);
                        }
                    }
                }
                this.BrocatBuffer(magicattackex.GetBuffer());
            }
            return(ret);
        }
Beispiel #8
0
        private const String XPFULL = "xpfull"; //xp满 参数: xp值

        #endregion Fields

        #region Methods

        public static void ExecuteGMCommand(String str, PlayerObject play)
        {
            try
            {
                String[] option = str.Split(' ');
                String command = option[0];
                command = command.Substring(1);
                command = command.ToLower();
                switch (command)
                {
                    case AWARDITEM:
                        {
                            uint itemid;
                            byte postion = NetMsg.MsgItemInfo.ITEMPOSITION_BACKPACK; //默认背包
                            if (option.Length >= 2)
                            {
                                itemid = Convert.ToUInt32(option[1]);
                                if (option.Length > 2) postion = Convert.ToByte(option[2]);
                                play.GetItemSystem().AwardItem(itemid, postion);
                            }

                            break;
                        }
                    case ADDMAGIC:
                        {
                            uint magicid;
                            byte level = 0;
                            uint exp = 0;
                            if (option.Length >= 2)
                            {
                                magicid = Convert.ToUInt32(option[1]);
                                if (option.Length >= 3) level = Convert.ToByte(option[2]);
                                if (option.Length >= 4) exp = Convert.ToUInt32(option[3]);
                                play.GetMagicSystem().AddMagicInfo(magicid, level, exp);
                            }
                            break;
                        }
                    case XPFULL:
                        {
                            //byte[] data1 = { 20, 0, 249, 3, 84, 66, 15, 0, 1, 0, 0, 0, 28, 0, 0, 0, 30, 0, 0, 0 };
                            //play.GetGamePackKeyEx().EncodePacket(ref data1, data1.Length);
                            //play.SendData(data1);

                            int exp = 100;
                            if (option.Length >= 2)
                            {
                                exp = Convert.ToInt32(option[1]);
                            }
                            play.ChangeAttribute(GameStruct.UserAttribute.XP, exp);
                            //NetMsg.MsgUserAttribute attr = new NetMsg.MsgUserAttribute();
                            //attr.Create(null, play.GetGamePackKeyEx());
                            //attr.AddAttribute(GameStruct.UserAttribute.XP, (uint)exp);
                            //attr.role_id = play.GetTypeId();
                            //play.SendData(attr.GetBuffer());
                            break;
                        }
                    case MOB:
                        {
                            if (option.Length < 2) break;

                            uint monsterid = Convert.ToUInt32(option[1]);
                            GameStruct.MonsterInfo info = ConfigManager.Instance().GetMonsterInfo(monsterid);
                            if (info == null) break;
                            MapServer.MonsterObject obj = new MapServer.MonsterObject(monsterid, info.ai,play.GetCurrentX(),play.GetCurrentY());

                            play.GetGameMap().AddObject(obj);
                            obj.Walk(GameStruct.DIR.MAX_DIRSIZE);

                            //play.SendMonsterInfo(obj);
                            //GameStruct.Action action = new GameStruct.Action(GameStruct.Action.MOVE, null);
                            //play.PushAction(action);
                            break;
                        }
                    case ADDGOLD:
                        {
                            if (option.Length < 2) break;
                            byte btype = Convert.ToByte(option[1]);
                            int count = Convert.ToInt32(option[2]);
                            if (btype == 1)//金币
                            {
                                play.ChangeAttribute(GameStruct.UserAttribute.GOLD, count);
                            }
                            else if (btype == 2)
                            {
                                play.ChangeAttribute(GameStruct.UserAttribute.GAMEGOLD, count);
                            }
                            break;
                        }
                    case FOLLOW:
                        {
                            if (option.Length < 2) break;
                            String name = option[1];
                            PlayerObject target = UserEngine.Instance().FindPlayerObjectToName(name);
                            if (target != null)
                            {
                                //在同一张地图上
                                if (target.GetGameMap().GetID() == play.GetGameMap().GetID())
                                {
                                    play.ScroolRandom(target.GetCurrentX(), target.GetCurrentY());
                                }
                                else
                                {
                                    play.ChangeMap(target.GetGameMap().GetID(), target.GetCurrentX(), target.GetCurrentY());
                                }
                            }
                            else
                            {
                                play.LeftNotice("玩家不存在,无法传送到玩家点。");
                            }
                            break;
                        }
                    case LEVEL:
                        {
                            if (option.Length < 2) break;
                            int level = Convert.ToInt32(option[1]);
                            play.ChangeAttribute(GameStruct.UserAttribute.LEVEL, level);
                            break;
                        }
                    case RELOAD:
                        {
                            String sPath = option[1];
                            ScripteManager.Instance().LoadScripteFile(sPath, true);
                            break;
                        }
                    case RELOADALL:
                        {
                            ConfigManager.Instance().ReloadAllScripte();
                            play.ChatNotice("重加载脚本成功!");
                            break;
                        }
                    case CHANGEMAP:
                        {
                            uint mapid = Convert.ToUInt32(option[1]);
                            GameMap map = MapManager.Instance().GetGameMapToID(mapid);
                            if (map == null) break;
                            short x = (short)map.GetMapInfo().recallx;
                            short y = (short)map.GetMapInfo().recally;
                            if (option.Length >= 4)
                            {
                                x = Convert.ToInt16(option[2]);
                                y = Convert.ToInt16(option[3]);
                            }
                            play.ChangeMap(mapid, x, y);
                            break;

                        }
                    case ROBOTACTION:
                        {
                            uint action_id = Convert.ToUInt32(option[1]);
                            play.PlayRobotAction(action_id);
                            break;
                        }
                    case KILLPLAY:
                        {
                            String name = option[1];
                            PlayerObject obj_play = UserEngine.Instance().FindPlayerObjectToName(option[1]);
                            if (obj_play != null)
                            {
                                obj_play.ExitGame();
                                play.MsgBox("踢出成功!");
                            }
                            else play.MsgBox("踢出失败,未找到玩家对象!");
                            break;
                        }
                    case "test":
                        {
                            //测试更改幻兽信息
                            int type = Convert.ToInt32(option[1]);
                            int value = Convert.ToInt32(option[2]);
                            //PacketOut outpack = new PacketOut(play.GetGamePackKeyEx());
                            //byte[] buff = {24,0,245,7,1,0,0,0,208,175,166,119,1,0,0,0};
                            //outpack.WriteBuff(buff);
                            //outpack.WriteInt32(type);
                            //outpack.WriteInt32(value);
                            //play.SendData(outpack.Flush());
                            PacketOut outpack = new PacketOut(play.GetGamePackKeyEx());

                            outpack.WriteUInt16(176);
                            outpack.WriteUInt16(1102);
                            outpack.WriteInt32(2005);
                            outpack.WriteByte(0);
                            outpack.WriteByte(10);
                            outpack.WriteInt16(0);
                            outpack.WriteInt32(0);
                            outpack.WriteUInt32(play.GetTypeId());
                            outpack.WriteInt32((int)1);
                            outpack.WriteUInt32(656);

                            outpack.WriteUInt32(420171);
                            //当前耐久度
                            outpack.WriteUInt16(1000);
                            //最大耐久度
                            outpack.WriteUInt16(9000);

                            byte[] data = new byte[72];
                            data[type] = (byte)value;
                            outpack.WriteBuff(data);
                            GameStruct.ItemTypeInfo baseitem = MapServer.ConfigManager.Instance().GetItemTypeInfo(420170);

                            if (baseitem != null)
                            {
                                byte[] namebyte = Coding.GetDefauleCoding().GetBytes(baseitem.name);
                                outpack.WriteBuff(namebyte);
                                data = new byte[68 - namebyte.Length];
                                outpack.WriteBuff(data);
                            }
                            else
                            {
                                data = new byte[68];
                                outpack.WriteBuff(data);
                            }
                            play.SendData(outpack.Flush());

                            // Log.Instance().WriteLog(GamePacketKeyEx.byteToText(outpack.GetNormalBuff()));

                            break;
                        }
                    case TESTCOMBO:
                        {
                            Program._Head = Convert.ToByte(option[1]);
                            Program._Tail = Convert.ToByte(option[2]);
                            break;
                        }
                    case CHANGELOOKFACE:
                        {
                            int look = Convert.ToInt32(option[1]);
                            play.ChangeAttribute(GameStruct.UserAttribute.LOOKFACE, look);
                            break;
                        }
                    case OTHERROLE:
                        {

                            //军团职位

                            // 200 普通团员
                            // 1000 军团长
                            // 690 指挥官
                            //680 荣誉指挥官

                            //收到网络协议:长度:185协议号:1014

                            //{189,0,246,3,217,168,113,0,17,152,2,0,17,152,2,0,0,0,0,0,0,0,0,4,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,250,17,0,0,42,0,2,0,132,66,6,0,0,0,0,0,0,0,0,0,59,1,217,1,161,0,0,0,6,5,0,0,100,0,0,0,130,20,0,0,0,7,0,6,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,138,130,2,0,0,0,0,0,1,22,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,53,0,1,0,0,0,250,17,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,8,179,224,215,211,196,167,207,192,0,0,0}
                            short legion_pos = Convert.ToInt16(option[1]);
                            PacketOut outpack = new PacketOut(play.GetGamePackKeyEx());
                            byte[] data11 = { 185, 0, 246, 3, 200, 16, 24, 0, 209, 251, 1, 0, 209, 251, 1, 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, 117, 1, 0, 0, 64, 234, 2, 0, 244, 83, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0,
                                              214, 0, 138, 0, 119, 0, 0, 0, 3, 5, 0, 0, 100, 0, 0, 0, 125, 70, 0, 0, 0, 5, 0,
                                              0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1/*军团头衔*/, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};// /*军团职位*//*178, 2*/,0/* 1*/,
                            byte[] data2 = {          0, 0, 0, 0, 0, /*1, 16*/0,0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
                                              0, 0, 74, 0, 255, 8, 0, 0, 117, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
                                              0, 0, 0, 0, 0, 0, 1, 4, 210, 193, 183, 227, 0, 0, 0 };
                            outpack.WriteBuff(data11);
                            outpack.WriteInt16(legion_pos);
                            outpack.WriteBuff(data2);
                            play.SendData(outpack.Flush());

                            //byte[] data11 = { 185, 0, 246, 3, 200, 16, 24, 0, 209, 251, 1, 0, 209, 251, 1, 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, 117, 1, 0, 0, 64, 234, 2, 0, 244, 83, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0,
                            //                    214, 0, 138, 0, 119, 0, 0, 0, 3, 5, 0, 0, 100, 0, 0, 0, 125, 70, 0, 0, 0, 5, 0,
                            //                    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1/*军团头衔*/, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,232,3 /*军团职位*//*178, 2*/,0/* 1*/,
                            //                    0, 0, 0, 0, 0, /*1, 16*/0,0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
                            //                    0, 0, 74, 0, 255, 8, 0, 0, 117, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
                            //                    0, 0, 0, 0, 0, 0, 1, 4, 210, 193, 183, 227, 0, 0, 0 };
                            // play.GetGamePackKeyEx().EncodePacket(ref data11, data11.Length);
                            // play.SendData(data11);
                            //收到网络协议:长度:28协议号:2036

                            //byte[] data1 = {28,0,244,7,109,0,5,0,84,66,15,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
                            //         play.GetGamePackKeyEx().EncodePacket(ref data1, data1.Length);
                            //          play.SendData(data1);
                            //收到网络协议:长度:16协议号:1012

                            //byte[] data12 = {16,0,244,3,212,21,24,0,0,0,0,0,0,0,0,0};
                            //         play.GetGamePackKeyEx().EncodePacket(ref data12, data12.Length);
                            //          play.SendData(data12);
                            //收到网络协议:长度:27协议号:1015

                            byte[] data13 = { 27, 0, 247, 3, 117, 1, 0, 0, 3, 0, 1, 14, 169, 89, 211, 200, 207, 170, 161, 239, 180, 180, 187, 212, 187, 205, 0 };
                            play.GetGamePackKeyEx().EncodePacket(ref data13, data13.Length);
                            play.SendData(data13);

                            //收到网络协议:长度:16协议号:2036

                            //                                        byte[] data14 = {16,0,244,7,199,0,2,0,84,66,15,0,40,0,0,0};
                            //                         play.GetGamePackKeyEx().EncodePacket(ref data14, data14.Length);
                            //                          play.SendData(data14);
                            ////收到网络协议:长度:16协议号:1034

                            //byte[] data15 = { 16, 0, 10, 4, 2, 0, 1, 0, 200, 16, 24, 0, 206, 0, 130, 0 };
                            //play.GetGamePackKeyEx().EncodePacket(ref data15, data15.Length);
                            //play.SendData(data15);

                            //收到网络协议:长度:16协议号:1034
                            ////
                            //                          byte[] data11 = { 16, 0, 10, 4, 2, 0, 1, 0, 200, 16, 24, 0, 224, 0, 135, 0 };
                            //                          play.GetGamePackKeyEx().EncodePacket(ref data11, data11.Length);
                            //                          play.SendData(data11);
                            //                          byte[] data1 = {187,0,246,3,58,255,230,0,17,152,2,0,17,152,2,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,243,2,0,0,18,0,2,0,247,65,6,0,0,0,0,0,0,0,0

                            //,0,243,0,249,0,101,0,0,0,4,5,0,0,100,0,0,0,112,20,0,0,0,5,0,5,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,200,0,3,0,0,0,0,0,1,21,0,0,0,0,0,0,0,0,0,0,0,0,0,

                            //0,0,0,0,0,0,0,0,0,91,0,127,4,0,0,243,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,6,97,118,49,51,49,52,0,0,0};
                            // byte pos = Convert.ToByte(option[1]);
                            // byte value = Convert.ToByte(option[2]);
                            // byte[] data2 = {187,0,246,3,58,255,230,0,17,152,2,0,17,152,2,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,243,2,0,0,18,0,2,0,247,65,6,0,0,0,0,0,0,0,0,0,243,0,249,0,101,0,0,0,4,5,0,0,100,0,0,0,112,20};
                            // byte[] data3 = new byte[90];
                            // data3[pos] = value;
                            // byte[] data4 = { 1, 6, 97, 118, 49, 51, 49, 52, 0, 0, 0 };
                            // PacketOut outpack = new PacketOut(play.GetGamePackKeyEx());
                            // outpack.WriteBuff(data2);
                            // outpack.WriteBuff(data3);
                            // outpack.WriteBuff(data4);
                            //// play.GetGamePackKeyEx().EncodePacket(ref data1, data1.Length);
                            // play.SendData(outpack.Flush());

                            //byte[] data2 = { 28, 0, 244, 7, 109, 0, 5, 0, 58, 255, 230, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
                            //play.GetGamePackKeyEx().EncodePacket(ref data2, data2.Length);
                            //play.SendData(data2);

                            //byte[] data3 = { 20, 0, 249, 3, 58, 255, 230, 0, 1, 0, 0, 0, 36, 0, 0, 0, 0, 4, 0, 0 };
                            //play.GetGamePackKeyEx().EncodePacket(ref data3, data3.Length);
                            //play.SendData(data3);

                            ////军团信息
                            //byte[] data4 = { 20, 0, 247, 3, 243, 2, 0, 0, 3, 0, 1, 7, 65, 198, 172, 190, 252, 205, 197, 0 };
                            //play.GetGamePackKeyEx().EncodePacket(ref data4, data4.Length);
                            //play.SendData(data4);

                            //byte[] data5 = { 28, 0, 242, 3, 174, 95, 70, 0, 58, 255, 230, 0, 243, 0, 249, 0, 4, 0, 0, 0, 100, 0, 0, 0, 58, 37, 0, 0 };
                            //play.GetGamePackKeyEx().EncodePacket(ref data5, data5.Length);
                            //play.SendData(data5);

                            break;
                        }

                    case "qicheng":
                        {
                            uint rid_id = Convert.ToUInt32(option[1]);
                            //byte[] data = { 36, 0, 244, 7, 209, 0, 7, 0 };
                            //byte[] data1 = { 226, 200, 184, 119, 45, 0, 0, 0, 1, 0, 0, 0, 20, 0, 0, 0, 0, 0, 0, 0 };
                            //PacketOut outpack = new PacketOut(play.GetGamePackKeyEx());
                            //outpack.WriteBuff(data);
                            //outpack.WriteUInt32(play.GetTypeId());
                            //outpack.WriteUInt32(rid_id);
                            //outpack.WriteBuff(data1);

                            //play.SendData(outpack.Flush());
                            play.TakeMount(0,rid_id);
                            break;
                        }
                    case "下马":
                        {
                            play.TakeOffMount(0);
                            break;
                        }
                    case CALLSCRIPT:
                        {
                            uint scripte_id = Convert.ToUInt32(option[1]);
                            ScripteManager.Instance().ExecuteAction(scripte_id, play);
                            break;
                        }
                    case "魔龙守护":
                        {

                            //收到网络协议:长度:40协议号:1022
                            //byte[] data2 = { 40, 0, 254, 3, 0, 0, 0, 0, 84, 66, 15, 0, 0, 0, 0, 0, 67, 2, 56, 1, 21, 0, 0, 0, 105, 20, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
                            //play.GetGamePackKeyEx().EncodePacket(ref data2, data2.Length);
                            //play.SendData(data2);
                            ////收到网络协议:长度:116协议号:1105
                            //byte[] data3 = { 116, 0, 81, 4, 84, 66, 15, 0, 67, 2, 56, 1, 105, 20, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 84, 66, 15, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 226, 200, 184, 119, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 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 };
                            //play.GetGamePackKeyEx().EncodePacket(ref data3, data3.Length);
                            //play.SendData(data3);
                            ////收到网络协议:长度:20协议号:1017
                            byte[] data7 = { 20, 0, 249, 3, 84, 66, 15, 0, 1, 0, 0, 0, 99, 0, 0, 0, 1, 0, 0, 0 };

                            play.GetGamePackKeyEx().EncodePacket(ref data7, data7.Length);
                            play.SendData(data7);
                            ////收到网络协议:长度:48协议号:1127
                            //8, 7,0,0
                            byte[] data4 = { 48, 0, 103, 4, 84, 66, 15, 0, 8, 7, 0, 0, 200, 0, 0, 0, 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 };
                            play.GetGamePackKeyEx().EncodePacket(ref data4, data4.Length);
                            play.SendData(data4);
                            ////收到网络协议:长度:48协议号:1127
                            //byte[] data5 = { 48, 0, 103, 4, 226, 200, 184, 119, 8, 7, 0, 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, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
                            //play.GetGamePackKeyEx().EncodePacket(ref data5, data5.Length);
                            //play.SendData(data5);
                            ////收到网络协议:长度:16协议号:1104
                            //byte[] data6 = { 16, 0, 80, 4, 84, 66, 15, 0, 114, 0, 0, 0, 105, 20, 1, 0 };
                            //play.GetGamePackKeyEx().EncodePacket(ref data6, data6.Length);
                            //play.SendData(data6);

                            break;
                        }
                    case TESTDIE: //测试死亡
                        {

                            //血量清零
                            //byte[] data1 = { 20, 0, 249, 3, 84, 66, 15, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
                            //play.GetGamePackKeyEx().EncodePacket(ref data1, data1.Length);
                            //play.SendData(data1);
                            ////收到网络协议:长度:40协议号:1022
                            //                        byte[] data2 = { 40, 0, 254, 3, 0, 0, 0, 0, 200, 105, 7, 0, 84, 66, 15, 0, 47, 3, 17, 4, 2, 0, 0, 0, 233, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
                            //                                play.GetGamePackKeyEx().EncodePacket(ref data2, data2.Length);
                            //                        play.SendData(data2);
                            ////收到网络协议:长度:40协议号:1022
                            //参数
                            //time  0, 0, 0, 0
                            //怪物id 200, 105, 7, 0
                            //角色id 84, 66, 15, 0
                            //x 50, 3
                            //y 17, 4
                            //标记 14
                            byte[] data3 = { 40, 0, 254, 3, 0, 0, 0, 0, 200, 105, 7, 0, 84, 66, 15, 0, 50, 3, 17, 4, 14, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
                            play.GetGamePackKeyEx().EncodePacket(ref data3, data3.Length);
                            play.SendData(data3);
                            //收到网络协议:长度:20协议号:1017 --
                            //                        byte[] data4 = { 20, 0, 249, 3, 84, 66, 15, 0, 1, 0, 0, 0, 28, 0, 0, 0, 0, 0, 0, 0 };
                            //         play.GetGamePackKeyEx().EncodePacket(ref data4, data4.Length);
                            //                        play.SendData(data4);
                            ////收到网络协议:长度:20协议号:1017
                            //                        byte[] data5 = { 20, 0, 249, 3, 84, 66, 15, 0, 1, 0, 0, 0, 26, 0, 0, 0, 2, 0, 0, 0 };
                            //play.GetGamePackKeyEx().EncodePacket(ref data5, data5.Length);
                            //play.SendData(data5);
                            //收到网络协议:长度:32协议号:1101

                            //byte[] data6 = { 32, 0, 77, 4, 248, 149, 1, 0, 204, 165, 16, 0, 50, 3, 17, 4, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
                            //play.GetGamePackKeyEx().EncodePacket(ref data6, data6.Length);
                            //play.SendData(data6);
                            ////收到网络协议:长度:20协议号:1017
                            //byte[] data7 = { 20, 0, 249, 3, 84, 66, 15, 0, 1, 0, 0, 0, 4, 0, 0, 0, 137, 172, 15, 0 };
                            //play.GetGamePackKeyEx().EncodePacket(ref data7, data7.Length);
                            //play.SendData(data7);
                            ////收到网络协议:长度:67协议号:1004
                            //byte[] data8 = { 67, 0, 236, 3, 0, 0, 255, 0, 213, 7, 0, 0, 173, 8, 0, 0, 255, 255, 255, 255, 0, 0, 0, 0, 4, 6, 83, 89, 83, 84, 69, 77, 8, 210, 176, 177, 200, 186, 243, 204, 236, 0, 21, 196, 227, 210, 197, 202, 167, 193, 203, 50, 50, 52, 50, 54, 195, 182, 189, 240, 177, 210, 161, 163, 0, 0, 0 };

                            //play.GetGamePackKeyEx().EncodePacket(ref data8, data8.Length);
                            //play.SendData(data8);
                            //                          //收到网络协议:长度:16协议号:1012
                            //byte[] data9 = { 16, 0, 244, 3, 84, 66, 15, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
                            //play.GetGamePackKeyEx().EncodePacket(ref data9, data9.Length);
                            //play.SendData(data9);

                            // byte[] data2 = {  20, 0, 249, 3, 84, 66, 15, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0} ;
                            // play.GetGamePackKeyEx().EncodePacket(ref data2, data2.Length);
                            // play.SendData(data2);

                            // byte[] data1 = { 20, 0, 249, 3, 84, 66, 15, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
                            // play.GetGamePackKeyEx().EncodePacket(ref data1, data1.Length);
                            // play.SendData(data1);

                            // byte[] data3 = {40,0,254,3,0,0,0,0,24,87,7,0,76,152,15,0,228,3,214,1,2,0,0,0,233,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
                            // play.GetGamePackKeyEx().EncodePacket(ref data3, data3.Length);
                            // play.SendData(data3);

                            // byte[] data4 = {40,0,254,3,0,0,0,0,24,87,7,0,76,152,15,0,225,3,214,1,14,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
                            // play.GetGamePackKeyEx().EncodePacket(ref data4, data4.Length);
                            // play.SendData(data4);
                            // byte[] data5= {20,0,249,3, 66, 15, 0, 1,1,0,0,0,28,0,0,0,0,0,0,0};
                            // play.GetGamePackKeyEx().EncodePacket(ref data5, data5.Length);
                            // play.SendData(data5);
                            // byte[] data6 = { 20, 0, 249, 3, 66, 15, 0, 1, 1, 0, 0, 0, 26, 0, 0, 0, 2, 0, 0, 0 };
                            // play.GetGamePackKeyEx().EncodePacket(ref data6, data6.Length);
                            // play.SendData(data6);
                            // byte[] data7 = {32,0,77,4,48,101,1,0,204,165,16,0,225,3,214,1,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0};
                            // play.GetGamePackKeyEx().EncodePacket(ref data7, data7.Length);
                            // play.SendData(data7);
                            //byte[] data8 = {16,0,244,3, 66, 15, 0, 1,0,0,0,0,0,0,0,0};
                            //play.GetGamePackKeyEx().EncodePacket(ref data8, data8.Length);
                            //play.SendData(data8);
                            byte[] data = { 28, 0, 249, 3, 84, 66, 15, 0, 2, 0, 0, 0, 26, 0, 0, 0, 6, 0, 0, 0, 12, 0, 0, 0, 33, 92, 108, 58 };
                            play.GetGamePackKeyEx().EncodePacket(ref data, data.Length);
                            play.SendData(data);
                            break;
                        }
                    case "引诱":
                        {

                            NetMsg.MsgMonsterMagicInjuredInfo injuredInfo = new NetMsg.MsgMonsterMagicInjuredInfo();
                            injuredInfo.tag = 21;
                            //   public int time;                //时间
                            //public uint roleid;             //角色id
                            //public uint monsterid;          //怪物id
                            //public short role_x;           //角色x
                            //public short role_y;           //角色y
                            //public uint tag;                 //标记
                            //public ushort magicid;          //技能id
                            //public ushort magiclv;      //技能等级
                            //public uint injuredvalue;       //攻击伤害值
                            //public int[] param;           //未知参数
                            // 收到网络协议:长度:20协议号:1017
                            //{20,0,249,3,76,152,15,0,1,0,0,0,9,0,0,0,97,0,0,0}
                            //收到网络协议:长度:40协议号:1022
                            byte[] data1 = { 40, 0, 254, 3, 0, 0, 0, 0, 84, 66, 15, 0, 84, 66, 15, 0, 63, 3, 7, 4, 21, 0, 0, 0, 235, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
                            play.GetGamePackKeyEx().EncodePacket(ref data1, data1.Length);
                            play.SendData(data1);
                            //收到网络协议:长度:88协议号:1105
                            byte[] data2 = { 88, 0, 81, 4, 84, 66, 15, 0, 84, 66, 15, 0, 235, 3, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 84, 66, 15, 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, 0, 0, 0, 0, 0 };
                            play.GetGamePackKeyEx().EncodePacket(ref data2, data2.Length);
                            play.SendData(data2);
                            //收到网络协议:长度:16协议号:1104
                            //                            byte[] data3 = { 16, 0, 80, 4, 84, 66, 15, 0, 83, 0, 0, 0, 235, 3, 1, 0 };
                            //                                           play.GetGamePackKeyEx().EncodePacket(ref data3, data3.Length);
                            //                            play.SendData(data3);
                            ////收到网络协议:长度:16协议号:1012
                            //                            byte[] data4 = { 16, 0, 244, 3, 84, 66, 15, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
                            //                                                       play.GetGamePackKeyEx().EncodePacket(ref data4, data4.Length);
                            //                            play.SendData(data4);
                            //收到网络协议:长度:20协议号:1017

                            //byte[] data5 = { 20, 0, 249, 3, 76, 152, 15, 0, 1, 0, 0, 0, 28, 0, 0, 0, 30, 0, 0, 0 };
                            //play.GetGamePackKeyEx().EncodePacket(ref data5, data5.Length);
                            //play.SendData(data5);
                            break;
                        }
                    case "骑士团守护":
                        {
                            //收到网络协议:长度:40协议号:1022
                            byte[] data1 = { 40, 0, 254, 3, 0, 0, 0, 0, 84, 66, 15, 0, 0, 0, 0, 0, 63, 2, 56, 1, 21, 0, 0, 0, 91, 20, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
                            play.GetGamePackKeyEx().EncodePacket(ref data1, data1.Length);
                            play.SendData(data1);
                            //收到网络协议:长度:172协议号:1105
                            byte[] data10 = { 172, 0, 81, 4, 84, 66, 15, 0, 63, 2, 56, 1, 91, 20, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 90, 180, 11, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 91, 180, 11, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 92, 180, 11, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 93, 180, 11, 0, 1, 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, 0, 0, 0 };
                            play.GetGamePackKeyEx().EncodePacket(ref data10, data10.Length);
                            play.SendData(data10);

                            //收到网络协议:长度:81协议号:2069
                            //byte[] data2 = { 81, 0, 21, 8, 90, 180, 11, 0, 84, 66, 15, 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, 201, 5, 0, 0, 63, 2, 63, 1, 0, 0, 125, 0, 43, 42, 0, 0, 80, 159, 4, 0, 80, 159, 4, 0, 1, 0, 100, 0, 1, 4, 210, 193, 183, 227, 0, 0, 0 };
                            //play.GetGamePackKeyEx().EncodePacket(ref data2, data2.Length);
                            //play.SendData(data2);
                            //收到网络协议:长度:28协议号:1010
                            //byte[] data3 = { 28, 0, 242, 3, 6, 140, 47, 86, 90, 180, 11, 0, 63, 2, 63, 1, 1, 0, 0, 0, 43, 42, 0, 0, 115, 37, 0, 0 };
                            //play.GetGamePackKeyEx().EncodePacket(ref data3, data3.Length);
                            //play.SendData(data3);
                            //收到网络协议:长度:81协议号:2069
                            //byte[] data4 = { 81, 0, 21, 8, 91, 180, 11, 0, 84, 66, 15, 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, 201, 5, 0, 0, 55, 2, 51, 1, 0, 0, 125, 0, 43, 42, 0, 0, 80, 159, 4, 0, 80, 159, 4, 0, 2, 0, 100, 0, 1, 4, 210, 193, 183, 227, 0, 0, 0 };
                            //play.GetGamePackKeyEx().EncodePacket(ref data4, data4.Length);
                            //play.SendData(data4);
                            //收到网络协议:长度:28协议号:1010
                            //byte[] data5 = { 28, 0, 242, 3, 6, 140, 47, 86, 91, 180, 11, 0, 55, 2, 51, 1, 2, 0, 0, 0, 43, 42, 0, 0, 115, 37, 0, 0 };
                            //play.GetGamePackKeyEx().EncodePacket(ref data5, data5.Length);
                            //play.SendData(data5);
                            //收到网络协议:长度:81协议号:2069
                            //byte[] data6 = { 81, 0, 21, 8, 92, 180, 11, 0, 84, 66, 15, 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, 201, 5, 0, 0, 67, 2, 51, 1, 0, 0, 125, 0, 43, 42, 0, 0, 80, 159, 4, 0, 80, 159, 4, 0, 5, 0, 100, 0, 1, 4, 210, 193, 183, 227, 0, 0, 0 };
                            //play.GetGamePackKeyEx().EncodePacket(ref data6, data6.Length);
                            //play.SendData(data6);
                            //收到网络协议:长度:28协议号:1010
                            //byte[] data7 = { 28, 0, 242, 3, 6, 140, 47, 86, 92, 180, 11, 0, 67, 2, 51, 1, 5, 0, 0, 0, 43, 42, 0, 0, 115, 37, 0, 0 };
                            //play.GetGamePackKeyEx().EncodePacket(ref data7, data7.Length);
                            //play.SendData(data7);
                            //收到网络协议:长度:81协议号:2069
                            //byte[] data8 = { 81, 0, 21, 8, 93, 180, 11, 0, 84, 66, 15, 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, 201, 5, 0, 0, 71, 2, 59, 1, 0, 0, 125, 0, 43, 42, 0, 0, 80, 159, 4, 0, 80, 159, 4, 0, 6, 0, 100, 0, 1, 4, 210, 193, 183, 227, 0, 0, 0 };
                            //play.GetGamePackKeyEx().EncodePacket(ref data8, data8.Length);
                            //play.SendData(data8);
                            //收到网络协议:长度:28协议号:1010
                            //byte[] data9 = { 28, 0, 242, 3, 6, 140, 47, 86, 93, 180, 11, 0, 71, 2, 59, 1, 6, 0, 0, 0, 43, 42, 0, 0, 115, 37, 0, 0 };
                            //play.GetGamePackKeyEx().EncodePacket(ref data9, data9.Length);
                            //play.SendData(data9);

                            //收到网络协议:长度:32协议号:1101 //地面持续特效
                            //176, 9, 13, 0 时间戳
                            // 176, 23, 0, 0 特效id
                            //63, 2 x坐标
                            //55,1 y坐标

                            byte[] data11 = { 32, 0, 77, 4, 176, 9, 13, 0, 176, 23, 0, 0, 63, 2, 55, 1, 0, 0, 0, 0, 10, 0, 0, 0, 0, 0, 0, 0, 15, 0, 0, 0 };
                            play.GetGamePackKeyEx().EncodePacket(ref data11, data11.Length);
                            play.SendData(data11);
                            ////收到网络协议:长度:16协议号:1104
                            //byte[] data12 = { 16, 0, 80, 4, 84, 66, 15, 0, 89, 0, 0, 0, 91, 20, 1, 0 };
                            //play.GetGamePackKeyEx().EncodePacket(ref data12, data12.Length);
                            //play.SendData(data12);
                            break;
                        }
                    case "清除特效":
                        {
                            byte[] data11 = { 32, 0, 77, 4, 176, 9, 13, 0, 176, 23, 0, 0, 63, 2, 55, 1, 0, 0, 0, 0, 12, 0, 0, 0, 0, 0, 0, 0, 15, 0, 0, 0 };
                            play.GetGamePackKeyEx().EncodePacket(ref data11, data11.Length);
                            play.SendData(data11);
                            break;
                        }
                    case "下雪":
                        {

                           // 收到网络协议:长度:28协议号:1010
            //        byte[] data1 = {28,0,242,3,232,3,0,0,76,152,15,0,75,1,155,1,0,0,0,0,232,3,0,0,63,37,0,0};
            //                                     play.GetGamePackKeyEx().EncodePacket(ref data1, data1.Length);
            //                            play.SendData(data1);
            ////收到网络协议:长度:28协议号:1010
            //                            byte[] data2 = { 28, 0, 242, 3, 52, 159, 49, 86, 76, 152, 15, 0, 75, 1, 155, 1, 0, 0, 0, 0, 255, 255, 255, 255, 95, 37, 0, 0 };
            //                            play.GetGamePackKeyEx().EncodePacket(ref data2, data2.Length);
            //                            play.SendData(data2);
            //收到网络协议:长度:20协议号:1110
                            //地图id
                            //地图id
                            //类型

                        byte[] data3={20,0,86,4,232,3,0,0,232,3,0,0,0,0,32,0,128,0,18,0};
                              play.GetGamePackKeyEx().EncodePacket(ref data3, data3.Length);
                            play.SendData(data3);
                            break;
                        }
                    case "元素掌控":
                        {
                     //       收到网络协议:长度:40协议号:1022
                            byte[] data1 = { 40, 0, 254, 3, 186, 192, 18, 1, 84, 66, 15, 0, 0, 0, 0, 0, 93, 1, 179, 1, 21, 0, 0, 0, 180, 20, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
                               play.GetGamePackKeyEx().EncodePacket(ref data1, data1.Length);
                            play.SendData(data1);
            //收到网络协议:长度:20协议号:1017
                            byte[] data2 = { 20, 0, 249, 3, 84, 66, 15, 0, 1, 0, 0, 0, 101, 0, 0, 0, 0, 2, 0, 0 };
                            play.GetGamePackKeyEx().EncodePacket(ref data2, data2.Length);
                            play.SendData(data2);
            //收到网络协议:长度:48协议号:1127
                            byte[] data3 = { 48, 0, 103, 4, 84, 66, 15, 0, 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 };
                            play.GetGamePackKeyEx().EncodePacket(ref data3, data3.Length);
                            play.SendData(data3);
                            //收到网络协议:长度:88协议号:1105
                            byte[] data4 = { 88, 0, 81, 4, 84, 66, 15, 0, 0, 0, 0, 0, 180, 20, 0, 0, 4, 1, 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, 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 };
            play.GetGamePackKeyEx().EncodePacket(ref data4, data4.Length);
            play.SendData(data4);

            byte[] data5 = { 20, 0, 249, 3, 84, 66, 15, 0, 1, 0, 0, 0, 107, 0, 0, 0, 3, 0, 0, 0 };
            play.GetGamePackKeyEx().EncodePacket(ref data5, data5.Length);
            play.SendData(data5);
                            break;
                        }
                    case WUDI:
                        {
                            if (play.GetTimerSystem().QueryStatus(GameStruct.RoleStatus.STATUS_WUDI) != null)
                            {
                                play.GetTimerSystem().DeleteStatus(GameStruct.RoleStatus.STATUS_WUDI);
                                play.LeftNotice("角色已取消无敌!!!");
                            }
                            else {
                                play.GetTimerSystem().AddStatus(GameStruct.RoleStatus.STATUS_WUDI);
                                play.LeftNotice("角色已无敌!!!");
                            }
                            break;
                        }
                    case "幻兽死亡":
                        {
                            EudemonObject obj = play.GetEudemonSystem().GetBattleEudemonSystem(0);
                            if (obj == null) break;
                            GameStruct.Action action = new GameStruct.Action(GameStruct.Action.DIE);
                            obj.PushAction(action);
                            break;
                        }
                    case "幻兽技能":
                        {
                            EudemonObject obj = play.GetEudemonSystem().GetBattleEudemonSystem(0);
                            if (obj == null) break;
                            ushort magicid = Convert.ToUInt16(option[1]);
                            obj.AddMagicInfo(magicid);
                            break;
                        }
                    case "幻兽等级":
                        {
                            EudemonObject obj = play.GetEudemonSystem().GetBattleEudemonSystem(0);
                            if (obj == null) break;
                            obj.GetEudemonInfo().level = 100;
                            play.GetEudemonSystem().SendEudemonInfo(obj.GetEudemonInfo());
                            break;
                        }
                    case "怪物外观":
                        {
                            uint lookface = Convert.ToUInt32(option[1]);
                            NetMsg.MsgMonsterInfo info = new NetMsg.MsgMonsterInfo();
                            info.id = 500000;
                            info.typeid = 3020;
                            info.lookface = lookface;
                            info.x = play.GetCurrentX();
                            info.y = play.GetCurrentY();
                            info.level = 125;
                            info.maxhp =10000;
                            info.hp = 10000;
                            info.dir = 7;
                            play.SendData(info.GetBuffer(), true);
                            break;
                        }
                    case "怪物名字":
                        {
                            uint typeid = Convert.ToUInt32(option[1]);
                            NetMsg.MsgMonsterInfo info = new NetMsg.MsgMonsterInfo();
                            info.id = 500000;
                            info.typeid = typeid;
                            info.lookface = 1243;
                            info.x = play.GetCurrentX();
                            info.y = play.GetCurrentY();
                            info.level = 125;
                            info.maxhp = 10000;
                            info.hp = 10000;
                            info.dir = 7;
                            play.SendData(info.GetBuffer(), true);
                            break;
                        }
                    case "创建npc":
                        {
                            uint id = Convert.ToUInt32(option[1]);
                            NetMsg.MsgNpcInfo info = new NetMsg.MsgNpcInfo();

                            info.Init(id, play.GetCurrentX(), play.GetCurrentY(), play.GetDir());
                            play.SendData(info.GetBuffer(),true);
                            break;
                        }
                    case GETONLINECOUNT:
                        {
                            play.ChatNotice("当前在线人数:" + UserEngine.Instance().GetOnlineCount().ToString());
                            break;
                        }
                    case "名人堂":
                        {
                            //248,42,0,0  用做NPC索引ID
                            //241,73,2,0  lookface
                            //241,73,2,0  lookface
                            //0, 0, 0, 0 未知
                            //60, 156, 29, 0 动作
                            //1, 0      名人堂排名名次
                            //132,16,2,0  衣服
                            //193, 182, 6, 0 学徒杖 武器
                            //205, 10, 0, 0 战斗力
                            // 178, 2, 0, 0 未知
                            // 33, 0, 0, 0  未知
                            //101, 0        X坐标
                            // 185, 0      Y坐标
                            //132, 0, 0, 0  发型
                            byte[] data = { 195, 0, 246, 3, 248, 42, 0, 0, 241, 73, 2, 0, 241, 73, 2, 0, 0, 0, 0, 0, /*60, 156, 29, 0*/0,0,0,0, 1, 0, 205, 10, 0, 0, 0, 0, 0,
                                              0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 132, 16, 2, 0, 193, 182, 6, 0,/* 178, 2, 0, 0, 33, 0, 0, 0*/0,0,0,0,0,0,0,0,
                                              101, 0, 185, 0, 132, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /*33, 10,*/0,0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
                                              0, 0, 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, 0, 0, 0,
                                              0, 0, 0, 0, 0, 0, 0, 0, 0, 0/*5*/, 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, 1,
                                              14, 185, 254, 176, 205, 185, 183, 176, 188, 161, 204, 205, 185, 194, 252, 0, 0, 0 };
                            play.SendData(data, true);
                            break;
                        }
                    case NOTICE:
                        {
                            String sMsg = option[1];
                            UserEngine.Instance().SceneNotice(sMsg);
                            break;
                        }
                    case "角色属性":
                        {
                            GameStruct.UserAttribute attr = (GameStruct.UserAttribute)Convert.ToInt32(option[1]);
                            int v = Convert.ToInt32(option[2]);
                            NetMsg.MsgUserAttribute msg = new NetMsg.MsgUserAttribute();
                            msg.role_id = play.GetTypeId();
                            msg.Create(null, null);

                            msg.AddAttribute(attr, (uint)v);
                            play.SendData(msg.GetBuffer(), true);
                            break;
                        }

                }
            }
            catch (System.Exception ex)
            {
                Log.Instance().WriteLog("----------------------------------------------------------------");
                Log.Instance().WriteLog("执行GM命令出错!!" + str);
                Log.Instance().WriteLog(ex.Message);
                Log.Instance().WriteLog(ex.StackTrace);
                Log.Instance().WriteLog("----------------------------------------------------------------");
            }
        }
Beispiel #9
0
        //幻兽魔法攻击
        public void MagicAttack(NetMsg.MsgAttackInfo info)
        {
            if (!this.IsHaveMagic((ushort)info.usType)) return;
            GameStruct.MagicTypeInfo typeinfo = ConfigManager.Instance().GetMagicTypeInfo(info.usType);
               //
            if (typeinfo == null) return;
            BaseObject targetobj = null;
            uint injured = 0;
            ushort magiclv = this.GetMagicLevel((ushort)info.usType);
            if (!CheckMagicAttackSpeed((ushort)info.usType, (byte)magiclv))
            {
                return;
            }
            switch (typeinfo.sort)
            {
                case GameStruct.MagicTypeInfo.MAGICSORT_ATTACK:
                    {
                        targetobj = this.GetGameMap().FindObjectForID(info.idTarget);
                        if (targetobj == null)
                        {
                            return;
                        }
                        if (targetobj.IsDie()) return;
                        if (targetobj.IsLock()) return; //被锁定了
                        byte bdir = DIR.GetDirByPos(this.GetCurrentX(), this.GetCurrentY(), targetobj.GetCurrentX(), targetobj.GetCurrentY());
                        this.SetDir(bdir);
                        //距离判断,防止非法封包
                        if (Math.Abs(this.GetCurrentX() - targetobj.GetCurrentY()) > typeinfo.distance &&
                            Math.Abs(this.GetCurrentY() - targetobj.GetCurrentY()) > typeinfo.distance)
                        { return; }
                        //连击技能
                        if (!play.CanPK(targetobj)) return;

                        //单体魔法攻击
                        injured = BattleSystem.AdjustDamage(this, targetobj, true);
                        if (injured <= 0) injured = 1;
                        NetMsg.MsgMonsterMagicInjuredInfo magicattack = new NetMsg.MsgMonsterMagicInjuredInfo();
                        magicattack.time = System.Environment.TickCount;
                        magicattack.roleid = this.GetTypeId();
                        magicattack.role_x = this.GetCurrentX();
                        magicattack.role_y = this.GetCurrentY();

                        magicattack.monsterid = targetobj.GetTypeId();
                        magicattack.tag = 21;
                        magicattack.magicid = (ushort)info.usType;
                        magicattack.magiclv = magiclv;
                        this.BrocatBuffer(magicattack.GetBuffer());

                        NetMsg.MsgGroupMagicAttackInfo magicattackex = new NetMsg.MsgGroupMagicAttackInfo();
                        //有轨迹的魔法--
                        magicattackex.SetSigleAttack(targetobj.GetTypeId());
                        magicattackex.nID = this.GetTypeId();
                        //magicattackex.nX = (short)info.usPosX;
                        //magicattackex.nY = (short)info.usPosY;

                        magicattackex.nMagicID = (ushort)info.usType;
                        magicattackex.nMagicLv = magiclv;
                        magicattackex.bDir = this.GetDir();
                        magicattackex.AddObject(targetobj.GetTypeId(), (int)injured);
                        this.BrocatBuffer(magicattackex.GetBuffer());

                        targetobj.Injured(this, injured, info);
                        break;
                    }
                case GameStruct.MagicTypeInfo.MAGICSORT_BOMB: //范围攻击
                    {
                        byte bdir = DIR.GetDirByPos(this.GetCurrentX(), this.GetCurrentY(), (short)info.usPosX, (short)info.usPosY);
                        play.SetDir(bdir);

                        NetMsg.MsgGroupMagicAttackInfo magicattackex = new NetMsg.MsgGroupMagicAttackInfo();
                        magicattackex.nID = this.GetTypeId();
                        magicattackex.nX = this.GetCurrentX();
                        magicattackex.nY = this.GetCurrentY();

                        magicattackex.nMagicID = (ushort)info.usType;
                        magicattackex.nMagicLv = magiclv;
                        magicattackex.bDir = this.GetDir();

                        //被攻击的对象
                        List<BaseObject> list = this.GetBombVisibleObj(info);
                        if (list != null)
                        {
                            for (int i = 0; i < list.Count; i++)
                            {

                                injured = BattleSystem.AdjustDamage(this, list[i], true);

                                list[i].Injured(this, injured, info);
                                magicattackex.AddObject(list[i].GetTypeId(), (int)injured);
                            }
                        }

                        byte[] msg = magicattackex.GetBuffer();

                        this.BrocatBuffer(msg);
                        break;
                    }
                case GameStruct.MagicTypeInfo.MAGICSORT_FAN: //扇形攻击
                    {

                        byte bdir = DIR.GetDirByPos(this.GetCurrentX(), this.GetCurrentY(), (short)info.usPosX, (short)info.usPosY);
                        this.SetDir(bdir);
                        NetMsg.MsgGroupMagicAttackInfo magicattackex = new NetMsg.MsgGroupMagicAttackInfo();
                        magicattackex.nID = this.GetTypeId();
                        magicattackex.nX = this.GetCurrentX();
                        magicattackex.nY = this.GetCurrentY();
                        magicattackex.nMagicID = (ushort)info.usType;
                        magicattackex.nMagicLv = magiclv;
                        magicattackex.bDir = bdir;
                        //被攻击的对象
                        List<BaseObject> list = this.GetFanVisibleObj(info);
                        if (list != null)
                        {
                            for (int i = 0; i < list.Count; i++)
                            {
                                injured = BattleSystem.AdjustDamage(this, list[i], true);
                                if (injured <= 0) injured = 1;
                                //怪物承受XP技能加倍伤害
                                if (list[i].type == OBJECTTYPE.MONSTER &&
                                    typeinfo.use_xp > 0)
                                {
                                    injured = injured * GameBase.Config.Define.XP_MULTIPLE;
                                }
                                list[i].Injured(this, injured, info);
                                magicattackex.AddObject(list[i].GetTypeId(), (int)injured);
                            }
                        }

                        byte[] msg = magicattackex.GetBuffer();
                        this.BrocatBuffer(msg);
                        break;
                    }
            }
        }
Beispiel #10
0
        public override bool Run()
        {
            bool ret = base.Run();
            //距离超出-
            if (!this.GetPoint().CheckVisualDistance(mPlay.GetCurrentX(), mPlay.GetCurrentY(), DIS))
            {
                mPlay.GetTimerSystem().DeleteStatus(GameStruct.RoleStatus.STATUS_MINGGUOSHENGNV);
                return false;
            }
            //刷新周围对象以便寻找目标
            if (this.GetAi().GetTargetObject() == null)
            {
                if (System.Environment.TickCount - mnRefreshTick > REFRESHTIME)
                {
                    this.RefreshVisibleObject();
                    mnRefreshTick = System.Environment.TickCount;
                }
            }
            if (mMagicAttackTime.ToNextTime())
            {
                this.RefreshVisibleObject();

                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 = 6051;
                magicattack.magiclv = 0;
                this.BrocatBuffer(magicattack.GetBuffer());

                NetMsg.MsgGroupMagicAttackInfo magicattackex = new NetMsg.MsgGroupMagicAttackInfo();
                magicattackex.nID = this.GetTypeId();
                magicattackex.nX = this.GetCurrentX();
                magicattackex.nY = this.GetCurrentY();
                magicattackex.nMagicID = 6051;
                magicattackex.nMagicLv = 0;
                magicattackex.bDir = this.GetDir();
                foreach (RefreshObject refobj in this.GetVisibleList().Values)
                {
                    //只攻击怪物
                    if (refobj.obj.type == OBJECTTYPE.MONSTER)
                    {
                        BaseObject obj = refobj.obj;
                        if (this.GetPoint().CheckVisualDistance(obj.GetCurrentX(), obj.GetCurrentY(), 10))
                        {
                            uint injured = BattleSystem.AdjustDamage(mPlay, obj, true);
                            NetMsg.MsgAttackInfo info = new NetMsg.MsgAttackInfo();
                            info.tag = 21;
                            obj.Injured(this, injured, info);
                            magicattackex.AddObject(obj.GetTypeId(), (int)injured);
                        }
                    }
                }
                this.BrocatBuffer(magicattackex.GetBuffer());

            }
            return ret;
        }