Hercules icon indicating copy to clipboard operation
Hercules copied to clipboard

Update mob.c

Open zaid-naim opened this issue 2 years ago • 2 comments

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

Changes Proposed

Issues addressed:

zaid-naim avatar Apr 28 '22 05:04 zaid-naim

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).

MrKeiKun avatar Jun 05 '22 12:06 MrKeiKun

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:

  1. Make 90% configurable (just like other drop rates)
  2. Fix mi to show 90% wherever applicable. (Or both)

dastgirp avatar Jun 05 '22 12:06 dastgirp

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)

MishimaHaruna avatar Dec 08 '22 22:12 MishimaHaruna