summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJesusaves <cpntb1@ymail.com>2024-07-27 16:55:08 -0300
committerJesusaves <cpntb1@ymail.com>2024-07-27 16:55:08 -0300
commitda87a8bac8a45c5335628e33f8874e26d4dc0cae (patch)
treef117f48eaf90bf324f468678952863f8bcdb1bbe /src
parent3f05f8aad14df24a7712cc88e1f8a5d4e524f486 (diff)
downloadevol-hercules-da87a8bac8a45c5335628e33f8874e26d4dc0cae.tar.gz
evol-hercules-da87a8bac8a45c5335628e33f8874e26d4dc0cae.tar.bz2
evol-hercules-da87a8bac8a45c5335628e33f8874e26d4dc0cae.tar.xz
evol-hercules-da87a8bac8a45c5335628e33f8874e26d4dc0cae.zip
Add a command to retrieve Homunculus GID
Diffstat (limited to 'src')
-rw-r--r--src/emap/init.c1
-rw-r--r--src/emap/script_buildins.c14
-rw-r--r--src/emap/script_buildins.h1
3 files changed, 16 insertions, 0 deletions
diff --git a/src/emap/init.c b/src/emap/init.c
index aa66d25..9072d1d 100644
--- a/src/emap/init.c
+++ b/src/emap/init.c
@@ -235,6 +235,7 @@ HPExport void plugin_init (void)
addScriptCommand("deployhomunculus","",deployhomunculus);
addScriptCommand("recallhomunculus","",recallhomunculus);
addScriptCommand("homstatus","",homstatus);
+ addScriptCommand("gethomunid","",gethomunid);
addScriptCommand("readparam2","i?",readparam2);
addScriptCommand("npcshopattach","s?",npcshopattach);
addScriptCommand("instanceowner", "i", InstanceOwner);
diff --git a/src/emap/script_buildins.c b/src/emap/script_buildins.c
index 97f6a29..0f56ee4 100644
--- a/src/emap/script_buildins.c
+++ b/src/emap/script_buildins.c
@@ -2990,6 +2990,20 @@ BUILDIN(homstatus)
/*==========================================
+ * Returns homunculus GID
+ *------------------------------------------*/
+BUILDIN(gethomunid)
+{
+ struct map_session_data *sd = script->rid2sd(st);
+ if (sd == NULL || sd->hd == NULL)
+ return true;
+
+ script_pushint(st,sd->hd->bl.id);
+ return true;
+}
+
+
+/*==========================================
* return the updated stats of sd (use bonus constants)
* Supported values: bStr~bLuk, bMaxHP, bMaxSP, bDef, bMdef, bAtk
*------------------------------------------*/
diff --git a/src/emap/script_buildins.h b/src/emap/script_buildins.h
index 756ee0b..1105207 100644
--- a/src/emap/script_buildins.h
+++ b/src/emap/script_buildins.h
@@ -120,6 +120,7 @@ BUILDIN(gethomunexp);
BUILDIN(deployhomunculus);
BUILDIN(recallhomunculus);
BUILDIN(homstatus);
+BUILDIN(gethomunid);
BUILDIN(readparam2);
BUILDIN(InstanceOwner);
BUILDIN(aggravate);