npc_test_func.txt 1023 B

1234567891011121314151617181920212223242526272829303132333435
  1. //===== rAthena Script =======================================
  2. //= Sample: Functions
  3. //===== By: ==================================================
  4. //= rAthena Dev Team
  5. //===== Last Updated: ========================================
  6. //= 20120901
  7. //===== Description: =========================================
  8. //= Demonstrates use of functions.
  9. //============================================================
  10. // Define the function func001
  11. function script func001 {
  12. mes "Hello there!";
  13. next;
  14. return; // Return to script
  15. }
  16. // Define the function func002
  17. function script func002 {
  18. return "I'm a function";
  19. }
  20. // Uses 3 different methods of displaying dialogue from both internal and external sources.
  21. prontera,168,189,1 script Functions 112,{
  22. callfunc "func001"; // Calls func001 and displays "Hello there!"
  23. mes callfunc("func002"); // Calls func002 and displays "I'm a function"
  24. next;
  25. callsub L_SUB001; // Calls the label L_SUB001 and displays "I'm a label"
  26. close;
  27. end;
  28. L_SUB001:
  29. mes "I'm a label";
  30. return;
  31. }