Przeglądaj źródła

- 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://svn.code.sf.net/p/rathena/svn/trunk@11482 54d463be-8e91-2dee-dedb-b68131a5f0ec

skotlex 17 lat temu
rodzic
commit
22b43b5903
4 zmienionych plików z 31 dodań i 8 usunięć
  1. 8 0
      Changelog-Trunk.txt
  2. 1 1
      db/item_db.txt
  3. 22 5
      src/map/itemdb.c
  4. 0 2
      src/map/log.c

+ 8 - 0
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.

+ 1 - 1
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; },{},{}

+ 22 - 5
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]);

+ 0 - 2
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