コード例 #1
0
        /// <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, EntityDeathEventArgs oevt)
        {
            EntityDeathScriptEvent evt = (EntityDeathScriptEvent)Duplicate();

            evt.Cancelled = oevt.Cancelled;
            evt.Entity    = oevt.Entity;
            evt.Amount    = oevt.Amount;
            evt.Call(prio);
            oevt.Amount    = evt.Amount;
            oevt.Cancelled = evt.Cancelled;
        }
コード例 #2
0
 /// <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, EntityDeathEventArgs oevt)
 {
     EntityDeathScriptEvent evt = (EntityDeathScriptEvent)Duplicate();
     evt.Cancelled = oevt.Cancelled;
     evt.Entity = oevt.Entity;
     evt.Amount = oevt.Amount;
     evt.Call(prio);
     oevt.Amount = evt.Amount;
     oevt.Cancelled = evt.Cancelled;
 }
コード例 #3
0
 public static bool EntityDeath(TemplateObject entity, ref byte amount)
 {
     // TODO: causes?
     EntityDeathEventArgs evt = new EntityDeathEventArgs();
     evt.Entity = entity;
     evt.Amount = new NumberTag(amount);
     UnturnedFreneticEvents.OnEntityDeath.Fire(evt);
     amount = (byte)evt.Amount.Internal;
     return evt.Cancelled;
 }