> For the complete documentation index, see [llms.txt](https://soulslike-framework.isik.vip/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://soulslike-framework.isik.vip/components-managers/shared-components/loot-drop-manager.md).

# Loot Drop Manager

<div align="left"><figure><img src="/files/Pxb9F1D6r6SRb7Q5t5rd" 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="/files/cVkK6v8WzeZGh4i0JeH2" alt=""><figcaption><p>Example from the <strong>Soulslike Enemy (B_Soulslike_Enemy) class</strong></p></figcaption></figure>
