public void OnPlayerHurt(HurtEvent he) { if (he.WeaponName == "Hunting Bow" && he.AttackerIsPlayer && !he.VictimIsSleeper) { Fougerite.Player attacker = (Fougerite.Player)he.Attacker; Fougerite.Player victim = (Fougerite.Player)he.Victim; if (victim.IsOnline && !victim.IsDisconnecting && victim.IsAlive) { var possibility = rnd.Next(0, 100); if (possibility < PossibilityOfPoisoning) { victim.AdjustPoisonLevel(AmountOfVenne); victim.Message("You have been poisoned with an PoisonArrow"); attacker.Message("You poisoned your victim with a PoisonArrow"); if (AvoidBypass) { //asegurarse que el jugador no intenta desconectarse para evitar su envenenamiento PoisonedIDs.Add(victim.SteamID); var listpois = new Dictionary <string, object>(); listpois["pID"] = victim.SteamID; Timer1(TimeToAvoidBypass * 60000, listpois).Start(); } } } } }
public void OnPlayerSpawned(Fougerite.Player pl, SpawnEvent se) { if (PoisonedIDs.Contains(pl.SteamID)) { pl.AdjustPoisonLevel(AmountOfVenne); pl.MessageFrom(Name, red + "WARNING " + white + " You are still poisoned."); } }
public void OnCommand(Fougerite.Player player, string cmd, string[] args) { if (!player.Admin) { return; } if (cmd == "pa" || cmd == "poison" || cmd == "arrow") { if (args.Length == 0) { player.MessageFrom(Name, "/pa " + orange + " List of commands"); player.MessageFrom(Name, "/pa reload " + orange + " Reload and apply the Settings"); player.MessageFrom(Name, "/pa test " + orange + " Utility to simulate an arrow impact yourself"); player.MessageFrom(Name, "/pa list " + orange + " List of the current players poisoned"); } else { if (args[0] == "reload") { ReloadConfig(); player.MessageFrom(Name, orange + "Settings has been Reloaded :)"); } else if (args[0] == "test") { var possibility = rnd.Next(0, 100); if (possibility < PossibilityOfPoisoning) { player.AdjustPoisonLevel(AmountOfVenne); player.MessageFrom(Name, "Poisoned: " + player.IsPoisoned); player.MessageFrom(Name, "AmountOfVenne: " + AmountOfVenne); player.MessageFrom(Name, "Possibility: " + possibility); player.MessageFrom(Name, "AvoidBypass: "******"TimeToAvoidBypass: "******" mins."); if (AvoidBypass) { PoisonedIDs.Add(player.SteamID); var listpois = new Dictionary <string, object>(); listpois["pID"] = player.SteamID; Timer1(TimeToAvoidBypass * 60000, listpois).Start(); player.MessageFrom(Name, "The player will be registered for" + TimeToAvoidBypass + " minutes to avoid bypass"); } } else { player.MessageFrom(Name, orange + "You were lucky and you were not poisoned"); } } else if (args[0] == "list") { foreach (var xx in Server.GetServer().Players) { if (PoisonedIDs.Contains(xx.SteamID)) { player.MessageFrom(Name, "Player: " + xx.Name + " ID: " + xx.SteamID); } } player.MessageFrom(Name, orange + "End of list"); } } } }