/// <summary> /// Runs the script event with the given input. /// </summary> /// <param name="prio">The priority to run with.</param> /// <param name="oevt">The details of the script to be ran.</param> /// <returns>The event details after firing.</returns> public void Run(int prio, EntityDamagedEventArgs oevt) { EntityDamagedScriptEvent evt = (EntityDamagedScriptEvent)Duplicate(); evt.Cancelled = oevt.Cancelled; evt.Entity = oevt.Entity; evt.Amount = oevt.Amount; evt.Call(prio); oevt.Amount = evt.Amount; oevt.Cancelled = evt.Cancelled; }
public static bool EntityDamaged(TemplateObject entity, ref ushort amount) { // TODO: causes? EntityDamagedEventArgs evt = new EntityDamagedEventArgs(); evt.Entity = entity; evt.Amount = new NumberTag(amount); UnturnedFreneticEvents.OnEntityDamaged.Fire(evt); amount = (ushort)evt.Amount.Internal; return evt.Cancelled; }
/// <summary> /// Runs the script event with the given input. /// </summary> /// <param name="prio">The priority to run with.</param> /// <param name="oevt">The details of the script to be ran.</param> /// <returns>The event details after firing.</returns> public void Run(int prio, EntityDamagedEventArgs oevt) { EntityDamagedScriptEvent evt = (EntityDamagedScriptEvent)Duplicate(); evt.Cancelled = oevt.Cancelled; evt.Entity = oevt.Entity; evt.Amount = oevt.Amount; evt.Call(prio); oevt.Amount = evt.Amount; oevt.Cancelled = evt.Cancelled; }