prontera,123,81,5 script Xmas Trader 116,{
set .@name$,"[^FF0000Libby^000000]";
mes .@name$;
mes "Hello!";
mes "Can you fetch us some ingredients";
mes "we need for my Christmas recipe?";
mes "We'll be glad to exchange them ";
mes "with a Xmas gift!";
next;
mes .@name$;
mes "Me and Ana Lucia will give you ^0055FF"+.Points[0]+" Point"+((.Points[0] == 1)?"":"s")+"^000000 for each ingredient";
mes "you give us.";
mes "You can trade those points with Ana Luciafor a Xmas Gift later on.";
next;
mes .@name$;
mes "How does that sound?";
next;
switch( select("Exchange ^0055FFCandy^000000","Exchange ^0055FFCandy Cane^000000","Exchange ^0055FFWell-baked Cookie^000000") ) {
case 1:
mes .@name$;
mes "How many Candy will you exchange?";
input .@num;
next;
if( .@num <= 0 || countitem(529) < .@num ) {
mes .@name$;
mes "Sorry, you don't have enough Candy!";
close;
}
if( select("Proceed:Nevermind") -1 ) {
mes .@name$;
mes "Goodbye!";
close;
}
set #Xmas_Points, #Xmas_Points + 5;
dispbottom "Gained: " +(.@num)+ " Xmas Points. Total: " +#Xmas_Points+" Xmas Points.";
delitem 529,.@num;
break;
case 2:
mes .@name$;
mes "How many Candy Cane will you exchange?";
input .@num;
next;
if( .@num <= 0 || countitem(530) < .@num ) {
mes .@name$;
mes "Sorry, you don't have enough Candy Cane!";
close;
}
if( select("Proceed:Nevermind") -1 ) {
mes .@name$;
mes "Goodbye!";
close;
}
set #Xmas_Points, #Xmas_Points + 5;
dispbottom "Gained: " +(.@num)+ " Xmas Points. Total: " +#Xmas_Points+" Xmas Points.";
delitem 530,.@num;
break;
case 3:
mes .@name$;
mes "How many Well-baked Cookie will you exchange?";
input .@num;
next;
if( .@num <= 0 || countitem(538) < .@num ) {
mes .@name$;
mes "Sorry, you don't have enough Well-baked Cookie!";
close;
}
if( select("Proceed:Nevermind") -1 ) {
mes .@name$;
mes "Goodbye!";
close;
}
set #Xmas_Points, #Xmas_Points + 5;
dispbottom "Gained: " +(.@num)+ " Xmas Points. Total: " +#Xmas_Points+" Xmas Points.";
delitem 538,.@num;
}
close;
}
================================================================================
//===== rAthena Script =======================================
//= Card Trader
//===== By: ==================================================
//= Euphy
//===== Current Version: =====================================
//= 1.1
//===== Compatible With: =====================================
//= rAthena SVN
//===== Description: =========================================
//= Exchange cards for points.
//============================================================
prontera,123,83,6 script Xmas Trader Shop 90,{
mes "[Card Trader]";
mes "Hi, "+strcharinfo(0)+"!";
mes "What can I do for you?";
next;
switch(select(" > Point shop (^0055FF"+getd(.XPoints$)+"^000000): > Leave")) {
case 1:
mes "[Card Trader]";
mes "You have ^0055FF"+getd(.XPoints$)+"^000000 Point"+((getd(.XPoints$) == 1)?".":"s.");
callshop "xmas_shop",1;
npcshopattach "xmas_shop";
end;
case 2:
mes "[Card Trader]";
mes "*yawn*";
mes "See you later!";
emotion e_yawn;
close;
}
OnBuyItem:
for(set .@i,0; .@i < getarraysize(@bought_nameid); set .@i,.@i+1)
for(set .@j,0; .@j <getarraysize(.Shop); set .@j,.@j+2)
if (@bought_nameid[.@i] == .Shop[.@j]) {
set .@cost, .@cost+(.Shop[.@j+1]*@bought_quantity[.@i]);
break;
}
if (.@cost > getd(.XPoints$)) {
mes "[Card Trader]";
mes "You don't have enough Points.";
emotion e_omg;
}
else {
mes "Items purchased:";
mes "-----------------------------------";
for(set .@i,0; .@i < getarraysize(@bought_nameid); set .@i,.@i+1) {
getitem @bought_nameid[.@i], @bought_quantity[.@i];
mes " ^777777"+@bought_quantity[.@i]+"x "+getitemname(@bought_nameid[.@i])+"^000000";
}
mes " ";
mes "---------- Total: ^0055FF"+.@cost+" pt.^000000 -------";
setd .XPoints$, getd(.XPoints$)-.@cost;
emotion e_cash;
}
deletearray @bought_nameid[0], getarraysize(@bought_nameid);
deletearray @bought_quantity[0], getarraysize(@bought_quantity);
close;
OnInit:
set .Level,0; // Minimum monster level to trade corresponding cards.
set .XPoints$,"#Xmas_Points"; // Variable to store points.
setarray .Shop[0], // Shop items: <ID>,<point cost>
12355,15;
setarray .XPoints[0],1,5; // Points per <normal card>,<MVP card>
npcshopdelitem "xmas_shop",909;
for(set .@i,0; .@i < getarraysize(.Shop); set .@i,.@i+2)
npcshopadditem "xmas_shop",.Shop[.@i],.Shop[.@i+1];
end;
}
- shop xmas_shop -1,909:-1