//===== rAthena Script ======================================= //= Euphy's Quest Shop //===== By: ================================================== //= Euphy //===== Current Version: ===================================== //= 1.6c //===== Compatible With: ===================================== //= rAthena Project //===== Description: ========================================= //= A dynamic quest shop based on Lunar's, with easier config. //= Includes support for multiple shops & cashpoints. //= Item Preview script by ToastOfDoom. //===== Additional Comments: ================================= //= 1.0 Initial script. //= 1.2 Added category support. //= 1.3 More options and fixes. //= 1.4 Added debug settings. //= 1.5 Replaced categories with shop IDs. //= 1.6 Added support for purchasing stackables. //= 1.6a Added support for previewing costumes and robes. //= 1.6b Added 'disable_items' command. //= 1.6c Replaced function 'A_An' with "F_InsertArticle". //============================================================ // Shop NPCs -- supplying no argument displays entire menu. // callfunc "qshop"{,{,{,...}}}; //============================================================ livion,189,213,3 script SeireiteiRO Quests#1 998,{ OnInit: waitingroom "Seireitei Quests",0; callfunc "vshop"; } // Script Core //============================================================ - script quest_shop1 -1,{ function Add; function Chk; function Slot; OnInit: freeloop(1); // ----------------------------------------------------------- // Basic shop settings. // ----------------------------------------------------------- set .Announce,1; // Announce quest completion? (1: yes / 0: no) set .ShowSlot,1; // Show item slots? (2: all equipment / 1: if slots > 0 / 0: never) set .ShowID,1; // Show item IDs? (1: yes / 0: no) set .ShowZeny,0; // Show Zeny cost, if any? (1: yes / 0: no) set .MaxStack,100; // Max number of quest items purchased at one time. // ----------------------------------------------------------- // Points variable -- optional quest requirement. // setarray .Points$[0],"",""; // ----------------------------------------------------------- setarray .Points$[0],"#CASHPOINTS","Cash Points"; // ----------------------------------------------------------- // Shop IDs -- to add shops, copy dummy data at bottom of file. // setarray .Shops1$[1],"",""{,...}; // ----------------------------------------------------------- setarray .Shops1$[1],"Quest Items"; // ----------------------------------------------------------- // Quest items -- do NOT use a reward item more than once! // Add(,,, // ,, // ,{,...}); // ----------------------------------------------------------- Add(1,40233,1,0,0,2280,1,979,10,7111,100,2258,1,7066,50,7150,400); Add(1,40215,1,0,0,40221,1,7723,5,5038,1,5017,1,1615,1,2255,5,7005,50,932,200,1038,500,1039,500,4122,3,983,5,30002,5); Add(1,40024,1,0,0,40221,1,6027,5,949,200,504,200,610,50,7063,100,2254,3,2282,3,2257,10,4033,5,4001,10,4197,1,4054,1,30002,5); Add(1,40678,1,0,0,40221,1,7405,5,602,200,7168,500,4327,1,978,10,980,10,982,10,981,10,979,10,4040,3,30002,5); Add(1,40098,1,0,0,40221,1,7309,5,6278,5,983,50,1020,300,7161,100,4203,3,732,50,924,300,7019,20,7023,15,990,50,30002,5); Add(1,40271,1,0,0,30132,1,7718,5,6245,5,916,500,949,500,7063,200,7079,10,7101,100,7115,200,7440,50,7441,50,7122,500,4155,3,30002,5); Add(1,40127,1,0,0,30132,1,6212,5,7425,5,916,500,949,500,7063,200,7079,10,7101,100,7115,200,7440,50,7441,50,7122,500,4155,3,30002,5); Add(1,40417,1,0,0,7911,2,6246,2,7346,2,7810,2,7812,2,30156,1,30157,1,30158,1,30159,1,30160,1,30161,1,30162,1,30163,1,30164,1,30165,1,30166,1,30167,1,30168,1,30169,1,30170,1,30171,1,30172,1,30173,1,30174,1,30175,1,30176,1,30177,1,30178,1,30179,1); Add(1,41032,1,0,0,7408,2,7760,2,7408,2,7810,2,7812,2,30156,1,30157,1,30158,1,30159,1,30160,1,30161,1,30162,1,30163,1,30164,1,30165,1,30166,1,30167,1,30168,1,30169,1,30170,1,30171,1,30172,1,30173,1,30174,1,30175,1,30176,1,30177,1,30178,1,30179,1); Add(1,41033,1,0,0,6514,2,7313,2,7304,2,7810,2,7812,2,30156,1,30157,1,30158,1,30159,1,30160,1,30161,1,30162,1,30163,1,30164,1,30165,1,30166,1,30167,1,30168,1,30169,1,30170,1,30171,1,30172,1,30173,1,30174,1,30175,1,30176,1,30177,1,30178,1,30179,1); Add(1,41034,1,0,0,7308,2,7044,2,6048,2,7305,2,7812,2,30156,1,30157,1,30158,1,30159,1,30160,1,30161,1,30162,1,30163,1,30164,1,30165,1,30166,1,30167,1,30168,1,30169,1,30170,1,30171,1,30172,1,30173,1,30174,1,30175,1,30176,1,30177,1,30178,1,30179,1); Add(1,41035,1,0,0,7103,2,7726,2,6002,2,7305,2,7812,2,30156,1,30157,1,30158,1,30159,1,30160,1,30161,1,30162,1,30163,1,30164,1,30165,1,30166,1,30167,1,30168,1,30169,1,30170,1,30171,1,30172,1,30173,1,30174,1,30175,1,30176,1,30177,1,30178,1,30179,1); Add(1,41036,1,0,0,7816,2,7611,2,7817,2,7305,2,7812,2,30156,1,30157,1,30158,1,30159,1,30160,1,30161,1,30162,1,30163,1,30164,1,30165,1,30166,1,30167,1,30168,1,30169,1,30170,1,30171,1,30172,1,30173,1,30174,1,30175,1,30176,1,30177,1,30178,1,30179,1); Add(1,40204,1,0,0,6252,5,6211,5,7907,5,7023,5,12020,50,7157,20,30156,1,30157,1,30158,1,30159,1,30160,1,30161,1,30162,1,30163,1,30164,1,30165,1,30166,1,30167,1,30168,1,30169,1,30170,1,30171,1,30172,1,30173,1,30174,1,30175,1,30176,1,30177,1,30178,1,30179,1); Add(1,40238,1,0,0,6024,5,6072,5,6009,5,7003,50,4252,3,625,20,30156,1,30157,1,30158,1,30159,1,30160,1,30161,1,30162,1,30163,1,30164,1,30165,1,30166,1,30167,1,30168,1,30169,1,30170,1,30171,1,30172,1,30173,1,30174,1,30175,1,30176,1,30177,1,30178,1,30179,1); Add(1,5013,1,0,0,6024,2,6072,2,6009,2,7425,2,6245,2,6278,2,6252,2,6211,2,7907,2,6212,2,7718,2,7309,2,7405,2,6027,2,7723,2,7911,2,6246,2,7346,2,7408,2,7760,2,7427,2,6514,2,7313,2,7304,2,7308,2,7044,2,6048,2,7103,2,7726,2,6002,2,7816,2,7611,2,7817,2,7810,2,7305,2,7812,2,40681,1,40233,1,40204,1,40238,1); Add(1,30000,1,0,0,6024,1,6072,1,6009,1,7425,1,6245,1,6278,1,6252,1,6211,1,7907,1,6212,1,7718,1,7309,1,7405,1,6027,1,7723,1,7911,1,6246,1,7346,1,7408,1,7760,1,7427,1,6514,1,7313,1,7304,1,7308,1,7044,1,6048,1,7103,1,7726,1,6002,1,7816,1,7611,1,7817,1,7810,1,7305,1,7812,2); Add(1,40258,1,10000000,0,7441,150,30002,5,661,50,7063,150,7720,50,1014,50,1045,100); Add(1,40259,1,10000000,0,7441,150,30002,5,661,50,7063,150,7720,50,1014,50,1045,100); Add(1,40273,1,10000000,0,7441,150,30002,5,661,50,7063,150,7720,50,1014,50,1045,100); Add(1,40560,1,10000000,0,7441,150,30002,5,661,50,7063,150,7720,50,1014,50,1045,100); Add(1,40684,1,10000000,0,7441,150,30002,5,661,50,7063,150,7720,50,1014,50,1045,100); Add(1,40554,1,10000000,0,7441,150,30002,5,661,50,7063,150,7720,50,1014,50,1045,100); Add(1,40574,1,10000000,0,7441,150,30002,5,661,50,7063,150,7720,50,1014,50,1045,100); Add(1,40350,1,10000000,0,7441,150,30002,5,661,50,7063,150,7720,50,1014,50,1045,100); Add(1,40236,1,10000000,0,7441,150,30002,5,661,50,7063,150,7720,50,1014,50,1045,100); Add(1,40087,1,10000000,0,7441,150,30002,5,661,50,7063,150,7720,50,1014,50,1045,100); Add(1,40012,1,10000000,0,7441,150,30002,5,661,50,7063,150,7720,50,1014,50,1045,100); Add(1,40649,1,0,0,6091,5,7562,5,7451,5,7450,5,5090,5,2345,5,13412,2,13413,2,1468,5,1166,3,1233,3,1369,3,1720,3,1528,3,1175,5,1162,5,1162,5,1737,5,2000,5,2513,10,7296,10); Add(1,13110,1,0,0,6091,5,7562,5,7451,5,7450,5,5090,5,2345,5,13412,2,13413,2,1468,5,1166,3,1233,3,1369,3,1720,3,1528,3,1175,5,1162,5,1162,5,1737,5,2000,5,2513,10,7296,10); Add(1,1637,1,0,0,6091,5,7562,5,7451,5,7450,5,5090,5,2345,5,13412,2,13413,2,1468,5,1166,3,1233,3,1369,3,1720,3,1528,3,1175,5,1162,5,1162,5,1737,5,2000,5,2513,10,7296,10); Add(1,40540,1,0,0,6091,5,7562,5,7451,5,7450,5,5090,5,2345,5,13412,2,13413,2,1468,5,1166,3,1233,3,1369,3,1720,3,1528,3,1175,5,1162,5,1162,5,1737,5,2000,5,2513,10,7296,10); Add(1,40367,1,0,0,6091,5,7562,5,7451,5,7450,5,5090,5,2345,5,13412,2,13413,2,1468,5,1166,3,1233,3,1369,3,1720,3,1528,3,1175,5,1162,5,1162,5,1737,5,2000,5,2513,10,7296,10); Add(1,13000,1,0,0,6091,5,7562,5,7451,5,7450,5,5090,5,2345,5,13412,2,13413,2,1468,5,1166,3,1233,3,1369,3,1720,3,1528,3,1175,5,1162,5,1162,5,1737,5,2000,5,2513,10,7296,10); Add(1,1819,1,0,0,6091,5,7562,5,7451,5,7450,5,5090,5,2345,5,13412,2,13413,2,1468,5,1166,3,1233,3,1369,3,1720,3,1528,3,1175,5,1162,5,1162,5,1737,5,2000,5,2513,10,7296,10); Add(1,13303,1,0,0,6091,5,7562,5,7451,5,7450,5,5090,5,2345,5,13412,2,13413,2,1468,5,1166,3,1233,3,1369,3,1720,3,1528,3,1175,5,1162,5,1162,5,1737,5,2000,5,2513,10,7296,10); Add(1,1561,1,0,0,6091,5,7562,5,7451,5,7450,5,5090,5,2345,5,13412,2,13413,2,1468,5,1166,3,1233,3,1369,3,1720,3,1528,3,1175,5,1162,5,1162,5,1737,5,2000,5,2513,10,7296,10); //Add(2,40078,1,0,0,2280,1,979,10,7111,100,2258,1,4319,50,7150,400); //Add(3,30152,1,0,0,30132,1,969,10,999,50,714,10,7110,20,7188,10,7122,20,7120,50,7512,15,7068,15,7182,15,952,50,7263,15,736,10,1004,15,915,50,7295,5,7109,15); //Add(4,30188,1,0,0,32264,1,30132,1,30156,1,7097,50,7122,50,7120,50,658,10,5007,5,1036,20,926,50,30157,1,30158,1,30159,1,30160,1,30161,1,30162,1,30163,1,30164,1,30165,1,30166,1,30167,1,30168,1,30169,1,30170,1,30171,1,30172,1,30173,1,30174,1,30175,1,30176,1,30177,1,30178,1,30179,1); // ----------------------------------------------------------- freeloop(0); set .menu$,""; for(set .@i,1; .@i<=getarraysize(.Shops1$); set .@i,.@i+1) { set .menu$, .menu$+.Shops1$[.@i]+":"; npcshopdelitem "vshop"+.@i,909; } end; OnMenu: set .@size, getarraysize(@i); 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$+.Shops1$[@i[.@j]]+":"; set @shop_index, @i[select(.@menu$)-1]; } deletearray @i[0],getarraysize(@i); if (.Shops1$[@shop_index] == "") { message strcharinfo(0),"An error has occurred."; end; } dispbottom "Select one item at a time."; callshop "vshop"+@shop_index,1; npcshopattach "vshop"+@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_"+@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])+"."; end; } mes "[Quest Shop]"; mes "Reward: ^0055FF"+((.@q[2] > 1)?.@q[2]+"x ":"")+Slot(.@q[0])+"^000000"; mes "Requirements:"; disable_items; if (.@q[4]) mes " > "+Chk(Zeny,.@q[4]*.@q[1])+(.@q[4]*.@q[1])+" Zeny^000000"; if (.@q[5]) mes " > "+Chk(getd(.Points$[0]),.@q[5]*.@q[1])+(.@q[5]*.@q[1])+" "+.Points$[1]+" ("+getd(.Points$[0])+"/"+(.@q[5]*.@q[1])+")^000000"; if (.@q[6]) for(set .@i,6; .@i "+Chk(countitem(.@q[.@i]),.@q[.@i+1]*.@q[1])+((.ShowID)?"{"+.@q[.@i]+"} ":"")+Slot(.@q[.@i])+" ("+countitem(.@q[.@i])+"/"+(.@q[.@i+1]*.@q[1])+")^000000"; next; setarray @qe[1], getiteminfo(.@q[0],5), getiteminfo(.@q[0],11); if (@qe[2] > 0 && ((@qe[1] & EQP_HEAD_LOW) || (@qe[1] & EQP_HEAD_TOP) || (@qe[1] & EQP_HEAD_MID) || (@qe[1] & EQP_COSTUME_HEAD_TOP) || (@qe[1] & EQP_COSTUME_HEAD_MID) || (@qe[1] & EQP_COSTUME_HEAD_LOW) || (@qe[1] & EQP_GARMENT) || (@qe[1] & EQP_COSTUME_GARMENT))) set .@preview,1; addtimer 1000, strnpcinfo(0)+"::OnEnd"; while(1) { switch(select(" ~ Purchase ^0055FF"+getitemname(.@q[0])+"^000000:"+((.@preview && !@qe[7])?" ~ Preview...":"")+": ~ ^777777Cancel^000000")) { case 1: if (@qe[0]) { mes "[Quest Shop]"; mes "You're missing one or more quest requirements."; close; } if (!checkweight(.@q[0],.@q[2])) { mes "[Quest Shop]"; mes "^FF0000You need "+(((.@q[2]*getiteminfo(.@q[0],6))+Weight-MaxWeight)/10)+" additional weight capacity to complete this trade.^000000"; close; } if (.@q[4]) set Zeny, Zeny-(.@q[4]*.@q[1]); if (.@q[5]) setd .Points$[0], getd(.Points$[0])-(.@q[5]*.@q[1]); if (.@q[6]) for(set .@i,6; .@i 1)?.@q[2]+"x "+getitemname(.@q[0]):callfunc("F_InsertArticle",getitemname(.@q[0])))+"!",0; specialeffect2 EF_FLOWERLEAF; close; case 2: setarray @qe[3], getlook(LOOK_HEAD_BOTTOM), getlook(LOOK_HEAD_TOP), getlook(LOOK_HEAD_MID), getlook(LOOK_ROBE), 1; if ((@qe[1] & 1) || (@qe[1] & 4096)) changelook LOOK_HEAD_BOTTOM, @qe[2]; else if ((@qe[1] & 256) || (@qe[1] & 1024)) changelook LOOK_HEAD_TOP, @qe[2]; else if ((@qe[1] & 512) || (@qe[1] & 2048)) changelook LOOK_HEAD_MID, @qe[2]; else if ((@qe[1] & 4) || (@qe[1] & 8192)) changelook LOOK_ROBE, @qe[2]; break; case 3: close; } } OnEnd: if (@qe[7]) { changelook LOOK_HEAD_BOTTOM, @qe[3]; changelook LOOK_HEAD_TOP, @qe[4]; changelook LOOK_HEAD_MID, @qe[5]; changelook LOOK_ROBE, @qe[6]; } deletearray @qe[0],8; end; function Add { if (getitemname(getarg(1)) == "null") { debugmes "Quest reward #"+getarg(1)+" invalid (skipped)."; return; } setarray .@j[0],getarg(2),getarg(3),getarg(4); for(set .@i,5; .@i