diff options
author | Jesusaves <cpntb1@ymail.com> | 2024-07-27 16:55:08 -0300 |
---|---|---|
committer | Jesusaves <cpntb1@ymail.com> | 2024-07-27 16:55:08 -0300 |
commit | da87a8bac8a45c5335628e33f8874e26d4dc0cae (patch) | |
tree | f117f48eaf90bf324f468678952863f8bcdb1bbe /src | |
parent | 3f05f8aad14df24a7712cc88e1f8a5d4e524f486 (diff) | |
download | evol-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.c | 1 | ||||
-rw-r--r-- | src/emap/script_buildins.c | 14 | ||||
-rw-r--r-- | src/emap/script_buildins.h | 1 |
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); |