whisper_sys.txt 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. //===== Athena Doc ========================================
  2. //= NPC Whisper System
  3. //===== By ================================================
  4. //= lordalfa, Massdriller
  5. //===== Version ===========================================
  6. //= 1.1
  7. //=========================================================
  8. //= 1.1 - Cleanup. [Euphy]
  9. //===== Description =======================================
  10. //= A description of rAthena's NPC whispering system.
  11. //=========================================================
  12. This piece of code to allows characters to execute events in NPCs by whispering
  13. them up to ten parameters. The NPC must have an "OnWhisperGlobal" label, or an
  14. "event not found" error will result.
  15. NPC:<NPC Name> <String>{#String 2{#...{#String 10}}}
  16. The whispered strings are separated by the "#" character, and are each stored
  17. into separate temporary character string variables:
  18. @whispervar0$, @whispervar1$, ... @whispervar9$
  19. ---------------------------------------------------------------------------------
  20. Below is an example of how this feature might be used.
  21. You whisper an NPC "NPCCommander" in-game with the following instructions:
  22. NPC:NPCCommander Report#Killstealing#Lordalfa
  23. The parameters are passed on to the "OnWhisperGlobal" label of the NPC, and can
  24. be processed accordingly:
  25. - script NPCCommander -1,{
  26. OnWhisperGlobal:
  27. // The following code will inform player "Lordalfa" that he has been
  28. // reported for killstealing.
  29. if (@whispervar0$ == "Report")
  30. message @whispervar2$,"You have been reported for "+@whispervar1$+".";
  31. end;
  32. }