src/map/npc.c | 1 +
src/map/npc.h | 1 +
src/map/script.c | 1 +
src/map/script.h | 1 +
src/map/status.c | 2 ++
5 files changed, 6 insertions(+)
diff --git a/src/map/npc.c b/src/map/npc.c
index 7044fef..ea48bf3 100644
--- a/src/map/npc.c
+++ b/src/map/npc.c
@@ -4311,6 +4311,7 @@ void npc_read_event_script(void)
{"Die Event",script->config.die_event_name},
{"Kill PC Event",script->config.kill_pc_event_name},
{"Kill NPC Event",script->config.kill_mob_event_name},
+ {"Stat Calc Event",script->config.stat_calc_event_name},
};
for (i = 0; i < NPCE_MAX; i++)
diff --git a/src/map/npc.h b/src/map/npc.h
index bf3d149..12cbdc0 100644
--- a/src/map/npc.h
+++ b/src/map/npc.h
@@ -132,6 +132,7 @@ enum npce_event {
NPCE_DIE,
NPCE_KILLPC,
NPCE_KILLNPC,
+ NPCE_STATCALC,
NPCE_MAX
};
diff --git a/src/map/script.c b/src/map/script.c
index 54d8d33..b24814b 100644
--- a/src/map/script.c
+++ b/src/map/script.c
@@ -20788,6 +20788,7 @@ void script_defaults(void) {
script->config.loadmap_event_name = "OnPCLoadMapEvent";
script->config.baselvup_event_name = "OnPCBaseLvUpEvent";
script->config.joblvup_event_name = "OnPCJobLvUpEvent";
+ script->config.stat_calc_event_name = "OnPCStatCalcEvent";
script->config.ontouch_name = "OnTouch_"; //ontouch_name (runs on first visible char to enter area, picks another char if the first char leaves)
script->config.ontouch2_name = "OnTouch"; //ontouch2_name (run whenever a char walks into the OnTouch area)
script->config.onuntouch_name = "OnUnTouch"; //onuntouch_name (run whenever a char walks from the OnTouch area)
diff --git a/src/map/script.h b/src/map/script.h
index ff660de..d7f48b2 100644
--- a/src/map/script.h
+++ b/src/map/script.h
@@ -342,6 +342,7 @@ struct Script_Config {
const char *loadmap_event_name;
const char *baselvup_event_name;
const char *joblvup_event_name;
+ const char *stat_calc_event_name;
const char* ontouch_name;
const char* ontouch2_name;
diff --git a/src/map/status.c b/src/map/status.c
index 1a07f74..c4703ba 100644
--- a/src/map/status.c
+++ b/src/map/status.c
@@ -2242,6 +2242,8 @@ int status_calc_pc_(struct map_session_data* sd, enum e_status_calc_opt opt) {
pc->delautobonus(sd,sd->autobonus2,ARRAYLENGTH(sd->autobonus2),true);
pc->delautobonus(sd,sd->autobonus3,ARRAYLENGTH(sd->autobonus3),true);
+ npc->script_event(sd, NPCE_STATCALC);
+
// Parse equipment.
for(i=0;i<EQI_MAX;i++) {
status->current_equip_item_index = index = sd->equip_index[i]; //We pass INDEX to status->current_equip_item_index - for EQUIP_SCRIPT (new cards solution) [Lupus]