summaryrefslogtreecommitdiff
path: root/npc/test
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2016-09-26 19:23:38 +0300
committerAndrei Karas <akaras@inbox.ru>2016-09-26 19:32:34 +0300
commit8114310d0e5d0da10169968d98fe31742b0ba63d (patch)
treede6e3ded4c1d59bd28e9d6a3e777ae18a3e6eaa1 /npc/test
parent481133588d4ea5ee66e7f63dade9b27316d677a2 (diff)
downloadserverdata-8114310d0e5d0da10169968d98fe31742b0ba63d.tar.gz
serverdata-8114310d0e5d0da10169968d98fe31742b0ba63d.tar.bz2
serverdata-8114310d0e5d0da10169968d98fe31742b0ba63d.tar.xz
serverdata-8114310d0e5d0da10169968d98fe31742b0ba63d.zip
Add quest vars test script. Add test quest in quest_db.
Diffstat (limited to 'npc/test')
-rw-r--r--npc/test/npc1.txt30
-rw-r--r--npc/test/test1.txt26
2 files changed, 48 insertions, 8 deletions
diff --git a/npc/test/npc1.txt b/npc/test/npc1.txt
index 959154da..d1fcef7f 100644
--- a/npc/test/npc1.txt
+++ b/npc/test/npc1.txt
@@ -94,16 +94,30 @@ L_Start:
break;
case 5:
mes "current";
- .@val0 = getq(ShipQuests_Gugli);
- mes "val=" + .@val0;
- setq ShipQuests_Gugli, 10;
+ .@val1 = getq(ShipQuests_Gugli);
+ .@val2 = getq2(ShipQuests_Gugli);
+ .@val3 = getq3(ShipQuests_Gugli);
+ .@valTime = getqtime(ShipQuests_Gugli);
+ mes "val1=" + .@val1;
+ mes "val2=" + .@val2;
+ mes "val3=" + .@val3;
+ mes "valTime=" + .@valTime;
+ .@val1 ++;
+ .@val2 ++;
+ .@val3 ++;
+ .@valTime ++;
next;
- mes "test 10";
- next;
- .@val = getq(ShipQuests_Gugli);
- mes "val=" + .@val;
- setq ShipQuests_Gugli, .@val0;
+ mes "test " + str(.@val1) + ", " + str(.@val2) + ", " + str(.@val3) + ", " + str(.@valTime);
+ setq ShipQuests_Gugli, .@val1, .@val2, .@val3, .@valTime;
next;
+ .@val1 = getq(ShipQuests_Gugli);
+ .@val2 = getq2(ShipQuests_Gugli);
+ .@val3 = getq3(ShipQuests_Gugli);
+ .@valTime = getqtime(ShipQuests_Gugli);
+ mes "val1=" + .@val1;
+ mes "val2=" + .@val2;
+ mes "val3=" + .@val3;
+ mes "valTime=" + .@valTime;
break;
case 6:
while(1)
diff --git a/npc/test/test1.txt b/npc/test/test1.txt
index 01d43ca3..08ec8f49 100644
--- a/npc/test/test1.txt
+++ b/npc/test/test1.txt
@@ -19,6 +19,7 @@ function script test1function {
}
test,10,5,0 script test1 NPC_HAT_BOX,{
+ mes "Npc vars testing...";
.var = .walkmask;
if (.var != 3)
mes "Error: testing test1 npc variables.";
@@ -29,6 +30,7 @@ test,10,5,0 script test1 NPC_HAT_BOX,{
if (.var != 4)
mes "Error: testing test2 npc variables.";
test1function;
+ mes "Formatting testing...";
if (l("test @@", "") != "test ")
mes "Error: format string 'l(\"test @@\", \"\")': " + l("test @@", "");
if (l("test @@", "1") != "test 1")
@@ -41,6 +43,30 @@ test,10,5,0 script test1 NPC_HAT_BOX,{
mes "Error: format string 'l(\"@@ @@ @@\", \"this\", \"is\", \"test\") != \"this is test\"': " + l("@@ @@ @@", "this", "is", "test");
if (l("data @@ @@ @@ data", "this", "is", "test") != "data this is test data")
mes "Error: format string 'l(\"data @@ @@ @@ data\", \"this\", \"is\", \"test\")': " + l("data @@ @@ @@ data", "this", "is", "test");
+ mes "Quest vars testing...";
+ .@time = 1000;
+ setq Test_testing1, 1, 2, 3, .@time;
+ if (getq(Test_testing1) != 1)
+ mes "Error: quest variable 1 error. Must be 1, but get " + str(getq(Test_testing1));
+ if (getq2(Test_testing1) != 2)
+ mes "Error: quest variable 2 error. Must be 2, but get " + str(getq(Test_testing1));
+ if (getq3(Test_testing1) != 3)
+ mes "Error: quest variable 3 error. Must be 3, but get " + str(getq(Test_testing1));
+ if (getqtime(Test_testing1) != .@time)
+ mes "Error: quest variable 3 error. Must be 3, but get " + str(getqtime(Test_testing1));
+ next;
+ .@time = 2000;
+ setq Test_testing1, 2, 3, 4, .@time;
+ if (getq(Test_testing1) != 2)
+ mes "Error: quest variable 1 error. Must be 2, but get " + str(getq(Test_testing1));
+ if (getq2(Test_testing1) != 3)
+ mes "Error: quest variable 2 error. Must be 3, but get " + str(getq(Test_testing1));
+ if (getq3(Test_testing1) != 4)
+ mes "Error: quest variable 3 error. Must be 4, but get " + str(getq(Test_testing1));
+ if (getqtime(Test_testing1) != .@time)
+ mes "Error: quest variable 3 error. Must be 3, but get " + str(getqtime(Test_testing1));
+ next;
+ setq Test_testing1, 0;
mes "Tests complete.";
close;