// Chest in guard room, goblin jail

ON INIT {
 SET £type "chest"
 SET §unlock 1
 set §genInv 0
 INVENTORY ADD "provisions\\torch\\torch"
 INVENTORY ADD "jewelry\\gem\\gem"
 ACCEPT
}

ON LOAD {
 USE_MESH "CHEST_1\CHEST_1.TEO"
 ACCEPT
}

ON INVENTORY2_OPEN {
>>RANDOM_ITEM
 IF ( §genInv == 1 ) ACCEPT
  IF (#RANDOMIZER < 6) INVENTORY ADD "provisions\\torch\\torch"
  IF (#RANDOMIZER == 7) INVENTORY ADD "PROVISIONS\\BOTTLE_EMPTY\\BOTTLE_EMPTY"
  IF (#RANDOMIZER == 8) INVENTORY ADD "PROVISIONS\\BOTTLE_WATER\\BOTTLE_WATER"
  IF (#RANDOMIZER == 9) INVENTORY ADD "PROVISIONS\\BOTTLE_WINE\\BOTTLE_WINE"
  IF (#RANDOMIZER == 10) INVENTORY ADD "PROVISIONS\ROPE\ROPE"
  IF (#RANDOMIZER > 10) INVENTORY ADDMULTI "PROVISIONS\\BOTTLE_EMPTY\\BOTTLE_EMPTY" 2
 set §genInv 1
 ACCEPT
}