We need to put items in the room so the shopkeeper has something to sell. We can do this in the same way as with the character map, only this time with an item map. The item map will have the same footprint as the character map, so this will be the same as before.
We want to fill the remaining available spaces in the room with random item types of varying categories and worth. In the script, random items are created, but within the given parameters of minimum and maximum prices, and item category flags. This gives a good balance between high and low value items, preventing the game from creating a room full of broken leather boots, or for that matter, a room full of magic lamps! If we want we can generate specific items, and so by looking at this script you will see a wand of striking will generate in every shop, for every game of IVAN. This is an example of a so-called "guaranteed item", and is a design element I hope you will choose to use sparingly.
{| class="wikitable"