public void Update(ComponentPlayer localPlayer) { VisibleEntities.Clear(); LivingEnitites.Clear(); //refresh context if (localPlayer != null) { LocalPlayer = localPlayer.Owner; float closestDist = Mathf.Infinity; float closestvDist = closestDist; foreach (AgentHumanDT agentHumanDT in Mission.Instance.CurrentGameZone.Agents) { if (agentHumanDT.IsAlive && !agentHumanDT.IsFriend(LocalPlayer)) { LivingEnitites.Add(agentHumanDT); HitUtils.HitData data; bool targetFound; WeaponBase weapon = LocalPlayer.WeaponComponent.GetCurrentWeapon(); Vector3 startPos = LocalPlayer.Position; startPos.y += 1.7f; weapon.ComputeAimAssistDir(startPos, agentHumanDT.EyePosition - startPos, out targetFound, out data); if (targetFound) { float vdist = Vector3.Distance(agentHumanDT.transform.position, localPlayer.transform.position); if (closestvDist > vdist) { closestvDist = vdist; ClosestVEntity = agentHumanDT; } VisibleEntities.Add(agentHumanDT); } /*RaycastHit hit; * if (Physics.SphereCast(localPlayer.Owner.EyePosition, 5f, agentHumanDT.ChestPosition - localPlayer.Owner.EyePosition, out hit, 100f, -5, QueryTriggerInteraction.UseGlobal)) * { * AgentHumanDT target; * int offset = 0; * do * { * target = m_SearchDelegates[offset](hit.transform); * offset++; * } * while (target == null && offset < m_SearchDelegates.Length); * if (target != null) * VisibleEntities.Add(agentHumanDT); * }*/ float dist = Vector3.Distance(agentHumanDT.transform.position, localPlayer.transform.position); if (closestDist > dist) { closestDist = dist; ClosestEntity = agentHumanDT; } } } } Utils.NativeLMSLog(string.Format("Context update: v {0} l {1} p {2}", VisibleEntities.Count, LivingEnitites.Count, localPlayer != null)); }
public override void OnUpdate(Context context) { if (context.LivingEnitites.Count == 0 || context.LocalPlayer == null || context.ClosestVEntity == null) { return; } m_LockedOn = context.ClosestVEntity; Vector3 dir = m_LockedOn.EyePosition - context.LocalPlayer.EyePosition; m_AngleOffset = dir.x * -1f; float totalRotation = 360f + m_AngleOffset; }
public override void OnUpdate(Context context) { if (context.LivingEnitites.Count == 0 || context.LocalPlayer == null) { return; } AgentHumanDT target = m_ThroughWalls ? context.ClosestEntity : context.ClosestVEntity; if (Vector3.Distance(target.Position, context.LocalPlayer.Position) <= m_MaxRange) { context.LocalPlayer.BlackBoard.Desires.Rotation.SetLookRotation(GetTargetPosition(target) - context.LocalPlayer.ChestPosition); } }
Vector3 GetTargetPosition(AgentHumanDT agentHumanDT) { switch (m_Bone) { case 0: return(agentHumanDT.ChestPosition); case 1: return(agentHumanDT.Head.position); case 2: return(agentHumanDT.ChestPosition + 2f * agentHumanDT.transform.right + -agentHumanDT.transform.up); case 3: return(agentHumanDT.ChestPosition + 2f * agentHumanDT.transform.right + 3f * -agentHumanDT.transform.up); } return(Vector3.zero); }
public override void OnUpdate(Context context) { if (context.LivingEnitites.Count == 0 || context.LocalPlayer == null || context.ClosestEntity == null) { return; } List <Projectile> projectiles = GetProjectiles(); //Utils.NativeLMSLog("Projectile Count: " + projectiles.Count); foreach (Projectile projectile in projectiles) { if (projectile.Settings.Agent != context.LocalPlayer) { continue; } //projectile.GetComponent<Collider>().enabled = false; AgentHumanDT target = m_ThroughWalls ? context.ClosestEntity : context.ClosestVEntity; if (Vector3.Distance(target.Position, context.LocalPlayer.Position) <= m_MaxRange) { projectile.transform.LookAt(GetTargetPosition(target)); } } }
public void RegisterImportantObject(AgentHumanDT human, float time) { this.hudNavigation.RegisterObject(human, time); }
public void OnGUI() { GUI.color = Color.yellow; this.OpenClose = GUI.Toggle(new Rect(400f, 80f, 160f, 20f), this.OpenClose, " OPEN "); if (this.OpenClose) { GUI.color = Color.black; GUI.Box(new Rect(100f, 100f, 200f, 300f), ""); GUI.Box(new Rect(100f, 100f, 200f, 300f), ""); GUI.Box(new Rect(100f, 100f, 200f, 300f), ""); GUI.color = Color.yellow; this.hack1 = GUI.Toggle(new Rect(105f, 120f, 160f, 20f), this.hack1, " GodMode"); this.hack2 = GUI.Toggle(new Rect(105f, 150f, 160f, 20f), this.hack2, " Drop Xp"); this.hack3 = GUI.Toggle(new Rect(105f, 180f, 160f, 20f), this.hack3, " Drop Score"); this.hack4 = GUI.Toggle(new Rect(105f, 210f, 160f, 20f), this.hack4, " Drop Health"); this.hack5 = GUI.Toggle(new Rect(105f, 240f, 160f, 20f), this.hack5, " Aimbot"); this.hack6 = GUI.Toggle(new Rect(105f, 270f, 160f, 20f), this.hack6, " MassKill"); this.hack7 = GUI.Toggle(new Rect(105f, 300f, 160f, 20f), this.hack7, " Random Drop"); if (GUI.Button(new Rect(105f, 330f, 190f, 30f), "Close")) { this.OpenClose = false; } GUI.Label(new Rect(128f, 103f, 200f, 20f), "<color=yellow>MOD MENU BY AndnixSH</color> "); } if (this.hack1) { Player.Instance.Owner.BlackBoard.Invulnerable = true; } if (this.hack2) { PickupManager.Instance.DropPickup(Pickup.E_Type.Xp, Player.Instance.Owner.transform.position, Vector3.up, 1f, false, 25f); } if (this.hack3) { PickupManager.Instance.DropPickup(Pickup.E_Type.Score, Player.Instance.Owner.transform.position, Vector3.up, 1f, false, 25f); } if (this.hack4) { PickupManager.Instance.DropPickup(Pickup.E_Type.Health, Player.Instance.Owner.transform.position, Vector3.up, 1f, false, 25f); } if (this.hack5) { int num; List <Agent> agents = Mission.Instance.CurrentGameZone.Agents; for (int i = 0; i < agents.Count; i = num) { AgentHumanDT ndt = agents[i] as AgentHumanDT; if (((ndt != null) && ndt.IsAlive) && (Vector3.Distance(ndt.Transform.position, Player.Instance.Owner.Transform.position) < 11f)) { Vector3 view = ndt.Transform.position - Player.Instance.Owner.Transform.position; Player.Instance.Owner.BlackBoard.Desires.Rotation.SetLookRotation(view); } num = i + 1; } } else { if (this.hack6) { List <Agent> list3 = Mission.Instance.CurrentGameZone.Agents; int num3 = 0; for (int j = num3; j < list3.Count; j++) { AgentHumanDT ndt3 = list3[j] as AgentHumanDT; if ((ndt3 != null) && ndt3.IsAlive) { float x = 0f; float y = 0f; float z = 0f; Vector3 vector4 = new Vector3(x, y, z) { x = Player.Instance.Owner.Transform.position.x, y = Player.Instance.Owner.Transform.position.y + 2f, z = Player.Instance.Owner.Transform.position.z + 4f }; ndt3.Transform.position = vector4; } } } if (this.hack7) { PickupManager.Instance.DropPickup(Pickup.E_Type.Health, Player.Instance.Owner.transform.position, Vector3.up, 1f, false, 25f); PickupManager.Instance.DropPickup(Pickup.E_Type.Score, Player.Instance.Owner.transform.position, Vector3.up, 1f, false, 25f); PickupManager.Instance.DropPickup(Pickup.E_Type.Xp, Player.Instance.Owner.transform.position, Vector3.up, 1f, false, 25f); } } }