public static string CheckLimb(ELimb limb) { string limbd; if (limb.ToString() == "LEFT_BACK" || limb.ToString() == "LEFT_FRONT" || limb.ToString() == "RIGHT_BACK" || limb.ToString() == "RIGHT_FRONT" || limb.ToString() == "SPINE") { limbd = "body"; return(limbd); } else if (limb.ToString() == "SKULL") { limbd = "head"; return(limbd); } else if (limb.ToString() == "LEFT_FOOT" || limb.ToString() == "LEFT_LEG" || limb.ToString() == "RIGHT_FOOT" || limb.ToString() == "RIGHT_LEG") { limbd = "leg"; return(limbd); } else if (limb.ToString() == "LEFT_ARM" || limb.ToString() == "LEFT_HAND" || limb.ToString() == "RIGHT_ARM" || limb.ToString() == "RIGHT_HAND") { limbd = "arm"; return(limbd); } else { return(limbd = "unknown"); } }
public override void runGUI() { FovCrosshair = GUILayout.Toggle(FovCrosshair, "Fov Crosshair"); ignoreFOV = GUILayout.Toggle(ignoreFOV, "Ignore FOV"); GUILayout.Label("Aim FOV: " + FOV); FOV = (float)Math.Round(GUILayout.HorizontalSlider(FOV, 1f, 360f)); ignoreDistance = GUILayout.Toggle(ignoreDistance, "Ignore Distance"); GUILayout.Label("Distance: " + distance); distance = (float)Math.Round(GUILayout.HorizontalSlider(distance, 0f, 4000f)); if (GUILayout.Button("Target: " + aimLocation.ToString())) { if (Array.IndexOf(limbs, aimLocation) == limbs.Length - 1) { aimLocation = limbs[0]; } else { aimLocation = limbs[Array.IndexOf(limbs, aimLocation) + 1]; } } #if DEBUG if (GUILayout.Button("Priority: " + attackPriority.ToString())) { if (Array.IndexOf(prioritys, attackPriority) == prioritys.Length - 1) { attackPriority = prioritys[0]; } else { attackPriority = prioritys[Array.IndexOf(prioritys, attackPriority) + 1]; } } #endif GUILayout.Space(10f); aimbot = GUILayout.Toggle(aimbot, "Aimbot"); autoTrigger = GUILayout.Toggle(autoTrigger, "Auto Trigger"); #if !FREE GUILayout.Space(10f); silentAim = GUILayout.Toggle(silentAim, "Silent Aim"); #endif GUILayout.Space(10f); aim_players = GUILayout.Toggle(aim_players, "Attack Players"); aim_friends = GUILayout.Toggle(aim_friends, "Attack Friends"); GUILayout.Space(10f); drawTracer = GUILayout.Toggle(drawTracer, "Draw Tracer to Current Target"); }
private void OnPlayerDamage(Player player, ref EDeathCause cause, ref ELimb limb, ref CSteamID killer, ref Vector3 direction, ref float damage, ref float times, ref bool canDamage) { if (cause != EDeathCause.GUN && cause != EDeathCause.PUNCH && cause != EDeathCause.MELEE) { return; } var limbName = limb.ToString(); var chance = Configuration.Instance.boneBreakingChances.FirstOrDefault(x => x.Limb == limbName); if (chance != null && rand.Next(1, 101) <= chance.BreakChance) { player.life.breakLegs(); } }
public async Task HandleEvent(UnturnedPlayer target, ELimb limb) { await UniTask.SwitchToMainThread(); var chances = _configuration.GetSection("chances").Get <LimbChance[]>(); var chance = chances.FirstOrDefault(x => x.Limb == limb.ToString()); if (chance != null) { if (_random.Next(0, 100) <= chance.Chance) { target.Player.life.breakLegs(); } } await UniTask.SwitchToThreadPool(); }
public static bool PlayerDamaged(Player player, ref uint amount, ref Vector3 ragdoll, ref EDeathCause deathCause, ref ELimb limb, CSteamID killer, object attacker, bool fromUFM) { TemplateObject attackerTag = null; if (killer != null && killer != CSteamID.Nil && killer != Provider.server) { SteamPlayer steamkiller = PlayerTool.getSteamPlayer(killer); if (steamkiller != null) { attackerTag = new PlayerTag(steamkiller); } } else if (attacker != null) { if (attacker is Animal) { attackerTag = new AnimalTag((Animal)attacker); } else if (attacker is Zombie) { attackerTag = new ZombieTag((Zombie)attacker); } } PlayerTag playerTag = new PlayerTag(player.channel.owner); UFMHealthController healthController = player.gameObject.GetComponent<UFMHealthController>(); uint health = healthController != null ? healthController.health : player.life.health; if (amount >= health) { PlayerDeathEventArgs deathevt = new PlayerDeathEventArgs(); deathevt.Player = playerTag; deathevt.Amount = new NumberTag(amount); deathevt.Cause = new TextTag(deathCause.ToString()); deathevt.Limb = new TextTag(limb.ToString()); deathevt.Killer = attackerTag; UnturnedFreneticEvents.OnPlayerDeath.Fire(deathevt); amount = (uint)deathevt.Amount.Internal; if (!deathevt.Cancelled && !EntityDeath(playerTag, ref amount) && healthController != null) { healthController.Damage(amount); player.life.ragdoll = ragdoll; amount = (uint)(((double)amount / healthController.maxHealth) * 100.0); return false; } return true; } PlayerDamagedEventArgs evt = new PlayerDamagedEventArgs(); evt.Player = playerTag; evt.Amount = new NumberTag(amount); evt.Attacker = attackerTag; UnturnedFreneticEvents.OnPlayerDamaged.Fire(evt); amount = (uint)evt.Amount.Internal; if (!evt.Cancelled && !EntityDamaged(playerTag, ref amount) && healthController != null) { healthController.Damage(amount); player.life.ragdoll = ragdoll; amount = (uint)(((double)amount / healthController.maxHealth) * 100.0); return false; } return true; }
public static bool PlayerDamaged(Player player, ref uint amount, ref Vector3 ragdoll, ref EDeathCause deathCause, ref ELimb limb, CSteamID killer, object attacker, bool fromUFM) { TemplateObject attackerTag = null; if (killer != null && killer != CSteamID.Nil && killer != Provider.server) { SteamPlayer steamkiller = PlayerTool.getSteamPlayer(killer); if (steamkiller != null) { attackerTag = new PlayerTag(steamkiller); } } else if (attacker != null) { if (attacker is Animal) { attackerTag = new AnimalTag((Animal)attacker); } else if (attacker is Zombie) { attackerTag = new ZombieTag((Zombie)attacker); } } PlayerTag playerTag = new PlayerTag(player.channel.owner); UFMHealthController healthController = player.gameObject.GetComponent <UFMHealthController>(); uint health = healthController != null ? healthController.health : player.life.health; if (amount >= health) { PlayerDeathEventArgs deathevt = new PlayerDeathEventArgs(); deathevt.Player = playerTag; deathevt.Amount = new NumberTag(amount); deathevt.Cause = new TextTag(deathCause.ToString()); deathevt.Limb = new TextTag(limb.ToString()); deathevt.Killer = attackerTag; UnturnedFreneticEvents.OnPlayerDeath.Fire(deathevt); amount = (uint)deathevt.Amount.Internal; if (!deathevt.Cancelled && !EntityDeath(playerTag, ref amount) && healthController != null) { healthController.Damage(amount); player.life.ragdoll = ragdoll; amount = (uint)(((double)amount / healthController.maxHealth) * 100.0); return(false); } return(deathevt.Cancelled); } PlayerDamagedEventArgs evt = new PlayerDamagedEventArgs(); evt.Player = playerTag; evt.Amount = new NumberTag(amount); evt.Attacker = attackerTag; UnturnedFreneticEvents.OnPlayerDamaged.Fire(evt); amount = (uint)evt.Amount.Internal; if (!evt.Cancelled && !EntityDamaged(playerTag, ref amount) && healthController != null) { healthController.Damage(amount); player.life.ragdoll = ragdoll; amount = (uint)(((double)amount / healthController.maxHealth) * 100.0); return(false); } return(evt.Cancelled); }