blob: bb726974bf1865968618e7540f390b6812fd9dc4 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
|
//===== rAthena Documentation ================================
//= NPC Whisper System
//===== By: ==================================================
//= lordalfa
//===== Current Version: =====================================
//= 20120826
//===== Description: =========================================
//= A description of rAthena's 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;
}
|