Sly 2:PickpocketLootTable

From SlyMods
Jump to navigation Jump to search
PickpocketLootTable
Data Structure
GameSly 2: Band of Thieves
Size52 bytes
Official NameNo

PickpocketLootTable is a struct that stores the odds of pickpocketing a particular loot type from a particular guard type. There is one for each guard type that can be pickpocketed.

Fields

Offset Size Type Name Description
0x0 4
int
min coins Minimum possible amount of coins the guard can carry
0x4 4
int
max coins Maximum possible amount of coins the guard can carry
0x8 4
float
item chance % chance that the guard will have an item
0xc 4
int
odds 1 Odds of item 1 being in the pocket
0x10 4
int
item id 1 ID of item 1
0x14 4
int
odds 2 Odds of item 2
0x18 4
int
item id 2 ID of item 2
0x1c 4
int
odds 3 Odds of item 3
0c20 4
int
item id 3 ID of item 3
0x24 4
int
odds 4 Odds of item 4
0x28 4
int
item id 4 ID of item 3
0x2c 4
int
odds 5 Odds of item 5
0x30 4
int
item id 5 ID of item 5

Implementation

When populating the loot in a guards pocket, it first sets the total number of coins the guard has by selecting a random number of coins between the min and max values. It then uses the item chance to decide if there is an item in the pocket. The chance of any particular item appearing is the odds of that item out of the total odds.