From 98fdf31fb33746261d19d701ea2dcbee7ee73730 Mon Sep 17 00:00:00 2001 From: Jittapan Pluemsumran Date: Tue, 7 Jun 2016 23:50:34 +0700 Subject: [PATCH] Implemented recalculatestat command (#1348) This command will force a stat recalculation for the attached player. --- doc/script_commands.txt | 6 ++++++ src/map/script.c | 14 ++++++++++++++ 2 files changed, 20 insertions(+) diff --git a/doc/script_commands.txt b/doc/script_commands.txt index 4016e230fe..c250502dc6 100644 --- a/doc/script_commands.txt +++ b/doc/script_commands.txt @@ -4287,6 +4287,12 @@ wall), the character is pushed only up to the obstacle. --------------------------------------- +*recalculatestat; + +This command will force a stat recalculation for the attached player. + +--------------------------------------- + *get_revision() This command will return the SVN revision number that the server is currently diff --git a/src/map/script.c b/src/map/script.c index b9d43fe535..7b9dc13187 100644 --- a/src/map/script.c +++ b/src/map/script.c @@ -21433,6 +21433,19 @@ BUILDIN_FUNC(getexp2) { return SCRIPT_CMD_SUCCESS; } +/** +* Force stat recalculation of sd +* recalculatestat; +* @author [secretdataz] +**/ +BUILDIN_FUNC(recalculatestat) { + TBL_PC* sd; + + nullpo_retr(SCRIPT_CMD_FAILURE, sd); + + status_calc_pc(sd, SCO_FORCE); + return SCRIPT_CMD_SUCCESS; +} #include "../custom/script.inc" // declarations that were supposed to be exported from npc_chat.c @@ -22009,6 +22022,7 @@ struct script_function buildin_func[] = { BUILDIN_DEF(navigateto,"s???????"), BUILDIN_DEF(adopt,"vv"), BUILDIN_DEF(getexp2,"ii?"), + BUILDIN_DEF(recalculatestat,""), #include "../custom/script_def.inc"