summaryrefslogtreecommitdiff
path: root/npc/test
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2016-06-19 17:57:28 +0300
committerAndrei Karas <akaras@inbox.ru>2016-06-19 18:02:25 +0300
commitc6a55b06f6f56a5c3113b96af02d9d8d10b6d636 (patch)
tree842d302938171d687daba433527b6d429e50f1ab /npc/test
parent8bd8a14c83eb5a55288ad9035d839d61f7041104 (diff)
downloadserverdata-c6a55b06f6f56a5c3113b96af02d9d8d10b6d636.tar.gz
serverdata-c6a55b06f6f56a5c3113b96af02d9d8d10b6d636.tar.bz2
serverdata-c6a55b06f6f56a5c3113b96af02d9d8d10b6d636.tar.xz
serverdata-c6a55b06f6f56a5c3113b96af02d9d8d10b6d636.zip
Add some instance commands in npc1 in test map.
Diffstat (limited to 'npc/test')
-rw-r--r--npc/test/npc1.txt74
1 files changed, 73 insertions, 1 deletions
diff --git a/npc/test/npc1.txt b/npc/test/npc1.txt
index 062a37a4..a8f23c34 100644
--- a/npc/test/npc1.txt
+++ b/npc/test/npc1.txt
@@ -27,7 +27,7 @@ test,10,10,0 script npc1 NPC_TEST1,3,3,{
}
L_Start:
- switch (select("show area", "map", "pc", "change npc direction", "quest test", "cart", "items", "chat", "wall", "craft", "hashtable"))
+ switch (select("show area", "map", "pc", "change npc direction", "quest test", "cart", "items", "chat", "wall", "craft", "hashtable", "instance"))
{
case 1:
areatest;
@@ -448,6 +448,72 @@ L_Start:
} // switch
} // while
break;
+ case 12:
+ while(1)
+ {
+ switch (select("create", "warp", "info", "warp back", "delete", "back"))
+ {
+ case 1:
+ if (.instid >= 0)
+ {
+ mes "Error: test instance already created";
+ break;
+ }
+// .instid = instance_create("test@instance", 0, 0);
+ .instid = instance_create("test@instance", getcharid(3), IOT_CHAR);
+ if (.instid < 0)
+ {
+ mes "Error: creating instance";
+ break;
+ }
+ mes "new instance id: " + str(.instid);
+// .@instanceMapName$ = instance_attachmap("test", .instid, 1, "test@map1");
+// .@instanceMapName$ = instance_attachmap("test", .instid, 1);
+ .@instanceMapName$ = instance_attachmap("test", .instid, 0, "test@map1");
+ if (.@instanceMapName$ == "")
+ {
+ mes "Error: instance attach map error";
+ break;
+ }
+ mes "Attached instance map name: " + .@instanceMapName$;
+ instance_set_timeout(1000000, 1000000, .instid);
+ instance_init(.instid);
+ break;
+ case 2:
+ warp "test@map1", 12, 12;
+ break;
+ case 3:
+ mes "npc name: " + .name$;
+ mes "npc ext name: " + .extname$;
+ mes "npc id: " + .id;
+ mes "npc parent id: " + .parent;
+ mes "npc src id: " + .srcId;
+ if (instance_id() >= 0)
+ {
+ mes "npc1 in instance named: " + instance_npcname("npc1");
+ }
+ else
+ {
+ mes "npc1 not in instance";
+ }
+ break;
+ case 4:
+ warp "test", 12, 12;
+ break;
+ case 5:
+ if (.instid < 0)
+ {
+ mes "Error: test instance was not created";
+ break;
+ }
+ instance_destroy(.instid);
+ break;
+ case 6:
+ goto L_Start;
+ break;
+ }
+ }
+ break;
}
close;
@@ -466,6 +532,12 @@ OnInit:
.distance = 5;
.alwaysVisible = true;
waitingroom "test room", 2, "npc1::OnReadyCheck", 1;
+ // test instance id
+ .instid = -10;
+ if (.parent != 0)
+ {
+ setnpcdir 0;
+ }
end;
OnWhisperGlobal: