diff options
author | Jesusaves <cpntb1@ymail.com> | 2021-04-18 03:42:23 -0300 |
---|---|---|
committer | Jesusaves <cpntb1@ymail.com> | 2021-04-18 03:42:23 -0300 |
commit | 90f88f539307c0a6945d305aa591ae0b935365e4 (patch) | |
tree | 69d8b8707bdca068400ec91587a4ed68049ae8e1 | |
parent | 03996d97def7dda1d6a6f79a466daf668884d277 (diff) | |
download | evol-hercules-90f88f539307c0a6945d305aa591ae0b935365e4.tar.gz evol-hercules-90f88f539307c0a6945d305aa591ae0b935365e4.tar.bz2 evol-hercules-90f88f539307c0a6945d305aa591ae0b935365e4.tar.xz evol-hercules-90f88f539307c0a6945d305aa591ae0b935365e4.zip |
Implement SC_HALT_REGENERATION. Move SC IDs because this one is saved to SQL.
-rw-r--r-- | src/emap/enum/esctype.h | 3 | ||||
-rw-r--r-- | src/emap/init.c | 1 | ||||
-rw-r--r-- | src/emap/skill_const.c | 2 | ||||
-rw-r--r-- | src/emap/status.c | 17 | ||||
-rw-r--r-- | src/emap/status.h | 3 |
5 files changed, 23 insertions, 3 deletions
diff --git a/src/emap/enum/esctype.h b/src/emap/enum/esctype.h index 932d297..42dcffd 100644 --- a/src/emap/enum/esctype.h +++ b/src/emap/enum/esctype.h @@ -11,7 +11,8 @@ typedef enum esc_type { - SC_PHYSICAL_SHIELD = OLD_SC_MAX, // defined in vars.sh + SC_PHYSICAL_SHIELD = 1000, // used to be OLD_SC_MAX, defined in vars.sh + SC_HALT_REGENERATION, } esc_type; #endif // EVOL_MAP_ENUM_ESCTYPE diff --git a/src/emap/init.c b/src/emap/init.c index 7caccd6..2a4ac3f 100644 --- a/src/emap/init.c +++ b/src/emap/init.c @@ -385,6 +385,7 @@ HPExport void plugin_init (void) addHookPost(status, calc_def, estatus_calc_def_post); addHookPost(status, calc_fix_aspd, estatus_calc_fix_aspd_post); addHookPost(status, change_start, estatus_change_start_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..5f544c9 100644 --- a/src/emap/skill_const.c +++ b/src/emap/skill_const.c @@ -22,6 +22,6 @@ void eskill_addskill_conststants(void) script->set_constant("EFFECT_MAGIC_SHIELD_ENDS", EFFECT_MAGIC_SHIELD_ENDS, false, false); // sc - script->set_constant("SC_PHYSICAL_SHIELD", SC_PHYSICAL_SHIELD, false, false); + //script->set_constant("SC_PHYSICAL_SHIELD", SC_PHYSICAL_SHIELD, false, false); script->constdb_comment(NULL); } diff --git a/src/emap/status.c b/src/emap/status.c index 0aa5f13..24b2865 100644 --- a/src/emap/status.c +++ b/src/emap/status.c @@ -44,7 +44,8 @@ void eInitChangeTables(void) status->set_sc(EVOL_PHYSICAL_SHIELD, (sc_type)SC_PHYSICAL_SHIELD, SCB_DEF | SCB_DEF2 | SCB_ASPD); - status->dbs->IconChangeTable[SC_PHYSICAL_SHIELD].relevant_bl_types |= BL_SCEFFECT; + status->dbs->ChangeFlagTable[SC_HALT_REGENERATION] |= SCB_REGEN; + //status->dbs->IconChangeTable[SC_PHYSICAL_SHIELD].relevant_bl_types |= BL_SCEFFECT; } int estatus_init_post(int retVal, @@ -238,3 +239,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 f76c607..2ef0d81 100644 --- a/src/emap/status.h +++ b/src/emap/status.h @@ -40,4 +40,7 @@ int estatus_change_start_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 |