From 1d2b06473ec19907bc8b979b39cc62259d24271d Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Wed, 19 Apr 2017 23:13:15 +0300 Subject: Add to npc1 demonstration how item options works. --- npc/test/npc1.txt | 37 ++++++++++++++++++++++++++++++++++++- 1 file changed, 36 insertions(+), 1 deletion(-) diff --git a/npc/test/npc1.txt b/npc/test/npc1.txt index b3a868ac..bb610921 100644 --- a/npc/test/npc1.txt +++ b/npc/test/npc1.txt @@ -139,7 +139,7 @@ L_Start: case 7: while(1) { - switch (select("refine", "rent", "bound", "named", "cards", "back")) + switch (select("refine", "rent", "bound", "named", "cards", "options", "back")) { case 1: .@item = -1; @@ -273,6 +273,41 @@ L_Start: } break; case 6: + .@item = -1; + while(1) + { + switch (select("set item", "info", "set option 1", "remove options", "back")) + { + case 1: + .@item = requestitemindex(); + mes "Item index selected: " + str(.@item); + break; + case 2: + mes "Selected item options"; + for (.@i = 0; .@i < 5; .@i ++) + { + mes sprintf("%d: Option: %d, Value: %d", .@i, getitemoptionidbyindex(.@item, .@i), getitemoptionvaluebyindex(.@item, .@i)); + } + break; + case 3: + setitemoptionbyindex(.@item, 0, VAR_MAXHPAMOUNT, 200); + setitemoptionbyindex(.@item, 1, VAR_STRAMOUNT, 10); + setitemoptionbyindex(.@item, 2, VAR_VITAMOUNT, -5); + break; + case 4: + mes "Remove item options"; + for (.@i = 0; .@i < 5; .@i ++) + { + setitemoptionbyindex(.@item, .@i, 0, 0); + } + break; + case 5: + goto L_Start; + break; + } + } + break; + case 7: goto L_Start; break; } -- cgit v1.2.3-60-g2f50