public static void RemoveBuffId(int buffId, GameObject target) { var cg = CGPlayerCmd.CreateBuilder(); var binfo = BuffInfo.CreateBuilder(); binfo.BuffId = buffId; binfo.Target = target.GetComponent <KBEngine.KBNetworkView>().GetServerID(); cg.BuffInfo = binfo.Build(); cg.Cmd = "RemoveBuff"; var sc = WorldManager.worldManager.GetActive(); sc.BroadcastMsg(cg); }
public static void FastAddBuff(Affix affix, GameObject attacker, GameObject target, int skillId, int evtId, Vector3 pos) { var cg = CGPlayerCmd.CreateBuilder(); var binfo = BuffInfo.CreateBuilder(); binfo.BuffType = (int)affix.effectType; binfo.Attacker = attacker.GetComponent <KBEngine.KBNetworkView>().GetServerID(); binfo.Target = target.GetComponent <KBEngine.KBNetworkView>().GetServerID(); binfo.SkillId = skillId; binfo.EventId = evtId; //var pos = attacker.transform.position; binfo.AddAttackerPos((int)(pos.x * 100)); binfo.AddAttackerPos((int)(pos.y * 100)); binfo.AddAttackerPos((int)(pos.z * 100)); cg.BuffInfo = binfo.Build(); cg.Cmd = "Buff"; var sc = WorldManager.worldManager.GetActive(); sc.BroadcastMsg(cg); }
/// <summary> ///相同的技能 Skill Configure来触发Buff 但是不要触发 Buff修改非表现属性 /// </summary> /// <param name="affix">Affix.</param> /// <param name="attacker">Attacker.</param> /// <param name="target">Target.</param> public static void FastAddBuff(Affix affix, GameObject attacker, GameObject target, int skillId, int evtId) { var cg = CGPlayerCmd.CreateBuilder(); var binfo = BuffInfo.CreateBuilder(); binfo.BuffType = (int)affix.effectType; binfo.Attacker = attacker.GetComponent <KBEngine.KBNetworkView>().GetServerID(); binfo.Target = target.GetComponent <KBEngine.KBNetworkView>().GetServerID(); binfo.SkillId = skillId; binfo.EventId = evtId; var pos = attacker.transform.position; binfo.AddAttackerPos((int)(pos.x * 100)); binfo.AddAttackerPos((int)(pos.y * 100)); binfo.AddAttackerPos((int)(pos.z * 100)); var pos1 = NetworkUtil.ConvertPos(target.transform.position); binfo.X = pos1[0]; binfo.Y = pos1[1]; binfo.Z = pos1[2]; binfo.Dir = (int)target.transform.eulerAngles.y; var eft = BuffManager.buffManager.GetBuffInstance(affix.effectType); var buff = (IEffect)Activator.CreateInstance(eft); buff.attacker = attacker; buff.target = target; var param = buff.GetExtraParams(); binfo.Params = param; cg.BuffInfo = binfo.Build(); cg.Cmd = "Buff"; var sc = WorldManager.worldManager.GetActive(); sc.BroadcastMsg(cg); }