# 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>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://soulslike-framework.isik.vip/components-managers/shared-components/loot-drop-manager.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
