# Sly 2:Pickpocketing

Game Mechanic | |
---|---|

Game | Sly 2: Band of Thieves |

**Pickpocketing** guards in Sly 2 is a method of obtaining coins, as well as loot items which can be sold for coins in Thiefnet. Each guard can have been 2-4 pockets, with 2-3 pockets containing coins and 0-1 pockets with an item.

## Loot table[edit | edit source]

Each guard type in the game has it’s own loot table, with some exceptions. The loot table contains the following information:

- The minimum possible amount of coins the guard can have
- The maximum possible amount of coins the guard can have
- A percent chance that that guard will have an item
- For each of 5 possible items the guard can have:
- The odds of that item (out of the total odds for all 5 items)
- The ID of that item

## Pocket generation[edit | edit source]

When a guard is spawned, the game calls a function that populates the contents of each pocket.

### Coins[edit | edit source]

The following algorithm is used to populate the coins in the guard’s pockets.

- Select a random number of coins between the min and max values from the loot table
- Select a random number of pockets between 2 and 3
- For each pocket:
- Divide the number of coins by the number of pockets
- Put that many coins in the pocket
- Move on to the next pocket, or stop if no coins are left

### Items[edit | edit source]

The following algorithm is used to determine what item will be in the last pocket.

- Sum up the total odds for all items in the loot table
- Select a random value between 0 and the max odds
- For each item in the loot table:
- If the random value is greater than the current total odds, set the item to that item
- Otherwise, subtract that item’s odds from the total odds and move on

Although all the odds normally add up to 100, they can be anything. The odds of any one item appearing in a pocket is just the fraction of that item’s odds out of the total odds.

## Editing pocket values[edit | edit source]

The values on the guard pocket can be modified to change the loot type (from coins to items or vice versa), or replace the item with an entity.

To Do:Add instructions for how to modify the pocket to make it coins, health pickups, or a different entity |

## Gallery[edit | edit source]

## See also[edit | edit source]

- Sly 2:Pocket Murray - A mod which makes all guards have a tiny Murray in their pockets