summaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authorAsheraf <acheraf1998@gmail.com>2018-05-26 23:42:02 +0000
committerAsheraf <acheraf1998@gmail.com>2018-06-30 00:43:06 +0100
commitdff7e258eb1e4eefc5d455212a912fe454b7d3d3 (patch)
tree23b057fee0bb2b53bc688f7adefa91ef35a297cc /doc
parent8ea98a7ff92e0f34f323342b1d69da42d92f39ae (diff)
downloadhercules-dff7e258eb1e4eefc5d455212a912fe454b7d3d3.tar.gz
hercules-dff7e258eb1e4eefc5d455212a912fe454b7d3d3.tar.bz2
hercules-dff7e258eb1e4eefc5d455212a912fe454b7d3d3.tar.xz
hercules-dff7e258eb1e4eefc5d455212a912fe454b7d3d3.zip
add support for send target in unittalk
Diffstat (limited to 'doc')
-rw-r--r--doc/script_commands.txt31
1 files changed, 29 insertions, 2 deletions
diff --git a/doc/script_commands.txt b/doc/script_commands.txt
index efccf799b..53d24de4d 100644
--- a/doc/script_commands.txt
+++ b/doc/script_commands.txt
@@ -6631,22 +6631,49 @@ Examples:
*unitwarp(<GID>, <Mapname>, <x>, <y>)
*unitattack(<GID>, <Target ID>)
*unitstop(<GID>)
-*unittalk(<GID>, <Text>{, show_name})
+*unittalk(<GID>, <Text>{, show_name{, <send_target>{, <target_id>}}})
*unitemote(<GID>, <Emote>)
Okay, these commands should be fairly self explaining.
For the emotions, you can look in db/constants.conf for prefixes with e_
PS: unitwarp() supports a <GID> of zero, which causes the executor of the
-PS: unittalk() can receive a third parameter:
+PS: unittalk() can receive 3 extra parameters:
show_name:
true: Shows Unit name like "UnitName : Message" (default)
false: Hides Unit name
+ send_target:
+ AREA_CHAT_WOC: sends the message to everyone in view range including the attached unit (default)
+ SELF: sends the message to the given unit gid only
+ target_id:
+ if send_target is set to SELF, the message will be shown by the given gid,
+ target_id allows changing the unit that will see the message.
script to be affected. This can be used with OnTouchNPC to warp
monsters:
OnTouchNPC:
unitwarp(0, "this", -1, -1);
+ // hide the npc name from the text
+ unittalk(getnpcid(0), "foobar", false);
+
+ // display by npc to everyone
+ unittalk(getnpcid(0), "foobar", true);
+
+ // display by npc to npc
+ unittalk(getnpcid(0), "foobar", true, SELF);
+
+ // display the text by the npc to the attached player only
+ unittalk(getnpcid(0), "foobar", true, SELF, playerattached());
+
+ // display by player to everyone
+ unittalk(playerattached(), "foobar", true);
+
+ // display by player to himself only
+ unittalk(playerattached(), "foobar", true, SELF);
+
+ // display the text by the 1st player to the attached player only
+ unittalk(getcharid(CHAR_ID_ACCOUNT, "Name"), "foobar", true, SELF, playerattached());
+
---------------------------------------
*disablenpc("<NPC object name>")