void OnEntityDeath(BaseCombatEntity entity, HitInfo info)
 {
     if (EnchantedTools.Contains(entity.GetHashCode()))
     {
         EnchantedTools.Remove(entity.GetHashCode());
     }
 }
Esempio n. 2
0
 void OnEntityTakeDamage(BaseCombatEntity entity, HitInfo info)
 {
     if (Boxes.Contains(entity.GetHashCode()))
     {
         info.damageTypes.ScaleAll(0);
     }
 }
Esempio n. 3
0
        void OnLootEntityEnd(BasePlayer player, BaseCombatEntity entity)
        {
            SkinContainer container = Containers.Find(c => c.hashCode == entity.GetHashCode());

            if (container != null)
            {
                if (container.status != ContainerStatus.Ready)
                {
                    Item item = container.inventory.GetSlot(0);
                    if (item != null)
                    {
                        container.inventory.GetOwnerPlayer().GiveItem(item);
                    }
                }
                container.storage.KillMessage();
                Boxes.Remove(entity.GetHashCode());
                Containers.Remove(container);
            }
        }