From 8b53e58d4e2c4b815c3595c89afd88f19aefbf4a Mon Sep 17 00:00:00 2001 From: Atemo Date: Fri, 14 Jan 2022 10:37:35 +0100 Subject: [PATCH] Script command healap (#6514) Fixes #6492 --- doc/script_commands.txt | 16 +++++++++++++++- src/map/script.cpp | 15 +++++++++++++++ 2 files changed, 30 insertions(+), 1 deletion(-) diff --git a/doc/script_commands.txt b/doc/script_commands.txt index a9d2992d31..c1f41022be 100644 --- a/doc/script_commands.txt +++ b/doc/script_commands.txt @@ -561,6 +561,8 @@ Karma - The character's karma. Karma system is not fully functional, but Manner - The character's manner rating. Becomes negative if the player utters words forbidden through the use of 'manner.txt' client-side file. +Ap - Current amount of activity points. +MaxAp - Maximum amount of activity points. While these behave as variables, do not always expect to just set them - it is not certain whether this will work for all of them. Whenever there is a command @@ -2429,7 +2431,7 @@ Some example parameters: StatusPoint, BaseLevel, SkillPoint, Class, Upper, Zeny, Sex, Weight, MaxWeight, JobLevel, BaseExp, JobExp, NextBaseExp, NextJobExp, Hp, MaxHp, Sp, MaxSp, -BaseJob, Karma, Manner, bVit, bDex, bAgi, bStr, bInt, bLuk +BaseJob, Karma, Manner, bVit, bDex, bAgi, bStr, bInt, bLuk, Ap, MaxAp All of these also behave as variables, but don't expect to be able to just 'set' them - some will not work for various internal reasons. @@ -4323,6 +4325,18 @@ character and produces no other output whatsoever. --------------------------------------- +*healap {,}; + +This command will heal a set amount of AP on the invoking character. + + healap 10; // This will give 10 AP + healap -10; // This will remove 10 AP + +This command just alters the activity points of the invoking +character and produces no other output whatsoever. + +--------------------------------------- + *itemheal ,{,}; This command heals relative amounts of HP and/or SP on the invoking character. diff --git a/src/map/script.cpp b/src/map/script.cpp index 5b7682eb8f..15166527b6 100644 --- a/src/map/script.cpp +++ b/src/map/script.cpp @@ -5956,6 +5956,20 @@ BUILDIN_FUNC(heal) return SCRIPT_CMD_SUCCESS; } +/*========================================== + * Force Heal a player (ap) + *------------------------------------------*/ +BUILDIN_FUNC(healap) +{ + map_session_data* sd; + + if (!script_charid2sd(3, sd)) + return SCRIPT_CMD_FAILURE; + + status_heal(&sd->bl, 0, 0, script_getnum(st, 2), 1); + return SCRIPT_CMD_SUCCESS; +} + /*========================================== * Heal a player by item (get vit bonus etc) *------------------------------------------*/ @@ -25771,6 +25785,7 @@ struct script_function buildin_func[] = { BUILDIN_DEF(cutin,"si"), BUILDIN_DEF(viewpoint,"iiiii?"), BUILDIN_DEF(heal,"ii?"), + BUILDIN_DEF(healap,"i?"), BUILDIN_DEF(itemheal,"ii?"), BUILDIN_DEF(percentheal,"ii?"), BUILDIN_DEF(rand,"i?"),