/// <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, EntityDestroyedEventArgs oevt) { EntityDestroyedScriptEvent evt = (EntityDestroyedScriptEvent)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 EntityDestroyed(TemplateObject entity, ref ushort amount) { // TODO: causes? EntityDestroyedEventArgs evt = new EntityDestroyedEventArgs(); evt.Entity = entity; evt.Amount = new NumberTag(amount); UnturnedFreneticEvents.OnEntityDestroyed.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, EntityDestroyedEventArgs oevt) { EntityDestroyedScriptEvent evt = (EntityDestroyedScriptEvent)Duplicate(); evt.Cancelled = oevt.Cancelled; evt.Entity = oevt.Entity; evt.Amount = oevt.Amount; evt.Call(prio); oevt.Amount = evt.Amount; oevt.Cancelled = evt.Cancelled; }