summaryrefslogtreecommitdiff
path: root/npc
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2017-04-19 23:13:15 +0300
committerAndrei Karas <akaras@inbox.ru>2017-04-19 23:13:15 +0300
commit1d2b06473ec19907bc8b979b39cc62259d24271d (patch)
tree9137e1633e79dd940c7058114cb8959472c3a1f6 /npc
parent60b1a31b3d190cce795cd015d054ce4da097503b (diff)
downloadserverdata-1d2b06473ec19907bc8b979b39cc62259d24271d.tar.gz
serverdata-1d2b06473ec19907bc8b979b39cc62259d24271d.tar.bz2
serverdata-1d2b06473ec19907bc8b979b39cc62259d24271d.tar.xz
serverdata-1d2b06473ec19907bc8b979b39cc62259d24271d.zip
Add to npc1 demonstration how item options works.
Diffstat (limited to 'npc')
-rw-r--r--npc/test/npc1.txt37
1 files changed, 36 insertions, 1 deletions
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;
}