Searching for Items

### Summary

Items are the bread and butter for the human side. Without items the humans would not be able to survive against the zombie hordes. items are found by searching buildings. The items you can find in a building are determined by the building's type. Each building type has its own loot table. For example, Fire Stations have a different loot table than Apartments. There is overlap however, as many items can be found in multiple building types.

### Resource Points

Please see resource points for a complete breakdown.

### Search Breakdown

When you click search, the following process takes place. Keep in mind all of the code provided is simplified so that it makes more sense as as a small excerpt.

We create a variable to hold the floor's current RP and set it to 75% of its initial value. Keep in mind that if there are no lights on, then ResLvl has already been divided in half before taking 75% of it.

```
const resourceLevel = floor.resourceLevel \* 0.75;

```
We then pick a value between 1 and resource max. The resource max for almost all buildings is 1,000,000. If the random number is less than or equal to resourceLevel an item is found.

```
const resourceMax = 1000000;
const success = (roll(1, resourceMax) 2 <= resourceLevel);

```

When success is true, we found an item and reduce the floor's RP. If success is false, then we do nothing else because the building's RP will be unaffected.

##### **What does this mean?**

As the floor's resource level decreases, so does our chance of finding an item. When the building's RP is full (1,000,000), only 75% of the numbers between 1 and 1,000,000 will result in finding an item. As the RP goes down, the number of valid numbers also goes down. In effect, a lower RP means a lower chance to find items.

### What is Seeding?

Seeding is the practice of dropping items on the ground before a search, in order to not get those items. This works because when you search, the game tries to avoid giving an item if its currently on the ground. There are two misconceptions about seeding that we need to clear up. First, although it is less likely that receive an item if it is on the ground, it is still possible to receive one. And second, seeding does not change the actual chances of finding each item.

### How Seeding works

Searching happens in two phases. First, the game decides whether you found an item or not. This is explained above in the searching breakdown. Second, if you did find an item then the game must decide which item you get. The game makes a weighted random decision and selects an item from the building's loot table. If the selected item is currently on the floor, it will perform the exact same search again. It will do up to 2 additional searches to try and get different items. If on the last search it has still selected an item that is on the floor, it will give you the item anyways.

### Gaining & Subtracting RP

Every successful search depletes a percentage of RP points from the building, ranging from 5-8% per item found (see the individual buildings page for specific info). Buildings regain RP by 2% every 30 minutes. Completely ruining a building lowers that buildings RP to 0%. Repairing a building gives ?? RP back each repair, for a total of 45RP to a completely repaired building.

### Resource Levels

 The building has been rifled through.
 The building has been searched and left in disarray.
 The building has been looted.
 The building has been heavily looted.
 The building has been stripped of anything of value.
 The building has been picked clean, there's no way you can find something in here.