From 651b304904aec8ed8db8657c927939605ab326d1 Mon Sep 17 00:00:00 2001 From: Jesusaves Date: Wed, 16 Jun 2021 08:25:49 -0300 Subject: Add recalcstats() wrapper for Focus. --- src/emap/init.c | 1 + src/emap/script_buildins.c | 10 ++++++++++ src/emap/script_buildins.h | 1 + 3 files changed, 12 insertions(+) diff --git a/src/emap/init.c b/src/emap/init.c index 2a4ac3f..af9d2cd 100644 --- a/src/emap/init.c +++ b/src/emap/init.c @@ -223,6 +223,7 @@ HPExport void plugin_init (void) addScriptCommand("getnpcsubtype", "?", getNpcSubtype); addScriptCommand("kick", "v?", kick); addScriptCommand("getskillname", "i", getskillname); + addScriptCommand("recalcstatus", "", recalcstatus); addScriptCommand("harm", "ii??", harm); // Overrides diff --git a/src/emap/script_buildins.c b/src/emap/script_buildins.c index 7cea6c3..fdacd9b 100644 --- a/src/emap/script_buildins.c +++ b/src/emap/script_buildins.c @@ -20,6 +20,7 @@ #include "map/pc.h" #include "map/refine.h" #include "map/script.h" +#include "map/status.h" #include "map/skill.h" #include "map/quest.h" @@ -2687,6 +2688,15 @@ BUILDIN(getskillname) return true; } +BUILDIN(recalcstatus) +{ + struct map_session_data *sd = script->rid2sd(st); + status->calc_bl_(&sd->bl, SCB_BASE, SCO_NONE); + + script_pushint(st, 1); + return true; +} + /*========================================== * *------------------------------------------*/ diff --git a/src/emap/script_buildins.h b/src/emap/script_buildins.h index c4c587f..edf7b66 100644 --- a/src/emap/script_buildins.h +++ b/src/emap/script_buildins.h @@ -107,6 +107,7 @@ BUILDIN(getNpcSubtype); BUILDIN(kick); BUILDIN(getCraftRecipe); BUILDIN(getskillname); +BUILDIN(recalcstatus); BUILDIN(harm); // Overrides -- cgit v1.2.3-70-g09d2