Selaa lähdekoodia

- Cleaned up the Mistress Card related code so that the no-gemstone bonus reduces item requirements by one rather than totally skip them.
- Cleaned up the logs "can log"function to use the IT constants. Also corrected the "only log large amounts" setting not working on negative values (trades).


git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@7863 54d463be-8e91-2dee-dedb-b68131a5f0ec

skotlex 19 vuotta sitten
vanhempi
commit
91cae9f29b
3 muutettua tiedostoa jossa 28 lisäystä ja 30 poistoa
  1. 5 0
      Changelog-Trunk.txt
  2. 10 10
      src/map/log.c
  3. 13 20
      src/map/skill.c

+ 5 - 0
Changelog-Trunk.txt

@@ -4,6 +4,11 @@ AS OF SVN REV. 5091, WE ARE NOW USING TRUNK.  ALL UNTESTED BUGFIXES/FEATURES GO
 IF YOU HAVE A WORKING AND TESTED BUGFIX PUT IT INTO STABLE AS WELL AS TRUNK.
 
 2006/07/24
+	* Cleaned up the Mistress Card related code so that the no-gemstone bonus
+	  reduces item requirements by one rather than totally skip them. [Skotlex]
+	* Cleaned up the logs "can log"function to use the IT constants. Also
+	  corrected the "only log large amounts" setting not working on negative
+	  values (trades). [Skotlex]
 	* Adjusted skill_castfix_sc so that Suffragium will get consumed even on
 	  instant cast skills, but Memorize won't. [Skotlex]
 	* BladeStop will now end when either of the characters is moved (knocked

+ 10 - 10
src/map/log.c

@@ -47,17 +47,17 @@ time_t curtime;
 //check if this item should be logged according the settings
 int should_log_item(int filter, int nameid, int amount) {
 	struct item_data *item_data;
-	if (nameid<501 || (item_data= itemdb_search(nameid)) == NULL) return 0;
-	if ( (filter&1) || // Filter = 1, we log any item
-		(filter&2 && item_data->type == 0 ) ||	//healing items
-		(filter&4 && (item_data->type == 3 || item_data->type == 10) ) ||	//etc+arrows
-		(filter&8 && (item_data->type == 2 || item_data->type == 11) ) ||	//usable
-		(filter&16 && item_data->type == 4 ) ||	//weapon
-		(filter&32 && item_data->type == 5 ) ||	//armor
-		(filter&64 && item_data->type == 6 ) ||	//cards
-		(filter&128 && (item_data->type == 7 || item_data->type == 8) ) ||	//eggs+pet access
+	if ((item_data= itemdb_exists(nameid)) == NULL) return 0;
+	if ((filter&1) || // Filter = 1, we log any item
+		(filter&2 && item_data->type == IT_HEALING ) ||
+		(filter&4 && (item_data->type == IT_ETC || item_data->type == IT_AMMO) ) ||
+		(filter&8 && item_data->type == IT_USABLE ) ||
+		(filter&16 && item_data->type == IT_WEAPON ) ||
+		(filter&32 && item_data->type == IT_ARMOR ) ||
+		(filter&64 && item_data->type == IT_CARD ) ||
+		(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 && amount >= log_config.amount_items_log ) ||			//big amount of 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
 	) return item_data->nameid;
 

+ 13 - 20
src/map/skill.c

@@ -3492,16 +3492,6 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, in
 	case SA_ABRACADABRA:
 		{
 			int abra_skillid = 0, abra_skilllv;
-			if (sd)
-			{ //Crash-fix [Skotlex]
-				//require 1 yellow gemstone even with mistress card or Into the Abyss
-				if ((i = pc_search_inventory(sd, 715)) < 0 )
-				{ //bug fixed by Lupus (item pos can be 0, too!)
-					clif_skill_fail(sd,skillid,0,0);
-					break;
-				}
-				pc_delitem(sd, i, 1, 0);
-			}
 			do {
 				abra_skillid = rand() % MAX_SKILL_ABRA_DB;
 				if (
@@ -7847,7 +7837,6 @@ int skill_check_condition (struct map_session_data *sd, int skill, int lv, int t
 	struct status_change *sc;
 	int i,j,hp,sp,hp_rate,sp_rate,zeny,weapon,ammo,ammo_qty,state,spiritball,mhp;
 	int index[10],itemid[10],amount[10];
-	int force_gem_flag = 0;
 	int delitem_flag = 1, checkitem_flag = 1;
 
 	nullpo_retr(0, sd);
@@ -8209,9 +8198,6 @@ int skill_check_condition (struct map_session_data *sd, int skill, int lv, int t
 		if(!sc || sc->data[SC_COMBO].timer == -1 || sc->data[SC_COMBO].val1 != skill)
 			return 0;
 		break;
-	case HW_GANBANTEIN:
-		force_gem_flag = 1;
-		break;
 	case AM_BERSERKPITCHER:
 	case AM_POTIONPITCHER:
 	case CR_SLIMPITCHER:
@@ -8485,11 +8471,19 @@ int skill_check_condition (struct map_session_data *sd, int skill, int lv, int t
 			index[i] = -1;
 			if(itemid[i] <= 0)
 				continue;
-			if(itemid[i] >= 715 && itemid[i] <= 717 && sd->special_state.no_gemstone && !force_gem_flag)
-				continue;
-			if(((itemid[i] >= 715 && itemid[i] <= 717) || itemid[i] == 1065)
-				&& sc && sc->data[SC_INTOABYSS].timer != -1 && !force_gem_flag)
+			if(itemid[i] >= 715 && itemid[i] <= 717 && skill != HW_GANBANTEIN)
+			{
+				if (sd->special_state.no_gemstone)
+				{	//Make it substract 1 gem rather than skipping the cost.
+					if (--amount[i] < 1)
+						continue;
+				}
+				if(sc && sc->data[SC_INTOABYSS].timer != -1)
+					continue;
+			} else
+			if(itemid[i] == 1065 && sc && sc->data[SC_INTOABYSS].timer != -1)
 				continue;
+
 			if((skill == AM_POTIONPITCHER ||
 				skill == CR_SLIMPITCHER ||
 				skill == CR_CULTIVATION) && i != x)
@@ -8503,9 +8497,8 @@ int skill_check_condition (struct map_session_data *sd, int skill, int lv, int t
 					clif_skill_fail(sd,skill,0,0);
 				return 0;
 			}
-			if((itemid[i] >= 715 && itemid[i] <= 717) && sc && sc->data[SC_SPIRIT].timer != -1 && sc->data[SC_SPIRIT].val2 == SL_WIZARD)
+			if(itemid[i] >= 715 && itemid[i] <= 717 && sc && sc->data[SC_SPIRIT].timer != -1 && sc->data[SC_SPIRIT].val2 == SL_WIZARD)
 				index[i] = -1; //Gemstones are checked, but not substracted from inventory.
-				
 		}
 	}