Bläddra i källkod

* fix Tetra Vortex triggering cooldown when not enough spheres present bugreport:7598 * fix Tetra Vortex not removing 5th sphere if present after casting * followup to r17316 - Mistress card removes gemstone requirements from Adoramus and Comet

git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@17320 54d463be-8e91-2dee-dedb-b68131a5f0ec
hipsterfont 12 år sedan
förälder
incheckning
7b97f55e05
1 ändrade filer med 24 tillägg och 8 borttagningar
  1. 24 8
      src/map/skill.c

+ 24 - 8
src/map/skill.c

@@ -4388,12 +4388,6 @@ int skill_castend_damage_id (struct block_list* src, struct block_list *bl, uint
 					j++; //
 				}
 
-			if( j < 4 )
-			{ // Need 4 spheres minimum
-				clif_skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0);
-				break;
-			}
-
 			// Sphere Sort, this time from new to old
 			for( i = 0; i <= j - 2; i++ )
 				for( k = i + 1; k <= j - 1; k++ )
@@ -4417,6 +4411,8 @@ int skill_castend_damage_id (struct block_list* src, struct block_list *bl, uint
 				clif_skill_nodamage(src, bl, subskill, skill_lv, 1);
 				status_change_end(src, spheres[i], INVALID_TIMER);
 			}
+			if (spheres[4]) // fix to remove last sphere if 5 are present, on official even though only 4 spheres are used, all spheres are removed
+				status_change_end(src, spheres[4], INVALID_TIMER);
 		}
 		break;
 
@@ -13142,13 +13138,14 @@ int skill_check_condition_castbegin(struct map_session_data* sd, uint16 skill_id
 		//	}
 		//	break;
 
-		case AB_ADORAMUS:
+		
+		case AB_ADORAMUS: // bugreport:7647 mistress card DOES remove requirements for gemstones from Adoramus and Comet -helvetica
 		/**
 		 * Warlock
 		 **/
 		case WL_COMET:
 			if( skill_check_pc_partner(sd,skill_id,&skill_lv,1,0) <= 0
-				&& ((i = pc_search_inventory(sd,require.itemid[0])) < 0 || sd->status.inventory[i].amount < require.amount[0]) ) {
+				&& ((i = pc_search_inventory(sd,require.itemid[0])) < 0 || sd->status.inventory[i].amount < require.amount[0] || !sd->special_state.no_gemstone) ) {
 				//clif_skill_fail(sd,skill_id,USESKILL_FAIL_NEED_ITEM,require.amount[0],require.itemid[0]);
 				clif_skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0);
 				return 0;
@@ -13166,6 +13163,25 @@ int skill_check_condition_castbegin(struct map_session_data* sd, uint16 skill_id
 				}
 			}
 			break;
+		case WL_TETRAVORTEX: // bugreport:7598 moved sphere check to precast to avoid triggering cooldown per official behavior -helvetica
+			if( sc ) {	
+				int j = 0;
+
+				for( i = SC_SPHERE_1; i <= SC_SPHERE_5; i++ )
+					if( sc->data[i] ) {
+						j++;
+					}
+			
+				if( j < 4 ) { // Need 4 spheres minimum
+					clif_skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0);
+					return 0;
+				}
+			}
+			else { // no status at all? no spheres present
+				clif_skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0);
+				return 0;
+			}
+			break;
 		/**
 		 * Guilotine Cross
 		 **/