summaryrefslogtreecommitdiff
path: root/doc/script_commands.txt
diff options
context:
space:
mode:
authorAnnieRuru <jeankof@ymail.com>2015-11-17 00:10:26 +0800
committerHaru <haru@dotalux.com>2015-12-18 05:53:48 +0100
commitdbe5f2237cada6a261e297b60857dc305860a88d (patch)
treec72148660232824579acd8890a7e98696093f50a /doc/script_commands.txt
parentc4f7383a3657a8937b589df4c35673f863cd775e (diff)
downloadhercules-dbe5f2237cada6a261e297b60857dc305860a88d.tar.gz
hercules-dbe5f2237cada6a261e297b60857dc305860a88d.tar.bz2
hercules-dbe5f2237cada6a261e297b60857dc305860a88d.tar.xz
hercules-dbe5f2237cada6a261e297b60857dc305860a88d.zip
Add *getunittype and update *getmapxy
- unlike rathena, hercules' getunittype use the value from getmapxy - getmapxy now can search object position using GID Closes #871 as merged Signed-off-by: Haru <haru@dotalux.com>
Diffstat (limited to 'doc/script_commands.txt')
-rw-r--r--doc/script_commands.txt58
1 files changed, 38 insertions, 20 deletions
diff --git a/doc/script_commands.txt b/doc/script_commands.txt
index b676eb7f4..1f6c40996 100644
--- a/doc/script_commands.txt
+++ b/doc/script_commands.txt
@@ -3095,7 +3095,7 @@ cards or if it's signed.
//=====================================
---------------------------------------
-*getmapxy("<variable for map name>",<variable for x>,<variable for y>,<type>{,"<search string>"})
+*getmapxy("<variable for map name>",<variable for x>,<variable for y>,<type>{,"<search parameter>"})
This function will locate a character object, NPC object or pet's
coordinates and place their coordinates into the variables specified when
@@ -3104,24 +3104,27 @@ parameters given were not variables or the search was not successful.
Type is the type of object to search for:
- 0 - Character object
- 1 - NPC object
- 2 - Pet object
- 3 - Monster object
- 4 - Homunculus object
- 5 - Mercenary object
- 6 - Elemental object
-
-While 3 is meant to look for a monster object, no searching will be done
-if you specify type 3, and the function will always return -1.
-
-The search string is optional. If it is not specified, the location of the
-invoking character will always be returned for types 0 and 2, the location
-of the NPC running this function for type 1.
-If a search string is specified, for types 0 and 1, the character or NPC
-with the specified name will be located. If type is 3, the search will
-locate the current pet of the character who's name is given in the search
-string, it will NOT locate a pet by name.
+ UNITTYPE_PC - Character object
+ UNITTYPE_NPC - NPC object
+ UNITTYPE_PET - Pet object
+ UNITTYPE_MOB - Monster object
+ UNITTYPE_HOM - Homunculus object
+ UNITTYPE_MER - Mercenary object
+ UNITTYPE_ELEM - Elemental object
+
+To look for a monster object, monster GID is required. The function will
+always return -1 when search using string.
+
+The search parameter is optional. If it is not specified, the location of the
+invoking character will always be returned for UNITTYPE_PC, the location of the
+NPC running this function for UNITTYPE_NPC. If a search parameter is specified,
+for UNITTYPE_PC and UNITTYPE_NPC, the character or NPC with the specified name
+or GID will be located.
+
+If type is UNITTYPE_PET, UNITTYPE_HOM, UNITTYPE_MER or UNITTYPE_ELEM the search
+will locate the owner's pet/homun/mercenary/elementals if the search parameter
+is not provided. It will NOT locate these object by name, but can be done if GID
+is provided.
What a mess. Example, a working and tested one now:
@@ -3133,7 +3136,7 @@ What a mess. Example, a working and tested one now:
prontera,164,299,3%TAB%script%TAB%Nyah%TAB%730,{
mes "My name is Nyah.";
mes "I will now search for Meh all across the world!";
- if (getmapxy(.@mapname$,.@mapx,.@mapy,1,"Meh")!=0) {
+ if (getmapxy(.@mapname$, .@mapx, .@mapy, UNITTYPE_NPC, "Meh") != 0) {
mes "I can't seem to find Meh anywhere!";
close;
}
@@ -6193,6 +6196,21 @@ and will return the following values:
---------------------------------------
+*getunittype <GID>;
+
+Returns the type of object from the given Game ID. Returns -1 if the given GID
+does not exist. The return values are :-
+
+ UNITTYPE_PC 0
+ UNITTYPE_NPC 1
+ UNITTYPE_PET 2
+ UNITTYPE_MOB 3
+ UNITTYPE_HOM 4
+ UNITTYPE_MER 5
+ UNITTYPE_ELEM 6
+
+---------------------------------------
+
*unitwalk <GID>,<x>,<y>;
*unitwalk <GID>,<target_GID>;