From 8eadb9fc241e1784084625e89b208d80bda9e6e2 Mon Sep 17 00:00:00 2001 From: Haru Date: Mon, 13 Jan 2014 04:06:56 +0100 Subject: 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 --- npc/custom/test.txt | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) (limited to 'npc') 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. ****"; -- cgit v1.2.3-60-g2f50