Hercules
Hercules copied to clipboard
Update mob.c
Right now if you try to put 100% drop rate on drops.conf, it will show correctly on @mi and @rates but monsters will not really drop items by 100% chance. Monsters will only drop items by 90% chance even if @mi and @rates say 100%. This change fixes that.
Pull Request Prelude
- [x] I have followed proper Hercules code styling.
- [x] I have read and understood the contribution guidelines before making this PR.
- [x] I am aware that this PR may be closed if the above-mentioned criteria are not fulfilled.
Changes Proposed
Issues addressed:
I now understand the real problem here.
droprate = monster->dropitem[i].p;
#ifdef RENEWAL_DROP
if( battle_config.atcommand_mobinfo_type ) {
droprate = droprate * pc->level_penalty_mod(monster->lv - sd->status.base_level, monster->status.race, monster->status.mode, 2) / 100;
if (droprate <= 0 && !battle_config.drop_rate0item)
droprate = 1;
}
since mobinfo itself doesn't display the idea of the 90% cap, it provides rates when using @mi
that are not similar to rates when monster died and tries to drop an item (which in mob.c).
90% cap is official behavior for boosted items as far as I know.
The possible changes for this to work as you want could be:
- Make 90% configurable (just like other drop rates)
- Fix mi to show 90% wherever applicable. (Or both)
I made this configurable and adjusted the behavior to be closer to what irowiki describes. Database edits and server drop rates will bypass this, as it used to be before commit 5401f961cf (except for an unintended behavior that made it possible for a positive bonus to actually lower the drop rate by making the cap kick in)