//连击技能 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); } }