summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/emap/enum/esctype.h3
-rw-r--r--src/emap/init.c1
-rw-r--r--src/emap/skill_const.c2
-rw-r--r--src/emap/status.c17
-rw-r--r--src/emap/status.h3
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