Browse Source

Correct Death Valley behavior (#8502)

* Follow up to 4b32621.
* The target player should be healed from the remaining SP before the SP reduction is applied.
* Update HP/SP without sending extra packets.
* Fix SP ratio.

---------

Co-authored-by: Atemo <Atemo@users.noreply.github.com>
Co-authored-by: Lemongrass3110 <lemongrass@kstp.at>
Aleos 9 months ago
parent
commit
94a731aad0
1 changed files with 3 additions and 8 deletions
  1. 3 8
      src/map/skill.cpp

+ 3 - 8
src/map/skill.cpp

@@ -11705,15 +11705,10 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, ui
 			if( !status_isdead(bl) )
 			if( !status_isdead(bl) )
 				break;
 				break;
 
 
-			status_zap(bl, 0, tstatus->sp * 10 * skill_lv / 100);
-
-			int heal = tstatus->sp;
-
-			if( heal <= 0 )
-				heal = 1;
-			tstatus->hp = heal;
+			tstatus->hp = max(tstatus->sp, 1);
+			tstatus->sp -= tstatus->sp * ( 60 - 10 * skill_lv ) / 100;
 			clif_skill_nodamage(src,bl,skill_id,skill_lv,1);
 			clif_skill_nodamage(src,bl,skill_id,skill_lv,1);
-			pc_revive((TBL_PC*)bl,heal,0);
+			pc_revive(reinterpret_cast<map_session_data*>(bl),true,true);
 			clif_resurrection( *bl );
 			clif_resurrection( *bl );
 		}
 		}
 		break;
 		break;