Beispiel #1
0
 private void OnAttack(EntityAttackEventArgs e)
 {
     foreach (EventListener el in Plugins)
     {
         if (el.Event == Event.EntityAttack)
         {
             IEntityListener l = el.Listener as IEntityListener;
             l.OnAttack(e);
         }
     }
 }
Beispiel #2
0
        public override void Attack(ILivingEntity target)
        {
            if (target == null)
                return;
            short weaponDmg = Inventory.ActiveItem.GetDamage();

            //Start Event
            EntityAttackEventArgs e = new EntityAttackEventArgs(this, weaponDmg, target);
            Server.PluginManager.CallEvent(Event.EntityAttack, e);
            if(e.EventCanceled) return;
            target = (LivingEntity)e.EntityToAttack;
            weaponDmg = e.Damage;
            //End Event

            Exhaustion += 300;
            
            target.Damage(DamageCause.EntityAttack, weaponDmg, this);
        }
 public void OnAttack(EntityAttackEventArgs e)
 {
 }