summaryrefslogtreecommitdiff
path: root/npc/custom/test.txt
diff options
context:
space:
mode:
authorHaru <haru@dotalux.com>2014-01-13 04:06:56 +0100
committerHaru <haru@dotalux.com>2014-01-13 04:16:48 +0100
commit8eadb9fc241e1784084625e89b208d80bda9e6e2 (patch)
tree098dc5775c6dd10cb7c98b8054df09e22d3689e2 /npc/custom/test.txt
parentff4faca9cc44e98abad50bfda849f596d7bc81c1 (diff)
downloadhercules-8eadb9fc241e1784084625e89b208d80bda9e6e2.tar.gz
hercules-8eadb9fc241e1784084625e89b208d80bda9e6e2.tar.bz2
hercules-8eadb9fc241e1784084625e89b208d80bda9e6e2.tar.xz
hercules-8eadb9fc241e1784084625e89b208d80bda9e6e2.zip
Improved overwriting priority of variables/constants/parameters
- Fixes issue 7968, thanks to Moguri http://hercules.ws/board/tracker/issue-7968-trader-npc-not-working/ - Corrected sprite name for KO_KAGE to match latest kRO info (previouly KO_ZANZOU, conflicting with a Kagerou/Oboro skill identifier) - Updated self-test script to include checks for constants and for setd and getd. - Made possible thanks to Ind. Signed-off-by: Haru <haru@dotalux.com>
Diffstat (limited to 'npc/custom/test.txt')
-rw-r--r--npc/custom/test.txt26
1 files changed, 26 insertions, 0 deletions
diff --git a/npc/custom/test.txt b/npc/custom/test.txt
index b3579d4c3..07523f008 100644
--- a/npc/custom/test.txt
+++ b/npc/custom/test.txt
@@ -494,6 +494,32 @@ OnInit:
callsub(OnCheck, "array shrink", .@x[1], 0);
callsub(OnCheck, "array shrink and getarraysize", getarraysize(.@x), 0);
+
+ // Constants
+ callsub(OnCheck, "'true' constant", true, 1);
+ callsub(OnCheck, "'false' constant", false, 0);
+ callsub(OnCheck, "'PORING' mob ID", PORING, 1002);
+ callsub(OnCheck, "'NV_BASIC' skill ID", NV_BASIC, 1);
+ callsub(OnCheck, "'Red_Potion' item ID", Red_Potion, 501);
+ callsub(OnCheck, "'Monster's_Feed' item ID", Monster's_Feed, 528);
+
+
+ // setd/getd
+ .@x = 1; .@x$ = ".@x";
+ callsub(OnCheck, "getd", getd(".@x"), 1);
+ callsub(OnCheck, "getd arguments", getd(.@x$), 1);
+ .@y = 0; .@y$ = ".@y";
+ setd(".@y", .@x);
+ callsub(OnCheck, "setd", .@y, 1);
+ setd(.@y$, 2);
+ callsub(OnCheck, "setd arguments", .@y, 2);
+ set getd(".@x"), getd(".@y");
+ callsub(OnCheck, "set getd", .@x, .@y);
+ .@y = 1;
+ setd(".@x", getd(".@y"));
+ callsub(OnCheck, "setd getd", .@x, .@y);
+
+
if (.errors) {
debugmes "Script engine self-test [ FAILED ]";
debugmes "**** The test was completed with " + .errors + " errors. ****";