diff options
author | eathenabot <eathenabot@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2012-03-23 04:57:11 +0000 |
---|---|---|
committer | eathenabot <eathenabot@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2012-03-23 04:57:11 +0000 |
commit | 30fe943332dfcf8c20a1ddb6fdd692666226dbe8 (patch) | |
tree | e6a395698c22f9160426ff0668a2b6aad9dd48ab | |
parent | c73b9c6444ee0d7d9f91cce676c370b55ca234b7 (diff) | |
download | hercules-30fe943332dfcf8c20a1ddb6fdd692666226dbe8.tar.gz hercules-30fe943332dfcf8c20a1ddb6fdd692666226dbe8.tar.bz2 hercules-30fe943332dfcf8c20a1ddb6fdd692666226dbe8.tar.xz hercules-30fe943332dfcf8c20a1ddb6fdd692666226dbe8.zip |
* Merged changes up to eAthena 15083.
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@15773 54d463be-8e91-2dee-dedb-b68131a5f0ec
-rw-r--r-- | doc/script_commands.txt | 11 | ||||
-rw-r--r-- | src/map/script.c | 20 |
2 files changed, 31 insertions, 0 deletions
diff --git a/doc/script_commands.txt b/doc/script_commands.txt index 354ad8298..4292017ca 100644 --- a/doc/script_commands.txt +++ b/doc/script_commands.txt @@ -2027,6 +2027,17 @@ Whatever it returns is determined by type. --------------------------------------- +*getnpcid(<type>) + +This function will return the GID of an NPC. +Type can be: + + 0 - The NPC that the running script is attached to. + +Useful for making an NPC perform an action using script commands that require a GID (e.g. unit*) + +--------------------------------------- + *getarraysize(<array name>) This function returns the number of values that are contained inside the diff --git a/src/map/script.c b/src/map/script.c index 512a84483..897575a30 100644 --- a/src/map/script.c +++ b/src/map/script.c @@ -6354,6 +6354,25 @@ BUILDIN_FUNC(getcharid) return 0; } /*========================================== + * returns the GID of an NPC + *------------------------------------------*/ +BUILDIN_FUNC(getnpcid) +{ + int num; + + switch (num = script_getnum(st,2)) { + case 0: + script_pushint(st,st->oid); + break; + default: + ShowError("buildin_getnpcid: invalid parameter (%d).\n", num); + script_pushint(st,0); + break; + } + + return 0; +} +/*========================================== *指定IDのPT名取得 *------------------------------------------*/ BUILDIN_FUNC(getpartyname) @@ -15911,6 +15930,7 @@ struct script_function buildin_func[] = { BUILDIN_DEF(checkweight,"vi"), BUILDIN_DEF(readparam,"i?"), BUILDIN_DEF(getcharid,"i?"), + BUILDIN_DEF(getnpcid,"i"), BUILDIN_DEF(getpartyname,"i"), BUILDIN_DEF(getpartymember,"i?"), BUILDIN_DEF(getpartyleader,"i?"), |