OnDamaging
(e)
Called on the host when the NPC is about to take a hit, before anyone else hears of it. Override to shape
the NPC's own incoming damage: change Sandbox.Component.IDamageable.DamageEvent.AcceptedDamage or
Sandbox.Component.IDamageable.DamageEvent.Instigator, or set Sandbox.Component.IDamageable.DamageEvent.Cancelled,
which ends the hit here. A hit goes through, in order: this, Sandbox.Component.IDamageable.IEvents.OnDamaging(Sandbox.Component.IDamageable.DamageEvent),
the health change, Sandbox.Npcs.BaseNpc.OnDamaged(Sandbox.Component.IDamageable.DamageEvent), Sandbox.Component.IDamageable.IEvents.OnDamaged(Sandbox.Component.IDamageable.DamageEvent).
OnDeath
(e)
Called on the host, once, when the NPC dies. Spawns a ragdoll with Sandbox.Npcs.BaseNpc.CreateRagdoll, which is
the place to change or leave out the corpse: listeners get it in Sandbox.Component.IDamageable.IEvents.OnDied(Sandbox.Component.IDamageable.DeathEvent),
which is raised after this. The NPC is destroyed once that has run, so listeners can still look at it.
Override to add NPC-specific behaviour before/after death.
SetRelationship
(faction, disposition, priority)
How this NPC regards the members of a faction: hostile to attack them, fearful to flee them, friendly to
treat them as allies. Among hostiles a higher priority is picked first. Call it from
Sandbox.Npcs.BaseNpc.SetupRelationships.