From 9fa7a5fd50eac3c139608d073717941de433c5ae Mon Sep 17 00:00:00 2001 From: Emistry Date: Thu, 12 Feb 2015 08:59:16 +0800 Subject: [PATCH] Issue #283 Enable same items to be added to different category. --- npc/custom/quests/quest_shop.txt | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/npc/custom/quests/quest_shop.txt b/npc/custom/quests/quest_shop.txt index 207dc2f87e..e56329d120 100644 --- a/npc/custom/quests/quest_shop.txt +++ b/npc/custom/quests/quest_shop.txt @@ -91,27 +91,27 @@ OnInit: OnMenu: set .@size, getarraysize(@i); - if (!.@size) set .@i, select(.menu$); - else if (.@size == 1) set .@i, @i[0]; + if (!.@size) set @shop_index, select(.menu$); + else if (.@size == 1) set @shop_index, @i[0]; else { for(set .@j,0; .@j<.@size; set .@j,.@j+1) set .@menu$, .@menu$+.Shops$[@i[.@j]]+":"; - set .@i, @i[select(.@menu$)-1]; + set @shop_index, @i[select(.@menu$)-1]; } deletearray @i[0],getarraysize(@i); - if (.Shops$[.@i] == "") { + if (.Shops$[@shop_index] == "") { message strcharinfo(0),"An error has occurred."; end; } dispbottom "Select one item at a time."; - callshop "qshop"+.@i,1; - npcshopattach "qshop"+.@i; + callshop "qshop"+@shop_index,1; + npcshopattach "qshop"+@shop_index; end; OnBuyItem: // .@q[] : RewardID, BoughtAmt, RewardAmt, BaseAmt, ReqZeny, ReqPts, { ReqItem, ReqAmt, ... } setarray .@q[0],@bought_nameid[0],((@bought_quantity[0] > .MaxStack)?.MaxStack:@bought_quantity[0]); - copyarray .@q[3],getd(".q_"+.@q[0]+"[0]"),getarraysize(getd(".q_"+.@q[0])); + copyarray .@q[3],getd(".q_"+@shop_index+"_"+.@q[0]+"[0]"),getarraysize(getd(".q_"+@shop_index+"_"+.@q[0])); set .@q[2],.@q[1]*.@q[3]; if (!.@q[2] || .@q[2] > 30000) { message strcharinfo(0),"You can't purchase that many "+getitemname(.@q[0])+"."; @@ -186,7 +186,7 @@ function Add { } else setarray .@j[.@i-2],getarg(.@i),getarg(.@i+1); } - copyarray getd(".q_"+getarg(1)+"[0]"),.@j[0],getarraysize(.@j); + copyarray getd(".q_"+getarg(0)+"_"+getarg(1)+"[0]"),.@j[0],getarraysize(.@j); npcshopadditem "qshop"+getarg(0),getarg(1),((.ShowZeny)?getarg(3):0); return; } @@ -224,4 +224,4 @@ function script qshop { - shop qshop2 -1,909:-1 - shop qshop3 -1,909:-1 - shop qshop4 -1,909:-1 -- shop qshop5 -1,909:-1 \ No newline at end of file +- shop qshop5 -1,909:-1