diff options
author | Lupus <Lupus@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2005-04-03 07:25:33 +0000 |
---|---|---|
committer | Lupus <Lupus@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2005-04-03 07:25:33 +0000 |
commit | 582afd97b0cc7050417ee16dc60638fa189a8fdf (patch) | |
tree | 055c842754fbeb52c0f58f6619122f21bb1f9b96 | |
parent | 7ae4ad581571866181d58ced35f9fa871672b7fa (diff) | |
download | hercules-582afd97b0cc7050417ee16dc60638fa189a8fdf.tar.gz hercules-582afd97b0cc7050417ee16dc60638fa189a8fdf.tar.bz2 hercules-582afd97b0cc7050417ee16dc60638fa189a8fdf.tar.xz hercules-582afd97b0cc7050417ee16dc60638fa189a8fdf.zip |
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
-rw-r--r-- | Changelog-SVN.txt | 1 | ||||
-rw-r--r-- | 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; |