Dolphin86 Posted September 20, 2015 Share Posted September 20, 2015 i was almost done with this quest shop, ( converted to coin shop ) i had no problem adding new shop, but up until shop 6 ( Shield card ) its not showing anything, When i click on Shield Card Shop nothing came up but i dint get any error, could someone help me or the creator it self? //===== rAthena Script ======================================= //= Euphy's Quest Shop //===== By: ================================================== //= Euphy //===== Current Version: ===================================== //= 1.6 //===== Compatible With: ===================================== //= rAthena SVN r16862+ //===== Description: ========================================= //= A dynamic quest shop based on Lunar's, with easier config. //= Includes support for multiple shops & cashpoints. //= Item Preview script by ToastOfDoom. //============================================================ // Shop NPCs -- supplying no argument displays entire menu. // callfunc "qshop"{,<shop ID>{,<shop ID>{,...}}}; //============================================================ prontera,159,185,6 script Coin Shop#1 998,{ callfunc "qshop"; } // Script Core //============================================================ - script quest_shop -1,{ function Add; function Chk; function Slot; function A_An; OnInit: freeloop(1); // ----------------------------------------------------------- // Basic shop settings. // ----------------------------------------------------------- set .Announce,0; // Announce quest completion? (1: yes / 0: no) set .ShowSlot,1; // Show item slots? (2: all equipment / 1: if slots > 0 / 0: never) set .ShowID,0; // 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],"<variable name>","<display name>"; // ----------------------------------------------------------- setarray .Points$[0],"#CASHPOINTS","Cash Points"; // ----------------------------------------------------------- // Shop IDs -- to add shops, copy dummy data at bottom of file. // setarray .Shops$[1],"<Shop 1>","<Shop 2>"{,...}; // ----------------------------------------------------------- setarray .Shops$[1],"Accessory Card","Armor Card","Footgear Card","Garment Card","Headgear Card","Shield Card"; // ----------------------------------------------------------- // Quest items -- do NOT use a reward item more than once! // Add(<shop ID>,<reward ID>,<reward amount>, // <Zeny cost>,<point cost>, // <required item ID>,<required item amount>{,...}); // ----------------------------------------------------------- Add(1,4344,1,0,0,28904,3); Add(1,4347,1,0,0,28904,3); Add(1,4356,1,0,0,28904,5); Add(1,4145,1,0,0,28904,20); Add(1,4215,1,0,0,28904,3); Add(1,4327,1,0,0,28904,10); Add(1,4212,1,0,0,28904,3); Add(1,4262,1,0,0,28904,3); Add(1,4293,1,0,0,28904,3); Add(1,4040,1,0,0,28904,10); Add(1,4272,1,0,0,28904,3); Add(1,4154,1,0,0,28904,1); Add(1,4385,1,0,0,28904,3); Add(1,4349,1,0,0,28904,10); Add(1,4152,1,0,0,28904,3); Add(1,4423,1,0,0,28904,5); Add(1,4418,1,0,0,28904,3); Add(1,4283,1,0,0,28904,3); Add(1,4377,1,0,0,28904,3); Add(1,4355,1,0,0,28904,5); Add(1,4331,1,0,0,28904,3); Add(1,4437,1,0,0,28904,10); Add(1,4232,1,0,0,28904,3); Add(1,4103,1,0,0,28904,10); Add(1,4384,1,0,0,28904,10); Add(1,4321,1,0,0,28904,3); Add(1,4430,1,0,0,28904,20); Add(1,4433,1,0,0,28904,10); Add(1,4139,1,0,0,28904,5); Add(1,4091,1,0,0,28904,5); Add(1,4027,1,0,0,28904,1); Add(1,4265,1,0,0,28904,10); Add(1,4193,1,0,0,28904,3); Add(1,4079,1,0,0,28904,5); Add(1,4084,1,0,0,28904,10); Add(1,4196,1,0,0,28904,1); Add(1,4205,1,0,0,28904,3); Add(1,4093,1,0,0,28904,3); Add(1,4256,1,0,0,28904,3); Add(1,4144,1,0,0,28904,20); Add(1,4238,1,0,0,28904,5); Add(1,4237,1,0,0,28904,3); Add(1,4077,1,0,0,28904,10); Add(1,4073,1,0,0,28904,5); Add(1,4389,1,0,0,28904,3); Add(1,4175,1,0,0,28904,3); Add(1,4033,1,0,0,28904,3); Add(1,4294,1,0,0,28904,1); Add(1,4436,1,0,0,28904,3); Add(1,4187,1,0,0,28904,3); Add(1,4391,1,0,0,28904,3); Add(1,4219,1,0,0,28904,3); Add(1,4326,1,0,0,28904,5); Add(1,4230,1,0,0,28904,5); Add(1,4416,1,0,0,28904,10); Add(1,4228,1,0,0,28904,5); Add(1,4044,1,0,0,28904,10); Add(1,4415,1,0,0,28904,10); Add(1,4022,1,0,0,28904,1); Add(1,4227,1,0,0,28904,10); Add(1,4424,1,0,0,28904,3); Add(1,4028,1,0,0,28904,3); Add(1,4282,1,0,0,28904,3); Add(1,4209,1,0,0,28904,5); Add(1,4053,1,0,0,28904,10); Add(1,4264,1,0,0,28904,10); Add(1,4190,1,0,0,28904,3); Add(1,4051,1,0,0,28904,3); Add(1,4064,1,0,0,28904,5); Add(2,4409,1,0,0,28904,3); Add(2,4401,1,0,0,28904,5); Add(2,4400,1,0,0,28904,5); Add(2,4387,1,0,0,28904,3); Add(2,4054,1,0,0,28904,12); Add(2,4234,1,0,0,28904,5); Add(2,4243,1,0,0,28904,5); Add(2,4242,1,0,0,28904,1); Add(2,4371,1,0,0,28904,5); Add(2,4114,1,0,0,28904,10); Add(2,4023,1,0,0,28904,1); Add(2,4233,1,0,0,28904,5); Add(2,4450,1,0,0,28904,10); Add(2,4119,1,0,0,28904,10); Add(2,4213,1,0,0,28904,10); Add(2,4426,1,0,0,28904,10); Add(2,4300,1,0,0,28904,10); Add(2,4299,1,0,0,28904,5); Add(2,4061,1,0,0,28904,5); Add(2,4298,1,0,0,28904,5); Add(2,4170,1,0,0,28904,10); Add(2,4173,1,0,0,28904,10); Add(2,4386,1,0,0,28904,12); Add(2,4181,1,0,0,28904,1); Add(2,4098,1,0,0,28904,10); Add(2,4279,1,0,0,28904,3); Add(2,4410,1,0,0,28904,1); Add(2,4346,1,0,0,28904,3); Add(2,4141,1,0,0,28904,10); Add(2,4405,1,0,0,28904,5); Add(2,4324,1,0,0,28904,20); Add(2,4280,1,0,0,28904,5); Add(2,4047,1,0,0,28904,20); Add(2,4270,1,0,0,28904,5); Add(2,4408,1,0,0,28904,20); Add(2,4150,1,0,0,28904,3); Add(2,4162,1,0,0,28904,5); Add(2,4286,1,0,0,28904,5); Add(2,4301,1,0,0,28904,10); Add(2,4295,1,0,0,28904,5); Add(2,4419,1,0,0,28904,20); Add(2,4191,1,0,0,28904,5); Add(2,4201,1,0,0,28904,10); Add(2,4105,1,0,0,28904,10); Add(2,4339,1,0,0,28904,1); Add(2,4166,1,0,0,28904,5); Add(2,4392,1,0,0,28904,3); Add(2,4338,1,0,0,28904,3); Add(2,4135,1,0,0,28904,12); Add(2,4099,1,0,0,28904,10); Add(2,4031,1,0,0,28904,3); Add(2,4315,1,0,0,28904,10); Add(2,4008,1,0,0,28904,5); Add(2,4011,1,0,0,28904,1); Add(2,4337,1,0,0,28904,3); Add(2,4001,1,0,0,28904,1); Add(2,4003,1,0,0,28904,3); Add(2,4383,1,0,0,28904,5); Add(2,4353,1,0,0,28904,3); Add(2,4021,1,0,0,28904,1); Add(2,4014,1,0,0,28904,3); Add(2,4342,1,0,0,28904,12); Add(2,4194,1,0,0,28904,10); Add(2,4101,1,0,0,28904,10); Add(2,4216,1,0,0,28904,10); Add(2,4078,1,0,0,28904,1); Add(2,4393,1,0,0,28904,3); Add(2,4222,1,0,0,28904,5); Add(2,4404,1,0,0,28904,10); Add(2,4158,1,0,0,28904,3); Add(2,4042,1,0,0,28904,3); Add(2,4218,1,0,0,28904,5); Add(2,4089,1,0,0,28904,10); Add(2,4302,1,0,0,28904,12); Add(2,4016,1,0,0,28904,1); Add(2,4369,1,0,0,28904,3); Add(2,4333,1,0,0,28904,10); Add(2,4332,1,0,0,28904,10); Add(2,4259,1,0,0,28904,1); Add(2,4189,1,0,0,28904,10); Add(2,4382,1,0,0,28904,10); Add(3,4244,1,3,0,28904,3); Add(3,4236,1,3,0,28904,10); Add(3,4160,1,3,0,28904,3); Add(3,4290,1,3,0,28904,5); Add(3,4009,1,3,0,28904,1); Add(3,4235,1,3,0,28904,10); Add(3,4168,1,3,0,28904,20); Add(3,4123,1,3,0,28904,12); Add(3,4070,1,3,0,28904,1); Add(3,4267,1,3,0,28904,10); Add(3,4319,1,3,0,28904,3); Add(3,4151,1,3,0,28904,10); Add(3,4149,1,3,0,28904,10); Add(3,4352,1,3,0,28904,12); Add(3,4378,1,3,0,28904,3); Add(3,4164,1,3,0,28904,10); Add(3,4417,1,3,0,28904,3); Add(3,4239,1,3,0,28904,10); Add(3,4376,1,3,0,28904,20); Add(3,4050,1,3,0,28904,1); Add(3,4097,1,3,0,28904,5); Add(3,4200,1,3,0,28904,3); Add(3,4199,1,3,0,28904,3); Add(3,4204,1,3,0,28904,5); Add(3,4208,1,3,0,28904,5); Add(3,4131,1,3,0,28904,20); Add(3,4186,1,3,0,28904,3); Add(3,4221,1,3,0,28904,5); Add(3,4100,1,3,0,28904,10); Add(3,4396,1,3,0,28904,3); Add(3,4107,1,3,0,28904,5); Add(3,4257,1,3,0,28904,3); Add(3,4038,1,3,0,28904,1); Add(3,4275,1,3,0,28904,3); Add(3,4435,1,3,0,28904,3); Add(4,4402,1,3,0,28904,3); Add(4,4129,1,3,0,28904,1); Add(4,4285,1,3,0,28904,5); Add(4,4373,1,3,0,28904,3); Add(4,4015,1,3,0,28904,5); Add(4,4174,1,3,0,28904,20); Add(4,4179,1,3,0,28904,3); Add(4,4178,1,3,0,28904,3); Add(4,4056,1,3,0,28904,10); Add(4,4266,1,3,0,28904,3); Add(4,4088,1,3,0,28904,10); Add(4,4303,1,3,0,28904,10); Add(4,4325,1,3,0,28904,5); Add(4,4081,1,3,0,28904,10); Add(4,4328,1,3,0,28904,10); Add(4,4116,1,3,0,28904,10); Add(4,4109,1,3,0,28904,10); Add(4,4287,1,3,0,28904,3); Add(4,4431,1,3,0,28904,5); Add(4,4351,1,3,0,28904,10); Add(4,4432,1,3,0,28904,3); Add(4,4113,1,3,0,28904,10); Add(4,4095,1,3,0,28904,10); Add(4,4197,1,3,0,28904,3); Add(4,4108,1,3,0,28904,10); Add(4,4159,1,3,0,28904,10); Add(4,4334,1,3,0,28904,10); Add(4,4375,1,3,0,28904,10); Add(4,4071,1,3,0,28904,10); Add(4,4313,1,3,0,28904,5); Add(4,4133,1,3,0,28904,10); Add(4,4422,1,3,0,28904,5); Add(4,4429,1,3,0,28904,10); Add(4,4183,1,3,0,28904,3); Add(4,4211,1,3,0,28904,3); Add(4,4210,1,3,0,28904,10); Add(4,4102,1,3,0,28904,10); Add(5,4241,1,3,0,28904,5); Add(5,4372,1,3,0,28904,20); Add(5,4438,1,3,0,28904,5); Add(5,4379,1,3,0,28904,1); Add(5,4288,1,3,0,28904,3); Add(5,4229,1,3,0,28904,5); Add(5,4041,1,3,0,28904,3); Add(5,4296,1,3,0,28904,1); Add(5,4169,1,3,0,28904,12); Add(5,4122,1,3,0,28904,10); Add(5,4177,1,3,0,28904,5); Add(5,4052,1,3,0,28904,1); Add(5,4258,1,3,0,28904,1); Add(5,4330,1,3,0,28904,12); Add(5,4354,1,3,0,28904,5); Add(5,4110,1,3,0,28904,3); Add(5,4271,1,3,0,28904,5); Add(5,4278,1,3,0,28904,3); Add(5,4087,1,3,0,28904,5); Add(5,4161,1,3,0,28904,1); Add(5,4365,1,3,0,28904,20); Add(5,4343,1,3,0,28904,1); Add(5,4269,1,3,0,28904,5); Add(5,4412,1,3,0,28904,5); Add(5,4366,1,3,0,28904,10); Add(5,4434,1,3,0,28904,3); Add(5,4195,1,3,0,28904,5); Add(5,4188,1,3,0,28904,5); Add(5,4357,1,3,0,28904,12); Add(5,4112,1,3,0,28904,10); Add(5,4364,1,3,0,28904,10); Add(5,4046,1,3,0,28904,3); Add(5,4132,1,3,0,28904,20); Add(5,4206,1,3,0,28904,3); Add(5,4127,1,3,0,28904,10); Add(5,4143,1,3,0,28904,12); Add(5,4311,1,3,0,28904,5); Add(5,4148,1,3,0,28904,12); Add(5,4358,1,3,0,28904,3); Add(5,4223,1,3,0,28904,3); Add(5,4336,1,3,0,28904,10); Add(5,4411,1,3,0,28904,10); Add(5,4374,1,3,0,28904,20); Add(5,4052,1,3,0,28904,1); Add(5,4010,1,3,0,28904,1); Add(5,4261,1,3,0,28904,3); Add(5,4260,1,3,0,28904,3); Add(6,4253,1,3,0,28904,10); Add(6,4032,1,3,0,28904,5); Add(6,4248,1,3,0,28904,3); Add(6,4013,1,3,0,28904,1); Add(6,4138,1,3,0,28904,10); Add(6,4443,1,3,0,28904,10); Add(6,4240,1,3,0,28904,1); Add(6,4075,1,3,0,28904,10); Add(6,4074,1,3,0,28904,3); Add(6,4447,1,3,0,28904,10); Add(6,4448,1,3,0,28904,10); Add(6,4449,1,3,0,28904,10); Add(6,4444,1,3,0,28904,10); Add(6,4217,1,3,0,28904,3); Add(6,4250,1,3,0,28904,10); Add(6,4439,1,3,0,28904,5); Add(6,4128,1,3,0,28904,20); Add(6,4322,1,3,0,28904,5); Add(6,4413,1,3,0,28904,10); Add(6,4045,1,3,0,28904,5); Add(6,4231,1,3,0,28904,5); Add(6,4136,1,3,0,28904,10); Add(6,4146,1,3,0,28904,20); Add(6,4124,1,3,0,28904,10); Add(6,4067,1,3,0,28904,10); Add(6,4090,1,3,0,28904,3); Add(6,4066,1,3,0,28904,5); Add(6,4309,1,3,0,28904,3); Add(6,4314,1,3,0,28904,10); Add(6,4083,1,3,0,28904,10); Add(6,4414,1,3,0,28904,10); Add(6,4120,1,3,0,28904,10); Add(6,4059,1,3,0,28904,10); Add(6,4304,1,3,0,28904,3); Add(6,4442,1,3,0,28904,10); Add(6,4397,1,3,0,28904,1); Add(6,4058,1,3,0,28904,10); Add(6,4012,1,3,0,28904,3); Add(6,4254,1,3,0,28904,10); Add(6,4277,1,3,0,28904,5); // ----------------------------------------------------------- freeloop(0); set .menu$,""; for(set [email protected],1; [email protected]<=getarraysize(.Shops$); set [email protected],[email protected]+1) { set .menu$, .menu$+.Shops$[[email protected]]+":"; npcshopdelitem "qshop"[email protected],909; } end; OnMenu: set [email protected], getarraysize(@i); if ([email protected]) set [email protected], select(.menu$); else if ([email protected] == 1) set [email protected], @i[0]; else { for(set [email protected],0; [email protected]<[email protected]; set [email protected],[email protected]+1) set [email protected]$, [email protected]$+.Shops$[@i[[email protected]]]+":"; set [email protected], @i[select([email protected]$)-1]; } deletearray @i[0],getarraysize(@i); if (.Shops$[[email protected]] == "") { message strcharinfo(0),"An error has occurred."; end; } dispbottom "Select one item at a time."; callshop "qshop"[email protected],1; npcshopattach "qshop"[email protected]; end; OnBuyItem: // [email protected][] : RewardID, BoughtAmt, RewardAmt, BaseAmt, ReqZeny, ReqPts, { ReqItem, ReqAmt, ... } setarray [email protected][0],@bought_nameid[0],((@bought_quantity[0] > .MaxStack)?.MaxStack:@bought_quantity[0]); copyarray [email protected][3],getd(".q_"[email protected][0]+"[0]"),getarraysize(getd(".q_"[email protected][0])); set [email protected][2],[email protected][1]*[email protected][3]; if ([email protected][2] || [email protected][2] > 30000) { message strcharinfo(0),"You can't purchase that many "+getitemname([email protected][0])+"."; end; } mes "[Coin Shop]"; mes "Reward: ^0055FF"+(([email protected][2] > 1)[email protected][2]+"x ":"")+Slot([email protected][0])+"^000000"; mes "Requirements:"; if ([email protected][4]) mes " > "+Chk(Zeny,[email protected][4]*[email protected][1])+([email protected][4]*[email protected][1])+" Zeny^000000"; if ([email protected][5]) mes " > "+Chk(getd(.Points$[0]),[email protected][5]*[email protected][1])+([email protected][5]*[email protected][1])+" "+.Points$[1]+" ("+getd(.Points$[0])+"/"+([email protected][5]*[email protected][1])+")^000000"; if ([email protected][6]) for(set [email protected],6; [email protected]<getarraysize([email protected]); set [email protected],[email protected]+2) mes " > "+Chk(countitem([email protected][[email protected]]),[email protected][[email protected]+1]*[email protected][1])+((.ShowID)?"{"[email protected][[email protected]]+"} ":"")+Slot([email protected][[email protected]])+" ("+countitem([email protected][[email protected]])+"/"+([email protected][[email protected]+1]*[email protected][1])+")^000000"; next; setarray @qe[1], getiteminfo([email protected][0],5), getiteminfo([email protected][0],11); if (((@qe[1] & 1) || (@qe[1] & 256) || (@qe[1] & 512)) && @qe[2] > 0) set [email protected],1; addtimer 1000, strnpcinfo(0)+"::OnEnd"; while(1) { switch(select(" ~ Purchase ^0055FF"+getitemname([email protected][0])+"^000000:"+(([email protected] && [email protected][6])?" ~ Preview...":"")+": ~ ^777777Cancel^000000")) { case 1: if (@qe[0]) { mes "[Coin Shop]"; mes "You're missing one or more quest requirements."; close; } if (!checkweight([email protected][0],[email protected][2])) { mes "[Coin Shop]"; mes "^FF0000You need "+((([email protected][2]*getiteminfo([email protected][0],6))+Weight-MaxWeight)/10)+" additional weight capacity to complete this trade.^000000"; close; } if ([email protected][4]) set Zeny, Zeny-([email protected][4]*[email protected][1]); if ([email protected][5]) setd .Points$[0], getd(.Points$[0])-([email protected][5]*[email protected][1]); if ([email protected][6]) for(set [email protected],6; [email protected]<getarraysize([email protected]); set [email protected],[email protected]+2) delitem [email protected][[email protected]],[email protected][[email protected]+1]*[email protected][1]; getitem [email protected][0],[email protected][2]; if (.Announce) announce strcharinfo(0)+" has created "+(([email protected][2] > 1)[email protected][2]+"x "+getitemname([email protected][0]):A_An(getitemname([email protected][0])))+"!",0; specialeffect2 699; close; case 2: setarray @qe[3], getlook(LOOK_HEAD_BOTTOM), getlook(LOOK_HEAD_TOP), getlook(LOOK_HEAD_MID), 1; if (@qe[1] & 1) changelook LOOK_HEAD_BOTTOM, @qe[2]; if (@qe[1] & 256) changelook LOOK_HEAD_TOP, @qe[2]; if (@qe[1] & 512) changelook LOOK_HEAD_MID, @qe[2]; break; case 3: close; } } OnEnd: if (@qe[6]) { changelook LOOK_HEAD_BOTTOM, @qe[3]; changelook LOOK_HEAD_TOP, @qe[4]; changelook LOOK_HEAD_MID, @qe[5]; } deletearray @qe[0],7; end; function Add { if (getitemname(getarg(1)) == "null") { debugmes "Quest reward #"+getarg(1)+" invalid (skipped)."; return; } setarray [email protected][0],getarg(2),getarg(3),getarg(4); for(set [email protected],5; [email protected]<getargcount(); set [email protected],[email protected]+2) { if (getitemname(getarg([email protected])) == "null") { debugmes "Quest requirement #"+getarg([email protected])+" invalid (skipped)."; return; } else setarray [email protected][[email protected]],getarg([email protected]),getarg([email protected]+1); } copyarray getd(".q_"+getarg(1)+"[0]"),[email protected][0],getarraysize([email protected]); npcshopadditem "qshop"+getarg(0),getarg(1),((.ShowZeny)?getarg(3):0); return; } function Chk { if (getarg(0) < getarg(1)) { set @qe[0],1; return "^FF0000"; } else return "^00FF00"; } function Slot { set [email protected]$,getitemname(getarg(0)); switch(.ShowSlot) { case 1: if (!getitemslots(getarg(0))) return [email protected]$; case 2: if (getiteminfo(getarg(0),2) == 4 || getiteminfo(getarg(0),2) == 5) return [email protected]$+" ["+getitemslots(getarg(0))+"]"; default: return [email protected]$; } } function A_An { setarray [email protected]$[0],"a","e","i","o","u"; set [email protected]$, "_"+getarg(0); for(set [email protected],0; [email protected]<5; set [email protected],[email protected]+1) if (compare([email protected]$,"_"[email protected]$[[email protected]])) return "an "+getarg(0); return "a "+getarg(0); } } function script qshop { deletearray @i[0],getarraysize(@i); for(set [email protected],0; [email protected]<getargcount(); set [email protected],[email protected]+1) set @i[[email protected]],getarg([email protected]); doevent "quest_shop::OnMenu"; end; } // Dummy shop data -- copy as needed. //============================================================ - shop qshop1 -1,909:-1 - shop qshop2 -1,909:-1 - shop qshop3 -1,909:-1 - shop qshop4 -1,909:-1 - shop qshop5 -1,909:-1 Quote Link to comment Share on other sites More sharing options...
Promise Posted September 20, 2015 Share Posted September 20, 2015 I never used this shop but with a fast view: // Dummy shop data -- copy as needed. //============================================================ - shop qshop1 -1,909:-1 - shop qshop2 -1,909:-1 - shop qshop3 -1,909:-1 - shop qshop4 -1,909:-1 - shop qshop5 -1,909:-1 u should try to add another shop (qshop6) Quote Link to comment Share on other sites More sharing options...
angryrestie Posted September 21, 2015 Share Posted September 21, 2015 I never used this shop but with a fast view: // Dummy shop data -- copy as needed. //============================================================ - shop qshop1 -1,909:-1 - shop qshop2 -1,909:-1 - shop qshop3 -1,909:-1 - shop qshop4 -1,909:-1 - shop qshop5 -1,909:-1 u should try to add another shop (qshop6) ^ - shop qshop6 -1,909:-1 Quote Link to comment Share on other sites More sharing options...
i was almost done with this quest shop, ( converted to coin shop ) i had no problem adding new shop, but up until shop 6 ( Shield card )
its not showing anything,
When i click on Shield Card Shop nothing came up but i dint get any error, could someone help me or the creator it self?
//===== rAthena Script ======================================= //= Euphy's Quest Shop //===== By: ================================================== //= Euphy //===== Current Version: ===================================== //= 1.6 //===== Compatible With: ===================================== //= rAthena SVN r16862+ //===== Description: ========================================= //= A dynamic quest shop based on Lunar's, with easier config. //= Includes support for multiple shops & cashpoints. //= Item Preview script by ToastOfDoom. //============================================================ // Shop NPCs -- supplying no argument displays entire menu. // callfunc "qshop"{,<shop ID>{,<shop ID>{,...}}}; //============================================================ prontera,159,185,6 script Coin Shop#1 998,{ callfunc "qshop"; } // Script Core //============================================================ - script quest_shop -1,{ function Add; function Chk; function Slot; function A_An; OnInit: freeloop(1); // ----------------------------------------------------------- // Basic shop settings. // ----------------------------------------------------------- set .Announce,0; // Announce quest completion? (1: yes / 0: no) set .ShowSlot,1; // Show item slots? (2: all equipment / 1: if slots > 0 / 0: never) set .ShowID,0; // 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],"<variable name>","<display name>"; // ----------------------------------------------------------- setarray .Points$[0],"#CASHPOINTS","Cash Points"; // ----------------------------------------------------------- // Shop IDs -- to add shops, copy dummy data at bottom of file. // setarray .Shops$[1],"<Shop 1>","<Shop 2>"{,...}; // ----------------------------------------------------------- setarray .Shops$[1],"Accessory Card","Armor Card","Footgear Card","Garment Card","Headgear Card","Shield Card"; // ----------------------------------------------------------- // Quest items -- do NOT use a reward item more than once! // Add(<shop ID>,<reward ID>,<reward amount>, // <Zeny cost>,<point cost>, // <required item ID>,<required item amount>{,...}); // ----------------------------------------------------------- Add(1,4344,1,0,0,28904,3); Add(1,4347,1,0,0,28904,3); Add(1,4356,1,0,0,28904,5); Add(1,4145,1,0,0,28904,20); Add(1,4215,1,0,0,28904,3); Add(1,4327,1,0,0,28904,10); Add(1,4212,1,0,0,28904,3); Add(1,4262,1,0,0,28904,3); Add(1,4293,1,0,0,28904,3); Add(1,4040,1,0,0,28904,10); Add(1,4272,1,0,0,28904,3); Add(1,4154,1,0,0,28904,1); Add(1,4385,1,0,0,28904,3); Add(1,4349,1,0,0,28904,10); Add(1,4152,1,0,0,28904,3); Add(1,4423,1,0,0,28904,5); Add(1,4418,1,0,0,28904,3); Add(1,4283,1,0,0,28904,3); Add(1,4377,1,0,0,28904,3); Add(1,4355,1,0,0,28904,5); Add(1,4331,1,0,0,28904,3); Add(1,4437,1,0,0,28904,10); Add(1,4232,1,0,0,28904,3); Add(1,4103,1,0,0,28904,10); Add(1,4384,1,0,0,28904,10); Add(1,4321,1,0,0,28904,3); Add(1,4430,1,0,0,28904,20); Add(1,4433,1,0,0,28904,10); Add(1,4139,1,0,0,28904,5); Add(1,4091,1,0,0,28904,5); Add(1,4027,1,0,0,28904,1); Add(1,4265,1,0,0,28904,10); Add(1,4193,1,0,0,28904,3); Add(1,4079,1,0,0,28904,5); Add(1,4084,1,0,0,28904,10); Add(1,4196,1,0,0,28904,1); Add(1,4205,1,0,0,28904,3); Add(1,4093,1,0,0,28904,3); Add(1,4256,1,0,0,28904,3); Add(1,4144,1,0,0,28904,20); Add(1,4238,1,0,0,28904,5); Add(1,4237,1,0,0,28904,3); Add(1,4077,1,0,0,28904,10); Add(1,4073,1,0,0,28904,5); Add(1,4389,1,0,0,28904,3); Add(1,4175,1,0,0,28904,3); Add(1,4033,1,0,0,28904,3); Add(1,4294,1,0,0,28904,1); Add(1,4436,1,0,0,28904,3); Add(1,4187,1,0,0,28904,3); Add(1,4391,1,0,0,28904,3); Add(1,4219,1,0,0,28904,3); Add(1,4326,1,0,0,28904,5); Add(1,4230,1,0,0,28904,5); Add(1,4416,1,0,0,28904,10); Add(1,4228,1,0,0,28904,5); Add(1,4044,1,0,0,28904,10); Add(1,4415,1,0,0,28904,10); Add(1,4022,1,0,0,28904,1); Add(1,4227,1,0,0,28904,10); Add(1,4424,1,0,0,28904,3); Add(1,4028,1,0,0,28904,3); Add(1,4282,1,0,0,28904,3); Add(1,4209,1,0,0,28904,5); Add(1,4053,1,0,0,28904,10); Add(1,4264,1,0,0,28904,10); Add(1,4190,1,0,0,28904,3); Add(1,4051,1,0,0,28904,3); Add(1,4064,1,0,0,28904,5); Add(2,4409,1,0,0,28904,3); Add(2,4401,1,0,0,28904,5); Add(2,4400,1,0,0,28904,5); Add(2,4387,1,0,0,28904,3); Add(2,4054,1,0,0,28904,12); Add(2,4234,1,0,0,28904,5); Add(2,4243,1,0,0,28904,5); Add(2,4242,1,0,0,28904,1); Add(2,4371,1,0,0,28904,5); Add(2,4114,1,0,0,28904,10); Add(2,4023,1,0,0,28904,1); Add(2,4233,1,0,0,28904,5); Add(2,4450,1,0,0,28904,10); Add(2,4119,1,0,0,28904,10); Add(2,4213,1,0,0,28904,10); Add(2,4426,1,0,0,28904,10); Add(2,4300,1,0,0,28904,10); Add(2,4299,1,0,0,28904,5); Add(2,4061,1,0,0,28904,5); Add(2,4298,1,0,0,28904,5); Add(2,4170,1,0,0,28904,10); Add(2,4173,1,0,0,28904,10); Add(2,4386,1,0,0,28904,12); Add(2,4181,1,0,0,28904,1); Add(2,4098,1,0,0,28904,10); Add(2,4279,1,0,0,28904,3); Add(2,4410,1,0,0,28904,1); Add(2,4346,1,0,0,28904,3); Add(2,4141,1,0,0,28904,10); Add(2,4405,1,0,0,28904,5); Add(2,4324,1,0,0,28904,20); Add(2,4280,1,0,0,28904,5); Add(2,4047,1,0,0,28904,20); Add(2,4270,1,0,0,28904,5); Add(2,4408,1,0,0,28904,20); Add(2,4150,1,0,0,28904,3); Add(2,4162,1,0,0,28904,5); Add(2,4286,1,0,0,28904,5); Add(2,4301,1,0,0,28904,10); Add(2,4295,1,0,0,28904,5); Add(2,4419,1,0,0,28904,20); Add(2,4191,1,0,0,28904,5); Add(2,4201,1,0,0,28904,10); Add(2,4105,1,0,0,28904,10); Add(2,4339,1,0,0,28904,1); Add(2,4166,1,0,0,28904,5); Add(2,4392,1,0,0,28904,3); Add(2,4338,1,0,0,28904,3); Add(2,4135,1,0,0,28904,12); Add(2,4099,1,0,0,28904,10); Add(2,4031,1,0,0,28904,3); Add(2,4315,1,0,0,28904,10); Add(2,4008,1,0,0,28904,5); Add(2,4011,1,0,0,28904,1); Add(2,4337,1,0,0,28904,3); Add(2,4001,1,0,0,28904,1); Add(2,4003,1,0,0,28904,3); Add(2,4383,1,0,0,28904,5); Add(2,4353,1,0,0,28904,3); Add(2,4021,1,0,0,28904,1); Add(2,4014,1,0,0,28904,3); Add(2,4342,1,0,0,28904,12); Add(2,4194,1,0,0,28904,10); Add(2,4101,1,0,0,28904,10); Add(2,4216,1,0,0,28904,10); Add(2,4078,1,0,0,28904,1); Add(2,4393,1,0,0,28904,3); Add(2,4222,1,0,0,28904,5); Add(2,4404,1,0,0,28904,10); Add(2,4158,1,0,0,28904,3); Add(2,4042,1,0,0,28904,3); Add(2,4218,1,0,0,28904,5); Add(2,4089,1,0,0,28904,10); Add(2,4302,1,0,0,28904,12); Add(2,4016,1,0,0,28904,1); Add(2,4369,1,0,0,28904,3); Add(2,4333,1,0,0,28904,10); Add(2,4332,1,0,0,28904,10); Add(2,4259,1,0,0,28904,1); Add(2,4189,1,0,0,28904,10); Add(2,4382,1,0,0,28904,10); Add(3,4244,1,3,0,28904,3); Add(3,4236,1,3,0,28904,10); Add(3,4160,1,3,0,28904,3); Add(3,4290,1,3,0,28904,5); Add(3,4009,1,3,0,28904,1); Add(3,4235,1,3,0,28904,10); Add(3,4168,1,3,0,28904,20); Add(3,4123,1,3,0,28904,12); Add(3,4070,1,3,0,28904,1); Add(3,4267,1,3,0,28904,10); Add(3,4319,1,3,0,28904,3); Add(3,4151,1,3,0,28904,10); Add(3,4149,1,3,0,28904,10); Add(3,4352,1,3,0,28904,12); Add(3,4378,1,3,0,28904,3); Add(3,4164,1,3,0,28904,10); Add(3,4417,1,3,0,28904,3); Add(3,4239,1,3,0,28904,10); Add(3,4376,1,3,0,28904,20); Add(3,4050,1,3,0,28904,1); Add(3,4097,1,3,0,28904,5); Add(3,4200,1,3,0,28904,3); Add(3,4199,1,3,0,28904,3); Add(3,4204,1,3,0,28904,5); Add(3,4208,1,3,0,28904,5); Add(3,4131,1,3,0,28904,20); Add(3,4186,1,3,0,28904,3); Add(3,4221,1,3,0,28904,5); Add(3,4100,1,3,0,28904,10); Add(3,4396,1,3,0,28904,3); Add(3,4107,1,3,0,28904,5); Add(3,4257,1,3,0,28904,3); Add(3,4038,1,3,0,28904,1); Add(3,4275,1,3,0,28904,3); Add(3,4435,1,3,0,28904,3); Add(4,4402,1,3,0,28904,3); Add(4,4129,1,3,0,28904,1); Add(4,4285,1,3,0,28904,5); Add(4,4373,1,3,0,28904,3); Add(4,4015,1,3,0,28904,5); Add(4,4174,1,3,0,28904,20); Add(4,4179,1,3,0,28904,3); Add(4,4178,1,3,0,28904,3); Add(4,4056,1,3,0,28904,10); Add(4,4266,1,3,0,28904,3); Add(4,4088,1,3,0,28904,10); Add(4,4303,1,3,0,28904,10); Add(4,4325,1,3,0,28904,5); Add(4,4081,1,3,0,28904,10); Add(4,4328,1,3,0,28904,10); Add(4,4116,1,3,0,28904,10); Add(4,4109,1,3,0,28904,10); Add(4,4287,1,3,0,28904,3); Add(4,4431,1,3,0,28904,5); Add(4,4351,1,3,0,28904,10); Add(4,4432,1,3,0,28904,3); Add(4,4113,1,3,0,28904,10); Add(4,4095,1,3,0,28904,10); Add(4,4197,1,3,0,28904,3); Add(4,4108,1,3,0,28904,10); Add(4,4159,1,3,0,28904,10); Add(4,4334,1,3,0,28904,10); Add(4,4375,1,3,0,28904,10); Add(4,4071,1,3,0,28904,10); Add(4,4313,1,3,0,28904,5); Add(4,4133,1,3,0,28904,10); Add(4,4422,1,3,0,28904,5); Add(4,4429,1,3,0,28904,10); Add(4,4183,1,3,0,28904,3); Add(4,4211,1,3,0,28904,3); Add(4,4210,1,3,0,28904,10); Add(4,4102,1,3,0,28904,10); Add(5,4241,1,3,0,28904,5); Add(5,4372,1,3,0,28904,20); Add(5,4438,1,3,0,28904,5); Add(5,4379,1,3,0,28904,1); Add(5,4288,1,3,0,28904,3); Add(5,4229,1,3,0,28904,5); Add(5,4041,1,3,0,28904,3); Add(5,4296,1,3,0,28904,1); Add(5,4169,1,3,0,28904,12); Add(5,4122,1,3,0,28904,10); Add(5,4177,1,3,0,28904,5); Add(5,4052,1,3,0,28904,1); Add(5,4258,1,3,0,28904,1); Add(5,4330,1,3,0,28904,12); Add(5,4354,1,3,0,28904,5); Add(5,4110,1,3,0,28904,3); Add(5,4271,1,3,0,28904,5); Add(5,4278,1,3,0,28904,3); Add(5,4087,1,3,0,28904,5); Add(5,4161,1,3,0,28904,1); Add(5,4365,1,3,0,28904,20); Add(5,4343,1,3,0,28904,1); Add(5,4269,1,3,0,28904,5); Add(5,4412,1,3,0,28904,5); Add(5,4366,1,3,0,28904,10); Add(5,4434,1,3,0,28904,3); Add(5,4195,1,3,0,28904,5); Add(5,4188,1,3,0,28904,5); Add(5,4357,1,3,0,28904,12); Add(5,4112,1,3,0,28904,10); Add(5,4364,1,3,0,28904,10); Add(5,4046,1,3,0,28904,3); Add(5,4132,1,3,0,28904,20); Add(5,4206,1,3,0,28904,3); Add(5,4127,1,3,0,28904,10); Add(5,4143,1,3,0,28904,12); Add(5,4311,1,3,0,28904,5); Add(5,4148,1,3,0,28904,12); Add(5,4358,1,3,0,28904,3); Add(5,4223,1,3,0,28904,3); Add(5,4336,1,3,0,28904,10); Add(5,4411,1,3,0,28904,10); Add(5,4374,1,3,0,28904,20); Add(5,4052,1,3,0,28904,1); Add(5,4010,1,3,0,28904,1); Add(5,4261,1,3,0,28904,3); Add(5,4260,1,3,0,28904,3); Add(6,4253,1,3,0,28904,10); Add(6,4032,1,3,0,28904,5); Add(6,4248,1,3,0,28904,3); Add(6,4013,1,3,0,28904,1); Add(6,4138,1,3,0,28904,10); Add(6,4443,1,3,0,28904,10); Add(6,4240,1,3,0,28904,1); Add(6,4075,1,3,0,28904,10); Add(6,4074,1,3,0,28904,3); Add(6,4447,1,3,0,28904,10); Add(6,4448,1,3,0,28904,10); Add(6,4449,1,3,0,28904,10); Add(6,4444,1,3,0,28904,10); Add(6,4217,1,3,0,28904,3); Add(6,4250,1,3,0,28904,10); Add(6,4439,1,3,0,28904,5); Add(6,4128,1,3,0,28904,20); Add(6,4322,1,3,0,28904,5); Add(6,4413,1,3,0,28904,10); Add(6,4045,1,3,0,28904,5); Add(6,4231,1,3,0,28904,5); Add(6,4136,1,3,0,28904,10); Add(6,4146,1,3,0,28904,20); Add(6,4124,1,3,0,28904,10); Add(6,4067,1,3,0,28904,10); Add(6,4090,1,3,0,28904,3); Add(6,4066,1,3,0,28904,5); Add(6,4309,1,3,0,28904,3); Add(6,4314,1,3,0,28904,10); Add(6,4083,1,3,0,28904,10); Add(6,4414,1,3,0,28904,10); Add(6,4120,1,3,0,28904,10); Add(6,4059,1,3,0,28904,10); Add(6,4304,1,3,0,28904,3); Add(6,4442,1,3,0,28904,10); Add(6,4397,1,3,0,28904,1); Add(6,4058,1,3,0,28904,10); Add(6,4012,1,3,0,28904,3); Add(6,4254,1,3,0,28904,10); Add(6,4277,1,3,0,28904,5); // ----------------------------------------------------------- freeloop(0); set .menu$,""; for(set [email protected],1; [email protected]<=getarraysize(.Shops$); set [email protected],[email protected]+1) { set .menu$, .menu$+.Shops$[[email protected]]+":"; npcshopdelitem "qshop"[email protected],909; } end; OnMenu: set [email protected], getarraysize(@i); if ([email protected]) set [email protected], select(.menu$); else if ([email protected] == 1) set [email protected], @i[0]; else { for(set [email protected],0; [email protected]<[email protected]; set [email protected],[email protected]+1) set [email protected]$, [email protected]$+.Shops$[@i[[email protected]]]+":"; set [email protected], @i[select([email protected]$)-1]; } deletearray @i[0],getarraysize(@i); if (.Shops$[[email protected]] == "") { message strcharinfo(0),"An error has occurred."; end; } dispbottom "Select one item at a time."; callshop "qshop"[email protected],1; npcshopattach "qshop"[email protected]; end; OnBuyItem: // [email protected][] : RewardID, BoughtAmt, RewardAmt, BaseAmt, ReqZeny, ReqPts, { ReqItem, ReqAmt, ... } setarray [email protected][0],@bought_nameid[0],((@bought_quantity[0] > .MaxStack)?.MaxStack:@bought_quantity[0]); copyarray [email protected][3],getd(".q_"[email protected][0]+"[0]"),getarraysize(getd(".q_"[email protected][0])); set [email protected][2],[email protected][1]*[email protected][3]; if ([email protected][2] || [email protected][2] > 30000) { message strcharinfo(0),"You can't purchase that many "+getitemname([email protected][0])+"."; end; } mes "[Coin Shop]"; mes "Reward: ^0055FF"+(([email protected][2] > 1)[email protected][2]+"x ":"")+Slot([email protected][0])+"^000000"; mes "Requirements:"; if ([email protected][4]) mes " > "+Chk(Zeny,[email protected][4]*[email protected][1])+([email protected][4]*[email protected][1])+" Zeny^000000"; if ([email protected][5]) mes " > "+Chk(getd(.Points$[0]),[email protected][5]*[email protected][1])+([email protected][5]*[email protected][1])+" "+.Points$[1]+" ("+getd(.Points$[0])+"/"+([email protected][5]*[email protected][1])+")^000000"; if ([email protected][6]) for(set [email protected],6; [email protected]<getarraysize([email protected]); set [email protected],[email protected]+2) mes " > "+Chk(countitem([email protected][[email protected]]),[email protected][[email protected]+1]*[email protected][1])+((.ShowID)?"{"[email protected][[email protected]]+"} ":"")+Slot([email protected][[email protected]])+" ("+countitem([email protected][[email protected]])+"/"+([email protected][[email protected]+1]*[email protected][1])+")^000000"; next; setarray @qe[1], getiteminfo([email protected][0],5), getiteminfo([email protected][0],11); if (((@qe[1] & 1) || (@qe[1] & 256) || (@qe[1] & 512)) && @qe[2] > 0) set [email protected],1; addtimer 1000, strnpcinfo(0)+"::OnEnd"; while(1) { switch(select(" ~ Purchase ^0055FF"+getitemname([email protected][0])+"^000000:"+(([email protected] && [email protected][6])?" ~ Preview...":"")+": ~ ^777777Cancel^000000")) { case 1: if (@qe[0]) { mes "[Coin Shop]"; mes "You're missing one or more quest requirements."; close; } if (!checkweight([email protected][0],[email protected][2])) { mes "[Coin Shop]"; mes "^FF0000You need "+((([email protected][2]*getiteminfo([email protected][0],6))+Weight-MaxWeight)/10)+" additional weight capacity to complete this trade.^000000"; close; } if ([email protected][4]) set Zeny, Zeny-([email protected][4]*[email protected][1]); if ([email protected][5]) setd .Points$[0], getd(.Points$[0])-([email protected][5]*[email protected][1]); if ([email protected][6]) for(set [email protected],6; [email protected]<getarraysize([email protected]); set [email protected],[email protected]+2) delitem [email protected][[email protected]],[email protected][[email protected]+1]*[email protected][1]; getitem [email protected][0],[email protected][2]; if (.Announce) announce strcharinfo(0)+" has created "+(([email protected][2] > 1)[email protected][2]+"x "+getitemname([email protected][0]):A_An(getitemname([email protected][0])))+"!",0; specialeffect2 699; close; case 2: setarray @qe[3], getlook(LOOK_HEAD_BOTTOM), getlook(LOOK_HEAD_TOP), getlook(LOOK_HEAD_MID), 1; if (@qe[1] & 1) changelook LOOK_HEAD_BOTTOM, @qe[2]; if (@qe[1] & 256) changelook LOOK_HEAD_TOP, @qe[2]; if (@qe[1] & 512) changelook LOOK_HEAD_MID, @qe[2]; break; case 3: close; } } OnEnd: if (@qe[6]) { changelook LOOK_HEAD_BOTTOM, @qe[3]; changelook LOOK_HEAD_TOP, @qe[4]; changelook LOOK_HEAD_MID, @qe[5]; } deletearray @qe[0],7; end; function Add { if (getitemname(getarg(1)) == "null") { debugmes "Quest reward #"+getarg(1)+" invalid (skipped)."; return; } setarray [email protected][0],getarg(2),getarg(3),getarg(4); for(set [email protected],5; [email protected]<getargcount(); set [email protected],[email protected]+2) { if (getitemname(getarg([email protected])) == "null") { debugmes "Quest requirement #"+getarg([email protected])+" invalid (skipped)."; return; } else setarray [email protected][[email protected]],getarg([email protected]),getarg([email protected]+1); } copyarray getd(".q_"+getarg(1)+"[0]"),[email protected][0],getarraysize([email protected]); npcshopadditem "qshop"+getarg(0),getarg(1),((.ShowZeny)?getarg(3):0); return; } function Chk { if (getarg(0) < getarg(1)) { set @qe[0],1; return "^FF0000"; } else return "^00FF00"; } function Slot { set [email protected]$,getitemname(getarg(0)); switch(.ShowSlot) { case 1: if (!getitemslots(getarg(0))) return [email protected]$; case 2: if (getiteminfo(getarg(0),2) == 4 || getiteminfo(getarg(0),2) == 5) return [email protected]$+" ["+getitemslots(getarg(0))+"]"; default: return [email protected]$; } } function A_An { setarray [email protected]$[0],"a","e","i","o","u"; set [email protected]$, "_"+getarg(0); for(set [email protected],0; [email protected]<5; set [email protected],[email protected]+1) if (compare([email protected]$,"_"[email protected]$[[email protected]])) return "an "+getarg(0); return "a "+getarg(0); } } function script qshop { deletearray @i[0],getarraysize(@i); for(set [email protected],0; [email protected]<getargcount(); set [email protected],[email protected]+1) set @i[[email protected]],getarg([email protected]); doevent "quest_shop::OnMenu"; end; } // Dummy shop data -- copy as needed. //============================================================ - shop qshop1 -1,909:-1 - shop qshop2 -1,909:-1 - shop qshop3 -1,909:-1 - shop qshop4 -1,909:-1 - shop qshop5 -1,909:-1Link to comment
Share on other sites