diff options
author | Jesusaves <cpntb1@ymail.com> | 2020-09-01 13:27:02 +0000 |
---|---|---|
committer | Jesusaves <cpntb1@ymail.com> | 2020-09-01 13:27:02 +0000 |
commit | 981c4a67825790a2fb2e1bf22242c6efe4e65967 (patch) | |
tree | b868b150542beed48862d66ccbb434412b29f06e | |
parent | f47ed38b0e286c059d7f4ca9a36676788a6177e9 (diff) | |
parent | 7a9332d87248c6d79168ed13d7025cc8b719b16b (diff) | |
download | plugin-981c4a67825790a2fb2e1bf22242c6efe4e65967.tar.gz plugin-981c4a67825790a2fb2e1bf22242c6efe4e65967.tar.bz2 plugin-981c4a67825790a2fb2e1bf22242c6efe4e65967.tar.xz plugin-981c4a67825790a2fb2e1bf22242c6efe4e65967.zip |
Merge branch 'jesusalva/getskillname' into 'master'
getskillname(), function required by magic functionality
See merge request evol/evol-hercules!25
-rw-r--r-- | src/emap/init.c | 1 | ||||
-rw-r--r-- | src/emap/script_buildins.c | 15 | ||||
-rw-r--r-- | src/emap/script_buildins.h | 1 |
3 files changed, 17 insertions, 0 deletions
diff --git a/src/emap/init.c b/src/emap/init.c index a4902ba..b663268 100644 --- a/src/emap/init.c +++ b/src/emap/init.c @@ -220,6 +220,7 @@ HPExport void plugin_init (void) addScriptCommand("aggravate", "i", aggravate); addScriptCommand("getnpcsubtype", "?", getNpcSubtype); addScriptCommand("kick", "v?", kick); + addScriptCommand("getskillname", "i", getskillname); do_init_langs(); diff --git a/src/emap/script_buildins.c b/src/emap/script_buildins.c index 109cb66..553e8b1 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/skill.h" #include "map/quest.h" #include "emap/clif.h" @@ -2636,3 +2637,17 @@ BUILDIN(kick) script_pushint(st, 1); return true; } + +BUILDIN(getskillname) +{ + int skill_id = script_getnum(st, 2); + + if (skill_id < 0) { + script_pushstr(st, ""); + return false; + } + + script_pushstrcopy(st, skill->get_desc(skill_id)); + return true; +} + diff --git a/src/emap/script_buildins.h b/src/emap/script_buildins.h index 5a653d7..bcffa7a 100644 --- a/src/emap/script_buildins.h +++ b/src/emap/script_buildins.h @@ -105,5 +105,6 @@ BUILDIN(aggravate); BUILDIN(getNpcSubtype); BUILDIN(kick); BUILDIN(getCraftRecipe); +BUILDIN(getskillname); #endif // EVOL_MAP_SCRIPT_BUILDINS |