[1] | 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 | |
---|
| 13 | - script Test Script -1,1,1,{ |
---|
| 14 | mes "Hi."; |
---|
| 15 | mes "My coords are "+ .map$ +", "+ .x +"/" +.y ; |
---|
| 16 | close; |
---|
| 17 | |
---|
| 18 | OnInit: |
---|
| 19 | getmapxy(.map$, .x, .y, 1); |
---|
| 20 | end; |
---|
| 21 | |
---|
| 22 | OnTouch: |
---|
| 23 | getmapxy(.map$, .x, .y, 1); |
---|
| 24 | emotion e_scissors; |
---|
| 25 | end; |
---|
| 26 | } |
---|
| 27 | |
---|
| 28 | prontera,150,175,4 duplicate(Test Script) Test1 909 |
---|
| 29 | prontera,155,175,4 duplicate(Test Script) Test2 909,2,2 |
---|
| 30 | prontera,160,175,4 duplicate(Test Script) Test3 909,3,3 |
---|