From 15052c64e803d612f44854358727e67e567e6415 Mon Sep 17 00:00:00 2001 From: skotlex Date: Mon, 15 Oct 2007 23:26:28 +0000 Subject: - fixed Halo-Halo not being consumed on use. - Updated the item price/sell reading code to enable 'null' values. The difference between a blank value and 0 is that when the value is blank, it should automatically take half/double the other value. The previous behaviour did this automatically and didn't let you specify, for example, if you wanted a given item to sell for 0. - Also added a warning when an item in the db has an exploitable price (through overcharge/discount). git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@11482 54d463be-8e91-2dee-dedb-b68131a5f0ec --- Changelog-Trunk.txt | 8 ++++++++ db/item_db.txt | 2 +- src/map/itemdb.c | 27 ++++++++++++++++++++++----- src/map/log.c | 2 -- 4 files changed, 31 insertions(+), 8 deletions(-) diff --git a/Changelog-Trunk.txt b/Changelog-Trunk.txt index 7bad2207f..66edfdd1e 100644 --- a/Changelog-Trunk.txt +++ b/Changelog-Trunk.txt @@ -3,6 +3,14 @@ Date Added AS OF SVN REV. 5091, WE ARE NOW USING TRUNK. ALL UNTESTED BUGFIXES/FEATURES GO INTO TRUNK. IF YOU HAVE A WORKING AND TESTED BUGFIX PUT IT INTO STABLE AS WELL AS TRUNK. +2007/10/15 + * Updated the item price/sell reading code to enable 'null' values. The + difference between a blank value and 0 is that when the value is blank, it + should automatically take half/double the other value. The previous + behaviour did this automatically and didn't let you specify, for example, + if you wanted a given item to sell for 0. + * Also added a warning when an item in the db has an exploitable price + (through overcharge/discount). [Skotlex] 2007/10/14 * Rev. 11476 Implemented new skill "Enlarge Weight Limit R", [L0ne_W0lf] and increased MAX_SKILL_TREE by 1. diff --git a/db/item_db.txt b/db/item_db.txt index 45c7dcfa7..204243554 100644 --- a/db/item_db.txt +++ b/db/item_db.txt @@ -3285,7 +3285,7 @@ 12244,Old_Gift_Box,Old Gift Box,2,,,200,,,,,0xFFFFFFFF,7,2,,,,,,{ getitem rand(5270,5272),1; },{},{} //St patrick's day Event (2007) 12245,Green_Ale_US,Green Ale,0,,10,500,,,,,0xFFFFFFFF,7,2,,,,,,{ percentheal 100,0; },{},{} -12247,Halohalo,Halo-Halo,11,,,1000,,,,,0xFFFFFFFF,7,2,,,20,,,{ sc_start SC_INCALLSTATUS,600000,3; },{},{} +12247,Halohalo,Halo-Halo,2,,,1000,,,,,0xFFFFFFFF,7,2,,,20,,,{ sc_start SC_INCALLSTATUS,600000,3; },{},{} 12248,Fancy_Ball_Box,Fancy_Ball_Box,2,,10,10,,,,,0xFFFFFFFF,7,2,,,,,,{ getitem 5296,1; getitem 5297,1; getitem 5298,1; },{},{} 12249,Kafra_Employee_Paystub,Kafra_Employee_Paystub,2,,10,10,,,,,0xFFFFFFFF,7,2,,,,,,{},{},{} 12250,Str_Dish_,Steamed Tongue,2,,10,10,,,,,0xFFFFFFFF,7,2,,,,,,{ sc_start SC_STRFood,3600000,10; percentheal 20,20; },{},{} diff --git a/src/map/itemdb.c b/src/map/itemdb.c index 9d533ad70..46caca0da 100644 --- a/src/map/itemdb.c +++ b/src/map/itemdb.c @@ -728,11 +728,28 @@ static bool itemdb_parse_dbrow(char** str, const char* source, int line, int scr } else //In case of an itemdb reload and the item type changed. id->flag.delay_consume = 0; - id->value_buy = atoi(str[4]); - id->value_sell = atoi(str[5]); - if (id->value_buy < id->value_sell * 2) id->value_buy = id->value_sell * 2; // prevent exploit - if (id->value_buy == 0 && id->value_sell > 0) id->value_buy = id->value_sell * 2; - if (id->value_sell == 0 && id->value_buy > 0) id->value_sell = id->value_buy / 2; + //When a particular price is not given, we should base it off the other one + //(it is important to make a distinction between 'no price' and 0z) + if ( str[4][0] ) + id->value_buy = atoi(str[4]); + else + id->value_buy = atoi(str[5]) * 2; + + if ( str[5][0] ) + id->value_sell = atoi(str[5]); + else + id->value_sell = id->value_buy / 2; + /* + if ( !str[4][0] && !str[5][0]) + { + ShowWarning("itemdb_parse_dbrow: No buying/selling price defined for item %d (%s), using 20/10z\n", nameid, id->jname); + id->value_buy = 20; + id->value_sell = 10; + } else + */ + if (id->value_buy/124. < id->value_sell/75.) + ShowWarning("itemdb_parse_dbrow: Buying/Selling [%d/%d] price of item %d (%s) allows Zeny making exploit through buying/selling at discounted/overcharged prices!\n", + id->value_buy, id->value_sell, nameid, id->jname); id->weight = atoi(str[6]); id->atk = atoi(str[7]); diff --git a/src/map/log.c b/src/map/log.c index b50bcfb70..bd5079a40 100644 --- a/src/map/log.c +++ b/src/map/log.c @@ -19,8 +19,6 @@ struct Log_Config log_config; char timestring[255]; time_t curtime; -static int should_log_item(int filter, int nameid, int amount); //log filter check - //FILTER OPTIONS //0 = Don't log //1 = Log any item -- cgit v1.2.3-70-g09d2