So I modified Happy's Script abit but I found out that the script was char-bound not account-bound. I wanted to prevent abuse so does anyone here know how to make this account-bound?
//===== Happy Scripts ================================== //= Freebee//===== By: ================================================== //= Happy//===== Current Version: ===================================== //= 1.0//===== Compatible With: ===================================== //= Hercules//===== Description: =========================================// Resettable Freebie Giver. More freeee stuffs!//===== Comments: ============================================//= Change npc coordinates and item ids/amounts etcs//===== Additional Comments: =================================//= 1.00 Initial Release//===== Contact Ifo: =========================================//= http://hercules.ws/board/user/164-happy///============================================================
new_2-1,55,115,4 script Freebies NPC 123,{
mes "[Freebie NPC]";
mes "What's up? Are you new?";
mes "What do you wanna do?";if(getgmlevel()>=.GM){set.@i,select("I'd like to claim my freebies:Leave:Reset Variables");}else{set.@i,select("I'd like to claim my freebies:Leave");}switch(.@i){case3:next;
mes "Are you sure you want to delete";
mes "ALL freebie records?";if(select("No:Yes")==1) close;next;
mes "Wait one Moment...";
mes ".....";
query_sql("DELETE FROM `char_reg_num_db` WHERE `key` = 'hpy_got_freebie'");set.@self, getcharid(3);set.@size, query_sql("select account_id from `char` where online = 1",.@aid);for(set.@i,0;.@i<.@size;set.@i,.@i+1){if(attachrid(.@aid[.@i])){set hpy_got_freebie,0;}}
attachrid(.@self);
mes "Cleared";
close;case1:next;if(!hpy_got_freebie){set hpy_got_freebie,1;for(set.@i,0;.@i< getarraysize(.hpy_freebie);set.@i,.@i+1){
getitem .hpy_freebie[.@i],.hpy_freebie_amt[.@i];}
mes "Enjoy!";}else{
mes "You already got your freebie!";}
close;case2:
close;}OnInit:/* *CONFIG */set.GM,99;// Group required to reset
setarray .hpy_freebie[0],607,608;// enter the itemids
setarray .hpy_freebie_amt[0],3,5;// enter the amount of the items/* on the example above, it gives 3x 607(ygg) and 5x 608(yggseed) */}
Share this post
Link to post
Share on other sites