Browse Source

Implement NPC_GRADUAL_GRAVITY (#7635)

eppc0330 2 years ago
parent
commit
b3881bd1fc
7 changed files with 41 additions and 1 deletions
  1. 12 0
      db/re/skill_db.yml
  2. 8 0
      db/re/status.yml
  3. 1 1
      src/common/mmo.hpp
  4. 1 0
      src/map/script_constants.hpp
  5. 5 0
      src/map/skill.cpp
  6. 12 0
      src/map/status.cpp
  7. 2 0
      src/map/status.hpp

+ 12 - 0
db/re/skill_db.yml

@@ -17907,6 +17907,18 @@ Body:
         NoReiteration: true
         NoOverlap: true
     Status: PropertyWalk
+  - Id: 752
+    Name: NPC_GRADUAL_GRAVITY
+    Description: Increased Gravity
+    MaxLevel: 3
+    TargetType: Attack
+    DamageFlags:
+      NoDamage: true
+    Flags:
+      IsNpc: true
+    Range: 9
+    Duration1: 3000
+    Status: GRADUAL_GRAVITY
   - Id: 756
     Name: NPC_WIDEBLEEDING2
     Description: Wide Bleeding

+ 8 - 0
db/re/status.yml

@@ -8548,3 +8548,11 @@ Body:
       Debuff: true
     CalcFlags:
       Res: true
+  - Status: GRADUAL_GRAVITY
+    Icon: EFST_GRADUAL_GRAVITY
+    DurationLookup: NPC_GRADUAL_GRAVITY
+    Flags:
+      BlEffect: true
+      DisplayPc: true
+      NoDispell: true
+      NoClearance: true

+ 1 - 1
src/common/mmo.hpp

@@ -89,7 +89,7 @@ typedef uint32 t_itemid;
 #endif
 #define MAX_FAME 1000000000 ///Max fame points
 #define MAX_CART 100 ///Maximum item in cart
-#define MAX_SKILL 1481 ///Maximum skill can be hold by Player, Homunculus, & Mercenary (skill list) AND skill_db limit
+#define MAX_SKILL 1486 ///Maximum skill can be hold by Player, Homunculus, & Mercenary (skill list) AND skill_db limit
 #define DEFAULT_WALK_SPEED 150 ///Default walk speed
 #define MIN_WALK_SPEED 20 ///Min walk speed
 #define MAX_WALK_SPEED 1000 ///Max walk speed

+ 1 - 0
src/map/script_constants.hpp

@@ -1872,6 +1872,7 @@
 	export_constant(SC_TOXIN_OF_MANDARA);
 	export_constant(SC_GOLDENE_TONE);
 	export_constant(SC_TEMPERING);
+	export_constant(SC_GRADUAL_GRAVITY);
 
 #ifdef RENEWAL
 	export_constant(SC_EXTREMITYFIST2);

+ 5 - 0
src/map/skill.cpp

@@ -7817,6 +7817,11 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, ui
 			sc_start(src,bl,type,100,skill_lv,skill_get_time(skill_id,skill_lv)));
 		break;
 
+	case NPC_GRADUAL_GRAVITY:
+		status_change_start(src, bl, type, 10000, skill_lv, 0, 0, 0, skill_get_time(skill_id, skill_lv), SCSTART_NOAVOID|SCSTART_NOTICKDEF|SCSTART_NORATEDEF);
+		clif_skill_nodamage(src, bl, skill_id, skill_lv, 1);
+		break;
+
 #ifdef RENEWAL
 	// EDP also give +25% WATK poison pseudo element to user.
 	case ASC_EDP:

+ 12 - 0
src/map/status.cpp

@@ -9352,6 +9352,7 @@ static int status_get_sc_interval(enum sc_type type)
 		case SC_LEECHESEND:
 		case SC_DPOISON:
 		case SC_DEATHHURT:
+		case SC_GRADUAL_GRAVITY:
 			return 1000;
 		case SC_BURNING:
 		case SC_PYREXIA:
@@ -10889,6 +10890,11 @@ int status_change_start(struct block_list* src, struct block_list* bl,enum sc_ty
 				val4 = 1;
 			tick_time = val2 * 1000; // [GodLesZ] tick time
 			break;
+		case SC_GRADUAL_GRAVITY:
+			val2 = 10 * val1;
+			tick_time = status_get_sc_interval(type);
+			val4 = tick - tick_time; // Remaining time
+			break;
 		case SC_BOSSMAPINFO:
 			if( sd != NULL ) {
 				struct mob_data *boss_md = map_getmob_boss(bl->m); // Search for Boss on this Map
@@ -13960,6 +13966,12 @@ TIMER_FUNC(status_change_timer){
 			return 0;
 		}
 		break;
+		
+	case SC_GRADUAL_GRAVITY:
+		if (sce->val4 >= 0) {
+			status_zap(bl, status->max_hp * sce->val2 / 100, 0);
+		}
+		break;
 
 	case SC_BOSSMAPINFO:
 		if( sd && --(sce->val4) >= 0 ) {

+ 2 - 0
src/map/status.hpp

@@ -1263,6 +1263,8 @@ enum sc_type : int16 {
 	SC_GOLDENE_TONE,
 	SC_TEMPERING,
 
+	SC_GRADUAL_GRAVITY,
+
 #ifdef RENEWAL
 	SC_EXTREMITYFIST2, //! NOTE: This SC should be right before SC_MAX, so it doesn't disturb if RENEWAL is disabled
 #endif