> For the complete documentation index, see [llms.txt](https://k0ssek-scripts.gitbook.io/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://k0ssek-scripts.gitbook.io/docs/scripts/easter-event/loot-tables.md).

# Loot Tables

What eggs contain and how to change it.

Loot is set in `config/shared.lua` under `Config.EggLoot`. There are two tables: `common` for common eggs and `rare` for rare eggs.

{% hint style="warning" %}
The default tables are examples. Replace the items with ones that exist on your server. An item that is not registered in your inventory cannot be given to the player.
{% endhint %}

## An entry

```lua
{ item = 'lockpick', weight = 7, min = 1, max = 2, rarity = 'rare', label = 'Lockpick' },
```

| Field    | Description                                                                                               |
| -------- | --------------------------------------------------------------------------------------------------------- |
| `item`   | Item name from your inventory.                                                                            |
| `weight` | How often the item drops compared to the rest of the table. Higher means more often.                      |
| `min`    | Lowest amount the player can get.                                                                         |
| `max`    | Highest amount the player can get.                                                                        |
| `rarity` | `common`, `uncommon`, `rare`, `epic` or `legendary`. Sets the colour and which drops are sent to Discord. |
| `label`  | Name shown in the Loot tab of the admin panel. The case opening shows the label from your inventory.      |

The chance of one entry is its weight divided by the sum of all weights in the table:

```
chance = weight / total weight * 100
```

You do not have to calculate it yourself. The **Loot** tab of the [Admin Panel](/docs/scripts/easter-event/admin-panel.md) shows the chance of every item.

## Default common egg

Total weight: 70.

| Item              | Weight | Chance | Rarity   | Amount |
| ----------------- | ------ | ------ | -------- | ------ |
| `water`           | 25     | 35.7%  | common   | 2 to 5 |
| `bandage`         | 20     | 28.6%  | common   | 1 to 3 |
| `easter_eggshell` | 15     | 21.4%  | uncommon | 1 to 3 |
| `lockpick`        | 7      | 10.0%  | rare     | 1 to 2 |
| `radio`           | 3      | 4.3%   | epic     | 1      |

## Default rare egg

Total weight: 95.

| Item            | Weight | Chance | Rarity    | Amount |
| --------------- | ------ | ------ | --------- | ------ |
| `bandage`       | 20     | 21.1%  | common    | 3 to 8 |
| `lockpick`      | 18     | 18.9%  | uncommon  | 1 to 3 |
| `radio`         | 15     | 15.8%  | uncommon  | 1      |
| `armor`         | 12     | 12.6%  | rare      | 1      |
| `weapon_bat`    | 10     | 10.5%  | rare      | 1      |
| `weapon_pistol` | 8      | 8.4%   | epic      | 1      |
| `weapon_smg`    | 5      | 5.3%   | epic      | 1      |
| `weapon_rifle`  | 3      | 3.2%   | legendary | 1      |
| `money_bag`     | 2      | 2.1%   | legendary | 1      |
| `golden_egg`    | 2      | 2.1%   | legendary | 1      |

## Adding an item

Add a line to the `common` or `rare` table:

```lua
Config.EggLoot = {
    common = {
        { item = 'water', weight = 25, min = 2, max = 5, rarity = 'common', label = 'Water' },
        -- your item
        { item = 'phone', weight = 4, min = 1, max = 1, rarity = 'epic', label = 'Phone' },
    },
    rare = {
        -- ...
    },
}
```

Adding an entry lowers the chance of every other entry in that table, because the total weight grows.

## Eggshells

The eggshell entry in the common table is what feeds the trader. If you remove it, players have no way to get eggshells. The item name comes from `Config.Items.eggshell`.

## Rarity colours

```lua
Config.RarityColors = {
    common    = '#b0b0b0',
    uncommon  = '#4fc3f7',
    rare      = '#ab47bc',
    epic      = '#ff7043',
    legendary = '#ffd740',
}
```

| Rarity    | Default colour |
| --------- | -------------- |
| common    | grey           |
| uncommon  | light blue     |
| rare      | purple         |
| epic      | orange         |
| legendary | gold           |

The colours are used on the item cards in the case opening and in the admin panel.

## What rarity changes

| Rarity              | Effect                                             |
| ------------------- | -------------------------------------------------- |
| any                 | Colour of the item card                            |
| `epic`, `legendary` | The drop is sent to the `rareDrop` Discord webhook |

Rarity does not change the chance. Only `weight` does.
