npc_test_func.txt 648 B

123456789101112131415161718192021222324252627
  1. // Define the function func001
  2. function script func001 {
  3. mes "Hello there!";
  4. next;
  5. return; // continue script
  6. }
  7. // Define the function func002
  8. function script func002 {
  9. return "I'm a function";
  10. }
  11. // An NPC using 3 different methods of displaying npc dialog from both internal
  12. // and external sources.
  13. prontera,168,189,1 script Functions 112,{
  14. callfunc "func001"; // Calls func001 and displays "Hello there!"
  15. mes callfunc("func002"); // Calls func002 and displays "I'm a function"
  16. next;
  17. callsub L_SUB001; // Calls the label L_SUB001 and displays "I'm a label"
  18. close;
  19. end;
  20. L_SUB001:
  21. mes "I'm a label";
  22. return; // continue script
  23. }