summaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authorHaru <haru@dotalux.com>2017-03-04 17:29:36 +0100
committerGitHub <noreply@github.com>2017-03-04 17:29:36 +0100
commite96e272e27ecac376fda6cbf524f7975b209f323 (patch)
treeaaee0108d958bedfc432059d3e64036d77bbf499 /doc
parent6eed96bc4680697c991b3884a911bd2b4ab1ea0e (diff)
parent1b0d3bd8f84db5b471646e0404193759afb908db (diff)
downloadhercules-e96e272e27ecac376fda6cbf524f7975b209f323.tar.gz
hercules-e96e272e27ecac376fda6cbf524f7975b209f323.tar.bz2
hercules-e96e272e27ecac376fda6cbf524f7975b209f323.tar.xz
hercules-e96e272e27ecac376fda6cbf524f7975b209f323.zip
Merge pull request #1592 from mekolat/getd2
revert #1586, add getvariableofpc
Diffstat (limited to 'doc')
-rw-r--r--doc/script_commands.txt26
1 files changed, 23 insertions, 3 deletions
diff --git a/doc/script_commands.txt b/doc/script_commands.txt
index 77b361498..7015feec1 100644
--- a/doc/script_commands.txt
+++ b/doc/script_commands.txt
@@ -1371,11 +1371,10 @@ Examples:
---------------------------------------
-*getd("<variable name>"{, <GID>{, <default value>}})
+*getd("<variable name>")
Returns a reference to a variable, the name can be constructed dynamically.
-If <GID> is present, it can be used to get a variable from another player or
-npc. If the target player or npc is not found, <default value> is returned.
+Refer to setd() for usage.
This can also be used to set an array dynamically:
setarray(getd(".array[0]"), 1, 2, 3, 4, 5);
@@ -1410,6 +1409,27 @@ getvariableofnpc() should not be used on them.
---------------------------------------
+*getvariableofpc(<variable>, <account id>{, <default value>})
+
+Returns a reference to a PC variable from the target player.
+If <default value> is passed, it will return this value if the player is
+not found.
+
+Examples:
+
+//This will return the value of @var, note that this can't be used, since
+//the value isn't caught.
+ getvariableofpc(@var, getcharid(CHAR_ID_ACCOUNT, "player"));
+
+//This will set the .@v variable to the value of the player's @var
+//variable.
+ .@v = getvariableofpc(@var, getcharid(CHAR_ID_ACCOUNT, "player"));
+
+//This will set the @var variable of the player to 1.
+ set(getvariableofpc(@var, getcharid(CHAR_ID_ACCOUNT, "player")), 1);
+
+---------------------------------------
+
*goto(<label>)
This command will make the script jump to a label, usually used in