From b3881bd1fc859ec672236e6bb31e0b0cec4078b1 Mon Sep 17 00:00:00 2001 From: eppc0330 <47050704+eppc0330@users.noreply.github.com> Date: Mon, 13 Mar 2023 08:25:47 +0900 Subject: [PATCH] Implement NPC_GRADUAL_GRAVITY (#7635) --- db/re/skill_db.yml | 12 ++++++++++++ db/re/status.yml | 8 ++++++++ src/common/mmo.hpp | 2 +- src/map/script_constants.hpp | 1 + src/map/skill.cpp | 5 +++++ src/map/status.cpp | 12 ++++++++++++ src/map/status.hpp | 2 ++ 7 files changed, 41 insertions(+), 1 deletion(-) diff --git a/db/re/skill_db.yml b/db/re/skill_db.yml index d877897d0f..7b57d015d3 100644 --- a/db/re/skill_db.yml +++ b/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 diff --git a/db/re/status.yml b/db/re/status.yml index 58b2f4652f..16ccd4797a 100644 --- a/db/re/status.yml +++ b/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 diff --git a/src/common/mmo.hpp b/src/common/mmo.hpp index 6f67726e54..804926f5b1 100644 --- a/src/common/mmo.hpp +++ b/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 diff --git a/src/map/script_constants.hpp b/src/map/script_constants.hpp index 665d11caa0..5ba824c51d 100644 --- a/src/map/script_constants.hpp +++ b/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); diff --git a/src/map/skill.cpp b/src/map/skill.cpp index 75e04aa17a..21c72b5e97 100755 --- a/src/map/skill.cpp +++ b/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: diff --git a/src/map/status.cpp b/src/map/status.cpp index b6ef6f9fdf..02c2bfb025 100644 --- a/src/map/status.cpp +++ b/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 ) { diff --git a/src/map/status.hpp b/src/map/status.hpp index f932e87f44..899f3b2591 100644 --- a/src/map/status.hpp +++ b/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