- shop costume_shop -1,501:-1
prontera,150,180,5 script bghjkl 58,{
mes "Hi Good Day! Do you have spare costumes !";
mes "that you wanna get rid of?";
next;
set .@s, select( "No ! Goood bye.", "Trade", "More informations" );
if( .@s == 1 )
mes "Okay have a nice day.";
else if( .@s == 3 ) {
mes "blabla more informations.";
}
getinventorylist;
.@calc = 1024|2048|4096|8192;// to lazy to calculate
for( set .@i, 0; .@i < @inventorylist_count; set .@i, .@i + 1 )
if( !@inventorylist_expire[.@i] ) {
if ( getiteminfo( @inventorylist_id[.@i],5 ) & .@calc ) {
for( set .@j, 0; .@j < @inventorylist_amount[.@i]; set .@j, .@j + 1 ) {
set .@list_id[ .@size_shop ], @inventorylist_id[.@i];
set .@size_shop, .@size_shop + 1;
}
}
}
if( !.@size_shop )
mes "Hmm I don't see any costumes on your inventory. Please check your inventory.";
else {
mes "Okay, here's a list of the costumes in your inventory.";
next;
npcshopitem "costume_shop",501,-1;
for( set .@i, 0; .@i < .@size_shop; set .@i, .@i + 1 )
npcshopadditem "costume_shop",.@list_id[.@i],0;
npcshopdelitem "costume_shop",501;
callshop "costume_shop", 1;
npcshopattach "costume_shop";
}
end;
OnBuyItem:
// if( !checkweight2( .reward_ID,.reward_amount ) ) {
// message strcharinfo(0),"You need additional weight capacity to complete this trade.";
// close;
// }
set .@count, getarraysize( @bought_nameid );
for( set .@i, 0; .@i < .size_count; set .@i, .@i + 1 ) {// don't check the weight..
set .@check, .reward_amount[.@i] * .@count;
if( .@check > 30000 ) {
message strcharinfo(0),"You can't purchase that many "+ getitemname( .reward_ID[.@i] ) +".";
end;
}
set .@gain$, .@gain$ + ( getstrlen( .@gain$ ) ? ", " : "" ) + .@check +" "+ getitemname( .reward_ID[.@i] );
}
mes "Sell the costume for "+ .@gain$ +"?";
next;
if( select( "Yes, I sell", "No" ) -1 ) end;
for( set .@i, 0; .@i < .@count; set .@i, .@i + 1 )
if ( countitem( @bought_nameid[.@i] ) < @bought_quantity[.@i] ) {
mes "Have you lost one item?";
close;
}
for( set .@i, 0; .@i < .@count; set .@i, .@i + 1 )
delitem @bought_nameid[.@i], @bought_quantity[.@i];
for( set .@i, 0; .@i < .size_count; set .@i, .@i + 1 )
getitem .reward_ID[.@i], .reward_amount[.@i] * .@count;
mes "Good bye.";
close;
OnInit:
setarray .reward_ID, 7539; // item ID gained - you can add more ID <item ID>, <item ID>,...
setarray .reward_amount, 10; // item count gained - ( count of the item /element of array of .reward_ID )
set .size_count, getarraysize( .reward_amount );
end;
}