Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- prontera,172,204,4 script Joana 680,{
- function Add; function Chk; function Slot; function A_An;
- mes "[ ^008000Joana^000000 ]";
- mes "Olá, ^FF0000"+strcharinfo(0)+"^000000.";
- mes "Aqui no RagnaDIX temos um sistema de quests que funciona como uma loja que pede items.";
- next;
- mes "[ ^008000Joana^000000 ]";
- mes "Então, qual tipo de item você quer fazer?";
- next;
- if(.Shops$ != "") set .@i,1;
- else {
- set .@menu$,"";
- for(set .@i,1; .@i<=getarraysize(.Shops$); set .@i,.@i+1)
- set .@menu$, .@menu$+.Shops$[.@i]+":";
- set .@i, select(.@menu$); }
- dispbottom "Selecione um item de cada vez.";
- callshop "qshop"+.@i,1;
- npcshopattach "qshop"+.@i;
- end;
- function Add {
- if (getitemname(getarg(1))=="null") {
- debugmes "Quest reward #"+getarg(1)+" invalid (skipped)."; return; }
- for(set .@n,5; .@n<127; set .@n,.@n+2) {
- if (!getarg(.@n,0)) break;
- if (getitemname(getarg(.@n))=="null") {
- debugmes "Quest requirement #"+getarg(.@n)+" invalid (skipped)."; return; } }
- for(set .@i,2; .@i<.@n; set .@i,.@i+1)
- set getd(".q_"+getarg(1)+"["+(.@i-2)+"]"), getarg(.@i);
- npcshopadditem "qshop"+getarg(0),getarg(1),((.ShowZeny)?getarg(3):0);
- return; }
- function Chk {
- if (getarg(0)<getarg(1)) { set @qe0,1; return "^FF0000"; }
- else return "^00FF00"; }
- function Slot {
- set .@s$,getitemname(getarg(0));
- switch(.ShowSlot){
- case 1: if (!getitemslots(getarg(0))) return .@s$;
- case 2: if (getiteminfo(getarg(0),11)>0) return .@s$+" ["+getitemslots(getarg(0))+"]";
- default: return .@s$; } }
- function A_An {
- setarray .@A$[0],"a","e","i","o","u";
- set .@B$, "_"+getarg(0);
- for(set .@i,0; .@i<5; set .@i,.@i+1)
- if (compare(.@B$,"_"+.@A$[.@i])) return "an "+getarg(0);
- return "a "+getarg(0); }
- OnBuyItem:
- set .@q[0],@bought_nameid;
- copyarray .@q[1],getd(".q_"+@bought_nameid+"[0]"),getarraysize(getd(".q_"+@bought_nameid+"[0]"));
- if (!.@q[1]) { message strcharinfo(0),"An error has occurred."; end; }
- mes "[ ^008000Quest Shop^000000 ]";
- mes "Recompensa: ^0055FF"+((.@q[1]>1)?.@q[1]+"x ":"")+Slot(.@q[0])+"^000000";
- mes "Requerimentos:";
- if (.@q[2]) mes " > "+Chk(Zeny,.@q[2])+.@q[2]+" Zeny^000000";
- if (.@q[3]) mes " > "+Chk(getd(.Points$[0]),.@q[3])+.@q[3]+" "+.Points$[1]+" ("+getd(.Points$[0])+"/"+.@q[3]+")^000000";
- if (.@q[4]) for(set .@i,4; .@i<getarraysize(.@q); set .@i,.@i+2)
- mes " > "+Chk(countitem(.@q[.@i]),.@q[.@i+1])+((.DisplayID)?"{"+.@q[.@i]+"} ":"")+Slot(.@q[.@i])+" ("+countitem(.@q[.@i])+"/"+.@q[.@i+1]+")^000000";
- next;
- set @qe1, getiteminfo(.@q[0],5); set @qe2, getiteminfo(.@q[0],11);
- addtimer 1000, strnpcinfo(1)+"::OnEnd";
- while(1){
- switch(select("[^008000»^000000] Fazer ^0055FF"+getitemname(.@q[0])+"^000000:"+((((@qe1&1) || (@qe1&256) || (@qe1&512)) && @qe2>0 && !@qe6)?"[^008000»^000000] Experimentar Item.":"")+": ^777777Cancel.^000000")) {
- case 1:
- if (@qe0) {
- mes "[ ^008000Quest Shop^000000 ]";
- mes "Você está esquecendo um ou mais requisitos da quest.";
- close; }
- if (!checkweight(.@q[0],.@q[1])) {
- mes "[ ^008000Quest Shop^000000 ]";
- mes "^FF0000You need "+(((.@q[1]*getiteminfo(.@q[0],6))+Weight-MaxWeight)/10)+" additional weight capacity to complete this trade.^000000";
- close; }
- if (.@q[2]) set Zeny, Zeny-.@q[2];
- if (.@q[3]) setd .Points$[0], getd(.Points$[0])-.@q[3];
- if (.@q[4]) for(set .@i,4; .@i<getarraysize(.@q); set .@i,.@i+2)
- delitem .@q[.@i],.@q[.@i+1];
- getitem .@q[0],.@q[1];
- if (.Announce) announce strcharinfo(0)+" acabou de criar seu item: "+(getitemname(.@q[0]))+"!",0;
- specialeffect2 699;
- close;
- case 2:
- set @qe3, getlook(3); set @qe4, getlook(4); set @qe5, getlook(5);
- if (@qe1&1) atcommand "@changelook 3 "+@qe2;
- if (@qe1&256) atcommand "@changelook 1 "+@qe2;
- if (@qe1&512) atcommand "@changelook 2 "+@qe2;
- set @qe6,1;
- break;
- case 3:
- close; } }
- OnEnd:
- if (@qe6) { atcommand "@changelook 3 "+@qe3; atcommand "@changelook 1 "+@qe4; atcommand "@changelook 2 "+@qe5; }
- for(set .@i,0; .@i<7; set .@i,.@i+1) setd "@qe"+.@i,0;
- end;
- OnPCLoadMapEvent:
- if( strcharinfo(3) == strnpcinfo(4) )
- showevent 1,0;
- end;
- OnInit:
- freeloop(1);
- // --------------------- Config ---------------------
- // Custom points, if needed: "<variable>","<name to display>"
- setarray .Points$[0],"#CASHPOINTS","Cash Points";
- set .Announce,1; // Announce quest completion? (1: yes / 0: no)
- set .ShowSlot,2; // Show item slots? (2: all equipment / 1: if slots > 0 / 0: never)
- set .DisplayID,1; // Show item IDs? (1: yes / 0: no)
- set .ShowZeny,0; // 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],"[^008000»^000000] Equipamentos Para Cabeça [Topo].","[^008000»^000000] Equipamentos Para Cabeça [Meio].","[^008000»^000000] Equipamentos Para Cabeça [Baixo].","[^008000»^000000] Visual.","[^008000»^000000] Acessórios.","[^008000»^000000] Equipamentos.";
- // set .Shops$,"n/a";
- // Add(<shop number>,<reward ID>,<reward amount>,<Zeny cost>,<point cost>,
- // <required item ID>,<required item amount>{,...});
- // Shop number corresponds with order above (default is 1).
- // Note: Do NOT use a reward item more than once!
- Add(1,5506,1,500000,0,5076,1,978,1,949,1000);
- Add(1,5507,1,500000,0,5076,1,975,1,949,1000);
- Add(1,5360,1,500000,0,2213,1,983,1,914,500);
- sleep 10;
- Add(1,5388,1,5000000,0,2229,1,979,1,954,300,926,300);
- Add(1,5208,1,5000000,0,7063,600,7182,300,1052,50);
- //Add(1,20038,1,5000000,0,7063,600,7182,300,1052,50);
- //Add(1,20039,1,5000000,0,7063,600,7182,300,1052,50);
- //Add(1,20040,1,5000000,0,7063,600,7182,300,1052,50);
- //Add(1,20041,1,5000000,0,7063,600,7182,300,1052,50);
- //Add(1,20051,1,5000000,0,7063,600,7182,300,1052,50);
- Add(2,20002,1,5000000,0,1099,500,548,200,724,100);
- //Add(2,20201,1,5000000,0,727,400,7323,100,724,100);
- //Add(2,20202,1,5000000,0,999,600,951,600,724,100);
- //Add(2,20211,1,5000000,0,1055,500,936,200,724,100);
- //Add(2,20219,1,5000000,0,1037,400,928,600,724,100);
- Add(3,20003,1,5000000,0,921,600,7220,300,7225,20);
- //Add(3,20401,1,5000000,0,7066,600,945,300,7225,20);
- //Add(3,20402,1,5000000,0,1019,600,7106,300,7225,20);
- //Add(3,20403,1,5000000,0,996,600,1011,300,7225,20);
- //Add(3,20404,1,5000000,0,746,600,971,400,7225,20);
- sleep 10;
- //Add(3,20412,1,5000000,0,1021,600,972,200,7225,20);
- //Add(3,20419,1,5000000,0,713,600,970,200,7225,20);
- Add(4,20004,1,5000000,0,22029,10,22002,1,7773,500);
- //Add(4,20830,1,5000000,0,22029,10,22002,1,7773,500);
- //Add(4,20831,1,5000000,0,22029,10,22002,1,7773,500);
- //Add(4,20832,1,5000000,0,22029,10,22002,1,7773,500);
- //Add(4,20833,1,5000000,0,22029,10,22002,1,7773,500);
- //Add(4,20834,1,5000000,0,22029,10,22002,1,7773,500);
- Add(5,20010,1,5000000,0,931,1000,7214,30,7112,30);
- //Add(5,21504,1,5000000,0,931,1000,7214,30,7112,30);
- //Add(5,21503,1,5000000,0,931,1000,7214,30,7112,30);
- //Add(5,21500,1,5000000,0,931,1000,7214,30,7112,30);
- //Add(5,21505,1,5000000,0,931,1000,7214,30,7112,30);
- //Add(5,21502,1,5000000,0,931,1000,7214,30,7112,30);
- Add(6,2463,1,10000000,0,7074,2,7831,3,7075,4,7078,5,7087,5,7089,5,7830,5);
- //Add(6,25001,1,10000000,0,7080,4,7081,5,7082,4,7084,3,7085,3,7836,5,7837,5);
- //Add(6,25002,1,10000000,0,7073,4,7077,4,7088,3,7090,3,7092,3,7834,5,7835,5);
- //Add(6,25003,1,10000000,0,7076,3,7079,5,7083,3,7086,3,7832,5,7833,5);
- // --------------------------------------------------
- freeloop(0);
- for(set .@i,1; .@i<=getarraysize(.Shops$); set .@i,.@i+1)
- npcshopdelitem "qshop"+.@i,909;
- end;
- }
- // -------- Dummy data (duplicate 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
- - shop qshop6 -1,909:-1
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement