summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJesusaves <cpntb1@ymail.com>2022-01-02 09:07:07 -0300
committerJesusaves <cpntb1@ymail.com>2022-01-02 09:07:07 -0300
commitfcdec2a8dd0b6dcb3b28d9bdc5839c77affba002 (patch)
tree6e73b3a8d0135856f8f807f8878aa9596651e76a
parenta90e4b49e53f38ecdde98ffdf77f0f7791f27692 (diff)
downloadevol-hercules-fcdec2a8dd0b6dcb3b28d9bdc5839c77affba002.tar.gz
evol-hercules-fcdec2a8dd0b6dcb3b28d9bdc5839c77affba002.tar.bz2
evol-hercules-fcdec2a8dd0b6dcb3b28d9bdc5839c77affba002.tar.xz
evol-hercules-fcdec2a8dd0b6dcb3b28d9bdc5839c77affba002.zip
Implement SC_HALT_REGENERATION.
-rw-r--r--src/emap/enum/esctype.h1
-rw-r--r--src/emap/enum/esitype.h1
-rw-r--r--src/emap/init.c1
-rw-r--r--src/emap/skill_const.c1
-rw-r--r--src/emap/status.c17
-rw-r--r--src/emap/status.h3
6 files changed, 24 insertions, 0 deletions
diff --git a/src/emap/enum/esctype.h b/src/emap/enum/esctype.h
index 28e3930..13a868a 100644
--- a/src/emap/enum/esctype.h
+++ b/src/emap/enum/esctype.h
@@ -7,6 +7,7 @@
typedef enum esc_type
{
SC_PHYSICAL_SHIELD = 654,
+ SC_HALT_REGENERATION,
} esc_type;
#endif // EVOL_MAP_ENUM_ESCTYPE
diff --git a/src/emap/enum/esitype.h b/src/emap/enum/esitype.h
index b1d62c3..313f50a 100644
--- a/src/emap/enum/esitype.h
+++ b/src/emap/enum/esitype.h
@@ -7,6 +7,7 @@
enum esi_type
{
SI_PHYSICAL_SHIELD = 966,
+ SI_HALT_REGEN = 967,
//SI_TMW2_INCSTR = 970,
SI_TMW2_INCAGI = 971,
SI_TMW2_INCVIT = 972,
diff --git a/src/emap/init.c b/src/emap/init.c
index a50c5ef..af4c22e 100644
--- a/src/emap/init.c
+++ b/src/emap/init.c
@@ -416,6 +416,7 @@ HPExport void plugin_init (void)
addHookPost(status, calc_fix_aspd, estatus_calc_fix_aspd_post);
addHookPost(status, change_start, estatus_change_start_post);
addHookPost(status, change_end_, estatus_change_end__post);
+ addHookPost(status, calc_regen_rate, estatus_calc_regen_rate_post);
addHookPost(map, addflooritem, emap_addflooritem_post);
addHookPost(mob, read_db_mode_sub, emob_read_db_mode_sub_post);
addHookPost(mob, spawn_dataset, emob_spawn_dataset_post);
diff --git a/src/emap/skill_const.c b/src/emap/skill_const.c
index 6161e64..1aadf4d 100644
--- a/src/emap/skill_const.c
+++ b/src/emap/skill_const.c
@@ -23,5 +23,6 @@ void eskill_addskill_conststants(void)
// sc
script->set_constant("SC_PHYSICAL_SHIELD", SC_PHYSICAL_SHIELD, false, false);
+ script->set_constant("SC_HALT_REGENERATION", SC_HALT_REGENERATION, false, false);
script->constdb_comment(NULL);
}
diff --git a/src/emap/status.c b/src/emap/status.c
index b867f4d..38a5f66 100644
--- a/src/emap/status.c
+++ b/src/emap/status.c
@@ -45,6 +45,7 @@ void eInitChangeTables(void)
(sc_type)SC_PHYSICAL_SHIELD,
SI_PHYSICAL_SHIELD,
SCB_DEF | SCB_DEF2 | SCB_ASPD);
+ status->dbs->ChangeFlagTable[SC_HALT_REGENERATION] |= SCB_REGEN;
// TMW2 Customs
//status->dbs->IconChangeTable[SC_INCSTR] = SI_TMW2_INCSTR;
@@ -60,6 +61,8 @@ void eInitChangeTables(void)
status->dbs->IconChangeTable[SC_INCMHPRATE] = SI_TMW2_INCMHPRATE;
status->dbs->IconChangeTable[SC_INCMSPRATE] = SI_TMW2_INCMSPRATE;
+ status->dbs->IconChangeTable[SC_HALT_REGENERATION] = SI_HALT_REGEN;
+
// status->dbs->DisplayType[SC_PHYSICAL_SHIELD] = true;
}
@@ -274,3 +277,17 @@ void estatus_calc_pc_recover_hp_pre(struct map_session_data **sdPtr __attribute_
bstatus->hp = APPLY_RATE(bstatus->max_hp, battle->bc->restart_hp_rate);
hookStop();
}
+
+
+void estatus_calc_regen_rate_post(struct block_list *bl __attribute__ ((unused)),
+ struct regen_data *regen,
+ struct status_change *sc) {
+ // Check for SCs
+ if (!sc || !sc->count)
+ return;
+
+ // Additional SCs
+ if (sc->data[SC_HALT_REGENERATION])
+ regen->flag = 0; //No regen
+}
+
diff --git a/src/emap/status.h b/src/emap/status.h
index 4fa5a34..4df4975 100644
--- a/src/emap/status.h
+++ b/src/emap/status.h
@@ -45,4 +45,7 @@ int estatus_change_end__post(int retVal,
void estatus_calc_pc_recover_hp_pre(struct map_session_data **sdPtr,
struct status_data **bstatusPtr);
+void estatus_calc_regen_rate_post(struct block_list *bl,
+ struct regen_data *regen,
+ struct status_change *sc);
#endif // EVOL_MAP_STATUS