I don't have my laptop now for testing. So i suggest that you test this first before deployment on your server if any :
prontera,150,150,0 script Sample 100,{
OnMinute00:
if ( ( gettime(3) % 2 ) > 0 ) end;
set .index, rand( getarraysize( .Cards ) );
set .random_card, .Cards[ .index ];
set .random_reward, .Rewards[ .index ];
announce "I need " +getitemname(.random_card)+ " card for " +.random_reward+ " premium points.",0;
sleep 2000;
announce "Talk to me at prontera 150 150 if you have one!",0;
set .start, 1;
end;
if ( !.start ) {
mes .npc$;
mes "The event has not been initiated by any Game Master.";
close;
}
mes .npc$;
mes "So, " +strcharinfo(0)+ " do you have " +getitemname(.random_card)+ "?";
next;
if ( select( "Yes:No" ) - 1 ) end;
getinventorylist;
for ( set .@i, 0; .@i < @inventorylist_count; set .@i, .@i + 1 )
if ( @inventorylist_id[.@i] == .random_card )
set .count, @inventorylist_amount[.@i];
if ( !.count ) end;
mes .npc$;
mes "Alright then. You have " +.count+ "x " +getitemname(.random_card);
next;
mes .npc$:
mes "Here is your reward!";
delitem .random_card, .count;
set #PREMIUMPOINTS, #PREMIUMPOINTS + ( .random_reward * .count );
dispbottom "You now have " +#PREMIUMPOINTS+ " premium points.";
set .start, 0;
close;
OnInit:
setarray .Cards[0],4001;
setarray .Rewards[0],20;
set .npc$, strnpcinfo(1);
end;
}
The configuration part :
setarray .Cards[0],4001;
setarray .Rewards[0],20;
Meaning item id 4001 corresponds to 20 premium points. You can put cards and rewards as many as you want with the limitation of 128 array content only. Make sure also that the both array have the same size. Meaning if you add a card id in the .Cards array then it is mandatory to put a corresponding prize to it. Set the prize on the .Rewards array