Hi ! Im using Euphy's Quest NPC for my donation .. I just want to ask how to enable multi purchase ??? It allows buying single item only ..Please help I need this one ,., Thankyou
//===== rAthena Script =======================================
//= Euphy's Quest Shop
//===== By: ==================================================
//= Euphy
//===== Update Hat Maker By: ==================================================
//= Boy
//===== Current Version: =====================================
//= 1.4a
//===== Compatible With: =====================================
//= rAthena SVN r15340+
//===== Description: =========================================
//= A dynamic quest shop based on Lunar's, with easier config.
//= Includes support for multiple shops & cashpoints.
//= Item Preview script by ToastOfDoom.
//============================================================
brasilis,277,226,4 script Donation Shop 859,{
function Add; function Chk; function Slot; function A_An;
mes "[Aureus Kafra]";
mes "Welcome to ^FF0000Regular Donation Shop^000000 "+strcharinfo(0)+"!";
mes "Here you can buy ^0000FFDonation Items^000000.";
mes "This is to help our server to keep running.";
mes "You can also acquire ^0000FFAureus Tokens^000000 from streamer's event";
mes "Please, select shop category.";
if(.Shops$ != "") set [email protected],1;
else {
set [email protected]$,"";
for(set [email protected],1; [email protected]<=getarraysize(.Shops$); set [email protected],[email protected]+1)
set [email protected]$, [email protected]$+.Shops$[[email protected]]+":";
set [email protected], select([email protected]$); }
dispbottom "Select one item at a time.";
callshop "donationshop"[email protected],1;
npcshopattach "donationshop"[email protected];
end;
function Add {
if (getitemname(getarg(1))=="null") {
debugmes "Quest reward #"+getarg(1)+" invalid (skipped)."; return; }
for(set [email protected],5; [email protected]<127; set [email protected],[email protected]+2) {
if (!getarg([email protected],0)) break;
if (getitemname(getarg([email protected]))=="null") {
debugmes "Quest requirement #"+getarg([email protected])+" invalid (skipped) on Quest ItemID "+ getarg(1) +"."; return; } }
for(set [email protected],2; [email protected]<[email protected]; set [email protected],[email protected]+1)
set getd(".q_"+getarg(1)+"["+([email protected])+"]"), getarg([email protected]);
npcshopadditem "donationshop"+getarg(0),getarg(1),((.ShowZeny)?getarg(3):0);
return; }
function Chk {
if (getarg(0)<getarg(1)) { set @qe0,1; return"^FF0000"; }
elsereturn"^00FF00"; }
functionSlot {
set[email protected]s$,getitemname(getarg(0));
switch(.ShowSlot){
case 1: if (!getitemslots(getarg(0))) return[email protected]s$;
case 2: if (getiteminfo(getarg(0),11)>0) 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); }
OnBuyItem:
set [email protected][0],@bought_nameid;
copyarray [email protected][1],getd(".q_"[email protected]_nameid+"[0]"),getarraysize(getd(".q_"[email protected]_nameid+"[0]"));
if ([email protected][1]) { message strcharinfo(0),"An error has occurred."; end; }
mes "[Quest Shop]";
mes "Reward: ^0055FF"+(([email protected][1]>1)[email protected][1]+"x ":"")+Slot([email protected][0])+"^000000";
mes "Requirements:";
if ([email protected][2]) mes " > "+Chk(Zeny,[email protected][2])[email protected][2]+" Zeny^000000";
if ([email protected][3]) mes " > "+Chk(getd(.Points$[0]),[email protected][3])[email protected][3]+" "+.Points$[1]+" ("+getd(.Points$[0])+"/"[email protected][3]+")^000000";
if ([email protected][4]) for(set [email protected],4; [email protected]<getarraysize([email protected]q); set[email protected]i,[email protected]i+2)
mes" > "+Chk(countitem([email protected][[email protected]]),[email protected][[email protected]+1])+((.DisplayID)?"{"[email protected][[email protected]]+"} ":"")+Slot([email protected][[email protected]])+" ("+countitem([email protected][[email protected]])+"/"[email protected][[email protected]+1]+")^000000";
next;
set @qe1, getiteminfo([email protected][0],5); set @qe2, getiteminfo([email protected][0],11);
addtimer 1000, strnpcinfo(1)+"::OnEnd";
while(1){
switch(select(" ~ Purchase ^0055FF"+getitemname([email protected][0])+"^000000:"+((((@qe1&1) || (@qe1&256) || (@qe1&512) || (@qe1&1024) || (@qe1&2048) || (@qe1&4096) || (@qe1&8192) || (@qe1&65536)) && @qe2>0 && [email protected])?" ~ Preview...":"")+": ~ ^777777Cancel^000000")) {
case 1:
if (@qe0) {
mes "[Quest Shop]";
mes "You're missing one or more quest requirements.";
close; }
if (!checkweight([email protected][0],[email protected][1])) {
mes "[Quest Shop]";
mes "^FF0000You need "+((([email protected][1]*getiteminfo([email protected][0],6))+Weight-MaxWeight)/10)+" additional weight capacity to complete this trade.^000000";
close; }
if ([email protected][2]) set Zeny, [email protected][2];
if ([email protected][3]) setd .Points$[0], getd(.Points$[0])[email protected][3];
if ([email protected][4]) for(set [email protected],4; [email protected]<getarraysize([email protected]); set [email protected],[email protected]+2)
delitem [email protected][[email protected]],[email protected][[email protected]+1];
getitem [email protected][0],[email protected][1];
if (.Announce) announce strcharinfo(0)+" has purchased "+A_An(getitemname([email protected][0]))+" from Donation Shop!",0;
specialeffect2 699;
close;
case 2:
set @qe3, getlook(3); set @qe4, getlook(4); set @qe5, getlook(5);
if (@qe1&1) atcommand "@changelook 3 "[email protected];
if (@qe1&256) atcommand "@changelook 1 "[email protected];
if (@qe1&512) atcommand "@changelook 2 "[email protected];
if (@qe1&1024) atcommand "@changelook 1 "[email protected];
if (@qe1&2048) atcommand "@changelook 2 "[email protected];
if (@qe1&4096) atcommand "@changelook 3 "[email protected];
if (@qe1&8192) atcommand "@changelook 7 "[email protected];
if (@qe1&65536) atcommand "@changelook 4 "[email protected];
set @qe6,1;
break;
case 3:
close; } }
OnEnd:
if (@qe6) { atcommand "@changelook 3 "[email protected]; atcommand "@changelook 1 "[email protected]; atcommand "@changelook 2 "[email protected]; atcommand "@changelook 7 "[email protected];atcommand "@changelook 4 "[email protected]; }
for(set [email protected],0; [email protected]<7; set [email protected],[email protected]+1) setd "@qe"[email protected],0;
end;
OnInit:
//waitingroom "[Quest Costumes]",0;
// --------------------- Config ---------------------
// Custom points, if needed: "<variable>","<nametodisplay>"
setarray .Points$[0],"#CASHPOINTS","Cash Points";
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 .DisplayID,0; // Show item IDs? (1: yes / 0: no)
set .ShowZeny,1; // Show Zeny cost, if any? (1: yes / 0: no)
// Shop categories, if needed: "<Shop 1>","<Shop 2>"{,...};
// Duplicate dummy data for any additional shops (bottom of script).
// If no categories, use the second line instead (remove //).
setarray .Shops$[1],"Headgear Quest";
//set .Shops$,"n/a";
setarray .Shops$[1],"~ New Release";
setarray .Shops$[2],"~ Popular Items";
setarray .Shops$[3],"~ Limited Scrolls";
setarray .Shops$[4],"~ Rental Items";
setarray .Shops$[5],"~ Permanent Equipments";
setarray .Shops$[6],"~ Usables & ETC";
// Add(<shopnumber>,<rewardID>,<rewardamount>,<Zenycost>,<pointcost>,
// <requireditemID>,<requireditemamount>{,...});
// Shop number corresponds with order above (default is 1).
// Note: Do NOT use a reward item more than once!
sleep 10;
Add(1,33030,1,0,0,6732,195);
Add(1,502,1,0,0,7179,2400);
Add(1,33032,1,0,0,6732,750);
Add(1,33033,1,0,0,6732,1200);
Add(1,33034,1,0,0,6732,2400);
sleep 10;
Add(2,34000,1,0,0,7179,2400);
Add(2,34001,1,0,0,7179,2400);
Add(2,34002,1,0,0,7179,2400);
Add(2,34003,1,0,0,7179,2400);
Add(2,34004,1,0,0,7179,2400);
Add(2,34005,1,0,0,7179,2400);
Add(2,34006,1,0,0,7179,2400);
Add(2,34007,1,0,0,7179,2400);
Add(2,34008,1,0,0,7179,2400);
Add(2,34009,1,0,0,7179,2400);
Add(2,34010,1,0,0,7179,2400);
Add(2,34011,1,0,0,7179,2400);
sleep 10;
Add(3,14296,1,0,0,7179,60);
Add(3,14297,1,0,0,7179,60);
Add(3,12785,1,0,0,7179,60);
sleep 10;
Add(4,17229,1,0,0,7179,450);
Add(4,16683,1,0,0,7179,600);
Add(4,16682,1,0,0,7179,210);
sleep 10;
Add(5,5536,1,0,0,6732,1050);
Add(5,5597,1,0,0,7179,1800);
Add(5,5423,1,0,0,7179,2400);
Add(5,5137,1,0,0,7179,2100);
Add(5,5314,1,0,0,7179,2100);
Add(5,5225,1,0,0,7179,2100);
Add(5,5278,1,0,0,7179,2400);
Add(5,5325,1,0,0,7179,2400);
Add(5,5800,1,0,0,7179,2400);
Add(5,5362,1,0,0,7179,2100);
Add(5,5377,1,0,0,7179,2100);
Add(5,5490,1,0,0,7179,2100);
Add(5,5462,1,0,0,7179,2100);
sleep 10;
Add(6,12412,1,0,0,7179,135);
Add(6,12210,1,0,0,7179,75);
// --------------------------------------------------
for(set [email protected],1; [email protected]<=getarraysize(.Shops$); set [email protected],[email protected]+1)
npcshopdelitem "donationshop"[email protected],909;
end;
}
// -------- Dummy data (duplicate as needed) --------
- shop donationshop1 -1,909:-1,1
- shop donationshop2 -1,909:-1,1
- shop donationshop3 -1,909:-1,1
- shop donationshop4 -1,909:-1,1
- shop donationshop5 -1,909:-1,1
- shop donationshop6 -1,909:-1,1
Hi ! Im using Euphy's Quest NPC for my donation .. I just want to ask how to enable multi purchase ??? It allows buying single item only ..Please help I need this one ,., Thankyou
Link to comment
Share on other sites