npc_test_duplicate.txt 781 B

123456789101112131415161718192021222324252627282930
  1. //
  2. // This sample script tests:
  3. // * how npc-variables work with duplicated npcs
  4. // * how the trigger area is applied to duplicates
  5. //
  6. // Outcome (r11216 trunk):
  7. // * the variables are _shared_ between all duplicates
  8. // * each duplicate knows its own map coordinates
  9. // * 'OnInit' loads the middle poring last, for some reason
  10. // * duplicates always override the source npc's trigger area (even 0x0)
  11. //
  12. - script Test Script -1,1,1,{
  13. mes "Hi.";
  14. mes "My coords are "+ .map$ +", "+ .x +"/" +.y ;
  15. close;
  16. OnInit:
  17. getmapxy(.map$, .x, .y, 1);
  18. end;
  19. OnTouch:
  20. getmapxy(.map$, .x, .y, 1);
  21. emotion e_scissors;
  22. end;
  23. }
  24. prontera,150,175,4 duplicate(Test Script) Test1 909
  25. prontera,155,175,4 duplicate(Test Script) Test2 909,2,2
  26. prontera,160,175,4 duplicate(Test Script) Test3 909,3,3