diff options
author | Joseph Botosh <rumly111@gmail.com> | 2015-10-26 18:46:35 +0200 |
---|---|---|
committer | Joseph Botosh <rumly111@gmail.com> | 2015-10-26 20:44:40 +0200 |
commit | b0e940fa4ffda02aef57fc1ce8be9a89a880d53e (patch) | |
tree | 98f666d555a785cd2f5f808b064065503f980705 | |
parent | e5609decfc887e3f42a3a1f8ce99505dfe91af88 (diff) | |
download | serverdata-b0e940fa4ffda02aef57fc1ce8be9a89a880d53e.tar.gz serverdata-b0e940fa4ffda02aef57fc1ce8be9a89a880d53e.tar.bz2 serverdata-b0e940fa4ffda02aef57fc1ce8be9a89a880d53e.tar.xz serverdata-b0e940fa4ffda02aef57fc1ce8be9a89a880d53e.zip |
add function playertalk (similar to narrator)
-rw-r--r-- | npc/functions/main.txt | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/npc/functions/main.txt b/npc/functions/main.txt index a9edd4a1..92a90e5e 100644 --- a/npc/functions/main.txt +++ b/npc/functions/main.txt @@ -152,6 +152,39 @@ function script speech { } +// Function for displaying player thoughts +function script playertalk { + .@start = 0; + .@argc = getargcount(); + .@flags = 0; + + if (.@argc > 1 && !isstr(getarg(0))) + { + .@start = 1; + .@flags = getarg(0); + } + + if (.@flags & 0x1) + mes ""; + + mes "[" + strcharinfo(0) + "]"; + for (.@i = .@start; .@i < .@argc; .@i++) + { + mes col(getarg(.@i), 3); + + if (.@i < .@argc - 1) + next; + } + + if (.@flags & 0x4) + next; + else if (.@flags & 0x2) + mes ""; + + return; +} + + // Show debug message if .debug variable of NPC is set to 1 function script npcdebug { if (getvariableofnpc(.debug, strnpcinfo(3))) |