I had to ask AI. Is this legit?
1. Add the New Bonus Enum
In src/map/battle.hpp, add the new bonus to the e_bonus enum:
enum e_bonus {
// ... existing entries
bAddHealFoodDrop, // New bonus for healing/food item drop rate
// ... remaining entries
};
2. Update Bonus Name Array
In src/map/battle.cpp, add the bonus name to the bonus_name array:
{ "bAddHealFoodDrop", bAddHealFoodDrop }, // Maps the script name to the enum
3. Modify Drop Rate Calculation
In src/map/mob.cpp, update the mob_dead function to apply the bonus for healing items:
Locate the drop rate calculation section (around where bAddDrop is applied) and modify it:
if (steal) {
rate = rate * (100 + sd->indexed_bonus.bAddStealRate) / 100;
} else {
int drop_bonus = sd->indexed_bonus.bAddDrop;
struct item_data *id = itemdb_exists(md->dropitem[i].nameid);
if (id && id->type == IT_HEALING) {
drop_bonus += sd->indexed_bonus.bAddHealFoodDrop; // Apply additional bonus
}
rate = rate * (100 + drop_bonus) / 100;
}