v1.0.4
This commit is contained in:
parent
a7009be3e0
commit
898f86f888
137 changed files with 3553 additions and 3780 deletions
|
|
@ -15,29 +15,27 @@ namespace jRandomSkills
|
|||
public static void LoadSkill()
|
||||
{
|
||||
SkillUtils.RegisterSkill(skillName, Config.GetValue<string>(skillName, "color"));
|
||||
}
|
||||
|
||||
Instance.RegisterEventHandler<EventPlayerHurt>((@event, info) =>
|
||||
{
|
||||
var damage = @event.DmgHealth;
|
||||
var victim = @event.Userid;
|
||||
var attacker = @event.Attacker;
|
||||
var weapon = @event.Weapon;
|
||||
HitGroup_t hitgroup = (HitGroup_t)@event.Hitgroup;
|
||||
public static void PlayerHurt(EventPlayerHurt @event)
|
||||
{
|
||||
var damage = @event.DmgHealth;
|
||||
var victim = @event.Userid;
|
||||
var attacker = @event.Attacker;
|
||||
var weapon = @event.Weapon;
|
||||
HitGroup_t hitgroup = (HitGroup_t)@event.Hitgroup;
|
||||
|
||||
if (nades.Contains(weapon)) return HookResult.Continue;
|
||||
if (!Instance.IsPlayerValid(attacker) || !Instance.IsPlayerValid(victim) || attacker == victim) return HookResult.Continue;
|
||||
if (nades.Contains(weapon)) return;
|
||||
if (!Instance.IsPlayerValid(attacker) || !Instance.IsPlayerValid(victim) || attacker == victim) return;
|
||||
|
||||
var playerInfo = Instance.SkillPlayer.FirstOrDefault(p => p.SteamID == attacker?.SteamID);
|
||||
if (playerInfo?.Skill != skillName || attacker!.Team != victim!.Team) return HookResult.Continue;
|
||||
var playerInfo = Instance.SkillPlayer.FirstOrDefault(p => p.SteamID == attacker?.SteamID);
|
||||
if (playerInfo?.Skill != skillName || attacker!.Team != victim!.Team) return;
|
||||
|
||||
Server.ExecuteCommand("mp_autokick 0");
|
||||
Server.ExecuteCommand("mp_autokick 0");
|
||||
|
||||
var pawn = victim.PlayerPawn.Value;
|
||||
if (pawn == null || !pawn.IsValid) return HookResult.Continue;
|
||||
SkillUtils.AddHealth(pawn, damage + (int)(damage * healthMultiplier), pawn.MaxHealth);
|
||||
|
||||
return HookResult.Continue;
|
||||
});
|
||||
var pawn = victim.PlayerPawn.Value;
|
||||
if (pawn == null || !pawn.IsValid) return;
|
||||
SkillUtils.AddHealth(pawn, damage + (int)(damage * healthMultiplier), pawn.MaxHealth);
|
||||
}
|
||||
|
||||
public class SkillConfig(Skills skill = skillName, bool active = true, string color = "#ff0000", CsTeam onlyTeam = CsTeam.None, bool needsTeammates = true, float healthMultiplier = 1.5f) : Config.DefaultSkillInfo(skill, active, color, onlyTeam, needsTeammates)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue