diff options
-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); |