11 for (
int i = 0; i < rolls; i++) {
12 int gear_index = rand() % MAX_GEARS;
13 int potion_index = rand() % MAX_POTION_TYPES;
14 add_gear(c, gear_table->gears[gear_index]);
15 add_potion(c, &potion_table->potions[potion_index]);
void add_gear(character_t *character, gear_t *gear)
Adds gear to a character's inventory.
void add_potion(character_t *character, potion_t *potion)
Adds a potion to a character's inventory.
void generate_loot(character_t *c, gear_table_t *gear_table, potion_table_t *potion_table, int rolls)
Generates loot for a character by randomly selecting a number of gear and potions.
Exposes functions for loot generation.