summaryrefslogtreecommitdiff
path: root/doc/whisper_sys.txt
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2014-11-04 20:23:22 +0300
committerAndrei Karas <akaras@inbox.ru>2014-11-04 22:56:41 +0300
commitd6b5551bff867250edcdc36455ef32844ee2b935 (patch)
tree16acaf1c9a81b58ceb21bc4524a087c14f23735f /doc/whisper_sys.txt
parent905dada713af49bb610177c4842685628a1c0a97 (diff)
downloadserverdata-d6b5551bff867250edcdc36455ef32844ee2b935.tar.gz
serverdata-d6b5551bff867250edcdc36455ef32844ee2b935.tar.bz2
serverdata-d6b5551bff867250edcdc36455ef32844ee2b935.tar.xz
serverdata-d6b5551bff867250edcdc36455ef32844ee2b935.zip
convert server data for using with hercules.
Diffstat (limited to 'doc/whisper_sys.txt')
-rw-r--r--doc/whisper_sys.txt52
1 files changed, 52 insertions, 0 deletions
diff --git a/doc/whisper_sys.txt b/doc/whisper_sys.txt
new file mode 100644
index 000000000..39e2a54f2
--- /dev/null
+++ b/doc/whisper_sys.txt
@@ -0,0 +1,52 @@
+//===== Hercules Documentation ===============================
+//= NPC Whisper System
+//===== By: ==================================================
+//= lordalfa
+//===== Current Version: =====================================
+//= 20120904
+//===== Description: =========================================
+//= A description of Hercules' NPC whispering system.
+//============================================================
+
+This piece of code to allows characters to execute events in NPCs by whispering
+them up to ten parameters. The NPC must have an "OnWhisperGlobal" label, or an
+"event not found" error will result.
+
+ NPC:<NPC Name> <String>{#String 2{#...{#String 10}}}
+
+The whispered strings are separated by the "#" character, and are each stored
+into separate temporary character string variables:
+
+ @whispervar0$, @whispervar1$, ... @whispervar9$
+
+---------------------------------------------------------------------------------
+
+Below is an example of how this feature might be used.
+You whisper an NPC "NPCCommander" in-game with the following instructions:
+
+ NPC:NPCCommander Report#Killstealing#Lordalfa
+
+The parameters are passed on to the "OnWhisperGlobal" label of the NPC, and can
+be processed accordingly:
+
+- script NPCCommander -1,{
+OnWhisperGlobal:
+ // Inform player "Lordalfa" that he has been reported for killstealing.
+ if (@whispervar0$ == "Report")
+ message @whispervar2$,"You have been reported for "+@whispervar1$+".";
+ end;
+}
+
+This could also be used for hidden event triggers:
+
+- script EventManager -1,{
+OnWhisperGlobal:
+ if (getgmlevel() < 80) end;
+ if (@whispervar0$ == "pvp") {
+ // Script for a PVP event.
+ }
+ else if (@whispervar0$ == "mvp") {
+ // Script for an MVP summoning event.
+ }
+ end;
+}