public override void UpdateState(List <UnturnedPlayer> players) { if (ZombieManager.regions == null) { return; } if (!GetValueSafe()) { return; } foreach (ZombieRegion t in ZombieManager.regions.Where(t => t.zombies != null)) { // ReSharper disable once MergeSequentialChecks foreach (var zombie in t.zombies.Where(z => z != null && z.transform?.position != null)) { if (zombie.isDead) { continue; } Region region = RegionsPlugin.Instance?.GetRegionAt(zombie.transform.position); if (region == null) { continue; } zombie.gear = 0; zombie.isDead = true; Vector3 ragdoll = (Vector3)typeof(Zombie).GetField("ragdoll", BindingFlags.NonPublic | BindingFlags.Instance)?.GetValue(zombie); ZombieManager.sendZombieDead(zombie, ragdoll); } } }
public override void Execute(PointBlankPlayer executor, string[] args) { ZombieManager.tickingZombies.ForEach((zombie) => { ZombieManager.sendZombieDead(zombie, Vector3.zero); }); UnturnedChat.SendMessage(executor, Translate("KillZombies_Success"), ConsoleColor.Green); }
public override CommandResult OnExecute(ICommandSource src, ICommandArgs args) { var killedCount = 0; UWorld.Zombies.Where(zombie => !zombie.isDead).ForEach(zombie => { ZombieManager.sendZombieDead(zombie, Vector3.zero); killedCount++; }); EssLang.Send(src, "KILLED_ZOMBIES", killedCount); return CommandResult.Success(); }
public override void Execute(ICommandContext context) { var killedCount = 0; var zombies = Object.FindObjectsOfType <Zombie>(); zombies.Where(zombie => !zombie.isDead).ForEach(zombie => { ZombieManager.sendZombieDead(zombie, Vector3.zero); killedCount++; }); context.User.SendLocalizedMessage(Translations, "KILLED_ZOMBIES", killedCount); }
void KillZombies() { try { if (ZombieManager.tickingZombies.Count > GetAllowedZombies()) { randomValue = rand.Next(ZombieManager.tickingZombies.Count); Zombie zom = ZombieManager.tickingZombies[randomValue]; ZombieManager.sendZombieDead(zom, UnityEngine.Vector3.zero); //zom.tellDead(UnityEngine.Vector3.zero); if (Configuration.Instance.LogKills) { Logger.Log("Killed a zombie, current ticked zombie count: " + ZombieManager.tickingZombies.Count); } } } catch { } }
// Token: 0x06000011 RID: 17 RVA: 0x00002CB4 File Offset: 0x00000EB4 private void OnGUI() { if (Menu.MenuOpened != 1) { return; } GUI.skin = Menu.Skin; GUILayout.BeginArea(new Rect((float)(UnityEngine.Screen.width / 2 - 250), (float)(UnityEngine.Screen.height / 2 - 250), 700f, 700f), "Hake", GUI.skin.GetStyle("window")); GUILayout.BeginHorizontal(new GUILayoutOption[0]); GUILayout.BeginVertical(new GUILayoutOption[0]); MainMenu.NoRecoil = GUILayout.Toggle(MainMenu.NoRecoil, "No recoil", new GUILayoutOption[0]); MainMenu.NoShake = GUILayout.Toggle(MainMenu.NoShake, "No shake", new GUILayoutOption[0]); MainMenu.NoSpread = GUILayout.Toggle(MainMenu.NoSpread, "No spread", new GUILayoutOption[0]); this._zoom = GUILayout.Toggle(this._zoom, "Enable FOV", new GUILayoutOption[0]); GUILayout.Space(50f); MainMenu.Aimbot_Enable = GUILayout.Toggle(MainMenu.Aimbot_Enable, "Enable Aimbot", new GUILayoutOption[0]); MainMenu.Aimbot_Players = GUILayout.Toggle(MainMenu.Aimbot_Players, "At Players", new GUILayoutOption[0]); MainMenu.Aimbot_Zombies = GUILayout.Toggle(MainMenu.Aimbot_Zombies, "At Zombies", new GUILayoutOption[0]); MainMenu.Aimbot_Animals = GUILayout.Toggle(MainMenu.Aimbot_Animals, "At Animals", new GUILayoutOption[0]); GUILayout.Label(MainMenu.WebText, new GUILayoutOption[0]); GUILayout.Label("Unturned Hake", new GUILayoutOption[0]); GUILayout.EndVertical(); GUILayout.BeginVertical(new GUILayoutOption[0]); if (GUILayout.Button("Ballistic Force off", new GUILayoutOption[0])) { DisableBallistic(); } if (GUILayout.Button("Set day", new GUILayoutOption[0])) { LightingManager.time = (uint)(LightingManager.cycle * LevelLighting.transition); } if (GUILayout.Button("Night vision: " + this._nightVision, new GUILayoutOption[0])) { this._nightVision++; if (this._nightVision > 3) { this._nightVision = 0; } LevelLighting.vision = (ELightingVision)this._nightVision; LevelLighting.updateLighting(); LevelLighting.updateLocal(); PlayerLifeUI.updateGrayscale(); } if (GUILayout.Button("No Respawn Timer", new GUILayoutOption[0])) { this.DisableTimers(); } if (GUILayout.Button("No Fog" + Menu.GetToggleText(RenderSettings.fog), new GUILayoutOption[0])) { RenderSettings.fog = !RenderSettings.fog; } if (GUILayout.Button("No Rain", new GUILayoutOption[0])) { LevelLighting.rainyness = 0; } if (GUILayout.Button("Kill All Zombies", new GUILayoutOption[0])) { foreach (Zombie zombie in FindObjectsOfType <Zombie>()) { ZombieManager.sendZombieDead(zombie, new Vector3(0, 0, 0)); } } GUILayout.Space(50f); GUILayout.EndVertical(); GUILayout.EndHorizontal(); GUILayout.EndArea(); GUILayout.BeginArea(new Rect((float)((UnityEngine.Screen.width / 2 - 250) + 720), (float)(UnityEngine.Screen.height / 2 - 250), 200f, 800f), "Friend Menu", GUI.skin.GetStyle("window")); GUILayout.BeginHorizontal(new GUILayoutOption[0]); GUILayout.BeginVertical(new GUILayoutOption[0]); GUILayout.Label(FriendList, new GUILayoutOption[0]); if (GUILayout.Button("Refresh Friends List", new GUILayoutOption[0])) { CreateFriendButtons(); } GUILayout.EndVertical(); GUILayout.EndHorizontal(); GUILayout.EndArea(); }
public override void Execute(FreneticScript.CommandSystem.CommandQueue queue, CommandEntry entry) { EntityTag entity = EntityTag.For(entry.GetArgumentObject(queue, 0)); if (entity == null) { queue.HandleError(entry, "Invalid entity!"); return; } PlayerTag player; if (entity.TryGetPlayer(out player)) // TODO: Kick? { Provider.kick(player.Internal.playerID.steamID, "Removed forcibly."); if (entry.ShouldShowGood(queue)) { entry.Good(queue, "Successfully removed a player!"); } return; } ZombieTag zombie; if (entity.TryGetZombie(out zombie)) // TODO: Remove! { zombie.Internal.health = 0; ZombieManager.sendZombieDead(zombie.Internal, new Vector3(9999, 9999, -9999)); if (entry.ShouldShowGood(queue)) { entry.Good(queue, "Successfully removed a zombie!"); } return; } AnimalTag animal; if (entity.TryGetAnimal(out animal)) { animal.Internal.health = 0; AnimalManager.sendAnimalDead(animal.Internal, new Vector3(9999, 9999, -9999)); if (entry.ShouldShowGood(queue)) { entry.Good(queue, "Successfully removed an animal!"); } return; } BarricadeTag barricade; if (entity.TryGetBarricade(out barricade)) { // TODO: Use BarricadeManager magic to remove properly? barricade.InternalData.barricade.askDamage(barricade.InternalData.barricade.health); if (entry.ShouldShowGood(queue)) { entry.Good(queue, "Successfully destroyed a barricade!"); } return; } ResourceTag resource; if (entity.TryGetResource(out resource)) // TODO: Remove! { // TODO: Use ResourceManager magic to remove properly? resource.Internal.askDamage(resource.Internal.health); if (entry.ShouldShowGood(queue)) { entry.Good(queue, "Successfully destroyed a resource!"); } return; } StructureTag structure; if (entity.TryGetStructure(out structure)) // TODO: Remove! { // TODO: Use StructureManager magic to remove properly? structure.InternalData.structure.askDamage(structure.InternalData.structure.health); if (entry.ShouldShowGood(queue)) { entry.Good(queue, "Successfully destroyed a structure!"); } return; } VehicleTag vehicle; if (entity.TryGetVehicle(out vehicle)) // TODO: Remove! { vehicle.Internal.health = 0; VehicleManager.sendVehicleExploded(vehicle.Internal); if (entry.ShouldShowGood(queue)) { entry.Good(queue, "Successfully removed a vehicle!"); } return; } queue.HandleError(entry, "That entity can't be damaged!"); }
public void Execute(IRocketPlayer caller, string[] command) { if (command.Length < 1) { UnturnedChat.Say(caller, Syntax); return; } string typeString = command[0].ToLower(); // If player if (typeString.Equals("player") || typeString.Equals("players") || typeString.Equals("p")) { if (!caller.HasPermission("mobmanager.killall.players")) { UnturnedChat.Say(caller, Main.Instance.Translate("no_permission")); return; } int killedPlayers = 0; foreach (SteamPlayer player in Provider.clients) { UnturnedPlayer untPlayer = UnturnedPlayer.FromSteamPlayer(player); if (!untPlayer.Id.Equals(caller.Id)) { untPlayer.Player.life.tellDead(untPlayer.CSteamID, Vector3.zero, 0); killedPlayers++; } UnturnedChat.Say(caller, Main.Instance.Translate("killed_players", killedPlayers)); } } // If zombie else if (typeString.Equals("zombie") || typeString.Equals("zombies") || typeString.Equals("z")) { if (!caller.HasPermission("mobmanager.killall.zombies")) { UnturnedChat.Say(caller, Main.Instance.Translate("no_permission")); return; } int killedZombies = 0; foreach (Zombie zombie in Utils.GetZombies()) { if (!zombie.isDead) { ZombieManager.sendZombieDead(zombie, Vector3.zero); killedZombies++; } } UnturnedChat.Say(caller, Main.Instance.Translate("killed_zombies", killedZombies)); } // If animal else if (typeString.Equals("animal") || typeString.Equals("animals") || typeString.Equals("a")) { if (!caller.HasPermission("mobmanager.killall.animals")) { UnturnedChat.Say(caller, Main.Instance.Translate("no_permission")); return; } int killedAnimals = 0; foreach (Animal animal in Utils.GetAnimals()) { if (!animal.isDead) { AnimalManager.sendAnimalDead(animal, Vector3.zero); killedAnimals++; } } UnturnedChat.Say(caller, Main.Instance.Translate("killed_animals", killedAnimals)); } // Else try get animal name else { if (!caller.HasPermission("mobmanager.killall.animaltypes")) { UnturnedChat.Say(caller, Main.Instance.Translate("no_permission")); return; } ushort animalType = Utils.GetAnimalType(typeString); int killedAnimals = 0; if (animalType == 0) { UnturnedChat.Say(caller, Main.Instance.Translate("not_type")); return; } foreach (Animal animal in Utils.GetAnimals()) { if (!animal.isDead && animal.asset.id == animalType) { AnimalManager.sendAnimalDead(animal, Vector3.zero); killedAnimals++; } } UnturnedChat.Say(caller, Main.Instance.Translate("killed_animals_type", killedAnimals, typeString)); } }