Example #1
0
 public virtual void OnPickUpItem(EntityEventArgs e)
 {
     if (PickUpItem != null)
         PickUpItem(this, e);
 }
Example #2
0
 void Entity_PickUpItem(object sender, EntityEventArgs e)
 {
     var player = sender as PlayerEntity;
     var client = GetClient(player);
     var item = e.Entity as ItemEntity;
     var pickUp = player.Inventory.PickUpStack(item.Item);
     if (pickUp)
     {
         client.SendPacket(new CollectItemPacket(item.Id, player.Id));
         client.SendPacket(new NamedSoundEffectPacket(SoundEffect.RandomPop,
                     (int)player.Position.X, (int)player.Position.Y, 
                     (int)player.Position.Z, 0.2f, 98));
         DespawnEntity(item);
     }
 }
Example #3
0
 void Entity_PickUpItem(object sender, EntityEventArgs e)
 {
     var player = sender as PlayerEntity;
     var client = GetClient(player);
     var item = e.Entity as ItemEntity;
     var pickUp = player.Inventory.PickUpStack(item.Item);
     if (pickUp)
     {
         client.SendPacket(new CollectItemPacket(item.Id, player.Id));
         DespawnEntity(item);
     }
 }