Jelajahi Sumber

Fixed waterball not canceling magic power if target is killed while not all spheres were fired, credit to wildcard for the fix. bugreport:5303
- also removed a unused instance of status_change in skill_counter_additional_effect

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

shennetsind 13 tahun lalu
induk
melakukan
778eb05c94
1 mengubah file dengan 11 tambahan dan 7 penghapusan
  1. 11 7
      src/map/skill.c

+ 11 - 7
src/map/skill.c

@@ -1483,7 +1483,6 @@ int skill_counter_additional_effect (struct block_list* src, struct block_list *
 	int rate;
 	struct map_session_data *sd=NULL;
 	struct map_session_data *dstsd=NULL;
-	struct status_change *tsc;
 
 	nullpo_ret(src);
 	nullpo_ret(bl);
@@ -1491,10 +1490,6 @@ int skill_counter_additional_effect (struct block_list* src, struct block_list *
 	if(skillid < 0) return 0;
 	if(skillid > 0 && skilllv <= 0) return 0;	// don't forget auto attacks! - celest
 
-	tsc = status_get_sc(bl);
-	if (tsc && !tsc->count)
-		tsc = NULL;
-
 	sd = BL_CAST(BL_PC, src);
 	dstsd = BL_CAST(BL_PC, bl);
 
@@ -1571,10 +1566,19 @@ int skill_counter_additional_effect (struct block_list* src, struct block_list *
 			sp += sd->sp_gain_race[is_boss(bl)?RC_BOSS:RC_NONBOSS];
 			hp += sd->hp_gain_value;
 		}
-		if( attack_type&BF_MAGIC )
-		{
+		if( attack_type&BF_MAGIC ) {
 			sp += sd->magic_sp_gain_value;
 			hp += sd->magic_hp_gain_value;
+			if( skillid == WZ_WATERBALL ) {//(bugreport:5303)
+				struct status_change *sc = NULL;
+				if( ( sc = status_get_sc(src) ) ) {
+					status_change_end(src, SC_MAGICPOWER, INVALID_TIMER);
+					if(sc->data[SC_SPIRIT] &&
+								sc->data[SC_SPIRIT]->val2 == SL_WIZARD &&
+								sc->data[SC_SPIRIT]->val3 == WZ_WATERBALL)
+								sc->data[SC_SPIRIT]->val3 = 0; //Clear bounced spell check.
+				}
+			}
 		}
 		if( hp || sp )
 		{// updated to force healing to allow healing through berserk