From 7f2a12250794e5897f39acfa7314db7f926bdf12 Mon Sep 17 00:00:00 2001 From: ai4rei Date: Sun, 26 Dec 2010 13:32:07 +0000 Subject: * Fixed items, that get dropped at 100% chance, being reported in @iteminfo as 'available in the shops only' (since/replaces r3482). git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@14627 54d463be-8e91-2dee-dedb-b68131a5f0ec --- src/map/atcommand.c | 6 +++--- src/map/itemdb.h | 2 +- src/map/log.c | 2 +- src/map/mob.c | 4 ++-- src/map/npc.c | 4 ++-- src/map/script.c | 4 ++-- 6 files changed, 11 insertions(+), 11 deletions(-) (limited to 'src') diff --git a/src/map/atcommand.c b/src/map/atcommand.c index 277f770b8..95b3dc33e 100644 --- a/src/map/atcommand.c +++ b/src/map/atcommand.c @@ -7432,12 +7432,12 @@ ACMD_FUNC(iteminfo) sprintf(atcmd_output, "NPC Buy:%dz, Sell:%dz | Weight: %.1f ", item_data->value_buy, item_data->value_sell, item_data->weight/10. ); clif_displaymessage(fd, atcmd_output); - if (item_data->maxchance == 10000) - strcpy(atcmd_output, " - Available in the shops only"); + if (item_data->maxchance == -1) + strcpy(atcmd_output, " - Available in the shops only."); else if (item_data->maxchance) sprintf(atcmd_output, " - Maximal monsters drop chance: %02.02f%%", (float)item_data->maxchance / 100 ); else - strcpy(atcmd_output, " - Monsters don't drop this item"); + strcpy(atcmd_output, " - Monsters don't drop this item."); clif_displaymessage(fd, atcmd_output); } diff --git a/src/map/itemdb.h b/src/map/itemdb.h index 263e4fe3f..3fb14b2d4 100644 --- a/src/map/itemdb.h +++ b/src/map/itemdb.h @@ -45,7 +45,7 @@ struct item_data { int value_buy; int value_sell; int type; - int maxchance; //For logs, for external game info, for scripts: Max drop chance of this item (e.g. 0.01% , etc.. if it = 0, then monsters don't drop it) [Lupus] + int maxchance; //For logs, for external game info, for scripts: Max drop chance of this item (e.g. 0.01% , etc.. if it = 0, then monsters don't drop it, -1 denotes items sold in shops only) [Lupus] int sex; int equip; int weight; diff --git a/src/map/log.c b/src/map/log.c index 0affef995..bf6133684 100644 --- a/src/map/log.c +++ b/src/map/log.c @@ -52,7 +52,7 @@ int should_log_item(int filter, int nameid, int amount) (filter&128 && (item_data->type == IT_PETEGG || item_data->type == IT_PETARMOR) ) || (filter&256 && item_data->value_buy >= log_config.price_items_log ) || //expensive items (filter&512 && abs(amount) >= log_config.amount_items_log ) || //big amount of items - (filter&2048 && ((item_data->maxchance <= log_config.rare_items_log) || item_data->nameid == 714) ) //Rare items or Emperium + (filter&2048 && ((item_data->maxchance != -1 && item_data->maxchance <= log_config.rare_items_log) || item_data->nameid == 714) ) //Rare items or Emperium ) return item_data->nameid; return 0; diff --git a/src/map/mob.c b/src/map/mob.c index 6dbb1a5ad..d67b470af 100644 --- a/src/map/mob.c +++ b/src/map/mob.c @@ -3556,7 +3556,7 @@ static bool mob_parse_dbrow(char** str) //calculate and store Max available drop chance of the MVP item if (db->mvpitem[i].p) { id = itemdb_search(db->mvpitem[i].nameid); - if (id->maxchance == 10000 || (id->maxchance < db->mvpitem[i].p/10 + 1) ) { + if (id->maxchance == -1 || (id->maxchance < db->mvpitem[i].p/10 + 1) ) { //item has bigger drop chance or sold in shops id->maxchance = db->mvpitem[i].p/10 + 1; //reduce MVP drop info to not spoil common drop rate } @@ -3618,7 +3618,7 @@ static bool mob_parse_dbrow(char** str) if( db->dropitem[i].p && (class_ < 1324 || class_ > 1363) && (class_ < 1938 || class_ > 1946) ) { //Skip treasure chests. id = itemdb_search(db->dropitem[i].nameid); - if (id->maxchance == 10000 || (id->maxchance < db->dropitem[i].p) ) { + if (id->maxchance == -1 || (id->maxchance < db->dropitem[i].p) ) { id->maxchance = db->dropitem[i].p; //item has bigger drop chance or sold in shops } for (k = 0; k< MAX_SEARCH; k++) { diff --git a/src/map/npc.c b/src/map/npc.c index 2c514eb72..4b188c177 100644 --- a/src/map/npc.c +++ b/src/map/npc.c @@ -1939,8 +1939,8 @@ static const char* npc_parse_shop(char* w1, char* w2, char* w3, char* w4, const id->name, nameid, value, (int)(value*0.75), id->value_sell, (int)(id->value_sell*1.24), filepath, strline(buffer,start-buffer)); } //for logs filters, atcommands and iteminfo script command - if( id->maxchance <= 0 ) - id->maxchance = 10000; //10000 (100% drop chance)would show that the item's sold in NPC Shop + if( id->maxchance == 0 ) + id->maxchance = -1; // -1 would show that the item's sold in NPC Shop items[i].nameid = nameid; items[i].value = value; diff --git a/src/map/script.c b/src/map/script.c index a05d79159..af723bf28 100644 --- a/src/map/script.c +++ b/src/map/script.c @@ -10655,7 +10655,7 @@ BUILDIN_FUNC(getitemslots) 2 type; 3 maxchance = Max drop chance of this item e.g. 1 = 0.01% , etc.. if = 0, then monsters don't drop it at all (rare or a quest item) - if = 10000, then this item is sold in NPC shops only + if = -1, then this item is sold in NPC shops only 4 sex; 5 equip; 6 weight; @@ -10695,7 +10695,7 @@ BUILDIN_FUNC(getiteminfo) 2 type; 3 maxchance = Max drop chance of this item e.g. 1 = 0.01% , etc.. if = 0, then monsters don't drop it at all (rare or a quest item) - if = 10000, then this item is sold in NPC shops only + if = -1, then this item is sold in NPC shops only 4 sex; 5 equip; 6 weight; -- cgit v1.2.3-70-g09d2