From 582afd97b0cc7050417ee16dc60638fa189a8fdf Mon Sep 17 00:00:00 2001 From: Lupus Date: Sun, 3 Apr 2005 07:25:33 +0000 Subject: fixed impossible drops at 0.01% chance (e.g. CARDS, etc) git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/branches/stable@1387 54d463be-8e91-2dee-dedb-b68131a5f0ec --- Changelog-SVN.txt | 1 + src/map/mob.c | 8 ++++---- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/Changelog-SVN.txt b/Changelog-SVN.txt index ecc8d45ae..1d8606166 100644 --- a/Changelog-SVN.txt +++ b/Changelog-SVN.txt @@ -2,6 +2,7 @@ Date Added 04/03 + * Fixed impossible drops at 0.01% chance [Lupus] * Fixed some variable declarations in SQL login.c causing compilation errors [veider] * Added NetBSD support into Makefile (Still lots of warrnings during compilation [veider] * Finished Valkyrie. Now it correctly works. Valhallana reborns players to High Novices. [Lupus] diff --git a/src/map/mob.c b/src/map/mob.c index d3ad36b2e..cd096cabd 100644 --- a/src/map/mob.c +++ b/src/map/mob.c @@ -2604,11 +2604,11 @@ int mob_damage(struct block_list *src,struct mob_data *md,int damage,int type) drop_rate = 1; if(battle_config.drops_by_luk>0 && sd && md) drop_rate+=(sd->status.luk*battle_config.drops_by_luk)/100; // drops affected by luk [Valaris] if(sd && md && battle_config.pk_mode==1 && (mob_db[md->class_].lv - sd->status.base_level >= 20)) drop_rate = (int) (drop_rate*1.25); // pk_mode increase drops if 20 level difference [Valaris] - if(drop_rate <= rand()%10000+1) { //if rate == 0, then it doesn't drop (from Freya) - drop_ore = i; //we rmember an empty slot to put there ORE DISCOVERY drop later. + if(drop_rate < rand() % 10000 + 1) { //fixed 0.01% impossible drops bug [Lupus] + drop_ore = i; //we remember an empty slot to put there ORE DISCOVERY drop later. continue; } - drop_items++; //we cound if there were any drops + drop_items++; //we count if there were any drops ditem=(struct delay_item_drop *)aCalloc(1,sizeof(struct delay_item_drop)); ditem->nameid = mob_db[md->class_].dropitem[i].nameid; @@ -2630,7 +2630,7 @@ int mob_damage(struct block_list *src,struct mob_data *md,int damage,int type) ditem->nameid = itemdb_searchrandomid(6); if (drop_ore<0) i=8; //we have only 10 slots in LOG, there's a check to not overflow (9th item usually a card, so we use 8th slot) log_item[i] = ditem->nameid; //it's for logging only - drop_items++; //we cound if there were any drops + drop_items++; //we count if there were any drops ditem->amount = 1; ditem->m = md->bl.m; ditem->x = md->bl.x; -- cgit v1.2.3-60-g2f50