# Loot Drop Manager

<div align="left"><figure><img src="https://3303637552-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FOAGs3il6rJbkejwPOlEP%2Fuploads%2FOXndO6hKeLj0uEuE8Vaf%2FActorComponent_64x.png?alt=media&#x26;token=b00844b2-cbc3-4f89-9f4b-d2c8e193007c" alt=""><figcaption></figcaption></figure></div>

The **Loot Drop Manager (AC\_LootDropManager)** component is a lightweight loot selector which can be used to determine which item should be dropped based on a **weighted loot table** while also allowing for **manual item overrides** when necessary.

It can be attached to any enemy, container, or interactable object. It is added to the **Soulslike Enemy (B\_Soulslike Enemy) & Base Container (B\_Container) classes.**

### How it Works

* **Loot Table Configuration:**
  * The system uses a **Data Table** (Loot Table) that contains a list of potential item drops along with their **weight scores**.
  * The weights determine the probability of an item being selected when a drop is triggered.
* **Loot Selection Process:**
  * When the **PickItem** event is called, the system:
    * Retrieves and asynchronously loads the assigned **Loot Table** asset. Then iterates through the table and selects an item based on its weight score.
    * If an **Override Item** is assigned, the system will select that item instead.
* **Spawning & Dispatching:**
  * Once the selection is complete, the chosen item is sent through the **OnItemReadyForSpawn** dispatcher, making it available for world spawning.

### Example Usage

<figure><img src="https://3303637552-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FOAGs3il6rJbkejwPOlEP%2Fuploads%2Fr7lLeZvlerDebKCEFBuD%2Fimage.png?alt=media&#x26;token=3fb52f93-d020-40ca-97d4-bf1508fa0463" alt=""><figcaption><p>Example from the <strong>Soulslike Enemy (B_Soulslike_Enemy) class</strong></p></figcaption></figure>
