# Citizens & Lootbags

# Citizens & Lootbags

Citizens are the physical NPC entities that spawn in the world. Lootbags define randomized item rewards. Both editors follow the same base/custom pattern.

## Citizens

### Citizen List

The left sidebar lists all citizens with search filtering. Each entry shows:

- **Display name** (or ID if no name is set)
- **World** and **roles** summary
- **Source badge** -- `C` for custom, `OFF` for disabled base citizens

### Creating a Citizen

Click **+ New** and enter a **Citizen ID** and **Display Name**. New citizens default to `Entity_NPC_Base` with player model enabled, position `(0, 100, 0)`, invulnerable.

### Identity Section

| Field | Description |
|-------|-------------|
| **ID** | Unique identifier (read-only after creation) |
| **Display Name** | Name shown in-game above the NPC |
| **Entity Type** | The entity template (e.g. `Entity_NPC_Base`) |
| **Skin Username** | Player skin to use for this NPC |
| **Player Model** | Whether to use a player model or an NPC model |
| **Nameplate** | Whether to show the name above the NPC |

### Position Section

| Field | Description |
|-------|-------------|
| **World** | Which world this citizen spawns in (default: `default`) |
| **X / Y / Z** | Spawn coordinates |
| **Rotation** | Facing direction in degrees |

:::tip
To get coordinates in-game, stand where you want the NPC and use the debug screen. Enter those coordinates here.
:::

### Roles & Bindings

Configure **Group**, **Shop ID** (links to a shop), **Dialog ID**, and **Roles** (tags like `quest_giver`, `merchant`). Add roles with the input field and remove them with the X button.

### Equipment & Appearance

| Field | Description |
|-------|-------------|
| **Main Hand** | Item held in the right hand (autocomplete available) |
| **Off Hand** | Item held in the left hand (autocomplete available) |
| **Scale** | Size multiplier (default: 1.0) |
| **Invulnerable** | Whether the NPC can take damage |

### Movement

| Field | Description |
|-------|-------------|
| **Movement Type** | `NONE` (stationary), `WANDER` (random walking), or `PATH` (follows a path) |
| **Movement Range** | How far the NPC wanders from spawn |

### Hologram Lines & Emotes

**Hologram Lines** are floating text displayed above the NPC. **Emotes** are animation IDs the NPC can play. Both are managed as simple lists -- use **+ Add** to append and X to remove.

### Base vs. Custom

- **BASE** citizens are read-only. Use **Clone to Custom** for an editable copy, or **Disable** to exclude from spawning. Custom citizens can be fully edited and deleted.

---

## Lootbags

Lootbags define randomized loot tables used as quest rewards, achievement rewards, or dropped items.

### Lootbag List

The left sidebar lists all lootbags with their display name and item count (e.g. `5i`).

### Creating a Lootbag

Click **+ New** and enter a **Lootbag ID** (e.g. `lootbag_custom_reward`) and **Display Name**.

### Properties

- **Display Name** -- friendly name shown to players
- **Rolls** -- how many times the loot table is rolled (more rolls = more items)

### Items Table

Each item in the lootbag has:

| Column | Description |
|--------|-------------|
| **Item** | Item ID (with autocomplete for custom lootbags) |
| **Min** | Minimum amount per roll |
| **Max** | Maximum amount per roll |
| **Weight** | Relative drop chance (higher = more likely) |

For custom lootbags:
- Click **+ Add Item** to add an entry
- Use the X button to remove items
- All fields are directly editable in the table

:::info
The actual amount given per roll is randomized between Min and Max. Weight values are relative -- an item with weight 200 drops twice as often as one with weight 100.
:::

### Base vs. Custom

- **BASE** lootbags are read-only. Use **Clone to Custom** for an editable copy.
- **CUSTOM** lootbags can be fully edited and deleted.