Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //-----------------------------------------------
- //---------------- Points Trader --------------
- //-----------------------------------------------
- prontera,140,169,5 script Hourly Points Shop 405,{
- if(getgmlevel() >= 60) {
- mes "[ Hourly Points Shop ]";
- mes "Hello "+strcharinfo(0);
- mes "What can I help you with today?";
- menu "Normal Menu",Normalmenu,"GM Menu",gmmenushop;
- gmmenushop:
- callfunc "Event_Points_Viewer";
- end;
- }
- Normalmenu:
- callshop "Donator_SHOP#02",1;
- npcshopattach "Donator_SHOP#02";
- message strcharinfo(0),"You currently have ["+#KAFRAPOINTS+"] Hourly Points.";
- end;
- OnBuyItem:
- for(set @i,0; @i < getarraysize(@bought_nameid); set @i,@i+1) {
- for(set @j,0; @j < getarraysize(.POD_ITEMS); set @j,@j+2) {
- if(.POD_ITEMS[@j] == @bought_nameid[@i]) {
- set @itemcost,(.POD_ITEMS[(@j+1)]*@bought_quantity[@i]);
- set @totalcost,(@totalcost+@itemcost);
- break;
- }
- }
- }
- if(@totalcost > #KAFRAPOINTS) {
- message strcharinfo(0),"You don't have enough Hourly Points.";
- } else {
- for(set @i,0; @i < getarraysize(@bought_nameid); set @i,@i+1) {
- getitem @bought_nameid[@i],@bought_quantity[@i];
- }
- set #KAFRAPOINTS,#KAFRAPOINTS-@totalcost;
- //delitem .pod_item,@totalcost;
- message strcharinfo(0),"You now have ["+#KAFRAPOINTS+"] Hourly Points left.";
- }
- set @totalcost,0;
- deletearray @bought_nameid[0],128;
- deletearray @bought_quantity[0],128;
- end;
- OnInit:
- npcshopdelitem "Donator_SHOP#02",909;
- set .name$,"^9933FF[Kafra Point Trader]^000000";
- setarray .POD_ITEMS[0],12215,1,12216,1,12218,3,12114,2,12115,2,12116,2,12117,2,14517,3,14518,3,14519,3,14520,3,14545,2,13517,15,30110,15,30021,1000,30004,1000,7086,3000,7077,3000,7078,3000,7079,3000,7088,3000,7089,3000,7090,3000,7091,3000,7092,3000,; // Input as many items as you want (item::price)
- for(set .@i,0; .@i < getarraysize(.POD_ITEMS); set .@i,.@i+2) {
- npcshopadditem "Donator_SHOP#02",.POD_ITEMS[.@i],.POD_ITEMS[(.@i+1)];
- }
- }
- - shop Donator_SHOP#02 139,909:10
Add Comment
Please, Sign In to add comment