//有可能是他副本的NPC移动,因此增加64对象ID public void RequireUseSkill(AFCoreEx.AFIDENTID objectID, string strKillID, AFCoreEx.AFIDENTID nTargetID, float fNowX, float fNowZ, float fTarX, float fTarZ) { //Debug.Log("RequireUseSkill:" + strKillID); AFMsg.Position xNowPos = new AFMsg.Position(); AFMsg.Position xTarPos = new AFMsg.Position(); xNowPos.X = fNowX; xNowPos.Y = 0.0f; xNowPos.Z = fNowZ; xTarPos.X = fTarX; xTarPos.Y = 0.0f; xTarPos.Z = fTarZ; AFMsg.ReqAckUseSkill xData = new AFMsg.ReqAckUseSkill(); xData.User = AFToPB(objectID); xData.SkillId = strKillID; xData.TarPos = xTarPos; xData.NowPos = xNowPos; if (!nTargetID.IsNull()) { AFMsg.EffectData xEffectData = new AFMsg.EffectData(); xEffectData.EffectIdent = AFToPB(nTargetID); xEffectData.EffectValue = 0; xEffectData.EffectRlt = 0; xData.EffectData.Add(xEffectData); } SendMsg(objectID, AFMsg.EGameMsgID.EgmiReqSkillObjectx, xData); }
public void RequireMoveImmune(AFCoreEx.AFIDENTID objectID, float fX, float fZ) { AFMsg.ReqAckPlayerMove xData = new AFMsg.ReqAckPlayerMove(); xData.Mover = AFToPB(objectID); xData.MoveType = 0; AFMsg.Position xTargetPos = new AFMsg.Position(); xTargetPos.X = fX; xTargetPos.Z = fZ; xData.TargetPos.Add(xTargetPos); SendMsg(objectID, AFMsg.EGameMsgID.EgmiReqMoveImmune, xData); }
////////////////////////////////// private void EGMI_ACK_SKILL_OBJECTX(MsgHead head, MemoryStream stream) { AFMsg.ReqAckUseSkill xReqAckUseSkill = ReqAckUseSkill.Parser.ParseFrom(stream);// new AFMsg.ReqAckUseSkill(); // ReceiveMsg(stream, ref xReqAckUseSkill); AFMsg.Position xNowPos = xReqAckUseSkill.NowPos; AFMsg.Position xTarPos = xReqAckUseSkill.TarPos; AFIDataList xObjectList = new AFCDataList(); AFIDataList xRtlList = new AFCDataList(); AFIDataList xValueList = new AFCDataList(); if (xReqAckUseSkill.EffectData.Count <= 0) { return; } for (int i = 0; i < xReqAckUseSkill.EffectData.Count; ++i) { xObjectList.AddObject(PBToAF(xReqAckUseSkill.EffectData[i].EffectIdent)); xRtlList.AddInt64((int)xReqAckUseSkill.EffectData[i].EffectRlt); xValueList.AddInt64((int)xReqAckUseSkill.EffectData[i].EffectValue); } string strSkillName = xReqAckUseSkill.SkillId;//System.Text.Encoding.Default.GetString(); //Debug.Log("AckUseSkill:" + strSkillName); AFCDataList varList = new AFCDataList(); varList.AddObject(PBToAF(xReqAckUseSkill.User)); varList.AddFloat(xNowPos.X); varList.AddFloat(xNowPos.Z); varList.AddFloat(xTarPos.X); varList.AddFloat(xTarPos.Z); if (xObjectList.Count() != xRtlList.Count() || xObjectList.Count() != xValueList.Count()) { return; } varList.AddInt64(xObjectList.Count()); for (int i = 0; i < xObjectList.Count(); ++i) { varList.AddObject(xObjectList.ObjectVal(i)); } for (int i = 0; i < xRtlList.Count(); ++i) { varList.AddInt64(xRtlList.Int64Val(i)); } for (int i = 0; i < xValueList.Count(); ++i) { varList.AddInt64(xValueList.Int64Val(i)); } AFCLogicEvent.Instance.DoEvent((int)ClientEventDefine.EVENTDEFINE_USESKILL, varList); //AFCRenderInterface.Instance.UseSkill(, strSkillName, xNowPos.x, xNowPos.z, xTarPos.x, xTarPos.z, xObjectList, xRtlList, xValueList); }