private void Events_OnZombieDamaging(Zombie nativeZombie, ref ushort damageAmount, ref Vector3 ragdoll, ref ERagdollEffect ragdollEffect, ref bool trackKill, ref bool dropLoot, ref EZombieStunOverride stunOverride, out bool cancel) { UnturnedZombie zombie = new UnturnedZombie(nativeZombie); UnturnedZombieDamagingEvent @event; if (damageAmount >= zombie.Health) { @event = new UnturnedZombieDyingEvent(zombie, damageAmount, ragdoll, ragdollEffect, trackKill, dropLoot, stunOverride); } else { @event = new UnturnedZombieDamagingEvent(zombie, damageAmount, ragdoll, ragdollEffect, trackKill, dropLoot, stunOverride); } Emit(@event); damageAmount = @event.DamageAmount; ragdoll = @event.Ragdoll; ragdollEffect = @event.RagdollEffect; trackKill = @event.TrackKill; dropLoot = @event.DropLoot; stunOverride = @event.StunOverride; cancel = @event.IsCancelled; }
private void OnZombieAlert(UnturnedZombie zombie, ref UnturnedPlayer player, ref bool cancel) { if (player.Metadata.ContainsKey("Vanish")) { cancel = true; } }
public UnturnedZombieDyingEvent(UnturnedZombie zombie, UnturnedPlayer?player, ushort damageAmount, Vector3 ragdoll, ERagdollEffect ragdollEffect, EZombieStunOverride stunOverride) : base(zombie, player, damageAmount, ragdoll, ragdollEffect, stunOverride) { }
public UnturnedZombieDyingEvent(UnturnedZombie zombie, ushort damageAmount, Vector3 ragdoll, ERagdollEffect ragdollEffect, bool trackKill, bool dropLoot, EZombieStunOverride stunOverride) : base(zombie, damageAmount, ragdoll, ragdollEffect, trackKill, dropLoot, stunOverride) { }