# Configuration

### Configuration

All configurable parameters are defined in the `{game}/x64/scripts/config/TheInsurgentsLuckyLootConfig.lua` file.

This configuration file can be modified via any text editor.

### Layout

```lua
local function config(statusEffects, augments, locations, contents)
  local initialSteps = initialSteps
  local recurringSteps = recurringSteps
  local statusEffectIds = {
    statusEffectId0,
    statusEffectId1,
    ...
  }

  local dialogId = dialogId
  local augmentId = augmentId
  local soundEffectId = soundEffectId
  local castingState = castingState
  local targetedState = targetedState
  local fleeingState = fleeingState
  local findings = {
    {
      locationId,
      {contentId0, count0, chance0},
      {contentId1, count1, chance1}
      ...
    },
    ...
  }

  return initialSteps, recurringSteps, statusEffectIds, dialogId, augmentId, soundEffectId, castingState, targetedState, fleeingState, findings
end

return config
```

### Parameters

The following lists all configurable parameters and their purposes:

#### `config`

A function that returns all configurable parameters.

It is called with the following arguments:

<table><thead><tr><th width="149.99993896484375">Name</th><th width="351.00006103515625">Description</th><th>Example</th></tr></thead><tbody><tr><td><code>statusEffects</code></td><td>A metatable that maps status effect names to numeric identifiers and vice versa.</td><td><code>statusEffects.ko</code></td></tr><tr><td><code>augments</code></td><td>A metatable that maps augment names to numeric identifiers and vice versa.</td><td><code>augments.essentials</code></td></tr><tr><td><code>locations</code></td><td>A metatable that maps location names to numeric identifiers and vice versa.</td><td><code>locations.sandSweptNaze</code></td></tr><tr><td><code>contents</code></td><td>A nested metatable where each category is itself a lookup metatable that maps inventory content names to numeric identifiers and vice versa.</td><td><code>contents.magicks.protect</code></td></tr></tbody></table>

For more information on how these arguments can be used, you can refer to the [Name vs Identifier](/the-insurgents-lucky-loot/overview/configuration/name-vs-identifier.md) page.

#### `initialSteps`

The amount of steps a party member has to take to start the recurring steps counter.

Reset whenever a new location is entered.

#### `recurringSteps`

The amount of steps a party member has to take to trigger the chance to find an item.

For example: With `initialSteps` set to `100` and `recurringSteps` set to `50`, a party member would need to take 150 steps (100 + 50) to trigger the chance to find an item. Afterwards they would only need to take an additional 50 to trigger it again, and again, until a new location is entered upon which they need to take the full 150 steps again.

#### `statusEffectIds`

A table of status effects that should prevent a party member from finding an item.

For example, the following would prevent a party member from finding an item if they have the status effects Sleep (4), Blind (7), or Berserk (27).

```lua
local statusEffectIds = {4, 7, 27}
```

#### `dialogId`

The dialog of the combat log that will be shown when an item is found.

For more information on how to create the dialog, you can refer to the [Combat Log Message](/the-insurgents-lucky-loot/getting-started/combat-log-message.md) page.

#### `augmentId`

Only party members with a specific augment have a chance to find an item.

This augment can either be acquired by unlocking a license node, using an equipment that grants it, or by default for a party member.

#### `soundEffectId`

The sound effect that will be played when an item is found.

A value of `-1` equals no sound effect.

#### `castingState`

If `true`, a party member that is casting an action cannot advance their step counter and therefore not trigger the chance to find an item.

#### `targetedState`

If `true`, a party member that is being targeted (foe, ally, ...) cannot advance their step counter and therefore not trigger the chance to find an item.

#### `fleeingState`

If `true`, a party member that is fleeing cannot advance their step counter and therefore not trigger the chance to find an item.

#### `findings`

A table of findable items of every location. Each location can have multiple findable items, but only one of them can be found at a time.

#### `locationId`

The identifier of the location where the items can be found.

#### `contentId`

The content identifier of the item.

#### `count`

The amount of items that can be found.

#### `chance`

The probability that a party member will find the item.

Every party member has their own chance of finding a item. The more party members have the required augment, the higher the chance of course to find more items.

### Notes

{% hint style="warning" %}
Parameters are processed from top-left to bottom-right, which defines their priority. For example:

* If a location is listed more than once, only the last one will actually have an effect.
* If a content is used more than once, their chances are combined.
* If there are 3 contents with the following chances: 80%, 21%, 10%. The chance of the second one is actually 20%, not 21% and the third one is ignored.
* If there are 2 contents with the following chances: 50%, 20%. There is a 30% chance that no content will be found.
  {% endhint %}

{% hint style="info" %}
For a list of location identifiers, you can view the location spreadsheet in [Resources](/the-insurgents-lucky-loot/getting-started/resources.md).
{% endhint %}

{% hint style="info" %}
For a list of status effect and augment identifiers, you can view the battlepack spreadsheet in [Resources](/the-insurgents-lucky-loot/getting-started/resources.md).
{% endhint %}

{% hint style="info" %}
For a list of content identifiers, you can view the inventory content spreadsheet in [Resources](/the-insurgents-lucky-loot/getting-started/resources.md).

Only the following content types are supported: Items, Equipment, Loot, Magicks, Technicks, Gambits, Key Items, Mist.
{% endhint %}

{% hint style="info" %}
For a list of sound effect identifiers, you can do the following:

1. Extract the `ps2data/sound/se/sead_data_win/se000/se000.win.sab` file via the [VBF Browser](https://www.nexusmods.com/finalfantasy12/mods/3).
2. Download and open [foobar2000](https://www.foobar2000.org/download).
3. Open the extracted `se000.win.sab` file with it.
4. Select and play any track you want.

Once you like one, you can use the track identifier as the sound identifier (e.g. `se000.win#65` -> `65`).
{% endhint %}

{% hint style="info" %}
A party member's step counter is not changed in the following cases:

* When they or the party leader is riding a Chocobo.
* When they are in a reserved party slot.
  {% endhint %}


---

# 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://xeavin.gitbook.io/the-insurgents-lucky-loot/overview/configuration.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.
