# C_LootHistory: World of Warcraft Forever API

Forever 1.60.1 (70959), Interface 16001, Lua 5.1, from Blizzard's own API documentation. Page: https://wowaddons.gg/forever-api/C_LootHistory

## Functions

### C_LootHistory.GetAllEncounterInfos

```lua
infos = C_LootHistory.GetAllEncounterInfos()
```

Returns:
- `infos`: EncounterLootInfo[]

### C_LootHistory.GetInfoForEncounter

```lua
info = C_LootHistory.GetInfoForEncounter(encounterID)
```

Arguments:
- `encounterID`: number

Returns:
- `info`: EncounterLootInfo, may be nil

### C_LootHistory.GetLootHistoryTime

```lua
time = C_LootHistory.GetLootHistoryTime()
```

Returns:
- `time`: number

### C_LootHistory.GetSortedDropsForEncounter

```lua
drops = C_LootHistory.GetSortedDropsForEncounter(encounterID)
```

Arguments:
- `encounterID`: number

Returns:
- `drops`: EncounterLootDropInfo[], may be nil

### C_LootHistory.GetSortedInfoForDrop

```lua
info = C_LootHistory.GetSortedInfoForDrop(encounterID, lootListKey)
```

Arguments:
- `encounterID`: number
- `lootListKey`: number

Returns:
- `info`: EncounterLootDropInfo, may be nil

## Events

### LOOT_HISTORY_CLEAR_HISTORY

No payload.

### LOOT_HISTORY_GO_TO_ENCOUNTER

Payload, after the event's name:
- `encounterID`: number

### LOOT_HISTORY_ONE_HUNDRED_ROLL

Payload, after the event's name:
- `encounterID`: number
- `lootListKey`: number

### LOOT_HISTORY_UPDATE_DROP

Payload, after the event's name:
- `encounterID`: number
- `lootListKey`: number

### LOOT_HISTORY_UPDATE_ENCOUNTER

Payload, after the event's name:
- `encounterID`: number

## Tables

### Enum.EncounterLootDropRollState (enumeration)

- `NeedMainSpec` = 0
- `NeedOffSpec` = 1
- `Transmog` = 2
- `Greed` = 3
- `NoRoll` = 4
- `Pass` = 5

### EncounterLootDropInfo (structure)

- `lootListKey`: number
- `itemHyperlink`: string
- `playerRollState`: EncounterLootDropRollState
- `currentLeader`: EncounterLootDropRollInfo, may be nil
- `isTied`: bool, default false
- `winner`: EncounterLootDropRollInfo, may be nil
- `allPassed`: bool, default false
- `rollInfos`: EncounterLootDropRollInfo[]
- `startTime`: number
- `duration`: number

### EncounterLootDropRollInfo (structure)

- `playerName`: string
- `playerGUID`: WOWGUID
- `playerClass`: string
- `isSelf`: bool
- `state`: EncounterLootDropRollState
- `isWinner`: bool, default false
- `roll`: number, may be nil

### EncounterLootDrops (structure)

- `encounterID`: number
- `drops`: EncounterLootDropInfo[]

### EncounterLootInfo (structure)

- `encounterName`: string
- `encounterID`: number
- `startTime`: number
- `duration`: number

---
Make an addon with your AI: tell it "Read https://wowaddons.gg/agents.md, then make me a World of Warcraft Forever addon that …, try it with me in the game, and publish it."
