Jump to content

fireicesurfer

Members
  • Posts

    101
  • Joined

  • Last visited

Posts posted by fireicesurfer

  1. Hello guys.  Im confused where to put this code.

    I dont have ANY IDEA where and what is SQL Table. Help me please

    //SQL Table for Ghost's PvP System
    CREATE TABLE IF NOT EXISTS `pvp_rank` (
     `char_id` int(11) NOT NULL,
     `account_id` int(11) NOT NULL,
     `char` varchar(30) NOT NULL,
     `kill` int(11) NOT NULL,
     `death` int(11) NOT NULL,
     `kdr` varchar(30) NOT NULL,
     `killingstreak` int(11) NOT NULL,
     `multikill` int(11) NOT NULL,
     `killingspree` int(11) NOT NULL,
     `dominating` int(11) NOT NULL,
     `megakill` int(11) NOT NULL,
     `unstoppable` int(11) NOT NULL,
     `wickedsick` int(11) NOT NULL,
     `monsterkill` int(11) NOT NULL,
     `godlike` int(11) NOT NULL,
     `beyondgodlike` int(11) NOT NULL,
     `doublekill` int(11) NOT NULL,
     `triplekill` int(11) NOT NULL,
     `ultrakill` int(11) NOT NULL,
     `rampage` int(11) NOT NULL,
     `ownage` int(11) NOT NULL,
     `nemesiskill` int(11) NOT NULL,
     `feedcount` int(11) NOT NULL,
     PRIMARY KEY (`char_id`)
    ) ENGINE=MyISAM DEFAULT CHARSET=latin1;

     

  2. 6 minutes ago, Haruka Mayumi said:

    You need to click the CODEBOX first before you insert/paste the script. you must not highlight then click CODEBOX, this will make the code broken..

    Simply add this 

    
    OnInit:
    	waitingroom "Quest Board",0;
    	function AddCollection;
    	function AddHunting;

    Unbelievable. I tried it earlier on my end. didnt worked. But your touches makes my day and server complete. Thank You so much! Youre the best!!!!

  3. 2 hours ago, Haruka Mayumi said:

    1. Quest Board

    
    //===== rAthena Script =======================================
    //= tr0n's Questboard
    //===== By: ==================================================
    //= tr0n
    //===== Current Version: =====================================
    //= 1.6.5
    //===== Description: =========================================
    //= Easily add collection and hunting quests.
    //===== Changelogs: ==========================================
    // 1.0.0 Release
    // 1.1.0 Added zeny reward
    // 1.2.0 Rewrote checkmob and killcounter
    // 1.3.1 Added level restriction
    // 1.3.4 Added Reward Item Amount
    // 1.4.4 Added Quest delay
    // 1.5.4 Added repeatable Quests
    // 1.6.4 Added party support
    // 1.6.5 Bug fixes for party support
    //============================================================
    prontera,147,173,5	script	Event Monsters	676,{
    
    	if(c_run==true){
    		mes "[^FF7700Questboard^000000]";
    		mes "^0000FF"+getd("." + currentquest$ + "_collectionname$")+"^000000";
    		mes "--------------------------------";
    		set .@size, getarraysize(getd("."+ currentquest$ + "_collectionitem"));
    		for( set .@j, 0; .@j < .@size; set .@j,.@j+2){
    			mes "^FF0000"+getitemname(getd("."+currentquest$+"_collectionitem["+.@j
    
    +"]"))+" - "+countitem(getd("."+currentquest$+"_collectionitem["+.@j+"]"))+"/"+getd("."+currentquest
    
    $+"_collectionitem["+(.@j+1)+"]")+" ea.^000000";
    		}
    		mes "--------------------------------";
    		mes "[Reward]";
    		mes "Item: ^0000FF"+((getd("." +currentquest$+"_collectionprize"))?getitemname(getd
    
    ("." +currentquest$+"_collectionprize"))+" - "+getd("." +currentquest$+"_collectionamount")+" 
    
    ea.^000000":"Nothing^000000");
    		mes "Zeny: ^0000FF"+getd("." +currentquest$+"_collectionzeny")+"^000000";
    		mes "Base EXP: ^0000FF"+getd("." +currentquest$+"_collectionexp["+0+"]")+"^000000";
    		mes "Job EXP: ^0000FF"+getd("." +currentquest$+"_collectionexp["+1+"]")+"^000000";
    		next;
    		if(select("Finish:Abort") == 2){
    			mes "[^FF7700Questboard^000000]";
    			mes "Quest aborted.";
    			set currentquest$, "";
    			set c_run, false;
    			close;
    		}
    		goto L_checkitems;
    	}
    
    	if(h_run==true){
    		mes "[^FF7700Questboard^000000]";
    		mes "^0000FF"+getd("." + currentquest$ + "_huntingname$")+"^000000";
    		mes "--------------------------------";
    		set .@size, getarraysize(getd("."+ currentquest$ + "_huntingmob"));
    		for( set .@j, 0; .@j < .@size; set .@j,.@j+2){
    			set .@currentmob, getd("."+currentquest$+"_huntingmob["+(.@j)+"]");
    			mes "^FF0000"+strmobinfo(1,getd("."+currentquest$+"_huntingmob["+.@j+"]"))+" 
    
    - "+getd(currentquest$+"_"+.@currentmob+"_"+(.@j+1)+"_killcount")+"/"+getd("."+currentquest$
    
    +"_huntingmob["+(.@j+1)+"]")+" ea.^000000";
    		}
    		mes "--------------------------------";
    		mes "[Reward]";
    		mes "Item: ^0000FF"+((getd("." +currentquest$+"_huntingprize"))?getitemname(getd("." 
    
    +currentquest$+"_huntingprize"))+" - "+getd("." +currentquest$+"_huntingamount")+" 
    
    ea.^000000":"Nothing^000000");
    		mes "Zeny: ^0000FF"+getd("." +currentquest$+"_huntingzeny")+"^000000";
    		mes "Base EXP: ^0000FF"+getd("." +currentquest$+"_huntingexp["+0+"]")+"^000000";
    		mes "Job EXP: ^0000FF"+getd("." +currentquest$+"_huntingexp["+1+"]")+"^000000";
    		next;
    		if(select("Finish:Abort") == 2){
    			mes "[^FF7700Questboard^000000]";
    			mes "Quest aborted.";
    			for(set .@x, 1; .@x < .@size; set .@x,.@x+2){
    				set .@currentmob, getd("."+currentquest$+"_huntingmob["+(.@x-1)+"]");
    				setd(currentquest$+"_"+.@currentmob+"_"+.@x+"_killcount", 0);
    			}
    			set currentquest$, "";
    			set h_run, false;
    			close;
    		}
    		goto L_checkmobs;
    	}
    
    	mes "[^FF7700Questboard^000000]";
    	mes "Select category:";
    	next;
    
    	switch(select((.collection)?"Collection Quests":"",
    				  (.hunting)?"Hunting Quests":"",
    				  "Exit")) {
    
    	case 1:
    		set .@collectmenu$, "";
    		for( set .@i,0; .@i < .collectionquestcount; set .@i,.@i+1){
    			if (.@i) set .@collectmenu$,.@collectmenu$+":";
    			set .@collectmenu$, .@collectmenu$ + "[" + getd("." +(.@i
    
    +1)+"_collectionmin") + " - " + getd("." +(.@i+1)+"_collectionmax") + "] " + getd("." + (.@i+1) + 
    
    "_collectionname$");
    		}
    		set .@selection,select(.@collectmenu$);
    		if(.quest_repeat == true){
    			if(gettimetick(2) < getd(.@selection + "_collection_delay")){
    				set .@time_left, getd(.@selection + "_collection_delay")-gettimetick
    
    (2);
    				mes "[^FF7700Questboard^000000]";
    				mes "You have to wait ^0000FF"+Time2Str(.@time_left)+"^000000 to do 
    
    this quest again.";
    				close;
    			}
    		}
    		else{
    			if(getd(.@selection + "_collection_repeat") == true){
    				mes "[^FF7700Questboard^000000]";
    				mes "You already did this quest.";
    				mes "Please choose another one.";
    				close;
    			}
    		}
    		mes "[^FF7700Questboard^000000]";
    		mes "^0000FF"+getd("." + .@selection + "_collectionname$")+"^000000";
    		mes "--------------------------------";
    		set .@size, getarraysize(getd("."+ .@selection + "_collectionitem"));
    		for( set .@j, 0; .@j < .@size; set .@j,.@j+2){
    			mes "^FF0000"+getitemname(getd("."+.@selection+"_collectionitem["+.@j+"]"))+" 
    
    - "+getd("."+.@selection+"_collectionitem["+(.@j+1)+"]")+" ea.^000000";
    		}
    		mes "--------------------------------";
    		mes "[Reward]";
    		mes "Item: ^0000FF"+((getd("." +.@selection+"_collectionprize"))?getitemname(getd("." 
    
    +.@selection+"_collectionprize"))+" - "+getd("." +.@selection+"_collectionamount")+" 
    
    ea.^000000":"Nothing^000000");
    		mes "Zeny: ^0000FF"+getd("." +.@selection+"_collectionzeny")+"^000000";
    		mes "Base EXP: ^0000FF"+getd("." +.@selection+"_collectionexp["+0+"]")+"^000000";
    		mes "Job EXP: ^0000FF"+getd("." +.@selection+"_collectionexp["+1+"]")+"^000000";
    		next;
    		if(select("Accept:Decline") == 2){
    			close;
    		}
    		if(BaseLevel >= getd("." +.@selection+"_collectionmin") && BaseLevel <= getd("." 
    
    +.@selection+"_collectionmax")){
    			mes "[^FF7700Questboard^000000]";
    			mes "Quest accepted.";
    			set c_run, true;
    			set currentquest$, .@selection;
    			close;
    		}
    		else{
    			mes "[^FF7700Questboard^000000]";
    			mes "You don't have the required";
    			mes "level to do this quest.";
    			close;
    		}
    
    	case 2:
    		set .@huntmenu$, "";
    		for( set .@i,0; .@i < .huntingquestcount; set .@i,.@i+1){
    			if (.@i) set .@huntmenu$,.@huntmenu$+":";
    			set .@huntmenu$, .@huntmenu$ + "[" + getd("." +(.@i+1)+"_huntingmin") + " - " 
    
    + getd("." +(.@i+1)+"_huntingmax") + "] " + getd("." + (.@i+1) + "_huntingname$");
    		}
    		set .@selection,select(.@huntmenu$);
    		if(.quest_repeat == true){
    			if(gettimetick(2) < getd(.@selection + "_hunting_delay")){
    				set .@time_left, getd(.@selection + "_hunting_delay")-gettimetick(2);
    				mes "[^FF7700Questboard^000000]";
    				mes "You have to wait ^0000FF"+Time2Str(.@time_left)+"^000000 to do 
    
    this quest again.";
    				close;
    			}
    		}
    		else{
    			if(getd(.@selection + "_hunting_repeat") == true){
    				mes "[^FF7700Questboard^000000]";
    				mes "You already did this quest.";
    				mes "Please choose another one.";
    				close;
    			}
    		}
    		mes "[^FF7700Questboard^000000]";
    		mes "^0000FF"+getd("." + .@selection + "_huntingname$")+"^000000";
    		mes "--------------------------------";
    		set .@size, getarraysize(getd("."+ .@selection + "_huntingmob"));
    		for( set .@j, 0; .@j < .@size; set .@j,.@j+2){
    			mes "^FF0000"+strmobinfo(1,getd("."+.@selection+"_huntingmob["+.@j+"]"))+" - 
    
    "+getd("."+.@selection+"_huntingmob["+(.@j+1)+"]")+" ea.^000000";
    		}
    		mes "--------------------------------";
    		mes "[Reward]";
    		mes "Item: ^0000FF"+((getd("." +.@selection+"_huntingprize"))?getitemname(getd("." 
    
    +.@selection+"_huntingprize"))+" - "+getd("." +.@selection+"_huntingamount")+" 
    
    ea.^000000":"Nothing^000000");
    		mes "Zeny: ^0000FF"+getd("." +.@selection+"_huntingzeny")+"^000000";
    		mes "Base EXP: ^0000FF"+getd("." +.@selection+"_huntingexp["+0+"]")+"^000000";
    		mes "Job EXP: ^0000FF"+getd("." +.@selection+"_huntingexp["+1+"]")+"^000000";
    		next;
    		if(select("Accept:Decline") == 2){
    			close;
    		}
    		if(BaseLevel >= getd("." +.@selection+"_huntingmin") && BaseLevel <= getd("." 
    
    +.@selection+"_huntingmax")){
    			mes "[^FF7700Questboard^000000]";
    			mes "Quest accepted.";
    			set h_run, true;
    			set currentquest$, .@selection;
    			close;
    		}
    		else{
    			mes "[^FF7700Questboard^000000]";
    			mes "You don't have the required";
    			mes "level to do this quest.";
    			close;
    		}
    
    	case 3:
    		close;
    	}
    
    L_checkitems:
    	set .@size, getarraysize(getd("."+currentquest$+"_collectionitem"));
    	for( set .@k,0; .@k < .@size; set .@k,.@k+2){
    		if(countitem(getd("."+currentquest$+"_collectionitem["+.@k+"]"))>=getd
    
    ("."+currentquest$+"_collectionitem["+(.@k+1)+"]")){
    			set .@checkitem,.@checkitem+2;
    		}
    	}
    	if(.@checkitem<.@size){
    		mes "[^FF7700Questboard^000000]";
    		mes "You don't have everything.";
    		close;
    	}
    	for( set .@delcount,0; .@delcount < .@size; set .@delcount,.@delcount+2){
    		delitem getd("."+currentquest$+"_collectionitem["+.@delcount+"]"),getd
    
    ("."+currentquest$+"_collectionitem["+(.@delcount+1)+"]");
    	}
    	mes "[^FF7700Questboard^000000]";
    	mes "Congratulation! Here is your Reward.";
    	if(getd("." +currentquest$+"_collectionprize")!=0) getitem(getd("." +currentquest$
    
    +"_collectionprize"),getd("." +currentquest$+"_collectionamount"));
    	set Zeny,Zeny+getd("." +currentquest$+"_collectionzeny");
    	getexp getd("." +currentquest$+"_collectionexp["+0+"]"),getd("." +currentquest$
    
    +"_collectionexp["+1+"]");
    	setd(currentquest$ + "_collection_delay"),gettimetick(2)+.quest_delay;
    	setd(currentquest$ + "_collection_repeat"),true;
    	set currentquest$, "";
    	set c_run, false;
    	close;
    
    L_checkmobs:
    	set .@size, getarraysize(getd("."+currentquest$+"_huntingmob"));
    	set .@goal, .@size/2;
    	for(set .@i, 1; .@i < .@size; set .@i,.@i+2){
    		set .@currentmob, getd("."+currentquest$+"_huntingmob["+(.@i-1)+"]");
    		if(getd(currentquest$+"_"+.@currentmob+"_"+.@i+"_killcount")==getd("."+currentquest$
    
    +"_huntingmob["+.@i+"]")){
    			set .@checkmonster, .@checkmonster+1;
    			if(.@checkmonster==.@goal){
    				goto L_checkmobs2;
    			}
    			continue;
    		}
    		goto L_checkmobs2;
    	}
    
    L_checkmobs2:
    	if(.@checkmonster<.@goal){
    		mes "[^FF7700Questboard^000000]";
    		mes "You didn't kill everything.";
    		close;
    	}
    	mes "[^FF7700Questboard^000000]";
    	mes "Congratulation! Here is your Reward.";
    	set .@size, getarraysize(getd("."+currentquest$+"_huntingmob"));
    	for(set .@x, 1; .@x < .@size; set .@x,.@x+2){
    		set .@currentmob, getd("."+currentquest$+"_huntingmob["+(.@x-1)+"]");
    		setd(currentquest$+"_"+.@currentmob+"_"+.@x+"_killcount", 0);
    	}
    	if(getd("." +currentquest$+"_huntingprize")!=0) getitem(getd("." +currentquest$
    
    +"_huntingprize"),getd("." +currentquest$+"_huntingamount"));
    	set Zeny, Zeny+getd("." +currentquest$+"_huntingzeny");
    	getexp getd("." +currentquest$+"_huntingexp["+0+"]"),getd("." +currentquest$+"_huntingexp
    
    ["+1+"]");
    	setd(currentquest$ + "_hunting_delay"),gettimetick(2)+.quest_delay;
    	setd(currentquest$ + "_hunting_repeat"),true;
    	set currentquest$, "";
    	set h_run, false;
    	close;
    
    OnNPCKillEvent:
    	if(h_run!=true) end;
    	set .@size, getarraysize(getd("."+currentquest$+"_huntingmob"));
    	for(set .@i, 1; .@i < .@size; set .@i,.@i+2){
    		if(killedrid==getd("."+currentquest$+"_huntingmob["+(.@i-1)+"]")){
    			set .@currentmob, getd("."+currentquest$+"_huntingmob["+(.@i-1)+"]");
    			if(getd(currentquest$+"_"+.@currentmob+"_"+.@i+"_killcount")<getd
    
    ("."+currentquest$+"_huntingmob["+.@i+"]")){
    				setd(currentquest$+"_"+.@currentmob+"_"+.@i+"_killcount", getd
    
    (currentquest$+"_"+.@currentmob+"_"+.@i+"_killcount")+1);
    				dispbottom getd("."+currentquest$+"_huntingname$")+": ["+strmobinfo
    
    (1,.@currentmob)+"] ("+ getd(currentquest$+"_"+.@currentmob+"_"+.@i+"_killcount")+"/"+getd
    
    ("."+currentquest$+"_huntingmob["+.@i+"]")+")";
    			}
    			if(getcharid(1) != 0 && .party_support == true){
    				getmapxy(.@map1$,.@x1,.@y1);
    				set .@killerid, getcharid(3);
    				set .@currentquest$, currentquest$;
    				getpartymember getcharid(1),1;
    				getpartymember getcharid(1),2;
    				for(set .@j, 0; .@j < $@partymembercount; .@j++){
    					if(isloggedin($@partymemberaid[.@j], $@partymembercid[.@j])){
    						if(h_run==true && $@partymemberaid[.@j] != .@killerid 
    
    && .@currentquest$ == getvar(currentquest$, $@partymembercid[.@j]) && readparam(HP, $@partymembercid
    
    [.@j]) > 0){
    							getmapxy(.@map2$,.@x2,.@y2,BL_PC,rid2name
    
    ($@partymemberaid[.@j]));
    							if(.@map1$ == .@map2$ && distance
    
    (.@x1,.@y1,.@x2,.@y2) < .party_range){
    								set .@kill_amt,getvar(getd
    
    (.@currentquest$+"_"+.@currentmob+"_"+.@i+"_killcount"), $@partymembercid[.@j]);
    								set .@kill_goal,getd
    
    ("."+.@currentquest$+"_huntingmob["+.@i+"]");
    								if(.@kill_amt<.@kill_goal)
    								{
    									setd(.@currentquest$
    
    +"_"+.@currentmob+"_"+.@i+"_killcount", .@kill_amt+1, $@partymembercid[.@j]);
    									dispbottom getd
    
    ("."+.@currentquest$+"_huntingname$")+": ["+strmobinfo(1,.@currentmob)+"] ("+(.@kill_amt
    
    +1)+"/"+.@kill_goal+")", 0xB6FF00, $@partymembercid[.@j];
    								}
    							}
    						}
    					}
    				}
    			}
    			break;
    		}
    	}
    	end;
    
    OnInit:
    	waitingroom "Quest Board",0;
    	function AddCollection;
    	function AddHunting;
    
    	//Activate/Deactivate quest categories (true/1 - activated, false/0 - deactivated)
    	set .collection, false;
    	set .hunting, true;
    
    	//Quest Delay (seconds)
    	//24 hours = 86400 seconds
    	set .quest_delay, 0;
    
    	//Activate/Deactivate repeatable quests (true/1 - activated, false/0 - deactivated)
    	set .quest_repeat, true;
    
    	//Activate/Deactivate party support (true/1 - activated, false/0 - deactivated)
    	set .party_support, true;
    
    	//Max range for party support (+- x & y coordinations)
    	set .party_range, 25;
    
    	//Checks if quests are loaded (prevents out of index)
    	if(.questsloaded==true) end;
    	set .questsloaded, true;
    
    	//Add Collection Quests here (You can add as many required items as you want)
    	//AddCollection("<Quest Name>",<Min Lvl>,<Max Lvl>,<Reward|Item ID>,<Reward|Item 
    
    Amount>,<Zeny Reward>,<Base EXP>,<Job EXP>,<Item ID>,<Item Amount>,...);
    
    
    	//Add Hunting Quests here (You can add as many required mobs as you want)
    	//AddHunting("<Quest Name>",<Min Lvl>,<Max Lvl>,<Reward|Item ID>,<Reward|Item Amount>,<Zeny 
    
    Reward>,<Base EXP>,<Job EXP>,<Monster ID>,<Monster Amount>,...);
    	Addhunting("Mid-difficulty",1,99,7711,10,50000,50000,40000,1310,100);
    	Addhunting("High-difficulty",1,99,7711,20,50000,100000,80000,1098,100);
    	Addhunting("Extreme-difficulty",1,99,7711,30,100000,200000,160000,1833,100);
    	end;
    
    
    	function AddCollection{
    		set .collectionquestcount,.collectionquestcount+1;
    		setd ("." +.collectionquestcount+"_collectionname$", getarg(0));
    		setd ("." +.collectionquestcount+"_collectionmin", getarg(1));
    		setd ("." +.collectionquestcount+"_collectionmax", getarg(2));
    		setd ("." +.collectionquestcount+"_collectionprize", getarg(3));
    		setd ("." +.collectionquestcount+"_collectionamount", getarg(4));
    		setd ("." +.collectionquestcount+"_collectionzeny", getarg(5));
    		set .@argcount, 6;
    		set .@size, getarraysize(getd("."+ .collectionquestcount + "_collectionexp"));
    		setd ("." +.collectionquestcount+"_collectionexp["+.@size+"]",getarg(.@argcount)); 
    		setd ("." +.collectionquestcount+"_collectionexp["+(.@size+1)+"]",getarg(.@argcount
    
    +1)); 
    		set .@argcount, .@argcount+2;
    		set .@size, getarraysize(getd("."+ .collectionquestcount + "_collectionitem"));
    		while(getarg(.@argcount,-1)!=-1 && getarg(.@argcount+1,-1)!=-1){
    			setd ("."+.collectionquestcount+"_collectionitem["+.@size+"]",getarg
    
    (.@argcount)); 
    			setd ("."+.collectionquestcount+"_collectionitem["+(.@size+1)+"]",getarg
    
    (.@argcount+1));
    			set .@argcount,.@argcount+2;
    			set .@size, .@size+2;
    		}
    		return;
    	}
    
    	function AddHunting{
    		set .huntingquestcount,.huntingquestcount+1;
    		setd ("." +.huntingquestcount+"_huntingname$", getarg(0));
    		setd ("." +.huntingquestcount+"_huntingmin", getarg(1));
    		setd ("." +.huntingquestcount+"_huntingmax", getarg(2));
    		setd ("." +.huntingquestcount+"_huntingprize", getarg(3));
    		setd ("." +.huntingquestcount+"_huntingamount", getarg(4));
    		setd ("." +.huntingquestcount+"_huntingzeny", getarg(5));
    		set .@size, getarraysize(getd("."+ .huntingquestcount + "_huntingexp"));
    		set .@argcount, 6;
    		setd ("." +.huntingquestcount+"_huntingexp["+.@size+"]",getarg(.@argcount));
    		setd ("." +.huntingquestcount+"_huntingexp["+(.@size+1)+"]",getarg(.@argcount+1)); 
    		set .@argcount, .@argcount+2;
    		set .@size, getarraysize(getd("."+ .huntingquestcount + "_huntingmob"));
    		while(getarg(.@argcount,-1)!=-1 && getarg(.@argcount+1,-1)!=-1){
    			setd ("."+.huntingquestcount+"_huntingmob["+.@size+"]",getarg(.@argcount)); 
    			setd ("."+.huntingquestcount+"_huntingmob["+(.@size+1)+"]",getarg(.@argcount
    
    +1));
    			set .@argcount, .@argcount+2;
    			set .@size, .@size+2;
    		}
    		return;
    	}
    }

    2. Prize Giver

    
    //======= 3ceam Script =======================================
    //= Prize Giver NPC
    //===== Modified By: =========================================
    //= Keitenai
    //===== Current Version: =====================================
    //= 1.0
    //===== Compatible With: =====================================
    //= Athena Project
    //===== Description: =========================================
    //= Prize giver for single char, account and more.
    //===== Additional Comments: =================================
    //= 1.0 Modified Version for 3ceam compatibility
    //============================================================
    prontera,141,175,4	script	Server Reward	113,{
    	//cutin "v_sprakki04",2;
    	//Check if setups are loaded.
    	if(!.Setup)
    		{
    			callsub OnLoadSetup;
    		}
    
    	//Show GM Panel if player is GM.
    	if(getgmlevel() >= .GMin)
    		menu("Take a prize as a player",-,"Give prize",
    				OnManagement,"Reset Item Give",
    				OnDelete,"IP Limit per Item",
    				OnLimit);
    
    	//Read attached player gifts from SQL table.
    	if(select("Get Account Prize!:Get Character Prize!:Exit") == 1)
    		{
    			set .@query, query_sql("SELECT * FROM `" + .GiftTableName$ + "` WHERE account_id="+getcharid(3),
    				.@gift_id,
    				.@gift_account,
    				.@gift_char,
    				.@gift_item,
    				.@gift_amount,
    				.@gift_duration,
    				.@gift_time
    				); //Account gifts.
    		}
    		else if(@menu == 2)
    		{
    			set .@query, query_sql("SELECT * FROM `" + .GiftTableName$ + "` WHERE char_id="+getcharid(0),
    				.@gift_id,
    				.@gift_account,
    				.@gift_char,
    				.@gift_item,
    				.@gift_amount,
    				.@gift_duration,
    				.@gift_time
    				); //Char gifts.
    		}
    		else goto OnLeave;
    
    	//Check if player don't have gifts.
    	if(!.@query)
    		{
    			mes "[Reward Giver]";
    			mes "Sorry, you don't have any prize";
    
    			cutin "v_sprakki04",255;
    			close;
    		}
    
    	//Build menu from query arrays.
    		mes "[" + strnpcinfo(1) + "]";
    		mes "^009900You got the prize^000000";
    			for( set .@i, 0; .@i < .@query; set .@i, .@i + 1 )
    			{
    				mes "(" + .@gift_amount[.@i] + ") " + getitemname(.@gift_item[.@i]) + ".";
    				set .@menu$, .@menu$ + getitemname(.@gift_item[.@i]) + ":";
    			}
    			next;
    			set .@mid,select(.@menu$); //Show menu.
    			set .@mid,.@mid-1;
    
    	if (.@gift_time[.@mid] && .@gift_time[.@mid] < gettimetick(2))
    	{
    		mes "[Reward Giver]";
    		mes "Sorry, this prize's claim time is already over.";
    
    		cutin "v_sprakki04",255;
    		close;
    	}
    	//Item is now selected. Choose what you want to do with it.
    	mes "[" + strnpcinfo(1) + "]";
    	mes "what you want do with (" + .@gift_amount[.@mid] + ") " + getitemname(.@gift_item[.@mid]) + "?";
    	next;
    	set .@Select,select("^009900Get it^000000:^ff0000Delete it! ^000000:nothings");
    
    	//Receive gift selected.
    	if(.@Select == 1)
    	{
    		//Check weight.
    		if(checkweight( .@gift_item, .@gift_amount ) || .@gift_item[.@mid] == .ZenyID)
    		{
    			mes "[" + strnpcinfo(1) + "]";
    			mes "^009900Get : (" + .@gift_amount[.@mid] + ") " + getitemname(.@gift_item[.@mid]) + ".^000000";
    			if (.ip_limit)
    			{
    				// add ip_address to logs
    				.@ipexist = query_sql("SELECT item_id, ip_address, claim_count FROM " + .GiftTableNameIP$ + " WHERE last_ip = (SELECT last_ip FROM login WHERE account_id="+getcharid(3)+") AND item_id = "+.@gift_item[.@mid]+" LIMIT 1", .@item,.@ip,.@claim_count);
    				if (.@claim_count[0] >= .ip_limit)
    				{
    					next;
    					mes "Sorry you have reached the maximum redeem limit for this IP address";
    					cutin "v_sprakki04",255;
    					close;
    				}
    				if (!.@claim_count[0])
    				{
    					query_sql("INSERT INTO " + .GiftTableNameIP$ + " (give_id,item_id,last_ip,claim_count) VALUES("+.@gift_id+","+.@gift_item+",'(SELECT last_ip FROM login WHERE account_id="+getcharid(3)+")',1)");		
    				}
    				else
    				{
    					query_sql("UPDATE " + .GiftTableNameIP$ + " SET claim_count = "+(.@claim_count[0]+1)+" WHERE item_id = "+.@gift_item[.@mid]+" AND last_ip = (SELECT last_ip FROM login WHERE account_id="+getcharid(3)+")");
    				}
    			}
    			if (.@gift_item[.@mid] == .ZenyID) { // detects zeny ID and give zeny.
    				if (Zeny+.@gift_amount[.@mid] > .MaxZeny)
    				{
    					mes "Please make sure that you have enough space to handle all these zennies and come back later.";
    					cutin "v_sprakki04",255;
    					close;
    				}
    				set Zeny,Zeny+.@gift_amount[.@mid];
    			}
    			else
    			{
    				if (!.@gift_duration)
    				{
    					getitem .@gift_item[.@mid], .@gift_amount[.@mid]; //Give item to player.
    				}
    				else
    				{
    					rentitem .@gift_item[.@mid], .@gift_duration * 60; 
    				}
    			}
    			query_sql( "DELETE FROM `" + .GiftTableName$ + "` WHERE id = " + .@gift_id[.@mid] ); //Remove item from table.
    			cutin "v_sprakki04",255;
    			close;
    		}
    		else
    		{
    			//Overweight
    			mes "^ff0000Sorry ^000000 You can't take it " + getitemname(.@gift_item[.@mid]);
    			mes "Could lose some wight?";
    			cutin "v_sprakki04",255;
    			close;
    		}
    	}
    	//Remove gift selected.
    	else if(.@Select == 2) {
    		mes "[" + strnpcinfo(1) + "]";
    		mes "Are you sure you want dellet it?";
    		mes "Gift: ("+.@gift_amount[.@mid]+") "+getitemname(.@gift_item[.@mid])+".";
    		next;
    		if(select("Yes:No") == 1) {
    			mes "[" + strnpcinfo(1) + "]";
    			mes "^ff0000Dellet: ("+.@gift_amount[.@mid]+") "+getitemname(.@gift_item[.@mid])+".^000000";
    			query_sql("DELETE FROM `" + .GiftTableName$ + "` WHERE id = " + .@gift_id[.@mid]); //Remove item from table.
    			cutin "v_sprakki04",255;
    			close;
    		} else {
    			mes "[" + strnpcinfo(1) + "]";
    			mes "we will save it";
    			cutin "v_sprakki04",255;
    			close;
    		}
    	}
    	//Nothing selected.
    	else
    	{
    		goto OnLeave;
    	}
    
    //GM Panel below:
    OnManagement:
    	if(getgmlevel() < .GMin) goto OnLeave;
    	mes "[" + strnpcinfo(1) + "]";
    	mes "Welvome " + strcharinfo(0) + "!";
    	mes "How I can help you?";
    	next;
    
    	if(select("Make Gift:Nothing") != 1) goto OnLeave;
    
    		//Make new gift.
    		mes "[" + strnpcinfo(1) + "]";
    		mes "Please input the item id.";
    		mes "Default: 501";
    	next;
    		mes "What do you want to give?";
    		set .@zenygive,0;
    			if(select("Item:Zeny") == 1)
    				{
    					input .@new_item, 501, 30000;
    				}
    	next;
    	mes "Do you want to add a claim timer?";
    	if(select("No:Yes")==2)
    	{
    		next;
    		mes "How many minutes do you want this reward to be claimable?";
    		input(.@c);
    		.@claimtime = gettimetick(2)+(.@c*60);
    	}
    	if(select("Continue:Cancel") != 1) goto OnLeave;
    		mes "[" + strnpcinfo(1) + "]";
    		mes "How many items/zeny?";
    		mes "Default: 1";
    	next;
    	//item quantity range of 1 to 1,000.
    	if(.@zenygive)
    	{
    		input .@new_value, 1, .MaxZeny;
    	}
    	else
    	{
    		input .@new_value, 1, 1000;
    	}
    	
    	if(select("Continue:Cancel") != 1) goto OnLeave;
    		mes "[" + strnpcinfo(1) + "]";
    		mes "Please select input type:";
    		mes "1. Single Account";
    		mes "2. Single Character";
    		mes "3. All ^009900Online^000000 Accounts.";
    		mes "4. All Accounts.";
    		mes "5. All ^009900Online^000000 Players/Characters.";
    		mes "6. All Players/Characters.";
    		mes "7. ^ff0000Cancel.^000000";
    	next;
    	switch(select("Single Account:Single Character:^009900Online^000000 Accounts:All Accounts:^009900Online^000000 Characters:All Characters:Cancel"))
    	{
    		//Account gift
    		case 1:
    			mes "[" + strnpcinfo(1) + "]";
    			mes "Please select input type:";
    			mes "By AID or Name?";
    			next;
    			if(select("Account ID:Character Name") == 1)
    			{
    				mes "[" + strnpcinfo(1) + "]";
    				mes "Write account id:";
    				next;
    				input .@new_account, 2000000, 10000000; //Account id range from 2m to 10m.
    				set .@query, query_sql("SELECT account_id FROM `" + .CharTableName$ + "` WHERE account_id = " + .@new_account, .@new_account);
    				if(!.@query) goto OnNotExist;
    				if(select("Continue:Cancel") != 1) goto OnLeave;
    				mes "[" + strnpcinfo(1) + "]";
    				mes "^009900Gift is ready to go!^000000";
    				mes "AID: ^ff0000" + .@new_account + "^000000";
    				mes "------------------";
    				mes "Item: ^ff0000" + getitemname(.@new_item) + "^000000";
    				mes "Quantity: ^ff0000" + .@new_value + "^000000";
    				mes "Duration: " + .@duration + " Minutes";
    				mes "Claim Time: " + .@c + " Minutes";
    				next;
    				if(select("Send Gift:Cancel") != 1) goto OnLeave;
    				mes "[" + strnpcinfo(1) + "]";
    				mes "Gift sending success!";
    				//Create gift. <auto_id>, <account_id> <char_id> <item> <value>
    				query_sql("INSERT INTO `" + .GiftTableName$ + "` (account_id, item, value, duration, timestamp) VALUES(" + .@new_account + ", " + .@new_item + ", " + .@new_value + ", " + .@duration + ", " + .@claimtime + ")");
    			}
    			else
    			{
    				mes "[" + strnpcinfo(1) + "]";
    				mes "Write player name:";
    				next;
    				input .@new_name$;
    				set .@query, query_sql("SELECT account_id FROM `" + .CharTableName$ + "` WHERE name = '" + .@new_name$ + "'", .@new_account);
    				if(!.@query) goto OnNotExist;
    				if(select("Continue:Cancel") != 1) goto OnLeave;
    				mes "[" + strnpcinfo(1) + "]";
    				mes "^009900Gift is ready to go!^000000";
    				mes "AID: ^ff0000" + .@new_account + "^000000";
    				mes "Name: ^ff0000"+ .@new_name$ + "^000000";
    				mes "------------------";
    				mes "Item: ^ff0000" + getitemname(.@new_item) + "^000000";
    				mes "Quantity: ^ff0000" + .@new_value + "^000000";
    				mes "Duration: " + .@duration + " Minutes";
    				mes "Claim Time: " + .@c + " Minutes";
    				next;
    				if(select("Send Gift:Cancel") != 1) goto OnLeave;
    				//Check if player is logged in.
    				if(isloggedin(.@new_account)) {
    					mes "[" + strnpcinfo(1) + "]";
    					mes "Gift sending success!";
    					query_sql("INSERT INTO `" + .GiftTableName$ + "` (account_id, item, value, duration, timestamp) VALUES(" + .@new_account + ", " + .@new_item + ", " + .@new_value + ", " + .@duration + ", " + .@claimtime + ")");
    				} else {
    					//Account was not online.
    					mes "[" + strnpcinfo(1) + "]";
    					mes "Gift sending success!";
    					query_sql("INSERT INTO `" + .GiftTableName$ + "` (account_id, item, value, duration, timestamp) VALUES(" + .@new_account + ", " + .@new_item + ", " + .@new_value + ", " + .@duration + ", " + .@claimtime + ")"); // duplicate to other menus - continue here on giver side
    				}
    			}
    			break;
    
    		//Character gift.
    		case 2:
    			mes "[" + strnpcinfo(1) + "]";
    			mes "Please select input type:";
    			mes "By CID or Name?";
    			next;
    			if(select("Character ID:Character Name") == 1)
    			{
    				mes "[" + strnpcinfo(1) + "]";
    				mes "Write character id:";
    				next;
    				input .@new_char,150000, 10000000; //Char id range from 150k to 10m.
    				set .@query, query_sql("SELECT account_id, name FROM `" + .CharTableName$ + "` WHERE char_id = " + .@new_char, .@new_accountid, .@new_name$);
    				if(!.@query) goto OnNotExist;
    				if(select("Continue:Cancel") != 1) goto OnLeave;
    					mes "[" + strnpcinfo(1) + "]";
    					mes "^009900Gift is ready to go!^000000";
    					mes "CID: ^ff0000" + .@new_char + "^000000";
    					mes "Name: ^ff0000" + .@new_name$ + "^000000";
    					mes "------------------";
    					mes "Item: ^ff0000" + getitemname(.@new_item) + "^000000";
    					mes "Quantity: ^ff0000" + .@new_value + "^000000";
    					mes "Duration: " + .@duration + " Minutes";
    					mes "Claim Time: " + .@c + " Minutes";
    				next;
    				if(select("Send Gift:Cancel") != 1) goto OnLeave;
    				//Check if player is logged in.
    				if(isloggedin(.@new_accountid)) {
    					mes "[" + strnpcinfo(1) + "]";
    					mes "Gift sending success!";
    
    					//Create gift. <auto_id>, <account_id> <char_id> <item> <value>
    					query_sql("INSERT INTO `" + .GiftTableName$ + "` (char_id, item, value, duration, timestamp) VALUES (" + .@new_char + ", " + .@new_item + ", " + .@new_value + "," + .@duration + "," + .@claimtime + ")");
    				} else {
    					//not online ask if we still give the gift.
    					mes "[" + strnpcinfo(1) + "]";
    					mes "The character is not online!";
    					mes "Would you still like to send the gift?";
    					next;
    					if(select("Yes:No") != 1) goto OnLeave;
    					mes "[" + strnpcinfo(1) + "]";
    					mes "Gift sending success!";
    					//Create gift. <auto_id>, <account_id> <char_id> <item> <value>
    					query_sql("INSERT INTO `" + .GiftTableName$ + "` (char_id, item, value, duration, timestamp) VALUES (" + .@new_char + ", " + .@new_item + ", " + .@new_value + "," + .@duration + "," + .@claimtime + ")");
    				}
    
    			}
    			else
    			{
    				mes "[" + strnpcinfo(1) + "]";
    				mes "Write player name:";
    				next;
    				input .@new_name$;
    				set .@query, query_sql("SELECT char_id, account_id FROM `" + .CharTableName$ + "` WHERE name = '" + .@new_name$ + "'", .@new_char, .@new_accountid);
    				if(!.@query) goto OnNotExist;
    				if(select("Continue:Cancel") != 1) goto OnLeave;
    					mes "[" + strnpcinfo(1) + "]";
    					mes "^009900Gift is ready to go!^000000";
    					mes "CID: ^ff0000" + .@new_char + "^000000";
    					mes "Name: ^ff0000"+ .@new_name$ + "^000000";
    					mes "------------------";
    					mes "Item: ^ff0000" + getitemname(.@new_item) + "^000000";
    					mes "Quantity: ^ff0000" + .@new_value + "^000000";
    					mes "Duration: " + .@duration + " Minutes";
    					mes "Claim Time: " + .@c + " Minutes";
    				next;
    				if(select("Send Gift:Cancel") != 1) goto OnLeave;
    				//Check if player is logged in.
    				if(isloggedin(.@new_accountid))
    				{
    					mes "[" + strnpcinfo(1) + "]";
    					mes "Gift sending success!";
    					query_sql("INSERT INTO `" + .GiftTableName$ + "` (char_id, item, value, duration, timestamp) VALUES (" + .@new_char + ", " + .@new_item + ", " + .@new_value + "," + .@duration + "," + .@claimtime + ")");
    				}
    				else
    				{
    					//not online ask if we still give the gift.
    					mes "[" + strnpcinfo(1) + "]";
    					mes "The character is not online!";
    					mes "Would you still like to give the gift?";
    					next;
    					if(select("Yes:No") != 1) goto OnLeave;
    					mes "[" + strnpcinfo(1) + "]";
    					mes "Gift sending success!";
    					//Create gift. <auto_id>, <account_id> <char_id> <item> <value>
    					query_sql("INSERT INTO `" + .GiftTableName$ + "` (char_id, item, value, duration, timestamp) VALUES (" + .@new_char + ", " + .@new_item + ", " + .@new_value + "," + .@duration + "," + .@claimtime + ")");
    				}
    			}
    			announce strcharinfo(0)+" successfully sent " + .@new_value + "x " + getitemname(.@new_item) + " to " + .@new_name$,bc_all;
    			break;
    
    		//Register gift to all online accounts!
    		case 3:
    			mes "[" + strnpcinfo(1) + "]";
    			mes "^009900Gift is ready to go!^000000";
    			mes "Item: ^ff0000" + getitemname(.@new_item) + "^000000";
    			mes "Quantity: ^ff0000" + .@new_value + "^000000";
    			mes "Duration: " + .@duration + " Minutes";	
    			mes "Claim Time: " + .@c + " Minutes";
    			next;
    			if(select("Send Gift:Cancel") != 1) goto OnLeave;
    			mes "[" + strnpcinfo(1) + "]";
    			mes "Please hold...";
    			set .@c, 0; //Counting success.
    			set .@query, query_sql("SELECT account_id FROM `"+.CharTableName$+"` WHERE online=1",.@account);
    			for(set .@i, 0; .@i < .@query; set .@i, .@i + 1) {
    				sleep2 25; //Slowdown the loop abit.
    				.@at = query_sql("SELECT account_id, char_id FROM "+$GiftTableNameAT$+" WHERE account_id = "+.@account[.@i]+"", .@account_id, .@char_id); // check if in the table
    				if (!.@at) {		
    					query_sql("INSERT INTO `" + .GiftTableName$ + "` (account_id, item, value, duration, timestamp) VALUES(" + .@account[.@i] + ", " + .@new_item + ", " + .@new_value + ", " + .@duration + ", " + .@claimtime + ")");
    				}
    			}
    			mes "Gift registered to (" + .@i + ") accounts!";
    			break;
    
    		//Register gift to all accounts!
    		case 4:
    			mes "[" + strnpcinfo(1) + "]";
    			mes "^009900Gift is ready to go!^000000";
    			mes "Item: ^ff0000" + getitemname(.@new_item) + "^000000";
    			mes "Quantity: ^ff0000" + .@new_value + "^000000";
    			mes "Claim Time: " + .@c + " Minutes";		
    			next;
    			if(select("Send Gift:Cancel") != 1) goto OnLeave;
    			mes "[" + strnpcinfo(1) + "]";
    			mes "Please hold...";
    			set .@query, query_sql("SELECT account_id FROM `"+.LoginTableName$+"`",.@account);
    			for(set .@i, 0; .@i < .@query; set .@i, .@i + 1) {
    				sleep2 25; //Slowdown the loop abit.
    					query_sql("INSERT INTO `" + .GiftTableName$ + "` (account_id, item, value, duration, timestamp) VALUES(" + .@account[.@i] + ", " + .@new_item + ", " + .@new_value + ", " + .@duration + ", " + .@claimtime + ")");
    			}
    			mes "Gift registered to (" + .@i + ") accounts!";
    			break;
    
    		//Register gift to all online characters!
    		case 5:
    			mes "[" + strnpcinfo(1) + "]";
    			mes "^009900Gift is ready to go!^000000";
    			mes "Item: ^ff0000" + getitemname(.@new_item) + "^000000";
    			mes "Quantity: ^ff0000" + .@new_value + "^000000";
    			mes "Claim Time: " + .@c + " Minutes";		
    			next;
    			if(select("Send Gift:Cancel") != 1) goto OnLeave;
    			mes "[" + strnpcinfo(1) + "]";
    			mes "Please hold...";
    			set .@c, 0; //Counting success.
    			set .@query, query_sql("SELECT char_id FROM `"+.CharTableName$+"` WHERE online=1",.@char);
    			for(set .@i, 0; .@i < .@query; set .@i, .@i + 1) {
    				sleep2 25; //Slowdown the loop abit.
    				.@at = query_sql("SELECT account_id, char_id FROM "+$GiftTableNameAT$+" WHERE char_id = "+.@char[.@i]+"", .@account_id, .@char_id); // check if in the table
    				if (!.@at) {
    					query_sql("INSERT INTO `" + .GiftTableName$ + "` (char_id, item, value, duration, timestamp) VALUES (" + .@char[.@i] + ", " + .@new_item + ", " + .@new_value + "," + .@duration + "," + .@claimtime + ")");
    				}
    			}
    			mes "Gift registered to (" + .@i + ") players!";
    			break;
    
    		//Register gift to all characters!
    		case 6:
    			mes "[" + strnpcinfo(1) + "]";
    			mes "^009900Gift is ready to go!^000000";
    			mes "Item: ^ff0000" + getitemname(.@new_item) + "^000000";
    			mes "Quantity: ^ff0000" + .@new_value + "^000000";
    			mes "Claim Time: " + .@c + " Minutes";	
    			next;
    			if(select("Send Gift:Cancel") != 1) goto OnLeave;
    			mes "[" + strnpcinfo(1) + "]";
    			mes "Please hold...";
    			set .@query, query_sql("SELECT char_id FROM `"+.CharTableName$+"`",.@char);
    			for(set .@i, 0; .@i < .@query; set .@i, .@i + 1) {
    				sleep2 25; //Slowdown the loop abit.
    				query_sql("INSERT INTO `" + .GiftTableName$ + "` (char_id, item, value, duration, timestamp) VALUES (" + .@char[.@i] + ", " + .@new_item + ", " + .@new_value + "," + .@duration + "," + .@claimtime + ")");
    			}
    			mes "Gift registered to (" + .@i + ") players!";
    			break;
    
    		//Cancel.
    		Default:
    				mes "[Reward Giver]";
    				mes "See you later";
    				break;
    	}
    	close;
    
    OnLeave:
    		mes "[Reward Giver]";
    		mes "See you later";
    		cutin "v_sprakki04",255;
    		close;
    
    OnNotExist:
    		mes "[" + strnpcinfo(1) + "]";
    		mes "This account does not exist!";
    		cutin "v_sprakki04",255;
    		close;
    	
    //============Reset Function=========================
    OnDelete:
    		mes "Which gifts do you want to reset?";
    		mes "1. Single Account";
    		mes "2. Single Character";
    		mes "3. All ^009900Online^000000 Accounts.";
    		mes "4. All Accounts.";
    		mes "5. All ^009900Online^000000 Players/Characters.";
    		mes "6. All Players/Characters.";
    		mes "7. All cancel";
    		switch(select("Single Account:Single Character:^009900Online^000000 Accounts:All Accounts:^009900Online^000000 Characters:All Characters:Specific Item:IPLimit Logs:Cancel"))
    			{
    			case 1: //Single Account
    				mes "[" + strnpcinfo(1) + "]";
    				mes "Please select input type:";
    				mes "By AID or Name?";
    				next;
    				if(select("Account ID:Character Name") == 1)
    				{
    					mes "[" + strnpcinfo(1) + "]";
    					mes "Write account id:";
    					next;
    					input .@new_account, 2000000, 10000000; //Account id range from 2m to 10m.
    					set .@query, query_sql("SELECT account_id FROM `" + .CharTableName$ + "` WHERE account_id = " + .@new_account, .@new_account);
    					if(!.@query) goto OnNotExist;
    					if(select("Continue:Cancel") != 1) goto OnLeave;
    						query_sql("DELETE FROM " + .GiftTableName$ + " WHERE account_id = " + .@new_account);
    				}
    				else
    				{
    					mes "[" + strnpcinfo(1) + "]";
    					mes "Write player name:";
    					next;
    					input .@new_name$;
    					set .@query, query_sql("SELECT account_id FROM `" + .CharTableName$ + "` WHERE name = '" + .@new_name$ + "'", .@new_account);
    					if(!.@query) goto OnNotExist;
    					if(select("Continue:Cancel") != 1) goto OnLeave;
    						query_sql("DELETE FROM " + .GiftTableName$ + " WHERE account_id = " + .@new_account);
    				}
    				break;
    			case 2: //Single Character
    				mes "[" + strnpcinfo(1) + "]";
    				mes "Please select input type:";
    				mes "By CID or Name?";
    				next;
    				if(select("Character ID:Character Name") == 1)
    				{
    					mes "[" + strnpcinfo(1) + "]";
    					mes "Write character id:";
    					next;
    					input .@new_char,150000, 10000000; //Char id range from 150k to 10m.
    					set .@query, query_sql("SELECT account_id, name FROM `" + .CharTableName$ + "` WHERE char_id = " + .@new_char, .@new_accountid, .@new_name$);
    					if(!.@query) goto OnNotExist;
    					if(select("Continue:Cancel") != 1) goto OnLeave;
    						query_sql("DELETE FROM " + .GiftTableName$ + " WHERE char_id = " + .@new_char);
    				}
    				else
    				{
    					mes "[" + strnpcinfo(1) + "]";
    					mes "Write player name:";
    					next;
    					input .@new_name$;
    					set .@query, query_sql("SELECT char_id, account_id FROM `" + .CharTableName$ + "` WHERE name = '" + .@new_name$ + "'", .@new_char, .@new_accountid);
    					if(!.@query) goto OnNotExist;
    					if(select("Continue:Cancel") != 1) goto OnLeave;
    						query_sql("DELETE FROM " + .GiftTableName$ + " WHERE char_id = " + .@new_char);
    				}
    				break;
    			case 3: //All Online Accounts.
    				mes "[" + strnpcinfo(1) + "]";
    				mes "Please hold...";
    				set .@c, 0; //Counting success.
    				set .@query, query_sql("SELECT account_id FROM `"+.CharTableName$+"` WHERE online=1",.@account);
    				for(set .@i, 0; .@i < .@query; set .@i, .@i + 1) {
    					sleep2 25; //Slowdown the loop abit.
    					query_sql("DELETE FROM " + .GiftTableName$ + " WHERE account_id = " + .@account[.@i]);
    				}
    				break;
    			case 4: //All Accounts.
    				query_sql("DELETE FROM " + .GiftTableName$ + " WHERE account_id >= 1");
    				break;
    			case 5: //All Online Players/Characters.
    				mes "[" + strnpcinfo(1) + "]";
    				mes "Please hold...";
    				set .@c, 0; //Counting success.
    				set .@query, query_sql("SELECT char_id FROM `"+.CharTableName$+"` WHERE online=1",.@char);
    				for(set .@i, 0; .@i < .@query; set .@i, .@i + 1)
    					{
    						sleep2 25; //Slowdown the loop abit.
    						query_sql("DELETE FROM " + .GiftTableName$ + " WHERE char_id = " + .@char[.@i]);
    					}
    				break;
    			case 6: //All Players/Characters.
    				query_sql("TRUNCATE TABLE " + .GiftTableName$);
    				break;
    			case 7: // Delete specific item
    				mes "Please type the id of the item you wish to delete";
    				mes "This will delete all entries with the item id you typed";
    				input(.@deletethis);
    				next;
    				mes "Are you sure you want to delete all entries of " + .@deletethis;
    				if (select("Yes:No")==1)
    					{
    						query_sql("DELETE FROM " + .GiftTableName$ + " WHERE item = " + .@deletethis + "");
    					}
    					else
    					{
    						mes "Deletion cancelled";
    						close;
    					}
    			case 8: //All ip logs
    				query_sql("TRUNCATE TABLE " + .GiftTableNameIP$);
    				break;
    			default:
    				break;
    		}
    		next;
    		mes "deletion finished";
    		cutin "v_sprakki04",255;
    		close;
    
    OnLimit:
    	mes "Please enter an ip limit, current limit is " + .ip_limit;
    	input(.ip_limit);
    	mes "Done!";
    	cutin "v_sprakki04",255;
    	close;
    
    //============================================================ 
    // Config/Edit:
    //============================================================ 
    OnLoadSetup:
    	set .Setup, 1;	//OnInit is loaded check.
    	set .GMin, 60;	//Minimum GM level to use gm panel.
    	set .ZenyID,23500; // put this when asked for which item to give zeny.
    	set .MaxZeny,1000000000;
    	//Your table names:
    	set .CharTableName$, "char";	//Character table name(SQL).
    	set .LoginTableName$, "login";
    	set .GiftTableName$, "reward";	//Gift table name(SQL).
    	set .GiftTableNameIP$, "reward_ip";	//Gift table name for ip tracker
    	set $GiftTableNameAT$, "reward_at";	//Gift table name for auto trade tracker
    	//Create gift table <auto_id>, <account_id>, <char_id>, <item>, <value>
    
    	query_sql("CREATE TABLE IF NOT EXISTS `reward` (`id` int(11) NOT NULL AUTO_INCREMENT,`account_id` int(11) unsigned NOT NULL DEFAULT '0',`char_id` int(11) unsigned NOT NULL DEFAULT '0',`item` int(11) NOT NULL DEFAULT '0',`value` int(11) NOT NULL DEFAULT '0',`duration` int(11) NOT NULL DEFAULT '0',`timestamp` int(23) NOT NULL DEFAULT '0',PRIMARY KEY (`id`))");
    	query_sql("CREATE TABLE IF NOT EXISTS `reward_ip` ( `give_id` int(11) NOT NULL,  `item_id` int(11) NOT NULL,  `ip_address` varchar(23) NOT NULL, `claim_count` int(11) NOT NULL,  PRIMARY KEY (`give_id`))");
    	query_sql("CREATE TABLE IF NOT EXISTS `reward_at` (`account_id` int(11) NOT NULL,`char_id` int(11) NOT NULL)");
    	return;
    
    OnInit:
          waitingroom "Prize Giver",0;
    	callsub OnLoadSetup;
    	end;
    }
    
    /* Manual table update for at tracker 
    CREATE TABLE IF NOT EXISTS `reward_at` (
      `account_id` int(11) NOT NULL,
      `char_id` int(11) NOT NULL
    );
    */
    -	script	anti_trader	-1,{
    	
    OnInit:
    	.is_anti_trade = 1; // 0 to disable
    	end;
    	
    }
    function	script	PG_30Seconds	{
    	//dispbottom "anti trader 30sec";
    	//Check if Vending (normal or @at)
    	if(checkvending() >= 1)
    	{
    	   // mark as auto trader
    	   	.@query = query_sql("SELECT account_id, char_id FROM "+$GiftTableNameAT$+" WHERE account_id = "+getcharid(3)+"", .@account_id, .@char_id); // check if in the table
    		if (!.@query)
    		{ // add if not there yet
    			query_sql("INSERT INTO "+$GiftTableNameAT$+"(account_id,char_id) VALUES("+getcharid(3)+","+getcharid(0)+")");
    			//dispbottom "you have been marked as auto trader";
    			stopnpctimer;
    			detachnpctimer;
    			end;
    		}
    	}
    	return;
    }
    function	script	PG_Login	{
    	//dispbottom "at delete";
    	.@query = query_sql("SELECT account_id, char_id FROM "+$GiftTableNameAT$+" WHERE account_id = "+getcharid(3)+"", .@account_id, .@char_id); // check if in the table
    	if (.@query)
    	{ // remove to reverify vending status
    		query_sql("DELETE FROM "+$GiftTableNameAT$+" WHERE account_id = "+getcharid(3)+"");
    	}
    }

    I only put Waitingroom due to the fact that your request for announcement is not precise or accurate. doesn't even know when you want to announce or what to announce..

    As i've seen that you always Request for Waitingrooms.. you can do it by Looking for the OnInit of the script and add the line waitingroom.. if there's no OnInit, you can create one and add the OnInit: waitingroom end;

    i was able to put on some npc with waiting room. but some I cant really handle. Thank you again.  The prize giver worked perfect! YOURE SUPER DUPER AWESOME!.   

    I got problems on quest board.  Npc didn't show up. also got errors.  if its not too much to ask, is it possible to put announce global after get reward from Quest Board? like "thisplayer" completed the monster quest and received Event Ticket"

    image.png.e8ed208fa895930866db6f92b3c836b7.png

  4. Requesting to edit my script to add 

    OnInit:
    waitingroom "Quest Board",0;
    end;
    }

    OnInit:
    waitingroom "Prize Giver",0;
    end;
    }

    and global announce please

    1, Quest Board

    //===== rAthena Script =======================================
    //= tr0n's Questboard
    //===== By: ==================================================
    //= tr0n
    //===== Current Version: =====================================
    //= 1.6.5
    //===== Description: =========================================
    //= Easily add collection and hunting quests.
    //===== Changelogs: ==========================================
    // 1.0.0 Release
    // 1.1.0 Added zeny reward
    // 1.2.0 Rewrote checkmob and killcounter
    // 1.3.1 Added level restriction
    // 1.3.4 Added Reward Item Amount
    // 1.4.4 Added Quest delay
    // 1.5.4 Added repeatable Quests
    // 1.6.4 Added party support
    // 1.6.5 Bug fixes for party support
    //============================================================
    prontera,147,173,5	script	Event Monsters	676,{
    
    	if(c_run==true){
    		mes "[^FF7700Questboard^000000]";
    		mes "^0000FF"+getd("." + currentquest$ + "_collectionname$")+"^000000";
    		mes "--------------------------------";
    		set .@size, getarraysize(getd("."+ currentquest$ + "_collectionitem"));
    		for( set .@j, 0; .@j < .@size; set .@j,.@j+2){
    			mes "^FF0000"+getitemname(getd("."+currentquest$+"_collectionitem["+.@j
    
    +"]"))+" - "+countitem(getd("."+currentquest$+"_collectionitem["+.@j+"]"))+"/"+getd("."+currentquest
    
    $+"_collectionitem["+(.@j+1)+"]")+" ea.^000000";
    		}
    		mes "--------------------------------";
    		mes "[Reward]";
    		mes "Item: ^0000FF"+((getd("." +currentquest$+"_collectionprize"))?getitemname(getd
    
    ("." +currentquest$+"_collectionprize"))+" - "+getd("." +currentquest$+"_collectionamount")+" 
    
    ea.^000000":"Nothing^000000");
    		mes "Zeny: ^0000FF"+getd("." +currentquest$+"_collectionzeny")+"^000000";
    		mes "Base EXP: ^0000FF"+getd("." +currentquest$+"_collectionexp["+0+"]")+"^000000";
    		mes "Job EXP: ^0000FF"+getd("." +currentquest$+"_collectionexp["+1+"]")+"^000000";
    		next;
    		if(select("Finish:Abort") == 2){
    			mes "[^FF7700Questboard^000000]";
    			mes "Quest aborted.";
    			set currentquest$, "";
    			set c_run, false;
    			close;
    		}
    		goto L_checkitems;
    	}
    
    	if(h_run==true){
    		mes "[^FF7700Questboard^000000]";
    		mes "^0000FF"+getd("." + currentquest$ + "_huntingname$")+"^000000";
    		mes "--------------------------------";
    		set .@size, getarraysize(getd("."+ currentquest$ + "_huntingmob"));
    		for( set .@j, 0; .@j < .@size; set .@j,.@j+2){
    			set .@currentmob, getd("."+currentquest$+"_huntingmob["+(.@j)+"]");
    			mes "^FF0000"+strmobinfo(1,getd("."+currentquest$+"_huntingmob["+.@j+"]"))+" 
    
    - "+getd(currentquest$+"_"+.@currentmob+"_"+(.@j+1)+"_killcount")+"/"+getd("."+currentquest$
    
    +"_huntingmob["+(.@j+1)+"]")+" ea.^000000";
    		}
    		mes "--------------------------------";
    		mes "[Reward]";
    		mes "Item: ^0000FF"+((getd("." +currentquest$+"_huntingprize"))?getitemname(getd("." 
    
    +currentquest$+"_huntingprize"))+" - "+getd("." +currentquest$+"_huntingamount")+" 
    
    ea.^000000":"Nothing^000000");
    		mes "Zeny: ^0000FF"+getd("." +currentquest$+"_huntingzeny")+"^000000";
    		mes "Base EXP: ^0000FF"+getd("." +currentquest$+"_huntingexp["+0+"]")+"^000000";
    		mes "Job EXP: ^0000FF"+getd("." +currentquest$+"_huntingexp["+1+"]")+"^000000";
    		next;
    		if(select("Finish:Abort") == 2){
    			mes "[^FF7700Questboard^000000]";
    			mes "Quest aborted.";
    			for(set .@x, 1; .@x < .@size; set .@x,.@x+2){
    				set .@currentmob, getd("."+currentquest$+"_huntingmob["+(.@x-1)+"]");
    				setd(currentquest$+"_"+.@currentmob+"_"+.@x+"_killcount", 0);
    			}
    			set currentquest$, "";
    			set h_run, false;
    			close;
    		}
    		goto L_checkmobs;
    	}
    
    	mes "[^FF7700Questboard^000000]";
    	mes "Select category:";
    	next;
    
    	switch(select((.collection)?"Collection Quests":"",
    				  (.hunting)?"Hunting Quests":"",
    				  "Exit")) {
    
    	case 1:
    		set .@collectmenu$, "";
    		for( set .@i,0; .@i < .collectionquestcount; set .@i,.@i+1){
    			if (.@i) set .@collectmenu$,.@collectmenu$+":";
    			set .@collectmenu$, .@collectmenu$ + "[" + getd("." +(.@i
    
    +1)+"_collectionmin") + " - " + getd("." +(.@i+1)+"_collectionmax") + "] " + getd("." + (.@i+1) + 
    
    "_collectionname$");
    		}
    		set .@selection,select(.@collectmenu$);
    		if(.quest_repeat == true){
    			if(gettimetick(2) < getd(.@selection + "_collection_delay")){
    				set .@time_left, getd(.@selection + "_collection_delay")-gettimetick
    
    (2);
    				mes "[^FF7700Questboard^000000]";
    				mes "You have to wait ^0000FF"+Time2Str(.@time_left)+"^000000 to do 
    
    this quest again.";
    				close;
    			}
    		}
    		else{
    			if(getd(.@selection + "_collection_repeat") == true){
    				mes "[^FF7700Questboard^000000]";
    				mes "You already did this quest.";
    				mes "Please choose another one.";
    				close;
    			}
    		}
    		mes "[^FF7700Questboard^000000]";
    		mes "^0000FF"+getd("." + .@selection + "_collectionname$")+"^000000";
    		mes "--------------------------------";
    		set .@size, getarraysize(getd("."+ .@selection + "_collectionitem"));
    		for( set .@j, 0; .@j < .@size; set .@j,.@j+2){
    			mes "^FF0000"+getitemname(getd("."+.@selection+"_collectionitem["+.@j+"]"))+" 
    
    - "+getd("."+.@selection+"_collectionitem["+(.@j+1)+"]")+" ea.^000000";
    		}
    		mes "--------------------------------";
    		mes "[Reward]";
    		mes "Item: ^0000FF"+((getd("." +.@selection+"_collectionprize"))?getitemname(getd("." 
    
    +.@selection+"_collectionprize"))+" - "+getd("." +.@selection+"_collectionamount")+" 
    
    ea.^000000":"Nothing^000000");
    		mes "Zeny: ^0000FF"+getd("." +.@selection+"_collectionzeny")+"^000000";
    		mes "Base EXP: ^0000FF"+getd("." +.@selection+"_collectionexp["+0+"]")+"^000000";
    		mes "Job EXP: ^0000FF"+getd("." +.@selection+"_collectionexp["+1+"]")+"^000000";
    		next;
    		if(select("Accept:Decline") == 2){
    			close;
    		}
    		if(BaseLevel >= getd("." +.@selection+"_collectionmin") && BaseLevel <= getd("." 
    
    +.@selection+"_collectionmax")){
    			mes "[^FF7700Questboard^000000]";
    			mes "Quest accepted.";
    			set c_run, true;
    			set currentquest$, .@selection;
    			close;
    		}
    		else{
    			mes "[^FF7700Questboard^000000]";
    			mes "You don't have the required";
    			mes "level to do this quest.";
    			close;
    		}
    
    	case 2:
    		set .@huntmenu$, "";
    		for( set .@i,0; .@i < .huntingquestcount; set .@i,.@i+1){
    			if (.@i) set .@huntmenu$,.@huntmenu$+":";
    			set .@huntmenu$, .@huntmenu$ + "[" + getd("." +(.@i+1)+"_huntingmin") + " - " 
    
    + getd("." +(.@i+1)+"_huntingmax") + "] " + getd("." + (.@i+1) + "_huntingname$");
    		}
    		set .@selection,select(.@huntmenu$);
    		if(.quest_repeat == true){
    			if(gettimetick(2) < getd(.@selection + "_hunting_delay")){
    				set .@time_left, getd(.@selection + "_hunting_delay")-gettimetick(2);
    				mes "[^FF7700Questboard^000000]";
    				mes "You have to wait ^0000FF"+Time2Str(.@time_left)+"^000000 to do 
    
    this quest again.";
    				close;
    			}
    		}
    		else{
    			if(getd(.@selection + "_hunting_repeat") == true){
    				mes "[^FF7700Questboard^000000]";
    				mes "You already did this quest.";
    				mes "Please choose another one.";
    				close;
    			}
    		}
    		mes "[^FF7700Questboard^000000]";
    		mes "^0000FF"+getd("." + .@selection + "_huntingname$")+"^000000";
    		mes "--------------------------------";
    		set .@size, getarraysize(getd("."+ .@selection + "_huntingmob"));
    		for( set .@j, 0; .@j < .@size; set .@j,.@j+2){
    			mes "^FF0000"+strmobinfo(1,getd("."+.@selection+"_huntingmob["+.@j+"]"))+" - 
    
    "+getd("."+.@selection+"_huntingmob["+(.@j+1)+"]")+" ea.^000000";
    		}
    		mes "--------------------------------";
    		mes "[Reward]";
    		mes "Item: ^0000FF"+((getd("." +.@selection+"_huntingprize"))?getitemname(getd("." 
    
    +.@selection+"_huntingprize"))+" - "+getd("." +.@selection+"_huntingamount")+" 
    
    ea.^000000":"Nothing^000000");
    		mes "Zeny: ^0000FF"+getd("." +.@selection+"_huntingzeny")+"^000000";
    		mes "Base EXP: ^0000FF"+getd("." +.@selection+"_huntingexp["+0+"]")+"^000000";
    		mes "Job EXP: ^0000FF"+getd("." +.@selection+"_huntingexp["+1+"]")+"^000000";
    		next;
    		if(select("Accept:Decline") == 2){
    			close;
    		}
    		if(BaseLevel >= getd("." +.@selection+"_huntingmin") && BaseLevel <= getd("." 
    
    +.@selection+"_huntingmax")){
    			mes "[^FF7700Questboard^000000]";
    			mes "Quest accepted.";
    			set h_run, true;
    			set currentquest$, .@selection;
    			close;
    		}
    		else{
    			mes "[^FF7700Questboard^000000]";
    			mes "You don't have the required";
    			mes "level to do this quest.";
    			close;
    		}
    
    	case 3:
    		close;
    	}
    
    L_checkitems:
    	set .@size, getarraysize(getd("."+currentquest$+"_collectionitem"));
    	for( set .@k,0; .@k < .@size; set .@k,.@k+2){
    		if(countitem(getd("."+currentquest$+"_collectionitem["+.@k+"]"))>=getd
    
    ("."+currentquest$+"_collectionitem["+(.@k+1)+"]")){
    			set .@checkitem,.@checkitem+2;
    		}
    	}
    	if(.@checkitem<.@size){
    		mes "[^FF7700Questboard^000000]";
    		mes "You don't have everything.";
    		close;
    	}
    	for( set .@delcount,0; .@delcount < .@size; set .@delcount,.@delcount+2){
    		delitem getd("."+currentquest$+"_collectionitem["+.@delcount+"]"),getd
    
    ("."+currentquest$+"_collectionitem["+(.@delcount+1)+"]");
    	}
    	mes "[^FF7700Questboard^000000]";
    	mes "Congratulation! Here is your Reward.";
    	if(getd("." +currentquest$+"_collectionprize")!=0) getitem(getd("." +currentquest$
    
    +"_collectionprize"),getd("." +currentquest$+"_collectionamount"));
    	set Zeny,Zeny+getd("." +currentquest$+"_collectionzeny");
    	getexp getd("." +currentquest$+"_collectionexp["+0+"]"),getd("." +currentquest$
    
    +"_collectionexp["+1+"]");
    	setd(currentquest$ + "_collection_delay"),gettimetick(2)+.quest_delay;
    	setd(currentquest$ + "_collection_repeat"),true;
    	set currentquest$, "";
    	set c_run, false;
    	close;
    
    L_checkmobs:
    	set .@size, getarraysize(getd("."+currentquest$+"_huntingmob"));
    	set .@goal, .@size/2;
    	for(set .@i, 1; .@i < .@size; set .@i,.@i+2){
    		set .@currentmob, getd("."+currentquest$+"_huntingmob["+(.@i-1)+"]");
    		if(getd(currentquest$+"_"+.@currentmob+"_"+.@i+"_killcount")==getd("."+currentquest$
    
    +"_huntingmob["+.@i+"]")){
    			set .@checkmonster, .@checkmonster+1;
    			if(.@checkmonster==.@goal){
    				goto L_checkmobs2;
    			}
    			continue;
    		}
    		goto L_checkmobs2;
    	}
    
    L_checkmobs2:
    	if(.@checkmonster<.@goal){
    		mes "[^FF7700Questboard^000000]";
    		mes "You didn't kill everything.";
    		close;
    	}
    	mes "[^FF7700Questboard^000000]";
    	mes "Congratulation! Here is your Reward.";
    	set .@size, getarraysize(getd("."+currentquest$+"_huntingmob"));
    	for(set .@x, 1; .@x < .@size; set .@x,.@x+2){
    		set .@currentmob, getd("."+currentquest$+"_huntingmob["+(.@x-1)+"]");
    		setd(currentquest$+"_"+.@currentmob+"_"+.@x+"_killcount", 0);
    	}
    	if(getd("." +currentquest$+"_huntingprize")!=0) getitem(getd("." +currentquest$
    
    +"_huntingprize"),getd("." +currentquest$+"_huntingamount"));
    	set Zeny, Zeny+getd("." +currentquest$+"_huntingzeny");
    	getexp getd("." +currentquest$+"_huntingexp["+0+"]"),getd("." +currentquest$+"_huntingexp
    
    ["+1+"]");
    	setd(currentquest$ + "_hunting_delay"),gettimetick(2)+.quest_delay;
    	setd(currentquest$ + "_hunting_repeat"),true;
    	set currentquest$, "";
    	set h_run, false;
    	close;
    
    OnNPCKillEvent:
    	if(h_run!=true) end;
    	set .@size, getarraysize(getd("."+currentquest$+"_huntingmob"));
    	for(set .@i, 1; .@i < .@size; set .@i,.@i+2){
    		if(killedrid==getd("."+currentquest$+"_huntingmob["+(.@i-1)+"]")){
    			set .@currentmob, getd("."+currentquest$+"_huntingmob["+(.@i-1)+"]");
    			if(getd(currentquest$+"_"+.@currentmob+"_"+.@i+"_killcount")<getd
    
    ("."+currentquest$+"_huntingmob["+.@i+"]")){
    				setd(currentquest$+"_"+.@currentmob+"_"+.@i+"_killcount", getd
    
    (currentquest$+"_"+.@currentmob+"_"+.@i+"_killcount")+1);
    				dispbottom getd("."+currentquest$+"_huntingname$")+": ["+strmobinfo
    
    (1,.@currentmob)+"] ("+ getd(currentquest$+"_"+.@currentmob+"_"+.@i+"_killcount")+"/"+getd
    
    ("."+currentquest$+"_huntingmob["+.@i+"]")+")";
    			}
    			if(getcharid(1) != 0 && .party_support == true){
    				getmapxy(.@map1$,.@x1,.@y1);
    				set .@killerid, getcharid(3);
    				set .@currentquest$, currentquest$;
    				getpartymember getcharid(1),1;
    				getpartymember getcharid(1),2;
    				for(set .@j, 0; .@j < $@partymembercount; .@j++){
    					if(isloggedin($@partymemberaid[.@j], $@partymembercid[.@j])){
    						if(h_run==true && $@partymemberaid[.@j] != .@killerid 
    
    && .@currentquest$ == getvar(currentquest$, $@partymembercid[.@j]) && readparam(HP, $@partymembercid
    
    [.@j]) > 0){
    							getmapxy(.@map2$,.@x2,.@y2,BL_PC,rid2name
    
    ($@partymemberaid[.@j]));
    							if(.@map1$ == .@map2$ && distance
    
    (.@x1,.@y1,.@x2,.@y2) < .party_range){
    								set .@kill_amt,getvar(getd
    
    (.@currentquest$+"_"+.@currentmob+"_"+.@i+"_killcount"), $@partymembercid[.@j]);
    								set .@kill_goal,getd
    
    ("."+.@currentquest$+"_huntingmob["+.@i+"]");
    								if(.@kill_amt<.@kill_goal)
    								{
    									setd(.@currentquest$
    
    +"_"+.@currentmob+"_"+.@i+"_killcount", .@kill_amt+1, $@partymembercid[.@j]);
    									dispbottom getd
    
    ("."+.@currentquest$+"_huntingname$")+": ["+strmobinfo(1,.@currentmob)+"] ("+(.@kill_amt
    
    +1)+"/"+.@kill_goal+")", 0xB6FF00, $@partymembercid[.@j];
    								}
    							}
    						}
    					}
    				}
    			}
    			break;
    		}
    	}
    	end;
    
    OnInit:
    	
    	function AddCollection;
    	function AddHunting;
    
    	//Activate/Deactivate quest categories (true/1 - activated, false/0 - deactivated)
    	set .collection, false;
    	set .hunting, true;
    
    	//Quest Delay (seconds)
    	//24 hours = 86400 seconds
    	set .quest_delay, 0;
    
    	//Activate/Deactivate repeatable quests (true/1 - activated, false/0 - deactivated)
    	set .quest_repeat, true;
    
    	//Activate/Deactivate party support (true/1 - activated, false/0 - deactivated)
    	set .party_support, true;
    
    	//Max range for party support (+- x & y coordinations)
    	set .party_range, 25;
    
    	//Checks if quests are loaded (prevents out of index)
    	if(.questsloaded==true) end;
    	set .questsloaded, true;
    
    	//Add Collection Quests here (You can add as many required items as you want)
    	//AddCollection("<Quest Name>",<Min Lvl>,<Max Lvl>,<Reward|Item ID>,<Reward|Item 
    
    Amount>,<Zeny Reward>,<Base EXP>,<Job EXP>,<Item ID>,<Item Amount>,...);
    
    
    	//Add Hunting Quests here (You can add as many required mobs as you want)
    	//AddHunting("<Quest Name>",<Min Lvl>,<Max Lvl>,<Reward|Item ID>,<Reward|Item Amount>,<Zeny 
    
    Reward>,<Base EXP>,<Job EXP>,<Monster ID>,<Monster Amount>,...);
    	Addhunting("Mid-difficulty",1,99,7711,10,50000,50000,40000,1310,100);
    	Addhunting("High-difficulty",1,99,7711,20,50000,100000,80000,1098,100);
    	Addhunting("Extreme-difficulty",1,99,7711,30,100000,200000,160000,1833,100);
    	end;
    
    
    	function AddCollection{
    		set .collectionquestcount,.collectionquestcount+1;
    		setd ("." +.collectionquestcount+"_collectionname$", getarg(0));
    		setd ("." +.collectionquestcount+"_collectionmin", getarg(1));
    		setd ("." +.collectionquestcount+"_collectionmax", getarg(2));
    		setd ("." +.collectionquestcount+"_collectionprize", getarg(3));
    		setd ("." +.collectionquestcount+"_collectionamount", getarg(4));
    		setd ("." +.collectionquestcount+"_collectionzeny", getarg(5));
    		set .@argcount, 6;
    		set .@size, getarraysize(getd("."+ .collectionquestcount + "_collectionexp"));
    		setd ("." +.collectionquestcount+"_collectionexp["+.@size+"]",getarg(.@argcount)); 
    		setd ("." +.collectionquestcount+"_collectionexp["+(.@size+1)+"]",getarg(.@argcount
    
    +1)); 
    		set .@argcount, .@argcount+2;
    		set .@size, getarraysize(getd("."+ .collectionquestcount + "_collectionitem"));
    		while(getarg(.@argcount,-1)!=-1 && getarg(.@argcount+1,-1)!=-1){
    			setd ("."+.collectionquestcount+"_collectionitem["+.@size+"]",getarg
    
    (.@argcount)); 
    			setd ("."+.collectionquestcount+"_collectionitem["+(.@size+1)+"]",getarg
    
    (.@argcount+1));
    			set .@argcount,.@argcount+2;
    			set .@size, .@size+2;
    		}
    		return;
    	}
    
    	function AddHunting{
    		set .huntingquestcount,.huntingquestcount+1;
    		setd ("." +.huntingquestcount+"_huntingname$", getarg(0));
    		setd ("." +.huntingquestcount+"_huntingmin", getarg(1));
    		setd ("." +.huntingquestcount+"_huntingmax", getarg(2));
    		setd ("." +.huntingquestcount+"_huntingprize", getarg(3));
    		setd ("." +.huntingquestcount+"_huntingamount", getarg(4));
    		setd ("." +.huntingquestcount+"_huntingzeny", getarg(5));
    		set .@size, getarraysize(getd("."+ .huntingquestcount + "_huntingexp"));
    		set .@argcount, 6;
    		setd ("." +.huntingquestcount+"_huntingexp["+.@size+"]",getarg(.@argcount));
    		setd ("." +.huntingquestcount+"_huntingexp["+(.@size+1)+"]",getarg(.@argcount+1)); 
    		set .@argcount, .@argcount+2;
    		set .@size, getarraysize(getd("."+ .huntingquestcount + "_huntingmob"));
    		while(getarg(.@argcount,-1)!=-1 && getarg(.@argcount+1,-1)!=-1){
    			setd ("."+.huntingquestcount+"_huntingmob["+.@size+"]",getarg(.@argcount)); 
    			setd ("."+.huntingquestcount+"_huntingmob["+(.@size+1)+"]",getarg(.@argcount
    
    +1));
    			set .@argcount, .@argcount+2;
    			set .@size, .@size+2;
    		}
    		return;
    	}
    }

    2. Prize Giver

    //======= 3ceam Script =======================================
    //= Prize Giver NPC
    //===== Modified By: =========================================
    //= Keitenai
    //===== Current Version: =====================================
    //= 1.0
    //===== Compatible With: =====================================
    //= Athena Project
    //===== Description: =========================================
    //= Prize giver for single char, account and more.
    //===== Additional Comments: =================================
    //= 1.0 Modified Version for 3ceam compatibility
    //============================================================
    prontera,141,175,4	script	Server Reward	113,{
    	//cutin "v_sprakki04",2;
    	//Check if setups are loaded.
    	if(!.Setup)
    		{
    			callsub OnLoadSetup;
    		}
    
    	//Show GM Panel if player is GM.
    	if(getgmlevel() >= .GMin)
    		menu("Take a prize as a player",-,"Give prize",
    				OnManagement,"Reset Item Give",
    				OnDelete,"IP Limit per Item",
    				OnLimit);
    
    	//Read attached player gifts from SQL table.
    	if(select("Get Account Prize!:Get Character Prize!:Exit") == 1)
    		{
    			set .@query, query_sql("SELECT * FROM `" + .GiftTableName$ + "` WHERE account_id="+getcharid(3),
    				.@gift_id,
    				.@gift_account,
    				.@gift_char,
    				.@gift_item,
    				.@gift_amount,
    				.@gift_duration,
    				.@gift_time
    				); //Account gifts.
    		}
    		else if(@menu == 2)
    		{
    			set .@query, query_sql("SELECT * FROM `" + .GiftTableName$ + "` WHERE char_id="+getcharid(0),
    				.@gift_id,
    				.@gift_account,
    				.@gift_char,
    				.@gift_item,
    				.@gift_amount,
    				.@gift_duration,
    				.@gift_time
    				); //Char gifts.
    		}
    		else goto OnLeave;
    
    	//Check if player don't have gifts.
    	if(!.@query)
    		{
    			mes "[Reward Giver]";
    			mes "Sorry, you don't have any prize";
    
    			cutin "v_sprakki04",255;
    			close;
    		}
    
    	//Build menu from query arrays.
    		mes "[" + strnpcinfo(1) + "]";
    		mes "^009900You got the prize^000000";
    			for( set .@i, 0; .@i < .@query; set .@i, .@i + 1 )
    			{
    				mes "(" + .@gift_amount[.@i] + ") " + getitemname(.@gift_item[.@i]) + ".";
    				set .@menu$, .@menu$ + getitemname(.@gift_item[.@i]) + ":";
    			}
    			next;
    			set .@mid,select(.@menu$); //Show menu.
    			set .@mid,.@mid-1;
    
    	if (.@gift_time[.@mid] && .@gift_time[.@mid] < gettimetick(2))
    	{
    		mes "[Reward Giver]";
    		mes "Sorry, this prize's claim time is already over.";
    
    		cutin "v_sprakki04",255;
    		close;
    	}
    	//Item is now selected. Choose what you want to do with it.
    	mes "[" + strnpcinfo(1) + "]";
    	mes "what you want do with (" + .@gift_amount[.@mid] + ") " + getitemname(.@gift_item[.@mid]) + "?";
    	next;
    	set .@Select,select("^009900Get it^000000:^ff0000Delete it! ^000000:nothings");
    
    	//Receive gift selected.
    	if(.@Select == 1)
    	{
    		//Check weight.
    		if(checkweight( .@gift_item, .@gift_amount ) || .@gift_item[.@mid] == .ZenyID)
    		{
    			mes "[" + strnpcinfo(1) + "]";
    			mes "^009900Get : (" + .@gift_amount[.@mid] + ") " + getitemname(.@gift_item[.@mid]) + ".^000000";
    			if (.ip_limit)
    			{
    				// add ip_address to logs
    				.@ipexist = query_sql("SELECT item_id, ip_address, claim_count FROM " + .GiftTableNameIP$ + " WHERE last_ip = (SELECT last_ip FROM login WHERE account_id="+getcharid(3)+") AND item_id = "+.@gift_item[.@mid]+" LIMIT 1", .@item,.@ip,.@claim_count);
    				if (.@claim_count[0] >= .ip_limit)
    				{
    					next;
    					mes "Sorry you have reached the maximum redeem limit for this IP address";
    					cutin "v_sprakki04",255;
    					close;
    				}
    				if (!.@claim_count[0])
    				{
    					query_sql("INSERT INTO " + .GiftTableNameIP$ + " (give_id,item_id,last_ip,claim_count) VALUES("+.@gift_id+","+.@gift_item+",'(SELECT last_ip FROM login WHERE account_id="+getcharid(3)+")',1)");		
    				}
    				else
    				{
    					query_sql("UPDATE " + .GiftTableNameIP$ + " SET claim_count = "+(.@claim_count[0]+1)+" WHERE item_id = "+.@gift_item[.@mid]+" AND last_ip = (SELECT last_ip FROM login WHERE account_id="+getcharid(3)+")");
    				}
    			}
    			if (.@gift_item[.@mid] == .ZenyID) { // detects zeny ID and give zeny.
    				if (Zeny+.@gift_amount[.@mid] > .MaxZeny)
    				{
    					mes "Please make sure that you have enough space to handle all these zennies and come back later.";
    					cutin "v_sprakki04",255;
    					close;
    				}
    				set Zeny,Zeny+.@gift_amount[.@mid];
    			}
    			else
    			{
    				if (!.@gift_duration)
    				{
    					getitem .@gift_item[.@mid], .@gift_amount[.@mid]; //Give item to player.
    				}
    				else
    				{
    					rentitem .@gift_item[.@mid], .@gift_duration * 60; 
    				}
    			}
    			query_sql( "DELETE FROM `" + .GiftTableName$ + "` WHERE id = " + .@gift_id[.@mid] ); //Remove item from table.
    			cutin "v_sprakki04",255;
    			close;
    		}
    		else
    		{
    			//Overweight
    			mes "^ff0000Sorry ^000000 You can't take it " + getitemname(.@gift_item[.@mid]);
    			mes "Could lose some wight?";
    			cutin "v_sprakki04",255;
    			close;
    		}
    	}
    	//Remove gift selected.
    	else if(.@Select == 2) {
    		mes "[" + strnpcinfo(1) + "]";
    		mes "Are you sure you want dellet it?";
    		mes "Gift: ("+.@gift_amount[.@mid]+") "+getitemname(.@gift_item[.@mid])+".";
    		next;
    		if(select("Yes:No") == 1) {
    			mes "[" + strnpcinfo(1) + "]";
    			mes "^ff0000Dellet: ("+.@gift_amount[.@mid]+") "+getitemname(.@gift_item[.@mid])+".^000000";
    			query_sql("DELETE FROM `" + .GiftTableName$ + "` WHERE id = " + .@gift_id[.@mid]); //Remove item from table.
    			cutin "v_sprakki04",255;
    			close;
    		} else {
    			mes "[" + strnpcinfo(1) + "]";
    			mes "we will save it";
    			cutin "v_sprakki04",255;
    			close;
    		}
    	}
    	//Nothing selected.
    	else
    	{
    		goto OnLeave;
    	}
    
    //GM Panel below:
    OnManagement:
    	if(getgmlevel() < .GMin) goto OnLeave;
    	mes "[" + strnpcinfo(1) + "]";
    	mes "Welvome " + strcharinfo(0) + "!";
    	mes "How I can help you?";
    	next;
    
    	if(select("Make Gift:Nothing") != 1) goto OnLeave;
    
    		//Make new gift.
    		mes "[" + strnpcinfo(1) + "]";
    		mes "Please input the item id.";
    		mes "Default: 501";
    	next;
    		mes "What do you want to give?";
    		set .@zenygive,0;
    			if(select("Item:Zeny") == 1)
    				{
    					input .@new_item, 501, 30000;
    				}
    	next;
    	mes "Do you want to add a claim timer?";
    	if(select("No:Yes")==2)
    	{
    		next;
    		mes "How many minutes do you want this reward to be claimable?";
    		input(.@c);
    		.@claimtime = gettimetick(2)+(.@c*60);
    	}
    	if(select("Continue:Cancel") != 1) goto OnLeave;
    		mes "[" + strnpcinfo(1) + "]";
    		mes "How many items/zeny?";
    		mes "Default: 1";
    	next;
    	//item quantity range of 1 to 1,000.
    	if(.@zenygive)
    	{
    		input .@new_value, 1, .MaxZeny;
    	}
    	else
    	{
    		input .@new_value, 1, 1000;
    	}
    	
    	if(select("Continue:Cancel") != 1) goto OnLeave;
    		mes "[" + strnpcinfo(1) + "]";
    		mes "Please select input type:";
    		mes "1. Single Account";
    		mes "2. Single Character";
    		mes "3. All ^009900Online^000000 Accounts.";
    		mes "4. All Accounts.";
    		mes "5. All ^009900Online^000000 Players/Characters.";
    		mes "6. All Players/Characters.";
    		mes "7. ^ff0000Cancel.^000000";
    	next;
    	switch(select("Single Account:Single Character:^009900Online^000000 Accounts:All Accounts:^009900Online^000000 Characters:All Characters:Cancel"))
    	{
    		//Account gift
    		case 1:
    			mes "[" + strnpcinfo(1) + "]";
    			mes "Please select input type:";
    			mes "By AID or Name?";
    			next;
    			if(select("Account ID:Character Name") == 1)
    			{
    				mes "[" + strnpcinfo(1) + "]";
    				mes "Write account id:";
    				next;
    				input .@new_account, 2000000, 10000000; //Account id range from 2m to 10m.
    				set .@query, query_sql("SELECT account_id FROM `" + .CharTableName$ + "` WHERE account_id = " + .@new_account, .@new_account);
    				if(!.@query) goto OnNotExist;
    				if(select("Continue:Cancel") != 1) goto OnLeave;
    				mes "[" + strnpcinfo(1) + "]";
    				mes "^009900Gift is ready to go!^000000";
    				mes "AID: ^ff0000" + .@new_account + "^000000";
    				mes "------------------";
    				mes "Item: ^ff0000" + getitemname(.@new_item) + "^000000";
    				mes "Quantity: ^ff0000" + .@new_value + "^000000";
    				mes "Duration: " + .@duration + " Minutes";
    				mes "Claim Time: " + .@c + " Minutes";
    				next;
    				if(select("Send Gift:Cancel") != 1) goto OnLeave;
    				mes "[" + strnpcinfo(1) + "]";
    				mes "Gift sending success!";
    				//Create gift. <auto_id>, <account_id> <char_id> <item> <value>
    				query_sql("INSERT INTO `" + .GiftTableName$ + "` (account_id, item, value, duration, timestamp) VALUES(" + .@new_account + ", " + .@new_item + ", " + .@new_value + ", " + .@duration + ", " + .@claimtime + ")");
    			}
    			else
    			{
    				mes "[" + strnpcinfo(1) + "]";
    				mes "Write player name:";
    				next;
    				input .@new_name$;
    				set .@query, query_sql("SELECT account_id FROM `" + .CharTableName$ + "` WHERE name = '" + .@new_name$ + "'", .@new_account);
    				if(!.@query) goto OnNotExist;
    				if(select("Continue:Cancel") != 1) goto OnLeave;
    				mes "[" + strnpcinfo(1) + "]";
    				mes "^009900Gift is ready to go!^000000";
    				mes "AID: ^ff0000" + .@new_account + "^000000";
    				mes "Name: ^ff0000"+ .@new_name$ + "^000000";
    				mes "------------------";
    				mes "Item: ^ff0000" + getitemname(.@new_item) + "^000000";
    				mes "Quantity: ^ff0000" + .@new_value + "^000000";
    				mes "Duration: " + .@duration + " Minutes";
    				mes "Claim Time: " + .@c + " Minutes";
    				next;
    				if(select("Send Gift:Cancel") != 1) goto OnLeave;
    				//Check if player is logged in.
    				if(isloggedin(.@new_account)) {
    					mes "[" + strnpcinfo(1) + "]";
    					mes "Gift sending success!";
    					query_sql("INSERT INTO `" + .GiftTableName$ + "` (account_id, item, value, duration, timestamp) VALUES(" + .@new_account + ", " + .@new_item + ", " + .@new_value + ", " + .@duration + ", " + .@claimtime + ")");
    				} else {
    					//Account was not online.
    					mes "[" + strnpcinfo(1) + "]";
    					mes "Gift sending success!";
    					query_sql("INSERT INTO `" + .GiftTableName$ + "` (account_id, item, value, duration, timestamp) VALUES(" + .@new_account + ", " + .@new_item + ", " + .@new_value + ", " + .@duration + ", " + .@claimtime + ")"); // duplicate to other menus - continue here on giver side
    				}
    			}
    			break;
    
    		//Character gift.
    		case 2:
    			mes "[" + strnpcinfo(1) + "]";
    			mes "Please select input type:";
    			mes "By CID or Name?";
    			next;
    			if(select("Character ID:Character Name") == 1)
    			{
    				mes "[" + strnpcinfo(1) + "]";
    				mes "Write character id:";
    				next;
    				input .@new_char,150000, 10000000; //Char id range from 150k to 10m.
    				set .@query, query_sql("SELECT account_id, name FROM `" + .CharTableName$ + "` WHERE char_id = " + .@new_char, .@new_accountid, .@new_name$);
    				if(!.@query) goto OnNotExist;
    				if(select("Continue:Cancel") != 1) goto OnLeave;
    					mes "[" + strnpcinfo(1) + "]";
    					mes "^009900Gift is ready to go!^000000";
    					mes "CID: ^ff0000" + .@new_char + "^000000";
    					mes "Name: ^ff0000" + .@new_name$ + "^000000";
    					mes "------------------";
    					mes "Item: ^ff0000" + getitemname(.@new_item) + "^000000";
    					mes "Quantity: ^ff0000" + .@new_value + "^000000";
    					mes "Duration: " + .@duration + " Minutes";
    					mes "Claim Time: " + .@c + " Minutes";
    				next;
    				if(select("Send Gift:Cancel") != 1) goto OnLeave;
    				//Check if player is logged in.
    				if(isloggedin(.@new_accountid)) {
    					mes "[" + strnpcinfo(1) + "]";
    					mes "Gift sending success!";
    
    					//Create gift. <auto_id>, <account_id> <char_id> <item> <value>
    					query_sql("INSERT INTO `" + .GiftTableName$ + "` (char_id, item, value, duration, timestamp) VALUES (" + .@new_char + ", " + .@new_item + ", " + .@new_value + "," + .@duration + "," + .@claimtime + ")");
    				} else {
    					//not online ask if we still give the gift.
    					mes "[" + strnpcinfo(1) + "]";
    					mes "The character is not online!";
    					mes "Would you still like to send the gift?";
    					next;
    					if(select("Yes:No") != 1) goto OnLeave;
    					mes "[" + strnpcinfo(1) + "]";
    					mes "Gift sending success!";
    					//Create gift. <auto_id>, <account_id> <char_id> <item> <value>
    					query_sql("INSERT INTO `" + .GiftTableName$ + "` (char_id, item, value, duration, timestamp) VALUES (" + .@new_char + ", " + .@new_item + ", " + .@new_value + "," + .@duration + "," + .@claimtime + ")");
    				}
    
    			}
    			else
    			{
    				mes "[" + strnpcinfo(1) + "]";
    				mes "Write player name:";
    				next;
    				input .@new_name$;
    				set .@query, query_sql("SELECT char_id, account_id FROM `" + .CharTableName$ + "` WHERE name = '" + .@new_name$ + "'", .@new_char, .@new_accountid);
    				if(!.@query) goto OnNotExist;
    				if(select("Continue:Cancel") != 1) goto OnLeave;
    					mes "[" + strnpcinfo(1) + "]";
    					mes "^009900Gift is ready to go!^000000";
    					mes "CID: ^ff0000" + .@new_char + "^000000";
    					mes "Name: ^ff0000"+ .@new_name$ + "^000000";
    					mes "------------------";
    					mes "Item: ^ff0000" + getitemname(.@new_item) + "^000000";
    					mes "Quantity: ^ff0000" + .@new_value + "^000000";
    					mes "Duration: " + .@duration + " Minutes";
    					mes "Claim Time: " + .@c + " Minutes";
    				next;
    				if(select("Send Gift:Cancel") != 1) goto OnLeave;
    				//Check if player is logged in.
    				if(isloggedin(.@new_accountid))
    				{
    					mes "[" + strnpcinfo(1) + "]";
    					mes "Gift sending success!";
    					query_sql("INSERT INTO `" + .GiftTableName$ + "` (char_id, item, value, duration, timestamp) VALUES (" + .@new_char + ", " + .@new_item + ", " + .@new_value + "," + .@duration + "," + .@claimtime + ")");
    				}
    				else
    				{
    					//not online ask if we still give the gift.
    					mes "[" + strnpcinfo(1) + "]";
    					mes "The character is not online!";
    					mes "Would you still like to give the gift?";
    					next;
    					if(select("Yes:No") != 1) goto OnLeave;
    					mes "[" + strnpcinfo(1) + "]";
    					mes "Gift sending success!";
    					//Create gift. <auto_id>, <account_id> <char_id> <item> <value>
    					query_sql("INSERT INTO `" + .GiftTableName$ + "` (char_id, item, value, duration, timestamp) VALUES (" + .@new_char + ", " + .@new_item + ", " + .@new_value + "," + .@duration + "," + .@claimtime + ")");
    				}
    			}
    			announce strcharinfo(0)+" successfully sent " + .@new_value + "x " + getitemname(.@new_item) + " to " + .@new_name$,bc_all;
    			break;
    
    		//Register gift to all online accounts!
    		case 3:
    			mes "[" + strnpcinfo(1) + "]";
    			mes "^009900Gift is ready to go!^000000";
    			mes "Item: ^ff0000" + getitemname(.@new_item) + "^000000";
    			mes "Quantity: ^ff0000" + .@new_value + "^000000";
    			mes "Duration: " + .@duration + " Minutes";	
    			mes "Claim Time: " + .@c + " Minutes";
    			next;
    			if(select("Send Gift:Cancel") != 1) goto OnLeave;
    			mes "[" + strnpcinfo(1) + "]";
    			mes "Please hold...";
    			set .@c, 0; //Counting success.
    			set .@query, query_sql("SELECT account_id FROM `"+.CharTableName$+"` WHERE online=1",.@account);
    			for(set .@i, 0; .@i < .@query; set .@i, .@i + 1) {
    				sleep2 25; //Slowdown the loop abit.
    				.@at = query_sql("SELECT account_id, char_id FROM "+$GiftTableNameAT$+" WHERE account_id = "+.@account[.@i]+"", .@account_id, .@char_id); // check if in the table
    				if (!.@at) {		
    					query_sql("INSERT INTO `" + .GiftTableName$ + "` (account_id, item, value, duration, timestamp) VALUES(" + .@account[.@i] + ", " + .@new_item + ", " + .@new_value + ", " + .@duration + ", " + .@claimtime + ")");
    				}
    			}
    			mes "Gift registered to (" + .@i + ") accounts!";
    			break;
    
    		//Register gift to all accounts!
    		case 4:
    			mes "[" + strnpcinfo(1) + "]";
    			mes "^009900Gift is ready to go!^000000";
    			mes "Item: ^ff0000" + getitemname(.@new_item) + "^000000";
    			mes "Quantity: ^ff0000" + .@new_value + "^000000";
    			mes "Claim Time: " + .@c + " Minutes";		
    			next;
    			if(select("Send Gift:Cancel") != 1) goto OnLeave;
    			mes "[" + strnpcinfo(1) + "]";
    			mes "Please hold...";
    			set .@query, query_sql("SELECT account_id FROM `"+.LoginTableName$+"`",.@account);
    			for(set .@i, 0; .@i < .@query; set .@i, .@i + 1) {
    				sleep2 25; //Slowdown the loop abit.
    					query_sql("INSERT INTO `" + .GiftTableName$ + "` (account_id, item, value, duration, timestamp) VALUES(" + .@account[.@i] + ", " + .@new_item + ", " + .@new_value + ", " + .@duration + ", " + .@claimtime + ")");
    			}
    			mes "Gift registered to (" + .@i + ") accounts!";
    			break;
    
    		//Register gift to all online characters!
    		case 5:
    			mes "[" + strnpcinfo(1) + "]";
    			mes "^009900Gift is ready to go!^000000";
    			mes "Item: ^ff0000" + getitemname(.@new_item) + "^000000";
    			mes "Quantity: ^ff0000" + .@new_value + "^000000";
    			mes "Claim Time: " + .@c + " Minutes";		
    			next;
    			if(select("Send Gift:Cancel") != 1) goto OnLeave;
    			mes "[" + strnpcinfo(1) + "]";
    			mes "Please hold...";
    			set .@c, 0; //Counting success.
    			set .@query, query_sql("SELECT char_id FROM `"+.CharTableName$+"` WHERE online=1",.@char);
    			for(set .@i, 0; .@i < .@query; set .@i, .@i + 1) {
    				sleep2 25; //Slowdown the loop abit.
    				.@at = query_sql("SELECT account_id, char_id FROM "+$GiftTableNameAT$+" WHERE char_id = "+.@char[.@i]+"", .@account_id, .@char_id); // check if in the table
    				if (!.@at) {
    					query_sql("INSERT INTO `" + .GiftTableName$ + "` (char_id, item, value, duration, timestamp) VALUES (" + .@char[.@i] + ", " + .@new_item + ", " + .@new_value + "," + .@duration + "," + .@claimtime + ")");
    				}
    			}
    			mes "Gift registered to (" + .@i + ") players!";
    			break;
    
    		//Register gift to all characters!
    		case 6:
    			mes "[" + strnpcinfo(1) + "]";
    			mes "^009900Gift is ready to go!^000000";
    			mes "Item: ^ff0000" + getitemname(.@new_item) + "^000000";
    			mes "Quantity: ^ff0000" + .@new_value + "^000000";
    			mes "Claim Time: " + .@c + " Minutes";	
    			next;
    			if(select("Send Gift:Cancel") != 1) goto OnLeave;
    			mes "[" + strnpcinfo(1) + "]";
    			mes "Please hold...";
    			set .@query, query_sql("SELECT char_id FROM `"+.CharTableName$+"`",.@char);
    			for(set .@i, 0; .@i < .@query; set .@i, .@i + 1) {
    				sleep2 25; //Slowdown the loop abit.
    				query_sql("INSERT INTO `" + .GiftTableName$ + "` (char_id, item, value, duration, timestamp) VALUES (" + .@char[.@i] + ", " + .@new_item + ", " + .@new_value + "," + .@duration + "," + .@claimtime + ")");
    			}
    			mes "Gift registered to (" + .@i + ") players!";
    			break;
    
    		//Cancel.
    		Default:
    				mes "[Reward Giver]";
    				mes "See you later";
    				break;
    	}
    	close;
    
    OnLeave:
    		mes "[Reward Giver]";
    		mes "See you later";
    		cutin "v_sprakki04",255;
    		close;
    
    OnNotExist:
    		mes "[" + strnpcinfo(1) + "]";
    		mes "This account does not exist!";
    		cutin "v_sprakki04",255;
    		close;
    	
    //============Reset Function=========================
    OnDelete:
    		mes "Which gifts do you want to reset?";
    		mes "1. Single Account";
    		mes "2. Single Character";
    		mes "3. All ^009900Online^000000 Accounts.";
    		mes "4. All Accounts.";
    		mes "5. All ^009900Online^000000 Players/Characters.";
    		mes "6. All Players/Characters.";
    		mes "7. All cancel";
    		switch(select("Single Account:Single Character:^009900Online^000000 Accounts:All Accounts:^009900Online^000000 Characters:All Characters:Specific Item:IPLimit Logs:Cancel"))
    			{
    			case 1: //Single Account
    				mes "[" + strnpcinfo(1) + "]";
    				mes "Please select input type:";
    				mes "By AID or Name?";
    				next;
    				if(select("Account ID:Character Name") == 1)
    				{
    					mes "[" + strnpcinfo(1) + "]";
    					mes "Write account id:";
    					next;
    					input .@new_account, 2000000, 10000000; //Account id range from 2m to 10m.
    					set .@query, query_sql("SELECT account_id FROM `" + .CharTableName$ + "` WHERE account_id = " + .@new_account, .@new_account);
    					if(!.@query) goto OnNotExist;
    					if(select("Continue:Cancel") != 1) goto OnLeave;
    						query_sql("DELETE FROM " + .GiftTableName$ + " WHERE account_id = " + .@new_account);
    				}
    				else
    				{
    					mes "[" + strnpcinfo(1) + "]";
    					mes "Write player name:";
    					next;
    					input .@new_name$;
    					set .@query, query_sql("SELECT account_id FROM `" + .CharTableName$ + "` WHERE name = '" + .@new_name$ + "'", .@new_account);
    					if(!.@query) goto OnNotExist;
    					if(select("Continue:Cancel") != 1) goto OnLeave;
    						query_sql("DELETE FROM " + .GiftTableName$ + " WHERE account_id = " + .@new_account);
    				}
    				break;
    			case 2: //Single Character
    				mes "[" + strnpcinfo(1) + "]";
    				mes "Please select input type:";
    				mes "By CID or Name?";
    				next;
    				if(select("Character ID:Character Name") == 1)
    				{
    					mes "[" + strnpcinfo(1) + "]";
    					mes "Write character id:";
    					next;
    					input .@new_char,150000, 10000000; //Char id range from 150k to 10m.
    					set .@query, query_sql("SELECT account_id, name FROM `" + .CharTableName$ + "` WHERE char_id = " + .@new_char, .@new_accountid, .@new_name$);
    					if(!.@query) goto OnNotExist;
    					if(select("Continue:Cancel") != 1) goto OnLeave;
    						query_sql("DELETE FROM " + .GiftTableName$ + " WHERE char_id = " + .@new_char);
    				}
    				else
    				{
    					mes "[" + strnpcinfo(1) + "]";
    					mes "Write player name:";
    					next;
    					input .@new_name$;
    					set .@query, query_sql("SELECT char_id, account_id FROM `" + .CharTableName$ + "` WHERE name = '" + .@new_name$ + "'", .@new_char, .@new_accountid);
    					if(!.@query) goto OnNotExist;
    					if(select("Continue:Cancel") != 1) goto OnLeave;
    						query_sql("DELETE FROM " + .GiftTableName$ + " WHERE char_id = " + .@new_char);
    				}
    				break;
    			case 3: //All Online Accounts.
    				mes "[" + strnpcinfo(1) + "]";
    				mes "Please hold...";
    				set .@c, 0; //Counting success.
    				set .@query, query_sql("SELECT account_id FROM `"+.CharTableName$+"` WHERE online=1",.@account);
    				for(set .@i, 0; .@i < .@query; set .@i, .@i + 1) {
    					sleep2 25; //Slowdown the loop abit.
    					query_sql("DELETE FROM " + .GiftTableName$ + " WHERE account_id = " + .@account[.@i]);
    				}
    				break;
    			case 4: //All Accounts.
    				query_sql("DELETE FROM " + .GiftTableName$ + " WHERE account_id >= 1");
    				break;
    			case 5: //All Online Players/Characters.
    				mes "[" + strnpcinfo(1) + "]";
    				mes "Please hold...";
    				set .@c, 0; //Counting success.
    				set .@query, query_sql("SELECT char_id FROM `"+.CharTableName$+"` WHERE online=1",.@char);
    				for(set .@i, 0; .@i < .@query; set .@i, .@i + 1)
    					{
    						sleep2 25; //Slowdown the loop abit.
    						query_sql("DELETE FROM " + .GiftTableName$ + " WHERE char_id = " + .@char[.@i]);
    					}
    				break;
    			case 6: //All Players/Characters.
    				query_sql("TRUNCATE TABLE " + .GiftTableName$);
    				break;
    			case 7: // Delete specific item
    				mes "Please type the id of the item you wish to delete";
    				mes "This will delete all entries with the item id you typed";
    				input(.@deletethis);
    				next;
    				mes "Are you sure you want to delete all entries of " + .@deletethis;
    				if (select("Yes:No")==1)
    					{
    						query_sql("DELETE FROM " + .GiftTableName$ + " WHERE item = " + .@deletethis + "");
    					}
    					else
    					{
    						mes "Deletion cancelled";
    						close;
    					}
    			case 8: //All ip logs
    				query_sql("TRUNCATE TABLE " + .GiftTableNameIP$);
    				break;
    			default:
    				break;
    		}
    		next;
    		mes "deletion finished";
    		cutin "v_sprakki04",255;
    		close;
    
    OnLimit:
    	mes "Please enter an ip limit, current limit is " + .ip_limit;
    	input(.ip_limit);
    	mes "Done!";
    	cutin "v_sprakki04",255;
    	close;
    
    //============================================================ 
    // Config/Edit:
    //============================================================ 
    OnLoadSetup:
    	set .Setup, 1;	//OnInit is loaded check.
    	set .GMin, 60;	//Minimum GM level to use gm panel.
    	set .ZenyID,23500; // put this when asked for which item to give zeny.
    	set .MaxZeny,1000000000;
    	//Your table names:
    	set .CharTableName$, "char";	//Character table name(SQL).
    	set .LoginTableName$, "login";
    	set .GiftTableName$, "reward";	//Gift table name(SQL).
    	set .GiftTableNameIP$, "reward_ip";	//Gift table name for ip tracker
    	set $GiftTableNameAT$, "reward_at";	//Gift table name for auto trade tracker
    	//Create gift table <auto_id>, <account_id>, <char_id>, <item>, <value>
    
    	query_sql("CREATE TABLE IF NOT EXISTS `reward` (`id` int(11) NOT NULL AUTO_INCREMENT,`account_id` int(11) unsigned NOT NULL DEFAULT '0',`char_id` int(11) unsigned NOT NULL DEFAULT '0',`item` int(11) NOT NULL DEFAULT '0',`value` int(11) NOT NULL DEFAULT '0',`duration` int(11) NOT NULL DEFAULT '0',`timestamp` int(23) NOT NULL DEFAULT '0',PRIMARY KEY (`id`))");
    	query_sql("CREATE TABLE IF NOT EXISTS `reward_ip` ( `give_id` int(11) NOT NULL,  `item_id` int(11) NOT NULL,  `ip_address` varchar(23) NOT NULL, `claim_count` int(11) NOT NULL,  PRIMARY KEY (`give_id`))");
    	query_sql("CREATE TABLE IF NOT EXISTS `reward_at` (`account_id` int(11) NOT NULL,`char_id` int(11) NOT NULL)");
    	return;
    
    OnInit:
    	callsub OnLoadSetup;
    	end;
    }
    
    /* Manual table update for at tracker 
    CREATE TABLE IF NOT EXISTS `reward_at` (
      `account_id` int(11) NOT NULL,
      `char_id` int(11) NOT NULL
    );
    */
    -	script	anti_trader	-1,{
    	
    OnInit:
    	.is_anti_trade = 1; // 0 to disable
    	end;
    	
    }
    function	script	PG_30Seconds	{
    	//dispbottom "anti trader 30sec";
    	//Check if Vending (normal or @at)
    	if(checkvending() >= 1)
    	{
    	   // mark as auto trader
    	   	.@query = query_sql("SELECT account_id, char_id FROM "+$GiftTableNameAT$+" WHERE account_id = "+getcharid(3)+"", .@account_id, .@char_id); // check if in the table
    		if (!.@query)
    		{ // add if not there yet
    			query_sql("INSERT INTO "+$GiftTableNameAT$+"(account_id,char_id) VALUES("+getcharid(3)+","+getcharid(0)+")");
    			//dispbottom "you have been marked as auto trader";
    			stopnpctimer;
    			detachnpctimer;
    			end;
    		}
    	}
    	return;
    }
    function	script	PG_Login	{
    	//dispbottom "at delete";
    	.@query = query_sql("SELECT account_id, char_id FROM "+$GiftTableNameAT$+" WHERE account_id = "+getcharid(3)+"", .@account_id, .@char_id); // check if in the table
    	if (.@query)
    	{ // remove to reverify vending status
    		query_sql("DELETE FROM "+$GiftTableNameAT$+" WHERE account_id = "+getcharid(3)+"");
    	}
    }

    Please. I need your help master scripters

  5. Hello guys. I keep on screwing this script.

    Can you put announce and pubchat (waitingroom "Prize Giver",0;) on this npc please?

    //======= 3ceam Script =======================================
    //= Prize Giver NPC
    //===== Modified By: =========================================
    //= Keitenai
    //===== Current Version: =====================================
    //= 1.0
    //===== Compatible With: =====================================
    //= Athena Project
    //===== Description: =========================================
    //= Prize giver for single char, account and more.
    //===== Additional Comments: =================================
    //= 1.0 Modified Version for 3ceam compatibility
    //============================================================
    
    prontera,147,173,4	script	Server Reward	544,{
    	//cutin "v_sprakki04",2;
    	//Check if setups are loaded.
    	if(!.Setup)
    		{
    			callsub OnLoadSetup;
    		}
    
    	//Show GM Panel if player is GM.
    	if(getgmlevel() >= .GMin)
    		menu("Take a prize as a player",-,"Give prize",
    				OnManagement,"Reset Item Give",
    				OnDelete,"IP Limit per Item",
    				OnLimit);
    
    	//Read attached player gifts from SQL table.
    	if(select("Get Account Prize!:Get Character Prize!:Exit") == 1)
    		{
    			set .@query, query_sql("SELECT * FROM `" + .GiftTableName$ + "` WHERE account_id="+getcharid(3),
    				.@gift_id,
    				.@gift_account,
    				.@gift_char,
    				.@gift_item,
    				.@gift_amount,
    				.@gift_duration,
    				.@gift_time
    				); //Account gifts.
    		}
    		else if(@menu == 2)
    		{
    			set .@query, query_sql("SELECT * FROM `" + .GiftTableName$ + "` WHERE char_id="+getcharid(0),
    				.@gift_id,
    				.@gift_account,
    				.@gift_char,
    				.@gift_item,
    				.@gift_amount,
    				.@gift_duration,
    				.@gift_time
    				); //Char gifts.
    		}
    		else goto OnLeave;
    
    	//Check if player don't have gifts.
    	if(!.@query)
    		{
    			mes "[Reward Giver]";
    			mes "Sorry, you don't have any prize";
    
    			cutin "v_sprakki04",255;
    			close;
    		}
    
    	//Build menu from query arrays.
    		mes "[" + strnpcinfo(1) + "]";
    		mes "^009900You got the prize^000000";
    			for( set .@i, 0; .@i < .@query; set .@i, .@i + 1 )
    			{
    				mes "(" + .@gift_amount[.@i] + ") " + getitemname(.@gift_item[.@i]) + ".";
    				set .@menu$, .@menu$ + getitemname(.@gift_item[.@i]) + ":";
    			}
    			next;
    			set .@mid,select(.@menu$); //Show menu.
    			set .@mid,.@mid-1;
    
    	if (.@gift_time[.@mid] && .@gift_time[.@mid] < gettimetick(2))
    	{
    		mes "[Reward Giver]";
    		mes "Sorry, this prize's claim time is already over.";
    
    		cutin "v_sprakki04",255;
    		close;
    	}
    	//Item is now selected. Choose what you want to do with it.
    	mes "[" + strnpcinfo(1) + "]";
    	mes "what you want do with (" + .@gift_amount[.@mid] + ") " + getitemname(.@gift_item[.@mid]) + "?";
    	next;
    	set .@Select,select("^009900Get it^000000:^ff0000Delete it! ^000000:nothings");
    
    	//Receive gift selected.
    	if(.@Select == 1)
    	{
    		//Check weight.
    		if(checkweight( .@gift_item, .@gift_amount ) || .@gift_item[.@mid] == .ZenyID)
    		{
    			mes "[" + strnpcinfo(1) + "]";
    			mes "^009900Get : (" + .@gift_amount[.@mid] + ") " + getitemname(.@gift_item[.@mid]) + ".^000000";
    			if (.ip_limit)
    			{
    				// add ip_address to logs
    				.@ipexist = query_sql("SELECT item_id, ip_address, claim_count FROM " + .GiftTableNameIP$ + " WHERE last_ip = (SELECT last_ip FROM login WHERE account_id="+getcharid(3)+") AND item_id = "+.@gift_item[.@mid]+" LIMIT 1", .@item,.@ip,.@claim_count);
    				if (.@claim_count[0] >= .ip_limit)
    				{
    					next;
    					mes "Sorry you have reached the maximum redeem limit for this IP address";
    					cutin "v_sprakki04",255;
    					close;
    				}
    				if (!.@claim_count[0])
    				{
    					query_sql("INSERT INTO " + .GiftTableNameIP$ + " (give_id,item_id,last_ip,claim_count) VALUES("+.@gift_id+","+.@gift_item+",'(SELECT last_ip FROM login WHERE account_id="+getcharid(3)+")',1)");		
    				}
    				else
    				{
    					query_sql("UPDATE " + .GiftTableNameIP$ + " SET claim_count = "+(.@claim_count[0]+1)+" WHERE item_id = "+.@gift_item[.@mid]+" AND last_ip = (SELECT last_ip FROM login WHERE account_id="+getcharid(3)+")");
    				}
    			}
    			if (.@gift_item[.@mid] == .ZenyID) { // detects zeny ID and give zeny.
    				if (Zeny+.@gift_amount[.@mid] > .MaxZeny)
    				{
    					mes "Please make sure that you have enough space to handle all these zennies and come back later.";
    					cutin "v_sprakki04",255;
    					close;
    				}
    				set Zeny,Zeny+.@gift_amount[.@mid];
    			}
    			else
    			{
    				if (!.@gift_duration)
    				{
    					getitem .@gift_item[.@mid], .@gift_amount[.@mid]; //Give item to player.
    				}
    				else
    				{
    					rentitem .@gift_item[.@mid], .@gift_duration * 60; 
    				}
    			}
    			query_sql( "DELETE FROM `" + .GiftTableName$ + "` WHERE id = " + .@gift_id[.@mid] ); //Remove item from table.
    			cutin "v_sprakki04",255;
    			close;
    		}
    		else
    		{
    			//Overweight
    			mes "^ff0000Sorry ^000000 You can't take it " + getitemname(.@gift_item[.@mid]);
    			mes "Could lose some wight?";
    			cutin "v_sprakki04",255;
    			close;
    		}
    	}
    	//Remove gift selected.
    	else if(.@Select == 2) {
    		mes "[" + strnpcinfo(1) + "]";
    		mes "Are you sure you want dellet it?";
    		mes "Gift: ("+.@gift_amount[.@mid]+") "+getitemname(.@gift_item[.@mid])+".";
    		next;
    		if(select("Yes:No") == 1) {
    			mes "[" + strnpcinfo(1) + "]";
    			mes "^ff0000Dellet: ("+.@gift_amount[.@mid]+") "+getitemname(.@gift_item[.@mid])+".^000000";
    			query_sql("DELETE FROM `" + .GiftTableName$ + "` WHERE id = " + .@gift_id[.@mid]); //Remove item from table.
    			cutin "v_sprakki04",255;
    			close;
    		} else {
    			mes "[" + strnpcinfo(1) + "]";
    			mes "we will save it";
    			cutin "v_sprakki04",255;
    			close;
    		}
    	}
    	//Nothing selected.
    	else
    	{
    		goto OnLeave;
    	}
    
    //GM Panel below:
    OnManagement:
    	if(getgmlevel() < .GMin) goto OnLeave;
    	mes "[" + strnpcinfo(1) + "]";
    	mes "Welvome " + strcharinfo(0) + "!";
    	mes "How I can help you?";
    	next;
    
    	if(select("Make Gift:Nothing") != 1) goto OnLeave;
    
    		//Make new gift.
    		mes "[" + strnpcinfo(1) + "]";
    		mes "Please input the item id.";
    		mes "Default: 501";
    	next;
    		mes "What do you want to give?";
    		set .@zenygive,0;
    			if(select("Item:Zeny") == 1)
    				{
    					input .@new_item, 501, 30000;
    				}
    	next;
    	mes "Do you want to add a claim timer?";
    	if(select("No:Yes")==2)
    	{
    		next;
    		mes "How many minutes do you want this reward to be claimable?";
    		input(.@c);
    		.@claimtime = gettimetick(2)+(.@c*60);
    	}
    	if(select("Continue:Cancel") != 1) goto OnLeave;
    		mes "[" + strnpcinfo(1) + "]";
    		mes "How many items/zeny?";
    		mes "Default: 1";
    	next;
    	//item quantity range of 1 to 1,000.
    	if(.@zenygive)
    	{
    		input .@new_value, 1, .MaxZeny;
    	}
    	else
    	{
    		input .@new_value, 1, 1000;
    	}
    	
    	if(select("Continue:Cancel") != 1) goto OnLeave;
    		mes "[" + strnpcinfo(1) + "]";
    		mes "Please select input type:";
    		mes "1. Single Account";
    		mes "2. Single Character";
    		mes "3. All ^009900Online^000000 Accounts.";
    		mes "4. All Accounts.";
    		mes "5. All ^009900Online^000000 Players/Characters.";
    		mes "6. All Players/Characters.";
    		mes "7. ^ff0000Cancel.^000000";
    	next;
    	switch(select("Single Account:Single Character:^009900Online^000000 Accounts:All Accounts:^009900Online^000000 Characters:All Characters:Cancel"))
    	{
    		//Account gift
    		case 1:
    			mes "[" + strnpcinfo(1) + "]";
    			mes "Please select input type:";
    			mes "By AID or Name?";
    			next;
    			if(select("Account ID:Character Name") == 1)
    			{
    				mes "[" + strnpcinfo(1) + "]";
    				mes "Write account id:";
    				next;
    				input .@new_account, 2000000, 10000000; //Account id range from 2m to 10m.
    				set .@query, query_sql("SELECT account_id FROM `" + .CharTableName$ + "` WHERE account_id = " + .@new_account, .@new_account);
    				if(!.@query) goto OnNotExist;
    				if(select("Continue:Cancel") != 1) goto OnLeave;
    				mes "[" + strnpcinfo(1) + "]";
    				mes "^009900Gift is ready to go!^000000";
    				mes "AID: ^ff0000" + .@new_account + "^000000";
    				mes "------------------";
    				mes "Item: ^ff0000" + getitemname(.@new_item) + "^000000";
    				mes "Quantity: ^ff0000" + .@new_value + "^000000";
    				mes "Duration: " + .@duration + " Minutes";
    				mes "Claim Time: " + .@c + " Minutes";
    				next;
    				if(select("Send Gift:Cancel") != 1) goto OnLeave;
    				mes "[" + strnpcinfo(1) + "]";
    				mes "Gift sending success!";
    				//Create gift. <auto_id>, <account_id> <char_id> <item> <value>
    				query_sql("INSERT INTO `" + .GiftTableName$ + "` (account_id, item, value, duration, timestamp) VALUES(" + .@new_account + ", " + .@new_item + ", " + .@new_value + ", " + .@duration + ", " + .@claimtime + ")");
    			}
    			else
    			{
    				mes "[" + strnpcinfo(1) + "]";
    				mes "Write player name:";
    				next;
    				input .@new_name$;
    				set .@query, query_sql("SELECT account_id FROM `" + .CharTableName$ + "` WHERE name = '" + .@new_name$ + "'", .@new_account);
    				if(!.@query) goto OnNotExist;
    				if(select("Continue:Cancel") != 1) goto OnLeave;
    				mes "[" + strnpcinfo(1) + "]";
    				mes "^009900Gift is ready to go!^000000";
    				mes "AID: ^ff0000" + .@new_account + "^000000";
    				mes "Name: ^ff0000"+ .@new_name$ + "^000000";
    				mes "------------------";
    				mes "Item: ^ff0000" + getitemname(.@new_item) + "^000000";
    				mes "Quantity: ^ff0000" + .@new_value + "^000000";
    				mes "Duration: " + .@duration + " Minutes";
    				mes "Claim Time: " + .@c + " Minutes";
    				next;
    				if(select("Send Gift:Cancel") != 1) goto OnLeave;
    				//Check if player is logged in.
    				if(isloggedin(.@new_account)) {
    					mes "[" + strnpcinfo(1) + "]";
    					mes "Gift sending success!";
    					query_sql("INSERT INTO `" + .GiftTableName$ + "` (account_id, item, value, duration, timestamp) VALUES(" + .@new_account + ", " + .@new_item + ", " + .@new_value + ", " + .@duration + ", " + .@claimtime + ")");
    				} else {
    					//Account was not online.
    					mes "[" + strnpcinfo(1) + "]";
    					mes "Gift sending success!";
    					query_sql("INSERT INTO `" + .GiftTableName$ + "` (account_id, item, value, duration, timestamp) VALUES(" + .@new_account + ", " + .@new_item + ", " + .@new_value + ", " + .@duration + ", " + .@claimtime + ")"); // duplicate to other menus - continue here on giver side
    				}
    			}
    			break;
    
    		//Character gift.
    		case 2:
    			mes "[" + strnpcinfo(1) + "]";
    			mes "Please select input type:";
    			mes "By CID or Name?";
    			next;
    			if(select("Character ID:Character Name") == 1)
    			{
    				mes "[" + strnpcinfo(1) + "]";
    				mes "Write character id:";
    				next;
    				input .@new_char,150000, 10000000; //Char id range from 150k to 10m.
    				set .@query, query_sql("SELECT account_id, name FROM `" + .CharTableName$ + "` WHERE char_id = " + .@new_char, .@new_accountid, .@new_name$);
    				if(!.@query) goto OnNotExist;
    				if(select("Continue:Cancel") != 1) goto OnLeave;
    					mes "[" + strnpcinfo(1) + "]";
    					mes "^009900Gift is ready to go!^000000";
    					mes "CID: ^ff0000" + .@new_char + "^000000";
    					mes "Name: ^ff0000" + .@new_name$ + "^000000";
    					mes "------------------";
    					mes "Item: ^ff0000" + getitemname(.@new_item) + "^000000";
    					mes "Quantity: ^ff0000" + .@new_value + "^000000";
    					mes "Duration: " + .@duration + " Minutes";
    					mes "Claim Time: " + .@c + " Minutes";
    				next;
    				if(select("Send Gift:Cancel") != 1) goto OnLeave;
    				//Check if player is logged in.
    				if(isloggedin(.@new_accountid)) {
    					mes "[" + strnpcinfo(1) + "]";
    					mes "Gift sending success!";
    
    					//Create gift. <auto_id>, <account_id> <char_id> <item> <value>
    					query_sql("INSERT INTO `" + .GiftTableName$ + "` (char_id, item, value, duration, timestamp) VALUES (" + .@new_char + ", " + .@new_item + ", " + .@new_value + "," + .@duration + "," + .@claimtime + ")");
    				} else {
    					//not online ask if we still give the gift.
    					mes "[" + strnpcinfo(1) + "]";
    					mes "The character is not online!";
    					mes "Would you still like to send the gift?";
    					next;
    					if(select("Yes:No") != 1) goto OnLeave;
    					mes "[" + strnpcinfo(1) + "]";
    					mes "Gift sending success!";
    					//Create gift. <auto_id>, <account_id> <char_id> <item> <value>
    					query_sql("INSERT INTO `" + .GiftTableName$ + "` (char_id, item, value, duration, timestamp) VALUES (" + .@new_char + ", " + .@new_item + ", " + .@new_value + "," + .@duration + "," + .@claimtime + ")");
    				}
    
    			}
    			else
    			{
    				mes "[" + strnpcinfo(1) + "]";
    				mes "Write player name:";
    				next;
    				input .@new_name$;
    				set .@query, query_sql("SELECT char_id, account_id FROM `" + .CharTableName$ + "` WHERE name = '" + .@new_name$ + "'", .@new_char, .@new_accountid);
    				if(!.@query) goto OnNotExist;
    				if(select("Continue:Cancel") != 1) goto OnLeave;
    					mes "[" + strnpcinfo(1) + "]";
    					mes "^009900Gift is ready to go!^000000";
    					mes "CID: ^ff0000" + .@new_char + "^000000";
    					mes "Name: ^ff0000"+ .@new_name$ + "^000000";
    					mes "------------------";
    					mes "Item: ^ff0000" + getitemname(.@new_item) + "^000000";
    					mes "Quantity: ^ff0000" + .@new_value + "^000000";
    					mes "Duration: " + .@duration + " Minutes";
    					mes "Claim Time: " + .@c + " Minutes";
    				next;
    				if(select("Send Gift:Cancel") != 1) goto OnLeave;
    				//Check if player is logged in.
    				if(isloggedin(.@new_accountid))
    				{
    					mes "[" + strnpcinfo(1) + "]";
    					mes "Gift sending success!";
    					query_sql("INSERT INTO `" + .GiftTableName$ + "` (char_id, item, value, duration, timestamp) VALUES (" + .@new_char + ", " + .@new_item + ", " + .@new_value + "," + .@duration + "," + .@claimtime + ")");
    				}
    				else
    				{
    					//not online ask if we still give the gift.
    					mes "[" + strnpcinfo(1) + "]";
    					mes "The character is not online!";
    					mes "Would you still like to give the gift?";
    					next;
    					if(select("Yes:No") != 1) goto OnLeave;
    					mes "[" + strnpcinfo(1) + "]";
    					mes "Gift sending success!";
    					//Create gift. <auto_id>, <account_id> <char_id> <item> <value>
    					query_sql("INSERT INTO `" + .GiftTableName$ + "` (char_id, item, value, duration, timestamp) VALUES (" + .@new_char + ", " + .@new_item + ", " + .@new_value + "," + .@duration + "," + .@claimtime + ")");
    				}
    			}
    			announce strcharinfo(0)+" successfully sent " + .@new_value + "x " + getitemname(.@new_item) + " to " + .@new_name$,bc_all;
    			break;
    
    		//Register gift to all online accounts!
    		case 3:
    			mes "[" + strnpcinfo(1) + "]";
    			mes "^009900Gift is ready to go!^000000";
    			mes "Item: ^ff0000" + getitemname(.@new_item) + "^000000";
    			mes "Quantity: ^ff0000" + .@new_value + "^000000";
    			mes "Duration: " + .@duration + " Minutes";	
    			mes "Claim Time: " + .@c + " Minutes";
    			next;
    			if(select("Send Gift:Cancel") != 1) goto OnLeave;
    			mes "[" + strnpcinfo(1) + "]";
    			mes "Please hold...";
    			set .@c, 0; //Counting success.
    			set .@query, query_sql("SELECT account_id FROM `"+.CharTableName$+"` WHERE online=1",.@account);
    			for(set .@i, 0; .@i < .@query; set .@i, .@i + 1) {
    				sleep2 25; //Slowdown the loop abit.
    				.@at = query_sql("SELECT account_id, char_id FROM "+$GiftTableNameAT$+" WHERE account_id = "+.@account[.@i]+"", .@account_id, .@char_id); // check if in the table
    				if (!.@at) {		
    					query_sql("INSERT INTO `" + .GiftTableName$ + "` (account_id, item, value, duration, timestamp) VALUES(" + .@account[.@i] + ", " + .@new_item + ", " + .@new_value + ", " + .@duration + ", " + .@claimtime + ")");
    				}
    			}
    			mes "Gift registered to (" + .@i + ") accounts!";
    			break;
    
    		//Register gift to all accounts!
    		case 4:
    			mes "[" + strnpcinfo(1) + "]";
    			mes "^009900Gift is ready to go!^000000";
    			mes "Item: ^ff0000" + getitemname(.@new_item) + "^000000";
    			mes "Quantity: ^ff0000" + .@new_value + "^000000";
    			mes "Claim Time: " + .@c + " Minutes";		
    			next;
    			if(select("Send Gift:Cancel") != 1) goto OnLeave;
    			mes "[" + strnpcinfo(1) + "]";
    			mes "Please hold...";
    			set .@query, query_sql("SELECT account_id FROM `"+.LoginTableName$+"`",.@account);
    			for(set .@i, 0; .@i < .@query; set .@i, .@i + 1) {
    				sleep2 25; //Slowdown the loop abit.
    					query_sql("INSERT INTO `" + .GiftTableName$ + "` (account_id, item, value, duration, timestamp) VALUES(" + .@account[.@i] + ", " + .@new_item + ", " + .@new_value + ", " + .@duration + ", " + .@claimtime + ")");
    			}
    			mes "Gift registered to (" + .@i + ") accounts!";
    			break;
    
    		//Register gift to all online characters!
    		case 5:
    			mes "[" + strnpcinfo(1) + "]";
    			mes "^009900Gift is ready to go!^000000";
    			mes "Item: ^ff0000" + getitemname(.@new_item) + "^000000";
    			mes "Quantity: ^ff0000" + .@new_value + "^000000";
    			mes "Claim Time: " + .@c + " Minutes";		
    			next;
    			if(select("Send Gift:Cancel") != 1) goto OnLeave;
    			mes "[" + strnpcinfo(1) + "]";
    			mes "Please hold...";
    			set .@c, 0; //Counting success.
    			set .@query, query_sql("SELECT char_id FROM `"+.CharTableName$+"` WHERE online=1",.@char);
    			for(set .@i, 0; .@i < .@query; set .@i, .@i + 1) {
    				sleep2 25; //Slowdown the loop abit.
    				.@at = query_sql("SELECT account_id, char_id FROM "+$GiftTableNameAT$+" WHERE char_id = "+.@char[.@i]+"", .@account_id, .@char_id); // check if in the table
    				if (!.@at) {
    					query_sql("INSERT INTO `" + .GiftTableName$ + "` (char_id, item, value, duration, timestamp) VALUES (" + .@char[.@i] + ", " + .@new_item + ", " + .@new_value + "," + .@duration + "," + .@claimtime + ")");
    				}
    			}
    			mes "Gift registered to (" + .@i + ") players!";
    			break;
    
    		//Register gift to all characters!
    		case 6:
    			mes "[" + strnpcinfo(1) + "]";
    			mes "^009900Gift is ready to go!^000000";
    			mes "Item: ^ff0000" + getitemname(.@new_item) + "^000000";
    			mes "Quantity: ^ff0000" + .@new_value + "^000000";
    			mes "Claim Time: " + .@c + " Minutes";	
    			next;
    			if(select("Send Gift:Cancel") != 1) goto OnLeave;
    			mes "[" + strnpcinfo(1) + "]";
    			mes "Please hold...";
    			set .@query, query_sql("SELECT char_id FROM `"+.CharTableName$+"`",.@char);
    			for(set .@i, 0; .@i < .@query; set .@i, .@i + 1) {
    				sleep2 25; //Slowdown the loop abit.
    				query_sql("INSERT INTO `" + .GiftTableName$ + "` (char_id, item, value, duration, timestamp) VALUES (" + .@char[.@i] + ", " + .@new_item + ", " + .@new_value + "," + .@duration + "," + .@claimtime + ")");
    			}
    			mes "Gift registered to (" + .@i + ") players!";
    			break;
    
    		//Cancel.
    		Default:
    				mes "[Reward Giver]";
    				mes "See you later";
    				break;
    	}
    	close;
    
    OnLeave:
    		mes "[Reward Giver]";
    		mes "See you later";
    		cutin "v_sprakki04",255;
    		close;
    
    OnNotExist:
    		mes "[" + strnpcinfo(1) + "]";
    		mes "This account does not exist!";
    		cutin "v_sprakki04",255;
    		close;
    	
    //============Reset Function=========================
    OnDelete:
    		mes "Which gifts do you want to reset?";
    		mes "1. Single Account";
    		mes "2. Single Character";
    		mes "3. All ^009900Online^000000 Accounts.";
    		mes "4. All Accounts.";
    		mes "5. All ^009900Online^000000 Players/Characters.";
    		mes "6. All Players/Characters.";
    		mes "7. All cancel";
    		switch(select("Single Account:Single Character:^009900Online^000000 Accounts:All Accounts:^009900Online^000000 Characters:All Characters:Specific Item:IPLimit Logs:Cancel"))
    			{
    			case 1: //Single Account
    				mes "[" + strnpcinfo(1) + "]";
    				mes "Please select input type:";
    				mes "By AID or Name?";
    				next;
    				if(select("Account ID:Character Name") == 1)
    				{
    					mes "[" + strnpcinfo(1) + "]";
    					mes "Write account id:";
    					next;
    					input .@new_account, 2000000, 10000000; //Account id range from 2m to 10m.
    					set .@query, query_sql("SELECT account_id FROM `" + .CharTableName$ + "` WHERE account_id = " + .@new_account, .@new_account);
    					if(!.@query) goto OnNotExist;
    					if(select("Continue:Cancel") != 1) goto OnLeave;
    						query_sql("DELETE FROM " + .GiftTableName$ + " WHERE account_id = " + .@new_account);
    				}
    				else
    				{
    					mes "[" + strnpcinfo(1) + "]";
    					mes "Write player name:";
    					next;
    					input .@new_name$;
    					set .@query, query_sql("SELECT account_id FROM `" + .CharTableName$ + "` WHERE name = '" + .@new_name$ + "'", .@new_account);
    					if(!.@query) goto OnNotExist;
    					if(select("Continue:Cancel") != 1) goto OnLeave;
    						query_sql("DELETE FROM " + .GiftTableName$ + " WHERE account_id = " + .@new_account);
    				}
    				break;
    			case 2: //Single Character
    				mes "[" + strnpcinfo(1) + "]";
    				mes "Please select input type:";
    				mes "By CID or Name?";
    				next;
    				if(select("Character ID:Character Name") == 1)
    				{
    					mes "[" + strnpcinfo(1) + "]";
    					mes "Write character id:";
    					next;
    					input .@new_char,150000, 10000000; //Char id range from 150k to 10m.
    					set .@query, query_sql("SELECT account_id, name FROM `" + .CharTableName$ + "` WHERE char_id = " + .@new_char, .@new_accountid, .@new_name$);
    					if(!.@query) goto OnNotExist;
    					if(select("Continue:Cancel") != 1) goto OnLeave;
    						query_sql("DELETE FROM " + .GiftTableName$ + " WHERE char_id = " + .@new_char);
    				}
    				else
    				{
    					mes "[" + strnpcinfo(1) + "]";
    					mes "Write player name:";
    					next;
    					input .@new_name$;
    					set .@query, query_sql("SELECT char_id, account_id FROM `" + .CharTableName$ + "` WHERE name = '" + .@new_name$ + "'", .@new_char, .@new_accountid);
    					if(!.@query) goto OnNotExist;
    					if(select("Continue:Cancel") != 1) goto OnLeave;
    						query_sql("DELETE FROM " + .GiftTableName$ + " WHERE char_id = " + .@new_char);
    				}
    				break;
    			case 3: //All Online Accounts.
    				mes "[" + strnpcinfo(1) + "]";
    				mes "Please hold...";
    				set .@c, 0; //Counting success.
    				set .@query, query_sql("SELECT account_id FROM `"+.CharTableName$+"` WHERE online=1",.@account);
    				for(set .@i, 0; .@i < .@query; set .@i, .@i + 1) {
    					sleep2 25; //Slowdown the loop abit.
    					query_sql("DELETE FROM " + .GiftTableName$ + " WHERE account_id = " + .@account[.@i]);
    				}
    				break;
    			case 4: //All Accounts.
    				query_sql("DELETE FROM " + .GiftTableName$ + " WHERE account_id >= 1");
    				break;
    			case 5: //All Online Players/Characters.
    				mes "[" + strnpcinfo(1) + "]";
    				mes "Please hold...";
    				set .@c, 0; //Counting success.
    				set .@query, query_sql("SELECT char_id FROM `"+.CharTableName$+"` WHERE online=1",.@char);
    				for(set .@i, 0; .@i < .@query; set .@i, .@i + 1)
    					{
    						sleep2 25; //Slowdown the loop abit.
    						query_sql("DELETE FROM " + .GiftTableName$ + " WHERE char_id = " + .@char[.@i]);
    					}
    				break;
    			case 6: //All Players/Characters.
    				query_sql("TRUNCATE TABLE " + .GiftTableName$);
    				break;
    			case 7: // Delete specific item
    				mes "Please type the id of the item you wish to delete";
    				mes "This will delete all entries with the item id you typed";
    				input(.@deletethis);
    				next;
    				mes "Are you sure you want to delete all entries of " + .@deletethis;
    				if (select("Yes:No")==1)
    					{
    						query_sql("DELETE FROM " + .GiftTableName$ + " WHERE item = " + .@deletethis + "");
    					}
    					else
    					{
    						mes "Deletion cancelled";
    						close;
    					}
    			case 8: //All ip logs
    				query_sql("TRUNCATE TABLE " + .GiftTableNameIP$);
    				break;
    			default:
    				break;
    		}
    		next;
    		mes "deletion finished";
    		cutin "v_sprakki04",255;
    		close;
    
    OnLimit:
    	mes "Please enter an ip limit, current limit is " + .ip_limit;
    	input(.ip_limit);
    	mes "Done!";
    	cutin "v_sprakki04",255;
    	close;
    
    //============================================================ 
    // Config/Edit:
    //============================================================ 
    OnLoadSetup:
    	set .Setup, 1;	//OnInit is loaded check.
    	set .GMin, 60;	//Minimum GM level to use gm panel.
    	set .ZenyID,23500; // put this when asked for which item to give zeny.
    	set .MaxZeny,1000000000;
    	//Your table names:
    	set .CharTableName$, "char";	//Character table name(SQL).
    	set .LoginTableName$, "login";
    	set .GiftTableName$, "reward";	//Gift table name(SQL).
    	set .GiftTableNameIP$, "reward_ip";	//Gift table name for ip tracker
    	set $GiftTableNameAT$, "reward_at";	//Gift table name for auto trade tracker
    	//Create gift table <auto_id>, <account_id>, <char_id>, <item>, <value>
    
    	query_sql("CREATE TABLE IF NOT EXISTS `reward` (`id` int(11) NOT NULL AUTO_INCREMENT,`account_id` int(11) unsigned NOT NULL DEFAULT '0',`char_id` int(11) unsigned NOT NULL DEFAULT '0',`item` int(11) NOT NULL DEFAULT '0',`value` int(11) NOT NULL DEFAULT '0',`duration` int(11) NOT NULL DEFAULT '0',`timestamp` int(23) NOT NULL DEFAULT '0',PRIMARY KEY (`id`))");
    	query_sql("CREATE TABLE IF NOT EXISTS `reward_ip` ( `give_id` int(11) NOT NULL,  `item_id` int(11) NOT NULL,  `ip_address` varchar(23) NOT NULL, `claim_count` int(11) NOT NULL,  PRIMARY KEY (`give_id`))");
    	query_sql("CREATE TABLE IF NOT EXISTS `reward_at` (`account_id` int(11) NOT NULL,`char_id` int(11) NOT NULL)");
    	return;
    
    OnInit:
    	callsub OnLoadSetup;
    	end;
    }
    
    /* Manual table update for at tracker 
    CREATE TABLE IF NOT EXISTS `reward_at` (
      `account_id` int(11) NOT NULL,
      `char_id` int(11) NOT NULL
    );
    */
    -	script	anti_trader	-1,{
    	
    OnInit:
    	.is_anti_trade = 1; // 0 to disable
    	end;
    	
    }
    function	script	PG_30Seconds	{
    	//dispbottom "anti trader 30sec";
    	//Check if Vending (normal or @at)
    	if(checkvending() >= 1)
    	{
    	   // mark as auto trader
    	   	.@query = query_sql("SELECT account_id, char_id FROM "+$GiftTableNameAT$+" WHERE account_id = "+getcharid(3)+"", .@account_id, .@char_id); // check if in the table
    		if (!.@query)
    		{ // add if not there yet
    			query_sql("INSERT INTO "+$GiftTableNameAT$+"(account_id,char_id) VALUES("+getcharid(3)+","+getcharid(0)+")");
    			//dispbottom "you have been marked as auto trader";
    			stopnpctimer;
    			detachnpctimer;
    			end;
    		}
    	}
    	return;
    }
    function	script	PG_Login	{
    	//dispbottom "at delete";
    	.@query = query_sql("SELECT account_id, char_id FROM "+$GiftTableNameAT$+" WHERE account_id = "+getcharid(3)+"", .@account_id, .@char_id); // check if in the table
    	if (.@query)
    	{ // remove to reverify vending status
    		query_sql("DELETE FROM "+$GiftTableNameAT$+" WHERE account_id = "+getcharid(3)+"");
    	}
    }

     

  6. On 4/19/2020 at 10:34 PM, Haruka Mayumi said:

    This is why i kept telling you to put CODEBOX, which is on the last line of Support Rules.. this is way we can run the working script and we can run it on our side and see the errors as such without doing lot of work copying and pasting then change spaces to tabs.. 

    //===== rAthena Script =======================================
    //= Euphy's Quest Shop
    //===== By: ==================================================
    //= Euphy
    //===== Current Version: =====================================
    //= 1.6c
    //===== Compatible With: =====================================
    //= rAthena Project
    //===== Description: =========================================
    //= A dynamic quest shop based on Lunar's, with easier config.
    //= Includes support for multiple shops & cashpoints.
    //= Item Preview script by ToastOfDoom.
    //===== Additional Comments: =================================
    //= 1.0 Initial script.
    //= 1.2 Added category support.
    //= 1.3 More options and fixes.
    //= 1.4 Added debug settings.
    //= 1.5 Replaced categories with shop IDs.
    //= 1.6 Added support for purchasing stackables.
    //= 1.6a Added support for previewing costumes and robes.
    //= 1.6b Added 'disable_items' command.
    //= 1.6c Replaced function 'A_An' with "F_InsertArticle".
    //============================================================
    
    // Shop NPCs -- supplying no argument displays entire menu.
    //	callfunc "qshop"{,<shop ID>{,<shop ID>{,...}}};
    //  ADD YOUR NPC HERE
    //============================================================
    prontera,147,165,6	script	Quest Shop#1	998,{ callfunc "qshop"; 
    
    }
    //prontera,165,203,6	script	Quest Shop#2	998,{ callfunc 
    
    "qshop",1,2; }	// call the shop 1 and 2 defined below
    // etc.. Add your Shop NPCs 'Quest Shop#XXX' here
    //============================================================
    
    
    // Script Core - DO NOT DUPLICATE THIS NPC !!!!!!!!!!!!!
    //============================================================
    -	script	quest_shop	-1,{
    function Add; function Chk; function Slot;
    OnInit:
    	waitingroom "Quest Shop",0;
    	freeloop(1);
    	
    // -----------------------------------------------------------
    //  Basic shop settings.
    // -----------------------------------------------------------
    
    	set .Announce,1;	// Announce quest completion? (1: yes / 
    
    0: no)
    	set .ShowSlot,1;	// Show item slots? (2: all equipment / 
    
    1: if slots > 0 / 0: never)
    	set .ShowID,0;  	// Show item IDs? (1: yes / 0: no)
    	set .ShowZeny,0;	// Show Zeny cost, if any? (1: yes / 0: 
    
    no)
    	set .MaxStack,100;	// Max number of quest items purchased 
    
    at one time.
    
    // -----------------------------------------------------------
    //  Points variable -- optional quest requirement.
    //	setarray .Points$[0],"<variable name>","<display name>";
    // -----------------------------------------------------------
    
    	setarray .Points$[0],
    		"#CASHPOINTS", "Cash Points";
    
    
    //=====================================================================
    
    ================
    // ------------------- ADD YOUR SHOPS NAME AND ITEMS SHOPS STARTING 
    
    HERE --------------
    //=====================================================================
    
    ================
    
    // -----------------------------------------------------------
    //  Shop IDs -- to add shops, copy dummy data at bottom of file.
    //	setarray .Shops$[1],"<Shop 1>","<Shop 2>"{,...};
    // -----------------------------------------------------------
    
    	setarray .Shops$[1],
    		"Headgears",	// Shop Named 1
    		"Weapons",		// Shop Named 2
    		"Other";		// Shop Named 3
    
    // -----------------------------------------------------------
    //  Quest items -- do NOT use a reward item more than once!
    //	Add(<shop ID>,<reward ID>,<reward amount>,
    //	    <Zeny cost>,<point cost>,
    //	    <required item ID>,<required item amount>{,...});
    // -----------------------------------------------------------
    
    // Shop 1
    	Add(1,5086,1,0,0,2288,1,1095,3000);
    	
    	Add(1,5074,1,20000,0,2286,1,2254,1);
    	Add(1,5132,1,0,0,5035,1,5074,1,714,1,999,5);
    	Add(1,5153,1,0,0,10011,1);
    	Add(1,2284,1,0,0,923,20);
    	Add(1,5270,1,0,0,7198,200,7097,40);
    	sleep 10;
    	Add
    
    (1,5174,1,0,0,7445,7,7446,7,7447,7,7448,7,945,300,975,1,733,5,7166,50);
    	Add(1,5277,1,0,0,5278,1,508,200);
    	Add(1,2237,1,0,0,1020,100,983,1,2241,1);
    	
    	Add(1,5057,1,10000,0,2213,1,983,1,914,200);
    	Add(1,5076,1,0,0,2227,1,7038,500);
    	Add(1,5236,1,0,0,2227,1,7038,500,978,1);
    	Add(1,5235,1,0,0,2227,1,7038,500,982,1,983,1);
    	Add(1,5237,1,0,0,2227,1,7038,500,975,1,982,1);
    	Add(1,5382,1,0,0,969,8,10016,2,5083,1);
    	sleep 10;
    	Add(1,5065,1,0,0,624,1,959,300,544,50,1023,1);
    	Add(1,5052,1,0,0,2211,1,978,1,7003,300);
    	Add(1,2296,1,50000,0,2243,1,999,100);
    	Add(1,5129,1,0,0,604,1,916,1);
    	Add(1,5102,1,0,0,7263,2,2276,1,2239,1,568,150);
    	Add(1,5040,1,0,0,7047,100);
    	Add(1,5109,50000,0,0,10015,1,10007,1,5023,1,975,1);
    	Add(1,5016,1,0,0,1030,10,0,0,0,0,0,0);
    	Add(1,5110,1,0,0,526,2,7270,1,941,1,10004,1);
    	Add(1,5191,1,0,0,2208,1,983,1);
    	sleep 10;
    	Add
    
    (1,5169,1,0,0,706,1,1019,500,7200,10,1049,20,7165,500,1054,2,1024,100);
    	Add(1,5034,1,0,0,2233,1,746,20);
    	Add(1,2214,1,0,0,949,100,706,1,722,1,2213,1);
    	
    	Add(1,5175,1,100000,0,7111,100,938,99,983,1);
    	Add(1,5080,1,0,0,10006,1,714,1,969,3);
    	Add(1,5024,1,0,0,529,10,530,5,539,20,999,10,538,15);
    	Add(1,5028,1,0,0,2279,1,7035,50,526,100);
    	Add(1,5200,1,0,0,5016,1,981,1,7317,20);
    	Add(1,5184,1,0,0,5120,5,995,50,983,1,720,50);
    	
    	Add(1,5214,1,0,0,976,1,1060,300,1022,100,5008,5);
    	Add(1,5026,1,0,0,1036,450,949,330,539,120,982,1);
    	sleep 10;
    	Add
    
    (1,5142,1,0,0,5017,1,2229,1,5014,1,7209,100,7123,100,1036,100,979,1);
    	Add(1,5283,1,0,0,949,200,916,100,7063,20,925,1);
    	Add(1,5260,1,0,0,4293,1,538,100,530,100,529,50);
    	Add(1,5075,1,0,0,2248,1,7030,108,7194,108,7120,4);
    	Add(1,5048,1,0,0,5041,1,999,10);
    	Add(1,5036,1,0,0,2608,1,7069,500);
    	Add(1,5135,1,0,0,2295,1,969,1,975,1,999,5);
    	
    	Add(1,5108,1,5000,0,7301,1887,5114,1,611,10);
    	Add(1,5254,1,0,0,5132,1,5068,1,2255,1,7023,5,983,1);
    	sleep 10;
    	Add(1,5038,1,0,0,1038,600,7048,40);
    	Add(1,5229,1,0,0,1038,600,7048,40,982,1,983,1);
    	Add(1,5227,1,0,0,1038,600,7048,40,975,1);
    	Add(1,5228,1,0,0,1038,600,7048,40,982,1);
    	Add(1,5186,1,0,0,1032,100,7100,100,905,250);
    	Add(1,5091,1,20000,0,10016,1,714,1,969,3);
    	Add(1,5082,1,0,0,921,300);
    	Add(1,2273,1,3500,0,2275,1,998,50,733,1);
    	Add(1,5258,1,0,0,914,100,975,1,976,1,978,1);
    	Add(1,5198,1,0,0,5058,1,2214,1,949,500,914,200,622,50,1974,1);
    	sleep 10;
    	Add(1,5058,1,0,0,2233,1,983,1,7206,300,7030,1);
    	Add(1,5233,1,0,0,2233,1,983,1,7206,300,7030,1,978,1);
    	Add(1,5231,1,0,0,2233,1,983,1,7206,300,7030,1,982,1,983,1);
    	Add(1,5232,1,0,0,2233,1,983,1,7206,300,7030,1,982,1,975,1);
    	Add(1,5230,1,0,0,2233,1,983,1,7206,300,7030,1,982,1);
    	Add(1,5234,1,0,0,2233,1,983,1,7206,300,7030,1,976,1);
    	Add(1,5253,1,0,0,1034,300,7445,30,5141,10,979,1);
    	Add(1,5252,1,0,0,5058,1,1022,250,7267,100);
    	Add(1,2283,1,0,0,724,1,5001,1,949,200);
    	Add(1,5243,1,0,0,975,1,976,1,914,100,7441,150,7065,25,2283,1);
    	sleep 10;
    	Add(1,5259,1,0,0,978,1,7561,100,949,500,1026,200);
    	Add(1,5205,1,0,0,5185,1,610,100,706,25,7194,113);
    	Add(1,5068,1,20000,0,2255,1,2286,1);
    	Add(1,5304,1,0,0,7017,2,2510,1,983,1);
    	Add(1,5207,1,0,0,2282,5,2254,2,969,1,7063,15);
    	Add(1,5333,1,0,0,996,4,12028,1,12032,1,992,10,5011,1);
    	Add(1,5312,1,0,0,2261,1,983,1,2280,1,2627,1,969,2);
    
    	Add(1,5416,1,0,0,746,20,7097,12,587,20,2717,1);
    	
    	sleep 10;
    	Add(1,5427,1,0,0,5288,1,12078,1,7521,1,12183,1);
    	Add(1,5404,1,0,0,5187,1,1034,70,7441,10,978,10);
    	
    	Add(1,5429,1,0,0,5100,1,1021,30,7268,1);
    	Add(1,5338,1,0,0,5100,1,7112,25,561,1);
    	Add(1,5300,1,0,0,7106,2,2246,1,7263,1);
    	Add(1,5378,1,0,0,2214,1,5045,1,975,1,740,100);
    	Add(1,5414,1,100000000,0,7300,9,1068,4,7098,2);
    	Add(1,5307,1,0,0,2275,5,514,2,979,1,634,1,619,20,1027,20);
    	Add(1,5431,1,50000000,0,5283,1,916,50,2717,1);
    	sleep 10;
    	Add(1,5341,1,80000000,0,5137,1,2276,1,1060,25);
    	Add(1,5131,1,0,0,5128,1,969,10,978,1,985,27);
    	Add(1,5417,1,0,0,4112,1,5299,1);
    	Add(1,5373,1,0,0,2255,1,7566,3,7511,60,5104,1,7799,4,7023,20);
    	Add(1,5369,1,0,0,5191,6,7205,25,558,3,2210,1,7441,5);
    	Add(1,5340,1,0,0,5137,1,5040,1,1034,25);	
    	Add(1,5313,1,0,0,5124,1,2249,1,5007,1,523,200);
    	Add(1,5258,1,0,0,2261,1,914,200,975,1,976,1,978,1);
    	Add(1,5292,1,0,0,7266,2,1035,4,10001,1);
    	Add(1,5396,1,0,0,5058,1,980,1,1022,53);
    	sleep 10;
    	Add(1,5146,1,0,0,978,1,949,500,1019,1);
    	Add(1,5282,1,0,0,5200,1,982,1,978,2);
    	Add(1,5247,1,0,0,1039,60,923,25,2255,1);
    	Add(1,5364,1,0,0,5347,1,975,1,982,1,983,1,5048,1);	
    	
    	Add(1,5047,1,0,0,2271,1,975,1);
    	Add(1,5170,1,0,0,5172,1,7063,100,982,1);
    	Add(1,5380,1,0,0,5065,2);
    	Add(1,5303,1,0,0,712,100,710,5,629,5,10009,1);
    	Add(1,5302,1,0,0,7553,2,982,1,7771,1);
    	sleep 10;
    	Add(1,5056,1,0,0,5079,1,578,100);
    	Add(1,5390,1,0,0,2236,2,978,1,1034,50,2294,2);
    	Add(1,5144,1,0,0,2214,1,2221,1,7567,25,1001,200);
    	Add(1,5063,1,0,0,970,1,930,500);
    	Add(1,5193,1,0,0,2208,1,979,1);
    	Add(1,5021,1,0,0,2233,1,969,1,999,20,949,80,938,800);
    	Add(1,5179,1,0,0,2234,1,969,3,2610,4,13106,2);
    	Add
    
    (1,5176,1,0,0,706,1,1019,500,7200,10,7015,20,2267,1,952,100,1028,100);
    	Add(1,5001,1,0,0,999,40,984,1,970,1,1003,1);
    	Add(1,5031,1,0,0,7013,1200);
    	sleep 10;
    	Add(1,5025,1,0,0,2229,1,2254,1,7036,5);
    	Add(1,5061,1,20000,0,2269,1,999,10);
    	Add(1,5139,1,0,0,5085,1,710,5,7510,1,975,1);
    	Add(1,5070,1,0,0,7216,300,7097,300,2211,1,982,1);
    	Add(1,5071,1,10000,0,5010,1,5049,1,7101,10);
    	Add
    
    (1,5173,1,0,0,7445,7,7446,7,7447,7,7478,7,945,300,983,1,733,5,2221,1);
    	Add(1,5321,1,0,0,2275,2,2211,2,7215,4,7217,20);
    	
    	Add(1,2240,1,0,0,1040,2,982,2,949,4,7457,1);
    	Add(1,5405,1,0,0,7441,45,949,80,916,100);
    	sleep 10;
    	Add(1,5410,1,50000000,0,7188,40,7111,20);
    	
    	Add(1,5424,1,0,0,980,1,620,1,605,50,985,200);
    	Add(1,5425,1,0,0,981,1,533,1,605,50,985,200);
    	Add(1,5276,1,0,0,2261,1,914,200,983,1,976,1,975,1);
    	Add(1,5156,1,0,0,2265,10,982,1);
    	Add(1,5154,1,0,0,2202,1,7020,5);
    	Add(1,5155,1,0,0,7024,10,7754,2,7562,4,7450,1);
    	Add(1,5018,1,500,0,2247,1,916,300);
    	Add(1,5403,1,0,0,1023,1,544,5,579,1);
    	sleep 10;
    	Add(1,5317,1,0,0,5120,1,2290,1,938,4);
    	
    	Add(1,5334,1,0,0,5132,1,1971,20,7093,4,2659,1);
    	
    	Add(1,5400,1,0,0,1022,20,1234,2);
    	Add(1,5339,1,0,0,5100,1,7112,25,1558,1);
    	
    	Add(1,5346,1,0,0,5100,1,7112,25,558,1);
    	Add(1,5433,1,0,0,5185,1,969,2);
    	sleep 10;
    	Add(1,5262,1,0,0,5164,1,7799,1,7578,1,969,3);	
    	Add(1,5336,1,0,0,5100,1,7112,25,714,1);
    	Add(1,5273,1,0,0,2261,1,914,200,982,1,975,1,979,1);
    	Add(1,5319,1,0,0,5035,1,5074,1,978,1);
    	Add(1,5363,1,0,0,5120,1,2261,1,983,20);
    
    	Add(1,5360,1,0,0,5057,1,2747,2,5161,1);
    	Add(1,5383,1,0,0,5200,1,979,1,7445,50);
    
    	
    	sleep 10;
    	Add(1,5396,1,0,0,5430,1,5285,1,7262,20,5396,1);
    	Add(1,5371,1,0,0,5016,1,1004,35);
    	Add(1,5426,1,0,0,5027,1,976,5);
    	Add(1,5322,1,0,0,10019,1,982,2);
    	Add(1,5291,1,0,0,7323,100,969,20);
    	Add(1,5372,1,0,0,5099,1,5230,1,2747,5,982,15);
    	Add(1,5311,1,0,0,5139,5);
    	Add(1,5418,1,0,0,5016,1,2261,1,968,1,975,5,1004,35);
    	Add(1,5422,1,500000,0,1550,3,1006,20);
    	Add(1,5324,1,0,0,5137,1,7063,20,1034,20);
    	sleep 10;
    	Add(1,5448,1,0,0,521,200,1019,300);
    	Add(1,5449,1,0,0,521,200,1019,300);
    	Add(1,5332,1,0,0,7019,10,7200,10);
    	Add(1,5392,1,100000,0,721,5,7216,25);
    	
    	Add(1,5393,1,777777,0,2285,5,994,10,7097,25);
    	Add(1,5365,1,0,0,574,150,7031,150);
    	Add(1,5143,1,0,0,5090,1,1020,300,975,1,982,1);
    	Add(1,5020,1,0,0,2215,1,2210,1,7063,20);
    	Add(1,5140,1,0,0,5085,1,2244,1,5191,1,7166,50);
    	sleep 10;
    	Add(1,5069,1,0,0,1022,99);
    	Add
    
    (1,5185,1,0,0,5061,1,712,100,7194,150,7298,100,520,50,521,50);
    	Add(1,5130,1,0,0,1048,100,7564,150,517,30);
    	Add(1,5177,1,0,0,706,1,1019,500,7200,10,1049,500,1053,2,980,1);
    
    	Add(1,5084,1,0,0,1026,1000,7065,100,945,100,7030,1);
    	Add(1,5027,1,0,0,2252,1,1036,400,7001,50,4052,1);
    	Add(1,5241,1,0,0,2252,1,1036,400,7001,50,4052,1,978,1);
    	Add(1,5240,1,0,0,2252,1,1036,400,7001,50,4052,1,982,1,983,1);
    	Add(1,5238,1,0,0,2252,1,1036,400,7001,50,4052,1,975,1);
    	sleep 10;
    	Add(1,5239,1,0,0,2252,1,1036,400,7001,50,4052,1,982,1);
    	Add(1,5242,1,0,0,2252,1,1036,400,7001,50,4052,1,976,1);
    	Add(1,5054,1,0,0,2252,1,1054,450,943,1200);
    	Add(1,5187,1,0,0,5085,1,5091,1,5117,2,978,1,975,1);
    	Add(1,5138,1,0,0,5123,1,5027,1,7337,50,981,1);
    	Add(1,5099,1,0,0,7267,300,7171,300,1029,5);
    	Add(1,5031,1,0,0,5009,1,5028,1,747,1,999,25);
    	Add(1,5081,1,40000,0,2249,1,714,1,969,3);
    	Add(1,5073,1,0,0,2285,1,1550,1);
    	Add(1,5117,1,50000,0,731,10,748,2,982,1);
    	sleep 10;
    	Add(1,5183,1,0,0,604,100,916,100,7115,100);
    	Add(1,5151,1,0,0,5001,1,978,1,991,200);
    	Add(1,2281,1,5000,0,998,20,707,1);
    	Add(1,5043,1,0,0,2281,1,1048,50);
    	Add(1,5094,1,0,0,968,100,2299,1,1124,1,931,1000);
    	Add(1,5196,1,0,0,2208,1,980,1);
    	Add(1,5078,1,0,0,5033,1,5064,1);
    	Add(1,5004,1,0,0,701,5);
    	Add(1,5275,1,0,0,2261,1,914,200,975,1,976,1,981,1);
    	
    	sleep 10;
    	Add(1,5420,1,300000000,0,5430,2,5421,1);
    	Add(1,5323,1,0,0,5081,3,7754,1,2128,1);
    	Add(1,5806,1,0,0,2280,1,7479,1,2109,1);
    	Add(1,5315,1,0,0,2276,1,5135,1,7094,50,7353,50);
    	Add(1,5807,1,0,0,5416,1,2211,2,949,100);
    	Add(1,5375,1,0,0,5094,1,10018,2,968,5,7440,30);
    	Add(1,5370,1,0,0,5302,1,981,5);
    	Add(1,5060,1,0,0,2236,1,7151,100,7111,100);
    	Add
    
    (1,5299,1,0,0,7441,20,949,50,916,15,7115,10,7440,20,7063,10,7200,10,221
    
    4,1);
    	Add(1,5023,1,0,0,1059,150,907,100,978,1);
    	sleep 10;
    
    	Add(1,5271,1,0,0,2254,1,723,1,7301,20,999,50,978,1);
    	Add(1,5352,1,0,0,5035,1,979,1,938,100);
    	Add(1,2293,1,0,0,1049,4);
    	Add(1,5194,1,0,0,2208,1,975,1,982,1);
    	Add(1,5202,1,0,0,5035,1,1062,100,535,80);
    	Add(1,5182,1,0,0,5008,10,5118,1,1060,100,2210,1);
    	Add(1,5213,1,0,0,2214,1,983,1,7063,30);
    	Add(1,5033,1,0,0,1036,20,2213,1,7065,300,7012,200);
    	Add(1,5039,1,0,0,7030,50,978,1,5015,1);
    	sleep 10;
    	
    	Add(1,5195,1,0,0,2208,1,975,1);
    	Add(1,5211,1,0,0,5045,1,5083,1,7063,40,7553,1,982,1,975,1);
    	Add
    
    (1,5208,1,0,0,1550,1,1553,7,1556,7,1554,7,1557,7,1555,7,7015,30);
    	Add(1,5083,1,0,0,2244,1,2209,1,10007,1);
    	Add(1,2280,1,10000,0,1019,120);
    	Add(1,5100,1,0,0,2272,1,7451,4,7433,3,690,10);
    	Add(1,5067,1,0,0,5062,1,952,50,1907,1);
    	Add(1,5133,1,0,0,5160,1,7106,6,7107,80);
    	
    	sleep 10;
    	Add(1,5064,1,0,0,945,600,7030,1);
    	Add(1,2278,1,0,0,705,10,909,10,914,10);
    	Add(1,5203,1,0,0,2278,1,1015,1,999,5);
    	Add(1,5212,1,0,0,1820,2,5011,1,2651,1,4125,1);
    	Add(1,5257,1,0,0,5074,1,2282,1,7064,10,969,5);
    	Add(1,5029,1,0,0,7068,300,7033,850,1015,1);
    	Add(1,2272,1,911000,0,1019,50,983,1);
    	Add(1,5062,1,0,0,2280,1,7197,300,7150,300);
    	Add(1,5049,1,0,0,1099,1500);
    	Add(1,5287,1,0,0,5062,1,5348,1,978,1);
    	sleep 10;
    	Add(1,5032,1,0,0,1059,250,2221,1,2227,1,7063,600);
    	Add(1,5103,1,0,0,5351,1,10011,1);
    	Add(1,5022,1,0,0,7086,1,969,10,999,40,1003,50,984,2);
    	Add(1,5395,1,0,0,5045,2,7205,150,983,1,1059,100);
    	Add(1,5059,1,0,0,5030,1,7213,100,7217,100,7161,300);
    	Add(1,5107,1,0,0,519,50,7031,50,548,50,539,50);
    	Add(1,5255,1,0,0,5153,1,741,10,5132,1,5074,1);
    	Add(1,5077,1,0,0,2278,1,975,1);
    	Add(1,5337,1,0,0,5100,1,7112,25,2617,1);
    	
    	sleep 10;
    	Add(1,5152,1,0,0,2254,1,724,1,7301,20,999,50,978,1);
    	Add(1,5305,1,0,0,1214,5,969,10,7799,5);
    	Add(1,5413,1,0,0,608,20,1752,1,2261,1,978,1);
    	Add(1,5415,1,0,0,5255,1,5024,1);
    	Add(1,5318,1,0,0,5035,2,5060,2,741,10,530,50,938,100);
    	Add(1,5409,1,0,0,5075,1,7101,5,981,10);
    	Add(1,5051,1,0,0,7047,100);
    
    	
    	
    	sleep 10;
    	Add(1,5320,1,0,0,5205,1,1009,50,2111,1);
    	Add(1,5354,1,0,0,5431,1,12080,1,1629,1);
    	Add(1,5811,1,0,0,985,100,2241,10);
    	Add(1,5381,1,0,0,5335,1,2236,1);
    	Add(1,5397,1,0,0,7325,5,2205,1,7355,1);
    	Add(1,5355,1,0,0,7166,100,1059,200);
    	Add(1,5243,1,0,0,7446,1,2339,10,1059,70);
    	Add(1,5310,1,0,0,5034,1,1971,2,996,6);
    	Add(1,5274,1,0,0,2261,1,914,200,980,2,975,1);
    	Add(1,5261,1,0,0,5164,1,714,25,2611,50,7799,4);
    	sleep 10;
    	
    	Add(1,5342,1,0,0,5137,1,5040,1,1020,20,7152,5);
    	Add(1,5297,1,0,0,5257,1,1472,2,5158,2,7063,40);
    	Add(1,5335,1,0,0,741,5,607,5,940,150);
    	Add(1,5412,1,0,0,530,20,7035,10);
    	Add(1,5343,1,0,0,5137,1,2215,1,1034,25);
    	Add(1,5098,1,0,0,1029,10,2297,5,7267,50);
    	Add(1,5430,1,50000000,0,5414,1,7135,10,7451,4);
    	Add(1,5384,1,0,0,5390,1,975,1);
    	Add(1,5316,1,0,0,2226,1,622,10);
    	sleep 10;
    	Add(1,5289,1,0,0,526,200,7268,1);
    	
    	Add(1,5301,1,0,0,5191,3,5195,3);
    	Add(1,5344,1,0,0,5137,1,7038,20,1060,25);
    	Add(1,5345,1,0,0,5137,1,5195,2,1060,45);
    	Add(1,5411,1,0,0,5388,1,982,5,7263,2,978,2);
    	Add(1,5368,1,0,0,5197,6,7751,25,561,3,2210,1,7063,20);
    	Add(1,5385,1,0,0,753,100);
    	Add(1,5079,1,0,0,2294,1,7220,400);
    	Add
    
    (1,5171,1,0,0,4219,1,4114,1,4177,1,4259,1,4212,1,4073,1,4112,1,4081,1,4
    
    251,1,4166,1,7511,1000,7563,1000);
    	sleep 10;
    	Add(1,5256,1,0,0,7510,1,2210,1,7063,50);
    	Add(1,5285,1,0,0,7192,200,10011,1);
    	Add(1,5357,1,0,0,7510,20);
    	Add(1,5188,1,0,0,5027,1,7166,50,7064,1);
    	Add(1,2292,1,2000,0,999,50);
    	Add(1,5294,1,0,0,7019,5,7567,50);
    	Add(1,5115,1,50000,0,983,1,7267,99,749,1);
    	Add(1,5284,1,0,0,5302,1,975,1,982,1,5165,1);
    	Add(1,5050,1,0,0,5037,1,7064,500);
    	Add(1,5206,1,0,0,2269,1,982,1);
    	sleep 10;
    	Add(1,5197,1,0,0,2208,1,982,1);
    	Add(1,5278,1,0,0,2210,1,5192,1,2250,1);
    	Add(1,5192,1,0,0,2208,1,976,1);
    	Add(1,5121,1,0,0,7263,1,660,1,7099,30,7315,369);
    
    // Shop 2
    	Add(2,501,1,0,0,7263,1,660,1,7099,30,7315,369);
    
    // Shop 3
    	Add(3,531,1,3,0,512,1,713,1);
    	Add(3,532,1,3,0,513,1,713,1);
    	Add(3,533,1,3,0,514,1,713,1);
    	Add(3,534,1,3,0,515,1,713,1);
    
    // -----------------------------------------------------------
    
    //=====================================================================
    
    ================
    // ------------------- YOUR SHOPS AND ITEMS SHOPS HAVE BEEN ADDED 
    
    ---------------------
    //=====================================================================
    
    ================
    
    	freeloop(0);
    	set .menu$,"";
    	for(set .@i,1; .@i<=getarraysize(.Shops$); set .@i,.@i+1) {
    		set .menu$, .menu$+.Shops$[.@i]+":";
    		npcshopdelitem "qshop"+.@i,909;
    	}
    	end;
    
    OnMenu:
    	set .@size, getarraysize(@i);
    	if (!.@size) set @shop_index, select(.menu$);
    	else if (.@size == 1) set @shop_index, @i[0];
    	else {
    		for(set .@j,0; .@j<.@size; set .@j,.@j+1)
    			set .@menu$, .@menu$+.Shops$[@i[.@j]]+":";
    		set @shop_index, @i[select(.@menu$)-1];
    	}
    	deletearray @i[0],getarraysize(@i);
    	if (.Shops$[@shop_index] == "") {
    		message strcharinfo(0),"An error has occurred.";
    		end;
    	}
    	dispbottom "Select one item at a time.";
    	callshop "qshop"+@shop_index,1;
    	npcshopattach "qshop"+@shop_index;
    	end;
    
    OnBuyItem:
    	// .@q[] : RewardID, BoughtAmt, RewardAmt, BaseAmt, ReqZeny, 
    
    ReqPts, { ReqItem, ReqAmt, ... }
    	setarray .@q[0],@bought_nameid[0],((@bought_quantity[0] > 
    
    .MaxStack)?.MaxStack:@bought_quantity[0]);
    	copyarray .@q[3],getd(".q_"+@shop_index+"_"+.@q
    
    [0]+"[0]"),getarraysize(getd(".q_"+@shop_index+"_"+.@q[0]));
    	set .@q[2],.@q[1]*.@q[3];
    	if (!.@q[2] || .@q[2] > 30000) {
    		message strcharinfo(0),"You can't purchase that many 
    
    "+getitemname(.@q[0])+".";
    		end;
    	}
    	mes "[Quest Shop]";
    	mes "Reward: ^0055FF"+((.@q[2] > 1)?.@q[2]+"x ":"")+Slot(.@q
    
    [0])+"^000000";
    	mes "Requirements:";
    	disable_items;
    	if (.@q[4]) mes " > "+Chk(Zeny,.@q[4]*.@q[1])+(.@q[4]*.@q[1])+" 
    
    Zeny^000000";
    	if (.@q[5]) mes " > "+Chk(getd(.Points$[0]),.@q[5]*.@q
    
    [1])+(.@q[5]*.@q[1])+" "+.Points$[1]+" ("+getd(.Points$[0])+"/"+(.@q
    
    [5]*.@q[1])+")^000000";
    	if (.@q[6]) for(set .@i,6; .@i<getarraysize(.@q); set .@i,.@i
    
    +2)
    		mes " > "+Chk(countitem(.@q[.@i]),.@q[.@i+1]*.@q
    
    [1])+((.ShowID)?"{"+.@q[.@i]+"} ":"")+Slot(.@q[.@i])+" ("+countitem
    
    (.@q[.@i])+"/"+(.@q[.@i+1]*.@q[1])+")^000000";
    	next;
    	setarray @qe[1], getiteminfo(.@q[0],5), getiteminfo(.@q[0],11);
    	if (@qe[2] > 0 && ((@qe[1] & EQP_HEAD_LOW) || (@qe[1] & 
    
    EQP_HEAD_TOP) || (@qe[1] & EQP_HEAD_MID) || (@qe[1] & 
    
    EQP_COSTUME_HEAD_TOP) || (@qe[1] & EQP_COSTUME_HEAD_MID) || (@qe[1] & 
    
    EQP_COSTUME_HEAD_LOW) || (@qe[1] & EQP_GARMENT) || (@qe[1] & 
    
    EQP_COSTUME_GARMENT)))
    		set .@preview,1;
    	addtimer 1000, strnpcinfo(0)+"::OnEnd";
    	while(1) {
    		switch(select(" ~ Purchase ^0055FF"+getitemname(.@q
    
    [0])+"^000000:"+((.@preview && !@qe[7])?" ~ Preview...":"")+": ~ 
    
    ^777777Cancel^000000")) {
    		case 1:
    			if (@qe[0]) {
    				mes "[Quest Shop]";
    				mes "You're missing one or more quest 
    
    requirements.";
    				close;
    			}
    			if (!checkweight(.@q[0],.@q[2])) {
    				mes "[Quest Shop]";
    				mes "^FF0000You need "+(((.@q[2]
    
    *getiteminfo(.@q[0],6))+Weight-MaxWeight)/10)+" additional weight 
    
    capacity to complete this trade.^000000";
    				close;
    			}
    			if (.@q[4]) set Zeny, Zeny-(.@q[4]*.@q[1]);
    			if (.@q[5]) setd .Points$[0], getd(.Points
    
    $[0])-(.@q[5]*.@q[1]);
    			if (.@q[6]) for(set .@i,6; .@i<getarraysize
    
    (.@q); set .@i,.@i+2)
    				delitem .@q[.@i],.@q[.@i+1]*.@q[1];
    			getitem .@q[0],.@q[2];
    			if (.Announce) announce strcharinfo(0)+" has 
    
    created "+((.@q[2] > 1)?.@q[2]+"x "+getitemname(.@q[0]):callfunc
    
    ("F_InsertArticle",getitemname(.@q[0])))+"!",0;
    			specialeffect2 EF_FLOWERLEAF;
    			close;
    		case 2:
    			setarray @qe[3], getlook(LOOK_HEAD_BOTTOM), 
    
    getlook(LOOK_HEAD_TOP), getlook(LOOK_HEAD_MID), getlook(LOOK_ROBE), 1;
    			if ((@qe[1] & 1) || (@qe[1] & 4096)) changelook 
    
    LOOK_HEAD_BOTTOM, @qe[2];
    			else if ((@qe[1] & 256) || (@qe[1] & 1024)) 
    
    changelook LOOK_HEAD_TOP, @qe[2];
    			else if ((@qe[1] & 512) || (@qe[1] & 2048)) 
    
    changelook LOOK_HEAD_MID, @qe[2];
    			else if ((@qe[1] & 4) || (@qe[1] & 8192)) 
    
    changelook LOOK_ROBE, @qe[2];
    			break;
    		case 3:
    			close;
    		}
    	}
    
    OnEnd:
    	if (@qe[7]) {
    		changelook LOOK_HEAD_BOTTOM, @qe[3];
    		changelook LOOK_HEAD_TOP, @qe[4];
    		changelook LOOK_HEAD_MID, @qe[5];
    		changelook LOOK_ROBE, @qe[6];
    	}
    	deletearray @qe[0],8;
    	end;
    
    function Add {
    	if (getitemname(getarg(1)) == "null") {
    		debugmes "Quest reward #"+getarg(1)+" invalid 
    
    (skipped).";
    		return;
    	}
    	setarray .@j[0],getarg(2),getarg(3),getarg(4);
    	for(set .@i,5; .@i<getargcount(); set .@i,.@i+2) {
    		if (getitemname(getarg(.@i)) == "null") {
    			debugmes "Quest requirement #"+getarg(.@i)+" 
    
    invalid (skipped).";
    			return;
    		} else
    			setarray .@j[.@i-2],getarg(.@i),getarg(.@i+1);
    	}
    	copyarray getd(".q_"+getarg(0)+"_"+getarg(1)+"[0]"),.@j
    
    [0],getarraysize(.@j);
    	npcshopadditem "qshop"+getarg(0),getarg(1),((.ShowZeny)?getarg
    
    (3):0);
    	return;
    }
    
    function Chk {
    	if (getarg(0) < getarg(1)) {
    		set @qe[0],1;
    		return "^FF0000";
    	} else
    		return "^00FF00";
    }
    
    function Slot {
    	set .@s$,getitemname(getarg(0));
    	switch(.ShowSlot) {
    		case 1: if (!getitemslots(getarg(0))) return .@s$;
    		case 2: if (getiteminfo(getarg(0),2) == 4 || 
    
    getiteminfo(getarg(0),2) == 5) return .@s$+" ["+getitemslots(getarg
    
    (0))+"]";
    		default: return .@s$;
    	}
    }
    }
    
    function	script	qshop	{
    	deletearray @i[0],getarraysize(@i);
    	for(set .@i,0; .@i<getargcount(); set .@i,.@i+1)
    		set @i[.@i],getarg(.@i);
    	doevent "quest_shop::OnMenu";
    	end;
    }
    
    
    // Dummy shop data -- copy as needed.
    //============================================================
    -	shop	qshop1	-1,909:-1
    -	shop	qshop2	-1,909:-1
    -	shop	qshop3	-1,909:-1
    -	shop	qshop4	-1,909:-1
    -	shop	qshop5	-1,909:-1

    im sorry i just realized that now. I got too excited

     

    On 4/19/2020 at 10:46 PM, Haruka Mayumi said:

    Unbelievable too many errors..
    Fixed.

    
    //===== rAthena Script =======================================
    //= Euphy's Quest Shop
    //===== By: ==================================================
    //= Euphy
    //===== Current Version: =====================================
    //= 1.6c
    //===== Compatible With: =====================================
    //= rAthena Project
    //===== Description: =========================================
    //= A dynamic quest shop based on Lunar's, with easier config.
    //= Includes support for multiple shops & cashpoints.
    //= Item Preview script by ToastOfDoom.
    //===== Additional Comments: =================================
    //= 1.0 Initial script.
    //= 1.2 Added category support.
    //= 1.3 More options and fixes.
    //= 1.4 Added debug settings.
    //= 1.5 Replaced categories with shop IDs.
    //= 1.6 Added support for purchasing stackables.
    //= 1.6a Added support for previewing costumes and robes.
    //= 1.6b Added 'disable_items' command.
    //= 1.6c Replaced function 'A_An' with "F_InsertArticle".
    //============================================================
    
    // Shop NPCs -- supplying no argument displays entire menu.
    //	callfunc "qshop"{,<shop ID>{,<shop ID>{,...}}};
    //  ADD YOUR NPC HERE
    //============================================================
    prontera,147,165,6	script	Quest Shop#1	998,{
    	callfunc "qshop";
    end;
    
    OnInit:
    	waitingroom "Quest Shop",0;
    end;
    }
    //prontera,165,203,6	script	Quest Shop#2	998,{ callfunc "qshop",1,2; }	// call the shop 1 and 2 defined below
    // etc.. Add your Shop NPCs 'Quest Shop#XXX' here
    //============================================================
    
    
    // Script Core - DO NOT DUPLICATE THIS NPC !!!!!!!!!!!!!
    //============================================================
    -	script	quest_shop	-1,{
    function Add; function Chk; function Slot;
    OnInit:
    	freeloop(1);
    
    // -----------------------------------------------------------
    //  Basic shop settings.
    // -----------------------------------------------------------
    
    	set .Announce,1;	// Announce quest completion? (1: yes / 0: no)
    	set .ShowSlot,1;	// Show item slots? (2: all equipment / 1: if slots > 0 / 0: never)
    	set .ShowID,0;  	// Show item IDs? (1: yes / 0: no)
    	set .ShowZeny,0;	// Show Zeny cost, if any? (1: yes / 0: no)
    	set .MaxStack,100;	// Max number of quest items purchased at one time.
    
    // -----------------------------------------------------------
    //  Points variable -- optional quest requirement.
    //	setarray .Points$[0],"<variable name>","<display name>";
    // -----------------------------------------------------------
    
    	setarray .Points$[0],
    		"#CASHPOINTS", "Cash Points";
    
    
    //=====================================================================================
    // ------------------- ADD YOUR SHOPS NAME AND ITEMS SHOPS STARTING HERE --------------
    //=====================================================================================
    
    // -----------------------------------------------------------
    //  Shop IDs -- to add shops, copy dummy data at bottom of file.
    //	setarray .Shops$[1],"<Shop 1>","<Shop 2>"{,...};
    // -----------------------------------------------------------
    
    	setarray .Shops$[1],
    		"Headgears",	// Shop Named 1
    		"Weapons",		// Shop Named 2
    		"Other";		// Shop Named 3
    
    // -----------------------------------------------------------
    //  Quest items -- do NOT use a reward item more than once!
    //	Add(<shop ID>,<reward ID>,<reward amount>,
    //	    <Zeny cost>,<point cost>,
    //	    <required item ID>,<required item amount>{,...});
    // -----------------------------------------------------------
    
    	Add(1,5086,1,0,0,2288,1,1095,3000);
    	
    	Add(1,5074,1,20000,0,2286,1,2254,1);
    	Add(1,5132,1,0,0,5035,1,5074,1,714,1,999,5);
    	Add(1,5153,1,0,0,10011,1);
    	Add(1,2284,1,0,0,923,20);
    	Add(1,5270,1,0,0,7198,200,7097,40);
    	sleep 10;
    	Add(1,5174,1,0,0,7445,7,7446,7,7447,7,7448,7,945,300,975,1,733,5,7166,50);
    	Add(1,5277,1,0,0,5278,1,508,200);
    	Add(1,2237,1,0,0,1020,100,983,1,2241,1);
    	
    	Add(1,5057,1,10000,0,2213,1,983,1,914,200);
    	Add(1,5076,1,0,0,2227,1,7038,500);
    	Add(1,5236,1,0,0,2227,1,7038,500,978,1);
    	Add(1,5235,1,0,0,2227,1,7038,500,982,1,983,1);
    	Add(1,5237,1,0,0,2227,1,7038,500,975,1,982,1);
    	Add(1,5382,1,0,0,969,8,10016,2,5083,1);
    	sleep 10;
    	Add(1,5065,1,0,0,624,1,959,300,544,50,1023,1);
    	Add(1,5052,1,0,0,2211,1,978,1,7003,300);
    	Add(1,2296,1,50000,0,2243,1,999,100);
    	Add(1,5129,1,0,0,604,1,916,1);
    	Add(1,5102,1,0,0,7263,2,2276,1,2239,1,568,150);
    	Add(1,5040,1,0,0,7047,100);
    	Add(1,5109,50000,0,0,10015,1,10007,1,5023,1,975,1);
    	Add(1,5016,1,0,0,1030,10,0,0,0,0,0,0);
    	Add(1,5110,1,0,0,526,2,7270,1,941,1,10004,1);
    	Add(1,5191,1,0,0,2208,1,983,1);
    	sleep 10;
    	Add(1,5169,1,0,0,706,1,1019,500,7200,10,1049,20,7165,500,1054,2,1024,100);
    	Add(1,5034,1,0,0,2233,1,746,20);
    	Add(1,2214,1,0,0,949,100,706,1,722,1,2213,1);
    	
    	Add(1,5175,1,100000,0,7111,100,938,99,983,1);
    	Add(1,5080,1,0,0,10006,1,714,1,969,3);
    	Add(1,5024,1,0,0,529,10,530,5,539,20,999,10,538,15);
    	Add(1,5028,1,0,0,2279,1,7035,50,526,100);
    	Add(1,5200,1,0,0,5016,1,981,1,7317,20);
    	Add(1,5184,1,0,0,5120,5,995,50,983,1,720,50);
    	
    	Add(1,5214,1,0,0,976,1,1060,300,1022,100,5008,5);
    	Add(1,5026,1,0,0,1036,450,949,330,539,120,982,1);
    	sleep 10;
    	Add(1,5142,1,0,0,5017,1,2229,1,5014,1,7209,100,7123,100,1036,100,979,1);
    	Add(1,5283,1,0,0,949,200,916,100,7063,20,925,1);
    	Add(1,5260,1,0,0,4293,1,538,100,530,100,529,50);
    	Add(1,5075,1,0,0,2248,1,7030,108,7194,108,7120,4);
    	Add(1,5048,1,0,0,5041,1,999,10);
    	Add(1,5036,1,0,0,2608,1,7069,500);
    	Add(1,5135,1,0,0,2295,1,969,1,975,1,999,5);
    	
    	Add(1,5108,1,5000,0,7301,1887,5114,1,611,10);
    	Add(1,5254,1,0,0,5132,1,5068,1,2255,1,7023,5,983,1);
    	sleep 10;
    	Add(1,5038,1,0,0,1038,600,7048,40);
    	Add(1,5229,1,0,0,1038,600,7048,40,982,1,983,1);
    	Add(1,5227,1,0,0,1038,600,7048,40,975,1);
    	Add(1,5228,1,0,0,1038,600,7048,40,982,1);
    	Add(1,5186,1,0,0,1032,100,7100,100,905,250);
    	Add(1,5091,1,20000,0,10016,1,714,1,969,3);
    	Add(1,5082,1,0,0,921,300);
    	Add(1,2273,1,3500,0,2275,1,998,50,733,1);
    	Add(1,5258,1,0,0,914,100,975,1,976,1,978,1);
    	Add(1,5198,1,0,0,5058,1,2214,1,949,500,914,200,622,50,1974,1);
    	sleep 10;
    	Add(1,5058,1,0,0,2233,1,983,1,7206,300,7030,1);
    	Add(1,5233,1,0,0,2233,1,983,1,7206,300,7030,1,978,1);
    	Add(1,5231,1,0,0,2233,1,983,1,7206,300,7030,1,982,1,983,1);
    	Add(1,5232,1,0,0,2233,1,983,1,7206,300,7030,1,982,1,975,1);
    	Add(1,5230,1,0,0,2233,1,983,1,7206,300,7030,1,982,1);
    	Add(1,5234,1,0,0,2233,1,983,1,7206,300,7030,1,976,1);
    	Add(1,5253,1,0,0,1034,300,7445,30,5141,10,979,1);
    	Add(1,5252,1,0,0,5058,1,1022,250,7267,100);
    	Add(1,2283,1,0,0,724,1,5001,1,949,200);
    	Add(1,5243,1,0,0,975,1,976,1,914,100,7441,150,7065,25,2283,1);
    	sleep 10;
    	Add(1,5259,1,0,0,978,1,7561,100,949,500,1026,200);
    	Add(1,5205,1,0,0,5185,1,610,100,706,25,7194,113);
    	Add(1,5068,1,20000,0,2255,1,2286,1);
    	Add(1,5304,1,0,0,7017,2,2510,1,983,1);
    	Add(1,5207,1,0,0,2282,5,2254,2,969,1,7063,15);
    	Add(1,5333,1,0,0,996,4,12028,1,12032,1,992,10,5011,1);
    	Add(1,5312,1,0,0,2261,1,983,1,2280,1,2627,1,969,2);
    
    	Add(1,5416,1,0,0,746,20,7097,12,587,20,2717,1);
    	
    	sleep 10;
    	Add(1,5427,1,0,0,5288,1,12078,1,7521,1,12183,1);
    	Add(1,5404,1,0,0,5187,1,1034,70,7441,10,978,10);
    	
    	Add(1,5429,1,0,0,5100,1,1021,30,7268,1);
    	Add(1,5338,1,0,0,5100,1,7112,25,561,1);
    	Add(1,5300,1,0,0,7106,2,2246,1,7263,1);
    	Add(1,5378,1,0,0,2214,1,5045,1,975,1,740,100);
    	Add(1,5414,1,100000000,0,7300,9,1068,4,7098,2);
    	Add(1,5307,1,0,0,2275,5,514,2,979,1,634,1,619,20,1027,20);
    	Add(1,5431,1,50000000,0,5283,1,916,50,2717,1);
    	sleep 10;
    	Add(1,5341,1,80000000,0,5137,1,2276,1,1060,25);
    	Add(1,5131,1,0,0,5128,1,969,10,978,1,985,27);
    	Add(1,5417,1,0,0,4112,1,5299,1);
    	Add(1,5373,1,0,0,2255,1,7566,3,7511,60,5104,1,7799,4,7023,20);
    	Add(1,5369,1,0,0,5191,6,7205,25,558,3,2210,1,7441,5);
    	Add(1,5340,1,0,0,5137,1,5040,1,1034,25);	
    	Add(1,5313,1,0,0,5124,1,2249,1,5007,1,523,200);
    	Add(1,5258,1,0,0,2261,1,914,200,975,1,976,1,978,1);
    	Add(1,5292,1,0,0,7266,2,1035,4,10001,1);
    	Add(1,5396,1,0,0,5058,1,980,1,1022,53);
    	sleep 10;
    	Add(1,5146,1,0,0,978,1,949,500,1019,1);
    	Add(1,5282,1,0,0,5200,1,982,1,978,2);
    	Add(1,5247,1,0,0,1039,60,923,25,2255,1);
    	Add(1,5364,1,0,0,5347,1,975,1,982,1,983,1,5048,1);	
    	
    	Add(1,5047,1,0,0,2271,1,975,1);
    	Add(1,5170,1,0,0,5172,1,7063,100,982,1);
    	Add(1,5380,1,0,0,5065,2);
    	Add(1,5303,1,0,0,712,100,710,5,629,5,10009,1);
    	Add(1,5302,1,0,0,7553,2,982,1,7771,1);
    	sleep 10;
    	Add(1,5056,1,0,0,5079,1,578,100);
    	Add(1,5390,1,0,0,2236,2,978,1,1034,50,2294,2);
    	Add(1,5144,1,0,0,2214,1,2221,1,7567,25,1001,200);
    	Add(1,5063,1,0,0,970,1,930,500);
    	Add(1,5193,1,0,0,2208,1,979,1);
    	Add(1,5021,1,0,0,2233,1,969,1,999,20,949,80,938,800);
    	Add(1,5179,1,0,0,2234,1,969,3,2610,4,13106,2);
    	Add(1,5176,1,0,0,706,1,1019,500,7200,10,7015,20,2267,1,952,100,1028,100);
    	Add(1,5001,1,0,0,999,40,984,1,970,1,1003,1);
    	Add(1,5031,1,0,0,7013,1200);
    	sleep 10;
    	Add(1,5025,1,0,0,2229,1,2254,1,7036,5);
    	Add(1,5061,1,20000,0,2269,1,999,10);
    	Add(1,5139,1,0,0,5085,1,710,5,7510,1,975,1);
    	Add(1,5070,1,0,0,7216,300,7097,300,2211,1,982,1);
    	Add(1,5071,1,10000,0,5010,1,5049,1,7101,10);
    	Add(1,5173,1,0,0,7445,7,7446,7,7447,7,7478,7,945,300,983,1,733,5,2221,1);
    	Add(1,5321,1,0,0,2275,2,2211,2,7215,4,7217,20);
    	
    	Add(1,2240,1,0,0,1040,2,982,2,949,4,7457,1);
    	Add(1,5405,1,0,0,7441,45,949,80,916,100);
    	sleep 10;
    	Add(1,5410,1,50000000,0,7188,40,7111,20);
    	
    	Add(1,5424,1,0,0,980,1,620,1,605,50,985,200);
    	Add(1,5425,1,0,0,981,1,533,1,605,50,985,200);
    	Add(1,5276,1,0,0,2261,1,914,200,983,1,976,1,975,1);
    	Add(1,5156,1,0,0,2265,10,982,1);
    	Add(1,5154,1,0,0,2202,1,7020,5);
    	Add(1,5155,1,0,0,7024,10,7754,2,7562,4,7450,1);
    	Add(1,5018,1,500,0,2247,1,916,300);
    	Add(1,5403,1,0,0,1023,1,544,5,579,1);
    	sleep 10;
    	Add(1,5317,1,0,0,5120,1,2290,1,938,4);
    	
    	Add(1,5334,1,0,0,5132,1,1971,20,7093,4,2659,1);
    	
    	Add(1,5400,1,0,0,1022,20,1234,2);
    	Add(1,5339,1,0,0,5100,1,7112,25,1558,1);
    	
    	Add(1,5346,1,0,0,5100,1,7112,25,558,1);
    	Add(1,5433,1,0,0,5185,1,969,2);
    	sleep 10;
    	Add(1,5262,1,0,0,5164,1,7799,1,7578,1,969,3);	
    	Add(1,5336,1,0,0,5100,1,7112,25,714,1);
    	Add(1,5273,1,0,0,2261,1,914,200,982,1,975,1,979,1);
    	Add(1,5319,1,0,0,5035,1,5074,1,978,1);
    	Add(1,5363,1,0,0,5120,1,2261,1,983,20);
    
    	Add(1,5360,1,0,0,5057,1,2747,2,5161,1);
    	Add(1,5383,1,0,0,5200,1,979,1,7445,50);
    
    	
    	sleep 10;
    	Add(1,5396,1,0,0,5430,1,5285,1,7262,20,5396,1);
    	Add(1,5371,1,0,0,5016,1,1004,35);
    	Add(1,5426,1,0,0,5027,1,976,5);
    	Add(1,5322,1,0,0,10019,1,982,2);
    	Add(1,5291,1,0,0,7323,100,969,20);
    	Add(1,5372,1,0,0,5099,1,5230,1,2747,5,982,15);
    	Add(1,5311,1,0,0,5139,5);
    	Add(1,5418,1,0,0,5016,1,2261,1,968,1,975,5,1004,35);
    	Add(1,5422,1,500000,0,1550,3,1006,20);
    	Add(1,5324,1,0,0,5137,1,7063,20,1034,20);
    	sleep 10;
    	Add(1,5448,1,0,0,521,200,1019,300);
    	Add(1,5449,1,0,0,521,200,1019,300);
    	Add(1,5332,1,0,0,7019,10,7200,10);
    	Add(1,5392,1,100000,0,721,5,7216,25);
    	
    	Add(1,5393,1,777777,0,2285,5,994,10,7097,25);
    	Add(1,5365,1,0,0,574,150,7031,150);
    	Add(1,5143,1,0,0,5090,1,1020,300,975,1,982,1);
    	Add(1,5020,1,0,0,2215,1,2210,1,7063,20);
    	Add(1,5140,1,0,0,5085,1,2244,1,5191,1,7166,50);
    	sleep 10;
    	Add(1,5069,1,0,0,1022,99);
    	Add(1,5185,1,0,0,5061,1,712,100,7194,150,7298,100,520,50,521,50);
    	Add(1,5130,1,0,0,1048,100,7564,150,517,30);
    	Add(1,5177,1,0,0,706,1,1019,500,7200,10,1049,500,1053,2,980,1);
    
    	Add(1,5084,1,0,0,1026,1000,7065,100,945,100,7030,1);
    	Add(1,5027,1,0,0,2252,1,1036,400,7001,50,4052,1);
    	Add(1,5241,1,0,0,2252,1,1036,400,7001,50,4052,1,978,1);
    	Add(1,5240,1,0,0,2252,1,1036,400,7001,50,4052,1,982,1,983,1);
    	Add(1,5238,1,0,0,2252,1,1036,400,7001,50,4052,1,975,1);
    	sleep 10;
    	Add(1,5239,1,0,0,2252,1,1036,400,7001,50,4052,1,982,1);
    	Add(1,5242,1,0,0,2252,1,1036,400,7001,50,4052,1,976,1);
    	Add(1,5054,1,0,0,2252,1,1054,450,943,1200);
    	Add(1,5187,1,0,0,5085,1,5091,1,5117,2,978,1,975,1);
    	Add(1,5138,1,0,0,5123,1,5027,1,7337,50,981,1);
    	Add(1,5099,1,0,0,7267,300,7171,300,1029,5);
    	Add(1,5031,1,0,0,5009,1,5028,1,747,1,999,25);
    	Add(1,5081,1,40000,0,2249,1,714,1,969,3);
    	Add(1,5073,1,0,0,2285,1,1550,1);
    	Add(1,5117,1,50000,0,731,10,748,2,982,1);
    	sleep 10;
    	Add(1,5183,1,0,0,604,100,916,100,7115,100);
    	Add(1,5151,1,0,0,5001,1,978,1,991,200);
    	Add(1,2281,1,5000,0,998,20,707,1);
    	Add(1,5043,1,0,0,2281,1,1048,50);
    	Add(1,5094,1,0,0,968,100,2299,1,1124,1,931,1000);
    	Add(1,5196,1,0,0,2208,1,980,1);
    	Add(1,5078,1,0,0,5033,1,5064,1);
    	Add(1,5004,1,0,0,701,5);
    	Add(1,5275,1,0,0,2261,1,914,200,975,1,976,1,981,1);
    	
    	sleep 10;
    	Add(1,5420,1,300000000,0,5430,2,5421,1);
    	Add(1,5323,1,0,0,5081,3,7754,1,2128,1);
    	Add(1,5806,1,0,0,2280,1,7479,1,2109,1);
    	Add(1,5315,1,0,0,2276,1,5135,1,7094,50,7353,50);
    	Add(1,5807,1,0,0,5416,1,2211,2,949,100);
    	Add(1,5375,1,0,0,5094,1,10018,2,968,5,7440,30);
    	Add(1,5370,1,0,0,5302,1,981,5);
    	Add(1,5060,1,0,0,2236,1,7151,100,7111,100);
    	Add(1,5299,1,0,0,7441,20,949,50,916,15,7115,10,7440,20,7063,10,7200,10,2214,1);
    	Add(1,5023,1,0,0,1059,150,907,100,978,1);
    	sleep 10;
    
    	Add(1,5271,1,0,0,2254,1,723,1,7301,20,999,50,978,1);
    	Add(1,5352,1,0,0,5035,1,979,1,938,100);
    	Add(1,2293,1,0,0,1049,4);
    	Add(1,5194,1,0,0,2208,1,975,1,982,1);
    	Add(1,5202,1,0,0,5035,1,1062,100,535,80);
    	Add(1,5182,1,0,0,5008,10,5118,1,1060,100,2210,1);
    	Add(1,5213,1,0,0,2214,1,983,1,7063,30);
    	Add(1,5033,1,0,0,1036,20,2213,1,7065,300,7012,200);
    	Add(1,5039,1,0,0,7030,50,978,1,5015,1);
    	sleep 10;
    	
    	Add(1,5195,1,0,0,2208,1,975,1);
    	Add(1,5211,1,0,0,5045,1,5083,1,7063,40,7553,1,982,1,975,1);
    	Add(1,5208,1,0,0,1550,1,1553,7,1556,7,1554,7,1557,7,1555,7,7015,30);
    	Add(1,5083,1,0,0,2244,1,2209,1,10007,1);
    	Add(1,2280,1,10000,0,1019,120);
    	Add(1,5100,1,0,0,2272,1,7451,4,7433,3,690,10);
    	Add(1,5067,1,0,0,5062,1,952,50,1907,1);
    	Add(1,5133,1,0,0,5160,1,7106,6,7107,80);
    	
    	sleep 10;
    	Add(1,5064,1,0,0,945,600,7030,1);
    	Add(1,2278,1,0,0,705,10,909,10,914,10);
    	Add(1,5203,1,0,0,2278,1,1015,1,999,5);
    	Add(1,5212,1,0,0,1820,2,5011,1,2651,1,4125,1);
    	Add(1,5257,1,0,0,5074,1,2282,1,7064,10,969,5);
    	Add(1,5029,1,0,0,7068,300,7033,850,1015,1);
    	Add(1,2272,1,911000,0,1019,50,983,1);
    	Add(1,5062,1,0,0,2280,1,7197,300,7150,300);
    	Add(1,5049,1,0,0,1099,1500);
    	Add(1,5287,1,0,0,5062,1,5348,1,978,1);
    	sleep 10;
    	Add(1,5032,1,0,0,1059,250,2221,1,2227,1,7063,600);
    	Add(1,5103,1,0,0,5351,1,10011,1);
    	Add(1,5022,1,0,0,7086,1,969,10,999,40,1003,50,984,2);
    	Add(1,5395,1,0,0,5045,2,7205,150,983,1,1059,100);
    	Add(1,5059,1,0,0,5030,1,7213,100,7217,100,7161,300);
    	Add(1,5107,1,0,0,519,50,7031,50,548,50,539,50);
    	Add(1,5255,1,0,0,5153,1,741,10,5132,1,5074,1);
    	Add(1,5077,1,0,0,2278,1,975,1);
    	Add(1,5337,1,0,0,5100,1,7112,25,2617,1);
    	
    	sleep 10;
    	Add(1,5152,1,0,0,2254,1,724,1,7301,20,999,50,978,1);
    	Add(1,5305,1,0,0,1214,5,969,10,7799,5);
    	Add(1,5413,1,0,0,608,20,1752,1,2261,1,978,1);
    	Add(1,5415,1,0,0,5255,1,5024,1);
    	Add(1,5318,1,0,0,5035,2,5060,2,741,10,530,50,938,100);
    	Add(1,5409,1,0,0,5075,1,7101,5,981,10);
    	Add(1,5051,1,0,0,7047,100);
    	
    	sleep 10;
    	Add(1,5320,1,0,0,5205,1,1009,50,2111,1);
    	Add(1,5354,1,0,0,5431,1,12080,1,1629,1);
    	Add(1,5811,1,0,0,985,100,2241,10);
    	Add(1,5381,1,0,0,5335,1,2236,1);
    	Add(1,5397,1,0,0,7325,5,2205,1,7355,1);
    	Add(1,5355,1,0,0,7166,100,1059,200);
    	Add(1,5243,1,0,0,7446,1,2339,10,1059,70);
    	Add(1,5310,1,0,0,5034,1,1971,2,996,6);
    	Add(1,5274,1,0,0,2261,1,914,200,980,2,975,1);
    	Add(1,5261,1,0,0,5164,1,714,25,2611,50,7799,4);
    	sleep 10;
    	
    	Add(1,5342,1,0,0,5137,1,5040,1,1020,20,7152,5);
    	Add(1,5297,1,0,0,5257,1,1472,2,5158,2,7063,40);
    	Add(1,5335,1,0,0,741,5,607,5,940,150);
    	Add(1,5412,1,0,0,530,20,7035,10);
    	Add(1,5343,1,0,0,5137,1,2215,1,1034,25);
    	Add(1,5098,1,0,0,1029,10,2297,5,7267,50);
    	Add(1,5430,1,50000000,0,5414,1,7135,10,7451,4);
    	Add(1,5384,1,0,0,5390,1,975,1);
    	Add(1,5316,1,0,0,2226,1,622,10);
    	sleep 10;
    	Add(1,5289,1,0,0,526,200,7268,1);
    	
    	Add(1,5301,1,0,0,5191,3,5195,3);
    	Add(1,5344,1,0,0,5137,1,7038,20,1060,25);
    	Add(1,5345,1,0,0,5137,1,5195,2,1060,45);
    	Add(1,5411,1,0,0,5388,1,982,5,7263,2,978,2);
    	Add(1,5368,1,0,0,5197,6,7751,25,561,3,2210,1,7063,20);
    	Add(1,5385,1,0,0,753,100);
    	Add(1,5079,1,0,0,2294,1,7220,400);
    	Add(1,5171,1,0,0,4219,1,4114,1,4177,1,4259,1,4212,1,4073,1,4112,1,4081,1,4251,1,4166,1,7511,1000,7563,1000);
    	sleep 10;
    	Add(1,5256,1,0,0,7510,1,2210,1,7063,50);
    	Add(1,5285,1,0,0,7192,200,10011,1);
    	Add(1,5357,1,0,0,7510,20);
    	Add(1,5188,1,0,0,5027,1,7166,50,7064,1);
    	Add(1,2292,1,2000,0,999,50);
    	Add(1,5294,1,0,0,7019,5,7567,50);
    	Add(1,5115,1,50000,0,983,1,7267,99,749,1);
    	Add(1,5284,1,0,0,5302,1,975,1,982,1,5165,1);
    	Add(1,5050,1,0,0,5037,1,7064,500);
    	Add(1,5206,1,0,0,2269,1,982,1);
    	sleep 10;
    	Add(1,5197,1,0,0,2208,1,982,1);
    	Add(1,5278,1,0,0,2210,1,5192,1,2250,1);
    	Add(1,5192,1,0,0,2208,1,976,1);
    	Add(1,5121,1,0,0,7263,1,660,1,7099,30,7315,369);
    
    // Shop 2
    	Add(2,501,1,0,0,7263,1,660,1,7099,30,7315,369);
    
    // Shop 3
    	Add(3,531,1,3,0,512,1,713,1);
    	Add(3,532,1,3,0,513,1,713,1);
    	Add(3,533,1,3,0,514,1,713,1);
    	Add(3,534,1,3,0,515,1,713,1);
    
    // -----------------------------------------------------------
    
    //=====================================================================================
    // ------------------- YOUR SHOPS AND ITEMS SHOPS HAVE BEEN ADDED ---------------------
    //=====================================================================================
    
    	freeloop(0);
    	set .menu$,"";
    	for(set .@i,1; .@i<=getarraysize(.Shops$); set .@i,.@i+1) {
    		set .menu$, .menu$+.Shops$[.@i]+":";
    		npcshopdelitem "qshop"+.@i,909;
    	}
    	end;
    
    OnMenu:
    	set .@size, getarraysize(@i);
    	if (!.@size) set @shop_index, select(.menu$);
    	else if (.@size == 1) set @shop_index, @i[0];
    	else {
    		for(set .@j,0; .@j<.@size; set .@j,.@j+1)
    			set .@menu$, .@menu$+.Shops$[@i[.@j]]+":";
    		set @shop_index, @i[select(.@menu$)-1];
    	}
    	deletearray @i[0],getarraysize(@i);
    	if (.Shops$[@shop_index] == "") {
    		message strcharinfo(0),"An error has occurred.";
    		end;
    	}
    	dispbottom "Select one item at a time.";
    	callshop "qshop"+@shop_index,1;
    	npcshopattach "qshop"+@shop_index;
    	end;
    
    OnBuyItem:
    	// .@q[] : RewardID, BoughtAmt, RewardAmt, BaseAmt, ReqZeny, ReqPts, { ReqItem, ReqAmt, ... }
    	setarray .@q[0],@bought_nameid[0],((@bought_quantity[0] > .MaxStack)?.MaxStack:@bought_quantity[0]);
    	copyarray .@q[3],getd(".q_"+@shop_index+"_"+.@q[0]+"[0]"),getarraysize(getd(".q_"+@shop_index+"_"+.@q[0]));
    	set .@q[2],.@q[1]*.@q[3];
    	if (!.@q[2] || .@q[2] > 30000) {
    		message strcharinfo(0),"You can't purchase that many "+getitemname(.@q[0])+".";
    		end;
    	}
    	mes "[Quest Shop]";
    	mes "Reward: ^0055FF"+((.@q[2] > 1)?.@q[2]+"x ":"")+Slot(.@q[0])+"^000000";
    	mes "Requirements:";
    	disable_items;
    	if (.@q[4]) mes " > "+Chk(Zeny,.@q[4]*.@q[1])+(.@q[4]*.@q[1])+" Zeny^000000";
    	if (.@q[5]) mes " > "+Chk(getd(.Points$[0]),.@q[5]*.@q[1])+(.@q[5]*.@q[1])+" "+.Points$[1]+" ("+getd(.Points$[0])+"/"+(.@q[5]*.@q[1])+")^000000";
    	if (.@q[6]) for(set .@i,6; .@i<getarraysize(.@q); set .@i,.@i+2)
    		mes " > "+Chk(countitem(.@q[.@i]),.@q[.@i+1]*.@q[1])+((.ShowID)?"{"+.@q[.@i]+"} ":"")+Slot(.@q[.@i])+" ("+countitem(.@q[.@i])+"/"+(.@q[.@i+1]*.@q[1])+")^000000";
    	next;
    	setarray @qe[1], getiteminfo(.@q[0],5), getiteminfo(.@q[0],11);
    	if (@qe[2] > 0 && ((@qe[1] & EQP_HEAD_LOW) || (@qe[1] & EQP_HEAD_TOP) || (@qe[1] & EQP_HEAD_MID) || (@qe[1] & EQP_COSTUME_HEAD_TOP) || (@qe[1] & EQP_COSTUME_HEAD_MID) || (@qe[1] & EQP_COSTUME_HEAD_LOW) || (@qe[1] & EQP_GARMENT) || (@qe[1] & EQP_COSTUME_GARMENT)))
    		set .@preview,1;
    	addtimer 1000, strnpcinfo(0)+"::OnEnd";
    	while(1) {
    		switch(select(" ~ Purchase ^0055FF"+getitemname(.@q[0])+"^000000:"+((.@preview && !@qe[7])?" ~ Preview...":"")+": ~ ^777777Cancel^000000")) {
    		case 1:
    			if (@qe[0]) {
    				mes "[Quest Shop]";
    				mes "You're missing one or more quest requirements.";
    				close;
    			}
    			if (!checkweight(.@q[0],.@q[2])) {
    				mes "[Quest Shop]";
    				mes "^FF0000You need "+(((.@q[2]*getiteminfo(.@q[0],6))+Weight-MaxWeight)/10)+" additional weight capacity to complete this trade.^000000";
    				close;
    			}
    			if (.@q[4]) set Zeny, Zeny-(.@q[4]*.@q[1]);
    			if (.@q[5]) setd .Points$[0], getd(.Points$[0])-(.@q[5]*.@q[1]);
    			if (.@q[6]) for(set .@i,6; .@i<getarraysize(.@q); set .@i,.@i+2)
    				delitem .@q[.@i],.@q[.@i+1]*.@q[1];
    			getitem .@q[0],.@q[2];
    			if (.Announce) announce strcharinfo(0)+" has created "+((.@q[2] > 1)?.@q[2]+"x "+getitemname(.@q[0]):callfunc("F_InsertArticle",getitemname(.@q[0])))+"!",0;
    			specialeffect2 EF_FLOWERLEAF;
    			close;
    		case 2:
    			setarray @qe[3], getlook(LOOK_HEAD_BOTTOM), getlook(LOOK_HEAD_TOP), getlook(LOOK_HEAD_MID), getlook(LOOK_ROBE), 1;
    			if ((@qe[1] & 1) || (@qe[1] & 4096)) changelook LOOK_HEAD_BOTTOM, @qe[2];
    			else if ((@qe[1] & 256) || (@qe[1] & 1024)) changelook LOOK_HEAD_TOP, @qe[2];
    			else if ((@qe[1] & 512) || (@qe[1] & 2048)) changelook LOOK_HEAD_MID, @qe[2];
    			else if ((@qe[1] & 4) || (@qe[1] & 8192)) changelook LOOK_ROBE, @qe[2];
    			break;
    		case 3:
    			close;
    		}
    	}
    
    OnEnd:
    	if (@qe[7]) {
    		changelook LOOK_HEAD_BOTTOM, @qe[3];
    		changelook LOOK_HEAD_TOP, @qe[4];
    		changelook LOOK_HEAD_MID, @qe[5];
    		changelook LOOK_ROBE, @qe[6];
    	}
    	deletearray @qe[0],8;
    	end;
    
    function Add {
    	if (getitemname(getarg(1)) == "null") {
    		debugmes "Quest reward #"+getarg(1)+" invalid (skipped).";
    		return;
    	}
    	setarray .@j[0],getarg(2),getarg(3),getarg(4);
    	for(set .@i,5; .@i<getargcount(); set .@i,.@i+2) {
    		if (getitemname(getarg(.@i)) == "null") {
    			debugmes "Quest requirement #"+getarg(.@i)+" invalid (skipped).";
    			return;
    		} else
    			setarray .@j[.@i-2],getarg(.@i),getarg(.@i+1);
    	}
    	copyarray getd(".q_"+getarg(0)+"_"+getarg(1)+"[0]"),.@j[0],getarraysize(.@j);
    	npcshopadditem "qshop"+getarg(0),getarg(1),((.ShowZeny)?getarg(3):0);
    	return;
    }
    
    function Chk {
    	if (getarg(0) < getarg(1)) {
    		set @qe[0],1;
    		return "^FF0000";
    	} else
    		return "^00FF00";
    }
    
    function Slot {
    	set .@s$,getitemname(getarg(0));
    	switch(.ShowSlot) {
    		case 1: if (!getitemslots(getarg(0))) return .@s$;
    		case 2: if (getiteminfo(getarg(0),2) == 4 || getiteminfo(getarg(0),2) == 5) return .@s$+" ["+getitemslots(getarg(0))+"]";
    		default: return .@s$;
    	}
    }
    }
    
    function	script	qshop	{
    	deletearray @i[0],getarraysize(@i);
    	for(set .@i,0; .@i<getargcount(); set .@i,.@i+1)
    		set @i[.@i],getarg(.@i);
    	doevent "quest_shop::OnMenu";
    	end;
    }
    
    
    // Dummy shop data -- copy as needed.
    //============================================================
    -	shop	qshop1	-1,909:-1
    -	shop	qshop2	-1,909:-1
    -	shop	qshop3	-1,909:-1
    -	shop	qshop4	-1,909:-1
    -	shop	qshop5	-1,909:-1

     

    Thank you so much! Such a big help! you have a cold but a biiiiiiiiiiiiiiiiiiiiiiiig heart ❤️ all fixed! thank you!

     

    //======= 3ceam Script =======================================
    //= Prize Giver NPC
    //===== Modified By: =========================================
    //= Keitenai
    //===== Current Version: =====================================
    //= 1.0
    //===== Compatible With: =====================================
    //= Athena Project
    //===== Description: =========================================
    //= Prize giver for single char, account and more.
    //===== Additional Comments: =================================
    //= 1.0 Modified Version for 3ceam compatibility
    //============================================================
    
    prontera,147,173,4	script	Server Reward	544,{
    	//cutin "v_sprakki04",2;
    	//Check if setups are loaded.
    	if(!.Setup)
    		{
    			callsub OnLoadSetup;
    		}
    
    	//Show GM Panel if player is GM.
    	if(getgmlevel() >= .GMin)
    		menu("Take a prize as a player",-,"Give prize",
    				OnManagement,"Reset Item Give",
    				OnDelete,"IP Limit per Item",
    				OnLimit);
    
    	//Read attached player gifts from SQL table.
    	if(select("Get Account Prize!:Get Character Prize!:Exit") == 1)
    		{
    			set .@query, query_sql("SELECT * FROM `" + 
    
    .GiftTableName$ + "` WHERE account_id="+getcharid(3),
    				.@gift_id,
    				.@gift_account,
    				.@gift_char,
    				.@gift_item,
    				.@gift_amount,
    				.@gift_duration,
    				.@gift_time
    				); //Account gifts.
    		}
    		else if(@menu == 2)
    		{
    			set .@query, query_sql("SELECT * FROM `" + 
    
    .GiftTableName$ + "` WHERE char_id="+getcharid(0),
    				.@gift_id,
    				.@gift_account,
    				.@gift_char,
    				.@gift_item,
    				.@gift_amount,
    				.@gift_duration,
    				.@gift_time
    				); //Char gifts.
    		}
    		else goto OnLeave;
    
    	//Check if player don't have gifts.
    	if(!.@query)
    		{
    			mes "[Reward Giver]";
    			mes "Sorry, you don't have any prize";
    
    			cutin "v_sprakki04",255;
    			close;
    		}
    
    	//Build menu from query arrays.
    		mes "[" + strnpcinfo(1) + "]";
    		mes "^009900You got the prize^000000";
    			for( set .@i, 0; .@i < .@query; set .@i, .@i + 
    
    1 )
    			{
    				mes "(" + .@gift_amount[.@i] + ") " + 
    
    getitemname(.@gift_item[.@i]) + ".";
    				set .@menu$, .@menu$ + getitemname
    
    (.@gift_item[.@i]) + ":";
    			}
    			next;
    			set .@mid,select(.@menu$); //Show menu.
    			set .@mid,.@mid-1;
    
    	if (.@gift_time[.@mid] && .@gift_time[.@mid] < gettimetick(2))
    	{
    		mes "[Reward Giver]";
    		mes "Sorry, this prize's claim time is already over.";
    
    		cutin "v_sprakki04",255;
    		close;
    	}
    	//Item is now selected. Choose what you want to do with it.
    	mes "[" + strnpcinfo(1) + "]";
    	mes "what you want do with (" + .@gift_amount[.@mid] + ") " + 
    
    getitemname(.@gift_item[.@mid]) + "?";
    	next;
    	set .@Select,select("^009900Get it^000000:^ff0000Delete it! 
    
    ^000000:nothings");
    
    	//Receive gift selected.
    	if(.@Select == 1)
    	{
    		//Check weight.
    		if(checkweight( .@gift_item, .@gift_amount ) || 
    
    .@gift_item[.@mid] == .ZenyID)
    		{
    			mes "[" + strnpcinfo(1) + "]";
    			mes "^009900Get : (" + .@gift_amount[.@mid] + 
    
    ") " + getitemname(.@gift_item[.@mid]) + ".^000000";
    			if (.ip_limit)
    			{
    				// add ip_address to logs
    				.@ipexist = query_sql("SELECT item_id, 
    
    ip_address, claim_count FROM " + .GiftTableNameIP$ + " WHERE last_ip = 
    
    (SELECT last_ip FROM login WHERE account_id="+getcharid(3)+") AND 
    
    item_id = "+.@gift_item[.@mid]+" LIMIT 1", .@item,.@ip,.@claim_count);
    				if (.@claim_count[0] >= .ip_limit)
    				{
    					next;
    					mes "Sorry you have reached the 
    
    maximum redeem limit for this IP address";
    					cutin "v_sprakki04",255;
    					close;
    				}
    				if (!.@claim_count[0])
    				{
    					query_sql("INSERT INTO " + 
    
    .GiftTableNameIP$ + " (give_id,item_id,last_ip,claim_count) VALUES
    
    ("+.@gift_id+","+.@gift_item+",'(SELECT last_ip FROM login WHERE 
    
    account_id="+getcharid(3)+")',1)");		
    				}
    				else
    				{
    					query_sql("UPDATE " + 
    
    .GiftTableNameIP$ + " SET claim_count = "+(.@claim_count[0]+1)+" WHERE 
    
    item_id = "+.@gift_item[.@mid]+" AND last_ip = (SELECT last_ip FROM 
    
    login WHERE account_id="+getcharid(3)+")");
    				}
    			}
    			if (.@gift_item[.@mid] == .ZenyID) { // detects 
    
    zeny ID and give zeny.
    				if (Zeny+.@gift_amount[.@mid] > 
    
    .MaxZeny)
    				{
    					mes "Please make sure that you 
    
    have enough space to handle all these zennies and come back later.";
    					cutin "v_sprakki04",255;
    					close;
    				}
    				set Zeny,Zeny+.@gift_amount[.@mid];
    			}
    			else
    			{
    				if (!.@gift_duration)
    				{
    					getitem .@gift_item[.@mid], 
    
    .@gift_amount[.@mid]; //Give item to player.
    				}
    				else
    				{
    					rentitem .@gift_item[.@mid], 
    
    .@gift_duration * 60; 
    				}
    			}
    			query_sql( "DELETE FROM `" + .GiftTableName$ + 
    
    "` WHERE id = " + .@gift_id[.@mid] ); //Remove item from table.
    			cutin "v_sprakki04",255;
    			close;
    		}
    		else
    		{
    			//Overweight
    			mes "^ff0000Sorry ^000000 You can't take it " + 
    
    getitemname(.@gift_item[.@mid]);
    			mes "Could lose some wight?";
    			cutin "v_sprakki04",255;
    			close;
    		}
    	}
    	//Remove gift selected.
    	else if(.@Select == 2) {
    		mes "[" + strnpcinfo(1) + "]";
    		mes "Are you sure you want dellet it?";
    		mes "Gift: ("+.@gift_amount[.@mid]+") "+getitemname
    
    (.@gift_item[.@mid])+".";
    		next;
    		if(select("Yes:No") == 1) {
    			mes "[" + strnpcinfo(1) + "]";
    			mes "^ff0000Dellet: ("+.@gift_amount[.@mid]+") 
    
    "+getitemname(.@gift_item[.@mid])+".^000000";
    			query_sql("DELETE FROM `" + .GiftTableName$ + 
    
    "` WHERE id = " + .@gift_id[.@mid]); //Remove item from table.
    			cutin "v_sprakki04",255;
    			close;
    		} else {
    			mes "[" + strnpcinfo(1) + "]";
    			mes "we will save it";
    			cutin "v_sprakki04",255;
    			close;
    		}
    	}
    	//Nothing selected.
    	else
    	{
    		goto OnLeave;
    	}
    
    //GM Panel below:
    OnManagement:
    	if(getgmlevel() < .GMin) goto OnLeave;
    	mes "[" + strnpcinfo(1) + "]";
    	mes "Welvome " + strcharinfo(0) + "!";
    	mes "How I can help you?";
    	next;
    
    	if(select("Make Gift:Nothing") != 1) goto OnLeave;
    
    		//Make new gift.
    		mes "[" + strnpcinfo(1) + "]";
    		mes "Please input the item id.";
    		mes "Default: 501";
    	next;
    		mes "What do you want to give?";
    		set .@zenygive,0;
    			if(select("Item:Zeny") == 1)
    				{
    					input .@new_item, 501, 30000;
    				}
    	next;
    	mes "Do you want to add a claim timer?";
    	if(select("No:Yes")==2)
    	{
    		next;
    		mes "How many minutes do you want this reward to be 
    
    claimable?";
    		input(.@c);
    		.@claimtime = gettimetick(2)+(.@c*60);
    	}
    	if(select("Continue:Cancel") != 1) goto OnLeave;
    		mes "[" + strnpcinfo(1) + "]";
    		mes "How many items/zeny?";
    		mes "Default: 1";
    	next;
    	//item quantity range of 1 to 1,000.
    	if(.@zenygive)
    	{
    		input .@new_value, 1, .MaxZeny;
    	}
    	else
    	{
    		input .@new_value, 1, 1000;
    	}
    	
    	if(select("Continue:Cancel") != 1) goto OnLeave;
    		mes "[" + strnpcinfo(1) + "]";
    		mes "Please select input type:";
    		mes "1. Single Account";
    		mes "2. Single Character";
    		mes "3. All ^009900Online^000000 Accounts.";
    		mes "4. All Accounts.";
    		mes "5. All ^009900Online^000000 Players/Characters.";
    		mes "6. All Players/Characters.";
    		mes "7. ^ff0000Cancel.^000000";
    	next;
    	switch(select("Single Account:Single 
    
    Character:^009900Online^000000 Accounts:All 
    
    Accounts:^009900Online^000000 Characters:All Characters:Cancel"))
    	{
    		//Account gift
    		case 1:
    			mes "[" + strnpcinfo(1) + "]";
    			mes "Please select input type:";
    			mes "By AID or Name?";
    			next;
    			if(select("Account ID:Character Name") == 1)
    			{
    				mes "[" + strnpcinfo(1) + "]";
    				mes "Write account id:";
    				next;
    				input .@new_account, 2000000, 10000000; 
    
    //Account id range from 2m to 10m.
    				set .@query, query_sql("SELECT 
    
    account_id FROM `" + .CharTableName$ + "` WHERE account_id = " + 
    
    .@new_account, .@new_account);
    				if(!.@query) goto OnNotExist;
    				if(select("Continue:Cancel") != 1) goto 
    
    OnLeave;
    				mes "[" + strnpcinfo(1) + "]";
    				mes "^009900Gift is ready to go!
    
    ^000000";
    				mes "AID: ^ff0000" + .@new_account + 
    
    "^000000";
    				mes "------------------";
    				mes "Item: ^ff0000" + getitemname
    
    (.@new_item) + "^000000";
    				mes "Quantity: ^ff0000" + .@new_value + 
    
    "^000000";
    				mes "Duration: " + .@duration + " 
    
    Minutes";
    				mes "Claim Time: " + .@c + " Minutes";
    				next;
    				if(select("Send Gift:Cancel") != 1) 
    
    goto OnLeave;
    				mes "[" + strnpcinfo(1) + "]";
    				mes "Gift sending success!";
    				//Create gift. <auto_id>, <account_id> 
    
    <char_id> <item> <value>
    				query_sql("INSERT INTO `" + 
    
    .GiftTableName$ + "` (account_id, item, value, duration, timestamp) 
    
    VALUES(" + .@new_account + ", " + .@new_item + ", " + .@new_value + ", 
    
    " + .@duration + ", " + .@claimtime + ")");
    			}
    			else
    			{
    				mes "[" + strnpcinfo(1) + "]";
    				mes "Write player name:";
    				next;
    				input .@new_name$;
    				set .@query, query_sql("SELECT 
    
    account_id FROM `" + .CharTableName$ + "` WHERE name = '" + .@new_name$ 
    
    + "'", .@new_account);
    				if(!.@query) goto OnNotExist;
    				if(select("Continue:Cancel") != 1) goto 
    
    OnLeave;
    				mes "[" + strnpcinfo(1) + "]";
    				mes "^009900Gift is ready to go!
    
    ^000000";
    				mes "AID: ^ff0000" + .@new_account + 
    
    "^000000";
    				mes "Name: ^ff0000"+ .@new_name$ + 
    
    "^000000";
    				mes "------------------";
    				mes "Item: ^ff0000" + getitemname
    
    (.@new_item) + "^000000";
    				mes "Quantity: ^ff0000" + .@new_value + 
    
    "^000000";
    				mes "Duration: " + .@duration + " 
    
    Minutes";
    				mes "Claim Time: " + .@c + " Minutes";
    				next;
    				if(select("Send Gift:Cancel") != 1) 
    
    goto OnLeave;
    				//Check if player is logged in.
    				if(isloggedin(.@new_account)) {
    					mes "[" + strnpcinfo(1) + "]";
    					mes "Gift sending success!";
    					query_sql("INSERT INTO `" + 
    
    .GiftTableName$ + "` (account_id, item, value, duration, timestamp) 
    
    VALUES(" + .@new_account + ", " + .@new_item + ", " + .@new_value + ", 
    
    " + .@duration + ", " + .@claimtime + ")");
    				} else {
    					//Account was not online.
    					mes "[" + strnpcinfo(1) + "]";
    					mes "Gift sending success!";
    					query_sql("INSERT INTO `" + 
    
    .GiftTableName$ + "` (account_id, item, value, duration, timestamp) 
    
    VALUES(" + .@new_account + ", " + .@new_item + ", " + .@new_value + ", 
    
    " + .@duration + ", " + .@claimtime + ")"); // duplicate to other menus 
    
    - continue here on giver side
    				}
    			}
    			break;
    
    		//Character gift.
    		case 2:
    			mes "[" + strnpcinfo(1) + "]";
    			mes "Please select input type:";
    			mes "By CID or Name?";
    			next;
    			if(select("Character ID:Character Name") == 1)
    			{
    				mes "[" + strnpcinfo(1) + "]";
    				mes "Write character id:";
    				next;
    				input .@new_char,150000, 10000000; 
    
    //Char id range from 150k to 10m.
    				set .@query, query_sql("SELECT 
    
    account_id, name FROM `" + .CharTableName$ + "` WHERE char_id = " + 
    
    .@new_char, .@new_accountid, .@new_name$);
    				if(!.@query) goto OnNotExist;
    				if(select("Continue:Cancel") != 1) goto 
    
    OnLeave;
    					mes "[" + strnpcinfo(1) + "]";
    					mes "^009900Gift is ready to 
    
    go!^000000";
    					mes "CID: ^ff0000" + .@new_char 
    
    + "^000000";
    					mes "Name: ^ff0000" + 
    
    .@new_name$ + "^000000";
    					mes "------------------";
    					mes "Item: ^ff0000" + 
    
    getitemname(.@new_item) + "^000000";
    					mes "Quantity: ^ff0000" + 
    
    .@new_value + "^000000";
    					mes "Duration: " + .@duration + 
    
    " Minutes";
    					mes "Claim Time: " + .@c + " 
    
    Minutes";
    				next;
    				if(select("Send Gift:Cancel") != 1) 
    
    goto OnLeave;
    				//Check if player is logged in.
    				if(isloggedin(.@new_accountid)) {
    					mes "[" + strnpcinfo(1) + "]";
    					mes "Gift sending success!";
    
    					//Create gift. <auto_id>, 
    
    <account_id> <char_id> <item> <value>
    					query_sql("INSERT INTO `" + 
    
    .GiftTableName$ + "` (char_id, item, value, duration, timestamp) VALUES 
    
    (" + .@new_char + ", " + .@new_item + ", " + .@new_value + "," + 
    
    .@duration + "," + .@claimtime + ")");
    				} else {
    					//not online ask if we still 
    
    give the gift.
    					mes "[" + strnpcinfo(1) + "]";
    					mes "The character is not 
    
    online!";
    					mes "Would you still like to 
    
    send the gift?";
    					next;
    					if(select("Yes:No") != 1) goto 
    
    OnLeave;
    					mes "[" + strnpcinfo(1) + "]";
    					mes "Gift sending success!";
    					//Create gift. <auto_id>, 
    
    <account_id> <char_id> <item> <value>
    					query_sql("INSERT INTO `" + 
    
    .GiftTableName$ + "` (char_id, item, value, duration, timestamp) VALUES 
    
    (" + .@new_char + ", " + .@new_item + ", " + .@new_value + "," + 
    
    .@duration + "," + .@claimtime + ")");
    				}
    
    			}
    			else
    			{
    				mes "[" + strnpcinfo(1) + "]";
    				mes "Write player name:";
    				next;
    				input .@new_name$;
    				set .@query, query_sql("SELECT char_id, 
    
    account_id FROM `" + .CharTableName$ + "` WHERE name = '" + .@new_name$ 
    
    + "'", .@new_char, .@new_accountid);
    				if(!.@query) goto OnNotExist;
    				if(select("Continue:Cancel") != 1) goto 
    
    OnLeave;
    					mes "[" + strnpcinfo(1) + "]";
    					mes "^009900Gift is ready to 
    
    go!^000000";
    					mes "CID: ^ff0000" + .@new_char 
    
    + "^000000";
    					mes "Name: ^ff0000"+ 
    
    .@new_name$ + "^000000";
    					mes "------------------";
    					mes "Item: ^ff0000" + 
    
    getitemname(.@new_item) + "^000000";
    					mes "Quantity: ^ff0000" + 
    
    .@new_value + "^000000";
    					mes "Duration: " + .@duration + 
    
    " Minutes";
    					mes "Claim Time: " + .@c + " 
    
    Minutes";
    				next;
    				if(select("Send Gift:Cancel") != 1) 
    
    goto OnLeave;
    				//Check if player is logged in.
    				if(isloggedin(.@new_accountid))
    				{
    					mes "[" + strnpcinfo(1) + "]";
    					mes "Gift sending success!";
    					query_sql("INSERT INTO `" + 
    
    .GiftTableName$ + "` (char_id, item, value, duration, timestamp) VALUES 
    
    (" + .@new_char + ", " + .@new_item + ", " + .@new_value + "," + 
    
    .@duration + "," + .@claimtime + ")");
    				}
    				else
    				{
    					//not online ask if we still 
    
    give the gift.
    					mes "[" + strnpcinfo(1) + "]";
    					mes "The character is not 
    
    online!";
    					mes "Would you still like to 
    
    give the gift?";
    					next;
    					if(select("Yes:No") != 1) goto 
    
    OnLeave;
    					mes "[" + strnpcinfo(1) + "]";
    					mes "Gift sending success!";
    					//Create gift. <auto_id>, 
    
    <account_id> <char_id> <item> <value>
    					query_sql("INSERT INTO `" + 
    
    .GiftTableName$ + "` (char_id, item, value, duration, timestamp) VALUES 
    
    (" + .@new_char + ", " + .@new_item + ", " + .@new_value + "," + 
    
    .@duration + "," + .@claimtime + ")");
    				}
    			}
    			announce strcharinfo(0)+" successfully sent " + 
    
    .@new_value + "x " + getitemname(.@new_item) + " to " + .@new_name
    
    $,bc_all;
    			break;
    
    		//Register gift to all online accounts!
    		case 3:
    			mes "[" + strnpcinfo(1) + "]";
    			mes "^009900Gift is ready to go!^000000";
    			mes "Item: ^ff0000" + getitemname(.@new_item) + 
    
    "^000000";
    			mes "Quantity: ^ff0000" + .@new_value + 
    
    "^000000";
    			mes "Duration: " + .@duration + " Minutes";	
    			mes "Claim Time: " + .@c + " Minutes";
    			next;
    			if(select("Send Gift:Cancel") != 1) goto 
    
    OnLeave;
    			mes "[" + strnpcinfo(1) + "]";
    			mes "Please hold...";
    			set .@c, 0; //Counting success.
    			set .@query, query_sql("SELECT account_id FROM 
    
    `"+.CharTableName$+"` WHERE online=1",.@account);
    			for(set .@i, 0; .@i < .@query; set .@i, .@i + 
    
    1) {
    				sleep2 25; //Slowdown the loop abit.
    				.@at = query_sql("SELECT account_id, 
    
    char_id FROM "+$GiftTableNameAT$+" WHERE account_id = "+.@account
    
    [.@i]+"", .@account_id, .@char_id); // check if in the table
    				if (!.@at) {		
    					query_sql("INSERT INTO `" + 
    
    .GiftTableName$ + "` (account_id, item, value, duration, timestamp) 
    
    VALUES(" + .@account[.@i] + ", " + .@new_item + ", " + .@new_value + ", 
    
    " + .@duration + ", " + .@claimtime + ")");
    				}
    			}
    			mes "Gift registered to (" + .@i + ") 
    
    accounts!";
    			break;
    
    		//Register gift to all accounts!
    		case 4:
    			mes "[" + strnpcinfo(1) + "]";
    			mes "^009900Gift is ready to go!^000000";
    			mes "Item: ^ff0000" + getitemname(.@new_item) + 
    
    "^000000";
    			mes "Quantity: ^ff0000" + .@new_value + 
    
    "^000000";
    			mes "Claim Time: " + .@c + " Minutes";		
    			next;
    			if(select("Send Gift:Cancel") != 1) goto 
    
    OnLeave;
    			mes "[" + strnpcinfo(1) + "]";
    			mes "Please hold...";
    			set .@query, query_sql("SELECT account_id FROM 
    
    `"+.LoginTableName$+"`",.@account);
    			for(set .@i, 0; .@i < .@query; set .@i, .@i + 
    
    1) {
    				sleep2 25; //Slowdown the loop abit.
    					query_sql("INSERT INTO `" + 
    
    .GiftTableName$ + "` (account_id, item, value, duration, timestamp) 
    
    VALUES(" + .@account[.@i] + ", " + .@new_item + ", " + .@new_value + ", 
    
    " + .@duration + ", " + .@claimtime + ")");
    			}
    			mes "Gift registered to (" + .@i + ") 
    
    accounts!";
    			break;
    
    		//Register gift to all online characters!
    		case 5:
    			mes "[" + strnpcinfo(1) + "]";
    			mes "^009900Gift is ready to go!^000000";
    			mes "Item: ^ff0000" + getitemname(.@new_item) + 
    
    "^000000";
    			mes "Quantity: ^ff0000" + .@new_value + 
    
    "^000000";
    			mes "Claim Time: " + .@c + " Minutes";		
    			next;
    			if(select("Send Gift:Cancel") != 1) goto 
    
    OnLeave;
    			mes "[" + strnpcinfo(1) + "]";
    			mes "Please hold...";
    			set .@c, 0; //Counting success.
    			set .@query, query_sql("SELECT char_id FROM 
    
    `"+.CharTableName$+"` WHERE online=1",.@char);
    			for(set .@i, 0; .@i < .@query; set .@i, .@i + 
    
    1) {
    				sleep2 25; //Slowdown the loop abit.
    				.@at = query_sql("SELECT account_id, 
    
    char_id FROM "+$GiftTableNameAT$+" WHERE char_id = "+.@char[.@i]+"", 
    
    .@account_id, .@char_id); // check if in the table
    				if (!.@at) {
    					query_sql("INSERT INTO `" + 
    
    .GiftTableName$ + "` (char_id, item, value, duration, timestamp) VALUES 
    
    (" + .@char[.@i] + ", " + .@new_item + ", " + .@new_value + "," + 
    
    .@duration + "," + .@claimtime + ")");
    				}
    			}
    			mes "Gift registered to (" + .@i + ") 
    
    players!";
    			break;
    
    		//Register gift to all characters!
    		case 6:
    			mes "[" + strnpcinfo(1) + "]";
    			mes "^009900Gift is ready to go!^000000";
    			mes "Item: ^ff0000" + getitemname(.@new_item) + 
    
    "^000000";
    			mes "Quantity: ^ff0000" + .@new_value + 
    
    "^000000";
    			mes "Claim Time: " + .@c + " Minutes";	
    			next;
    			if(select("Send Gift:Cancel") != 1) goto 
    
    OnLeave;
    			mes "[" + strnpcinfo(1) + "]";
    			mes "Please hold...";
    			set .@query, query_sql("SELECT char_id FROM 
    
    `"+.CharTableName$+"`",.@char);
    			for(set .@i, 0; .@i < .@query; set .@i, .@i + 
    
    1) {
    				sleep2 25; //Slowdown the loop abit.
    				query_sql("INSERT INTO `" + 
    
    .GiftTableName$ + "` (char_id, item, value, duration, timestamp) VALUES 
    
    (" + .@char[.@i] + ", " + .@new_item + ", " + .@new_value + "," + 
    
    .@duration + "," + .@claimtime + ")");
    			}
    			mes "Gift registered to (" + .@i + ") 
    
    players!";
    			break;
    
    		//Cancel.
    		Default:
    				mes "[Reward Giver]";
    				mes "See you later";
    				break;
    	}
    	close;
    
    OnLeave:
    		mes "[Reward Giver]";
    		mes "See you later";
    		cutin "v_sprakki04",255;
    		close;
    
    OnNotExist:
    		mes "[" + strnpcinfo(1) + "]";
    		mes "This account does not exist!";
    		cutin "v_sprakki04",255;
    		close;
    	
    //============Reset Function=========================
    OnDelete:
    		mes "Which gifts do you want to reset?";
    		mes "1. Single Account";
    		mes "2. Single Character";
    		mes "3. All ^009900Online^000000 Accounts.";
    		mes "4. All Accounts.";
    		mes "5. All ^009900Online^000000 Players/Characters.";
    		mes "6. All Players/Characters.";
    		mes "7. All cancel";
    		switch(select("Single Account:Single 
    
    Character:^009900Online^000000 Accounts:All 
    
    Accounts:^009900Online^000000 Characters:All Characters:Specific 
    
    Item:IPLimit Logs:Cancel"))
    			{
    			case 1: //Single Account
    				mes "[" + strnpcinfo(1) + "]";
    				mes "Please select input type:";
    				mes "By AID or Name?";
    				next;
    				if(select("Account ID:Character Name") 
    
    == 1)
    				{
    					mes "[" + strnpcinfo(1) + "]";
    					mes "Write account id:";
    					next;
    					input .@new_account, 2000000, 
    
    10000000; //Account id range from 2m to 10m.
    					set .@query, query_sql("SELECT 
    
    account_id FROM `" + .CharTableName$ + "` WHERE account_id = " + 
    
    .@new_account, .@new_account);
    					if(!.@query) goto OnNotExist;
    					if(select("Continue:Cancel") != 
    
    1) goto OnLeave;
    						query_sql("DELETE FROM 
    
    " + .GiftTableName$ + " WHERE account_id = " + .@new_account);
    				}
    				else
    				{
    					mes "[" + strnpcinfo(1) + "]";
    					mes "Write player name:";
    					next;
    					input .@new_name$;
    					set .@query, query_sql("SELECT 
    
    account_id FROM `" + .CharTableName$ + "` WHERE name = '" + .@new_name$ 
    
    + "'", .@new_account);
    					if(!.@query) goto OnNotExist;
    					if(select("Continue:Cancel") != 
    
    1) goto OnLeave;
    						query_sql("DELETE FROM 
    
    " + .GiftTableName$ + " WHERE account_id = " + .@new_account);
    				}
    				break;
    			case 2: //Single Character
    				mes "[" + strnpcinfo(1) + "]";
    				mes "Please select input type:";
    				mes "By CID or Name?";
    				next;
    				if(select("Character ID:Character 
    
    Name") == 1)
    				{
    					mes "[" + strnpcinfo(1) + "]";
    					mes "Write character id:";
    					next;
    					input .@new_char,150000, 
    
    10000000; //Char id range from 150k to 10m.
    					set .@query, query_sql("SELECT 
    
    account_id, name FROM `" + .CharTableName$ + "` WHERE char_id = " + 
    
    .@new_char, .@new_accountid, .@new_name$);
    					if(!.@query) goto OnNotExist;
    					if(select("Continue:Cancel") != 
    
    1) goto OnLeave;
    						query_sql("DELETE FROM 
    
    " + .GiftTableName$ + " WHERE char_id = " + .@new_char);
    				}
    				else
    				{
    					mes "[" + strnpcinfo(1) + "]";
    					mes "Write player name:";
    					next;
    					input .@new_name$;
    					set .@query, query_sql("SELECT 
    
    char_id, account_id FROM `" + .CharTableName$ + "` WHERE name = '" + 
    
    .@new_name$ + "'", .@new_char, .@new_accountid);
    					if(!.@query) goto OnNotExist;
    					if(select("Continue:Cancel") != 
    
    1) goto OnLeave;
    						query_sql("DELETE FROM 
    
    " + .GiftTableName$ + " WHERE char_id = " + .@new_char);
    				}
    				break;
    			case 3: //All Online Accounts.
    				mes "[" + strnpcinfo(1) + "]";
    				mes "Please hold...";
    				set .@c, 0; //Counting success.
    				set .@query, query_sql("SELECT 
    
    account_id FROM `"+.CharTableName$+"` WHERE online=1",.@account);
    				for(set .@i, 0; .@i < .@query; set .@i, 
    
    .@i + 1) {
    					sleep2 25; //Slowdown the loop 
    
    abit.
    					query_sql("DELETE FROM " + 
    
    .GiftTableName$ + " WHERE account_id = " + .@account[.@i]);
    				}
    				break;
    			case 4: //All Accounts.
    				query_sql("DELETE FROM " + 
    
    .GiftTableName$ + " WHERE account_id >= 1");
    				break;
    			case 5: //All Online Players/Characters.
    				mes "[" + strnpcinfo(1) + "]";
    				mes "Please hold...";
    				set .@c, 0; //Counting success.
    				set .@query, query_sql("SELECT char_id 
    
    FROM `"+.CharTableName$+"` WHERE online=1",.@char);
    				for(set .@i, 0; .@i < .@query; set .@i, 
    
    .@i + 1)
    					{
    						sleep2 25; //Slowdown 
    
    the loop abit.
    						query_sql("DELETE FROM 
    
    " + .GiftTableName$ + " WHERE char_id = " + .@char[.@i]);
    					}
    				break;
    			case 6: //All Players/Characters.
    				query_sql("TRUNCATE TABLE " + 
    
    .GiftTableName$);
    				break;
    			case 7: // Delete specific item
    				mes "Please type the id of the item you 
    
    wish to delete";
    				mes "This will delete all entries with 
    
    the item id you typed";
    				input(.@deletethis);
    				next;
    				mes "Are you sure you want to delete 
    
    all entries of " + .@deletethis;
    				if (select("Yes:No")==1)
    					{
    						query_sql("DELETE FROM 
    
    " + .GiftTableName$ + " WHERE item = " + .@deletethis + "");
    					}
    					else
    					{
    						mes "Deletion 
    
    cancelled";
    						close;
    					}
    			case 8: //All ip logs
    				query_sql("TRUNCATE TABLE " + 
    
    .GiftTableNameIP$);
    				break;
    			default:
    				break;
    		}
    		next;
    		mes "deletion finished";
    		cutin "v_sprakki04",255;
    		close;
    
    OnLimit:
    	mes "Please enter an ip limit, current limit is " + .ip_limit;
    	input(.ip_limit);
    	mes "Done!";
    	cutin "v_sprakki04",255;
    	close;
    
    //============================================================ 
    // Config/Edit:
    //============================================================ 
    OnLoadSetup:
    	set .Setup, 1;	//OnInit is loaded check.
    	set .GMin, 60;	//Minimum GM level to use gm panel.
    	set .ZenyID,23500; // put this when asked for which item to 
    
    give zeny.
    	set .MaxZeny,1000000000;
    	//Your table names:
    	set .CharTableName$, "char";	//Character table name(SQL).
    	set .LoginTableName$, "login";
    	set .GiftTableName$, "reward";	//Gift table name(SQL).
    	set .GiftTableNameIP$, "reward_ip";	//Gift table name for 
    
    ip tracker
    	set $GiftTableNameAT$, "reward_at";	//Gift table name for 
    
    auto trade tracker
    	//Create gift table <auto_id>, <account_id>, <char_id>, <item>, 
    
    <value>
    
    	query_sql("CREATE TABLE IF NOT EXISTS `reward` (`id` int(11) 
    
    NOT NULL AUTO_INCREMENT,`account_id` int(11) unsigned NOT NULL DEFAULT 
    
    '0',`char_id` int(11) unsigned NOT NULL DEFAULT '0',`item` int(11) NOT 
    
    NULL DEFAULT '0',`value` int(11) NOT NULL DEFAULT '0',`duration` int
    
    (11) NOT NULL DEFAULT '0',`timestamp` int(23) NOT NULL DEFAULT 
    
    '0',PRIMARY KEY (`id`))");
    	query_sql("CREATE TABLE IF NOT EXISTS `reward_ip` ( `give_id` 
    
    int(11) NOT NULL,  `item_id` int(11) NOT NULL,  `ip_address` varchar
    
    (23) NOT NULL, `claim_count` int(11) NOT NULL,  PRIMARY KEY 
    
    (`give_id`))");
    	query_sql("CREATE TABLE IF NOT EXISTS `reward_at` (`account_id` 
    
    int(11) NOT NULL,`char_id` int(11) NOT NULL)");
    	return;
    
    OnInit:
    	callsub OnLoadSetup;
    	end;
    }
    
    /* Manual table update for at tracker 
    CREATE TABLE IF NOT EXISTS `reward_at` (
      `account_id` int(11) NOT NULL,
      `char_id` int(11) NOT NULL
    );
    */
    -	script	anti_trader	-1,{
    	
    OnInit:
    	.is_anti_trade = 1; // 0 to disable
    	end;
    	
    }
    function	script	PG_30Seconds	{
    	//dispbottom "anti trader 30sec";
    	//Check if Vending (normal or @at)
    	if(checkvending() >= 1)
    	{
    	   // mark as auto trader
    	   	.@query = query_sql("SELECT account_id, char_id FROM 
    
    "+$GiftTableNameAT$+" WHERE account_id = "+getcharid(3)+"", 
    
    .@account_id, .@char_id); // check if in the table
    		if (!.@query)
    		{ // add if not there yet
    			query_sql("INSERT INTO "+$GiftTableNameAT$
    
    +"(account_id,char_id) VALUES("+getcharid(3)+","+getcharid(0)+")");
    			//dispbottom "you have been marked as auto 
    
    trader";
    			stopnpctimer;
    			detachnpctimer;
    			end;
    		}
    	}
    	return;
    }
    function	script	PG_Login	{
    	//dispbottom "at delete";
    	.@query = query_sql("SELECT account_id, char_id FROM "+
    
    $GiftTableNameAT$+" WHERE account_id = "+getcharid(3)+"", .@account_id, 
    
    .@char_id); // check if in the table
    	if (.@query)
    	{ // remove to reverify vending status
    		query_sql("DELETE FROM "+$GiftTableNameAT$+" WHERE 
    
    account_id = "+getcharid(3)+"");
    	}
    }

    My master, can you help for this last one please?  I kept on screwing the script trying to put the  OnInit:
    waitingroom "Freebies Here",0;
    end;   I also dont know how to put announce . pls pls 

  7. 6 minutes ago, Haruka Mayumi said:

    image.png.032100ec434d40015117ebd8e0bda964.png
    CodeBox.. you make people scroll more than 20 times. and makes tabs into spaces..

    Delete that thing you inserted. and go to this line..

    
    OnInit:
        freeloop(1);

    then make it look like this

    
    OnInit:
    	waitingroom "Quest Shop",0;
    	freeloop(1);

     

    my lord., pub is not showing   -    script    quest_shop    -1,{
    function Add; function Chk; function Slot;
    OnInit:
        waitingroom "Quest Shop",0;
        freeloop(1);
         

    image.png

  8. 52 minutes ago, Haruka Mayumi said:

    hmm.. i dunno if you read the NOTE.. and emistry already warned you to use codebox when pasting scripts.. anyway.

    i said below line of code. so it should be like this
     

    
    ClearData();
    close;
    OnInit:
    waitingroom "Freebies Here",0;
    end;
    }


    EDIT also agh..  see that red bracket below

    
    for(set @i,0; @i < getarraysize( @bought_nameid ); set @i,@i+1) {

    oh my god. I LOVE YOU!.  its fixed

     

    How about this other npc please. last thing.  I get error "already has a chat room. 

    //===== rAthena Script =======================================
    //= Euphy's Quest Shop
    //===== By: ==================================================
    //= Euphy
    //===== Current Version: =====================================
    //= 1.6c
    //===== Compatible With: =====================================
    //= rAthena Project
    //===== Description: =========================================
    //= A dynamic quest shop based on Lunar's, with easier config.
    //= Includes support for multiple shops & cashpoints.
    //= Item Preview script by ToastOfDoom.
    //===== Additional Comments: =================================
    //= 1.0 Initial script.
    //= 1.2 Added category support.
    //= 1.3 More options and fixes.
    //= 1.4 Added debug settings.
    //= 1.5 Replaced categories with shop IDs.
    //= 1.6 Added support for purchasing stackables.
    //= 1.6a Added support for previewing costumes and robes.
    //= 1.6b Added 'disable_items' command.
    //= 1.6c Replaced function 'A_An' with "F_InsertArticle".
    //============================================================
    
    // Shop NPCs -- supplying no argument displays entire menu.
    //    callfunc "qshop"{,<shop ID>{,<shop ID>{,...}}};
    //  ADD YOUR NPC HERE
    //============================================================
    prontera,147,165,6    script    Quest Shop#1    998,{ callfunc "qshop"; }
    //prontera,165,203,6    script    Quest Shop#2    998,{ callfunc "qshop",1,2; }    // call the shop 1 and 2 defined below
    // etc.. Add your Shop NPCs 'Quest Shop#XXX' here
    //============================================================
    
    
    // Script Core - DO NOT DUPLICATE THIS NPC !!!!!!!!!!!!!
    //============================================================
    -    script    quest_shop    -1,{
    function Add; function Chk; function Slot;
    OnInit:
        freeloop(1);
    
    // -----------------------------------------------------------
    //  Basic shop settings.
    // -----------------------------------------------------------
    
        set .Announce,1;    // Announce quest completion? (1: yes / 0: no)
        set .ShowSlot,1;    // Show item slots? (2: all equipment / 1: if slots > 0 / 0: never)
        set .ShowID,0;      // Show item IDs? (1: yes / 0: no)
        set .ShowZeny,0;    // Show Zeny cost, if any? (1: yes / 0: no)
        set .MaxStack,100;    // Max number of quest items purchased at one time.
    
    // -----------------------------------------------------------
    //  Points variable -- optional quest requirement.
    //    setarray .Points$[0],"<variable name>","<display name>";
    // -----------------------------------------------------------
    
        setarray .Points$[0],
            "#CASHPOINTS", "Cash Points";
    
    
    //=====================================================================================
    // ------------------- ADD YOUR SHOPS NAME AND ITEMS SHOPS STARTING HERE --------------
    //=====================================================================================
    
    // -----------------------------------------------------------
    //  Shop IDs -- to add shops, copy dummy data at bottom of file.
    //    setarray .Shops$[1],"<Shop 1>","<Shop 2>"{,...};
    // -----------------------------------------------------------
    
        setarray .Shops$[1],
            "Headgears",    // Shop Named 1
            "Weapons",        // Shop Named 2
            "Other";        // Shop Named 3
    
    // -----------------------------------------------------------
    //  Quest items -- do NOT use a reward item more than once!
    //    Add(<shop ID>,<reward ID>,<reward amount>,
    //        <Zeny cost>,<point cost>,
    //        <required item ID>,<required item amount>{,...});
    // -----------------------------------------------------------
    
    // Shop 1
        Add(1,5086,1,0,0,2288,1,1095,3000);
        
        Add(1,5074,1,20000,0,2286,1,2254,1);
        Add(1,5132,1,0,0,5035,1,5074,1,714,1,999,5);
        Add(1,5153,1,0,0,10011,1);
        Add(1,2284,1,0,0,923,20);
        Add(1,5270,1,0,0,7198,200,7097,40);
        sleep 10;
        Add(1,5174,1,0,0,7445,7,7446,7,7447,7,7448,7,945,300,975,1,733,5,7166,50);
        Add(1,5277,1,0,0,5278,1,508,200);
        Add(1,2237,1,0,0,1020,100,983,1,2241,1);
        
        Add(1,5057,1,10000,0,2213,1,983,1,914,200);
        Add(1,5076,1,0,0,2227,1,7038,500);
        Add(1,5236,1,0,0,2227,1,7038,500,978,1);
        Add(1,5235,1,0,0,2227,1,7038,500,982,1,983,1);
        Add(1,5237,1,0,0,2227,1,7038,500,975,1,982,1);
        Add(1,5382,1,0,0,969,8,10016,2,5083,1);
        sleep 10;
        Add(1,5065,1,0,0,624,1,959,300,544,50,1023,1);
        Add(1,5052,1,0,0,2211,1,978,1,7003,300);
        Add(1,2296,1,50000,0,2243,1,999,100);
        Add(1,5129,1,0,0,604,1,916,1);
        Add(1,5102,1,0,0,7263,2,2276,1,2239,1,568,150);
        Add(1,5040,1,0,0,7047,100);
        Add(1,5109,50000,0,0,10015,1,10007,1,5023,1,975,1);
        Add(1,5016,1,0,0,1030,10,0,0,0,0,0,0);
        Add(1,5110,1,0,0,526,2,7270,1,941,1,10004,1);
        Add(1,5191,1,0,0,2208,1,983,1);
        sleep 10;
        Add(1,5169,1,0,0,706,1,1019,500,7200,10,1049,20,7165,500,1054,2,1024,100);
        Add(1,5034,1,0,0,2233,1,746,20);
        Add(1,2214,1,0,0,949,100,706,1,722,1,2213,1);
        
        Add(1,5175,1,100000,0,7111,100,938,99,983,1);
        Add(1,5080,1,0,0,10006,1,714,1,969,3);
        Add(1,5024,1,0,0,529,10,530,5,539,20,999,10,538,15);
        Add(1,5028,1,0,0,2279,1,7035,50,526,100);
        Add(1,5200,1,0,0,5016,1,981,1,7317,20);
        Add(1,5184,1,0,0,5120,5,995,50,983,1,720,50);
        
        Add(1,5214,1,0,0,976,1,1060,300,1022,100,5008,5);
        Add(1,5026,1,0,0,1036,450,949,330,539,120,982,1);
        sleep 10;
        Add(1,5142,1,0,0,5017,1,2229,1,5014,1,7209,100,7123,100,1036,100,979,1);
        Add(1,5283,1,0,0,949,200,916,100,7063,20,925,1);
        Add(1,5260,1,0,0,4293,1,538,100,530,100,529,50);
        Add(1,5075,1,0,0,2248,1,7030,108,7194,108,7120,4);
        Add(1,5048,1,0,0,5041,1,999,10);
        Add(1,5036,1,0,0,2608,1,7069,500);
        Add(1,5135,1,0,0,2295,1,969,1,975,1,999,5);
        
        Add(1,5108,1,5000,0,7301,1887,5114,1,611,10);
        Add(1,5254,1,0,0,5132,1,5068,1,2255,1,7023,5,983,1);
        sleep 10;
        Add(1,5038,1,0,0,1038,600,7048,40);
        Add(1,5229,1,0,0,1038,600,7048,40,982,1,983,1);
        Add(1,5227,1,0,0,1038,600,7048,40,975,1);
        Add(1,5228,1,0,0,1038,600,7048,40,982,1);
        Add(1,5186,1,0,0,1032,100,7100,100,905,250);
        Add(1,5091,1,20000,0,10016,1,714,1,969,3);
        Add(1,5082,1,0,0,921,300);
        Add(1,2273,1,3500,0,2275,1,998,50,733,1);
        Add(1,5258,1,0,0,914,100,975,1,976,1,978,1);
        Add(1,5198,1,0,0,5058,1,2214,1,949,500,914,200,622,50,1974,1);
        sleep 10;
        Add(1,5058,1,0,0,2233,1,983,1,7206,300,7030,1);
        Add(1,5233,1,0,0,2233,1,983,1,7206,300,7030,1,978,1);
        Add(1,5231,1,0,0,2233,1,983,1,7206,300,7030,1,982,1,983,1);
        Add(1,5232,1,0,0,2233,1,983,1,7206,300,7030,1,982,1,975,1);
        Add(1,5230,1,0,0,2233,1,983,1,7206,300,7030,1,982,1);
        Add(1,5234,1,0,0,2233,1,983,1,7206,300,7030,1,976,1);
        Add(1,5253,1,0,0,1034,300,7445,30,5141,10,979,1);
        Add(1,5252,1,0,0,5058,1,1022,250,7267,100);
        Add(1,2283,1,0,0,724,1,5001,1,949,200);
        Add(1,5243,1,0,0,975,1,976,1,914,100,7441,150,7065,25,2283,1);
        sleep 10;
        Add(1,5259,1,0,0,978,1,7561,100,949,500,1026,200);
        Add(1,5205,1,0,0,5185,1,610,100,706,25,7194,113);
        Add(1,5068,1,20000,0,2255,1,2286,1);
        Add(1,5304,1,0,0,7017,2,2510,1,983,1);
        Add(1,5207,1,0,0,2282,5,2254,2,969,1,7063,15);
        Add(1,5333,1,0,0,996,4,12028,1,12032,1,992,10,5011,1);
        Add(1,5312,1,0,0,2261,1,983,1,2280,1,2627,1,969,2);
    
        Add(1,5416,1,0,0,746,20,7097,12,587,20,2717,1);
        
        sleep 10;
        Add(1,5427,1,0,0,5288,1,12078,1,7521,1,12183,1);
        Add(1,5404,1,0,0,5187,1,1034,70,7441,10,978,10);
        
        Add(1,5429,1,0,0,5100,1,1021,30,7268,1);
        Add(1,5338,1,0,0,5100,1,7112,25,561,1);
        Add(1,5300,1,0,0,7106,2,2246,1,7263,1);
        Add(1,5378,1,0,0,2214,1,5045,1,975,1,740,100);
        Add(1,5414,1,100000000,0,7300,9,1068,4,7098,2);
        Add(1,5307,1,0,0,2275,5,514,2,979,1,634,1,619,20,1027,20);
        Add(1,5431,1,50000000,0,5283,1,916,50,2717,1);
        sleep 10;
        Add(1,5341,1,80000000,0,5137,1,2276,1,1060,25);
        Add(1,5131,1,0,0,5128,1,969,10,978,1,985,27);
        Add(1,5417,1,0,0,4112,1,5299,1);
        Add(1,5373,1,0,0,2255,1,7566,3,7511,60,5104,1,7799,4,7023,20);
        Add(1,5369,1,0,0,5191,6,7205,25,558,3,2210,1,7441,5);
        Add(1,5340,1,0,0,5137,1,5040,1,1034,25);    
        Add(1,5313,1,0,0,5124,1,2249,1,5007,1,523,200);
        Add(1,5258,1,0,0,2261,1,914,200,975,1,976,1,978,1);
        Add(1,5292,1,0,0,7266,2,1035,4,10001,1);
        Add(1,5396,1,0,0,5058,1,980,1,1022,53);
        sleep 10;
        Add(1,5146,1,0,0,978,1,949,500,1019,1);
        Add(1,5282,1,0,0,5200,1,982,1,978,2);
        Add(1,5247,1,0,0,1039,60,923,25,2255,1);
        Add(1,5364,1,0,0,5347,1,975,1,982,1,983,1,5048,1);    
        
        Add(1,5047,1,0,0,2271,1,975,1);
        Add(1,5170,1,0,0,5172,1,7063,100,982,1);
        Add(1,5380,1,0,0,5065,2);
        Add(1,5303,1,0,0,712,100,710,5,629,5,10009,1);
        Add(1,5302,1,0,0,7553,2,982,1,7771,1);
        sleep 10;
        Add(1,5056,1,0,0,5079,1,578,100);
        Add(1,5390,1,0,0,2236,2,978,1,1034,50,2294,2);
        Add(1,5144,1,0,0,2214,1,2221,1,7567,25,1001,200);
        Add(1,5063,1,0,0,970,1,930,500);
        Add(1,5193,1,0,0,2208,1,979,1);
        Add(1,5021,1,0,0,2233,1,969,1,999,20,949,80,938,800);
        Add(1,5179,1,0,0,2234,1,969,3,2610,4,13106,2);
        Add(1,5176,1,0,0,706,1,1019,500,7200,10,7015,20,2267,1,952,100,1028,100);
        Add(1,5001,1,0,0,999,40,984,1,970,1,1003,1);
        Add(1,5031,1,0,0,7013,1200);
        sleep 10;
        Add(1,5025,1,0,0,2229,1,2254,1,7036,5);
        Add(1,5061,1,20000,0,2269,1,999,10);
        Add(1,5139,1,0,0,5085,1,710,5,7510,1,975,1);
        Add(1,5070,1,0,0,7216,300,7097,300,2211,1,982,1);
        Add(1,5071,1,10000,0,5010,1,5049,1,7101,10);
        Add(1,5173,1,0,0,7445,7,7446,7,7447,7,7478,7,945,300,983,1,733,5,2221,1);
        Add(1,5321,1,0,0,2275,2,2211,2,7215,4,7217,20);
        
        Add(1,2240,1,0,0,1040,2,982,2,949,4,7457,1);
        Add(1,5405,1,0,0,7441,45,949,80,916,100);
        sleep 10;
        Add(1,5410,1,50000000,0,7188,40,7111,20);
        
        Add(1,5424,1,0,0,980,1,620,1,605,50,985,200);
        Add(1,5425,1,0,0,981,1,533,1,605,50,985,200);
        Add(1,5276,1,0,0,2261,1,914,200,983,1,976,1,975,1);
        Add(1,5156,1,0,0,2265,10,982,1);
        Add(1,5154,1,0,0,2202,1,7020,5);
        Add(1,5155,1,0,0,7024,10,7754,2,7562,4,7450,1);
        Add(1,5018,1,500,0,2247,1,916,300);
        Add(1,5403,1,0,0,1023,1,544,5,579,1);
        sleep 10;
        Add(1,5317,1,0,0,5120,1,2290,1,938,4);
        
        Add(1,5334,1,0,0,5132,1,1971,20,7093,4,2659,1);
        
        Add(1,5400,1,0,0,1022,20,1234,2);
        Add(1,5339,1,0,0,5100,1,7112,25,1558,1);
        
        Add(1,5346,1,0,0,5100,1,7112,25,558,1);
        Add(1,5433,1,0,0,5185,1,969,2);
        sleep 10;
        Add(1,5262,1,0,0,5164,1,7799,1,7578,1,969,3);    
        Add(1,5336,1,0,0,5100,1,7112,25,714,1);
        Add(1,5273,1,0,0,2261,1,914,200,982,1,975,1,979,1);
        Add(1,5319,1,0,0,5035,1,5074,1,978,1);
        Add(1,5363,1,0,0,5120,1,2261,1,983,20);
    
        Add(1,5360,1,0,0,5057,1,2747,2,5161,1);
        Add(1,5383,1,0,0,5200,1,979,1,7445,50);
    
        
        sleep 10;
        Add(1,5396,1,0,0,5430,1,5285,1,7262,20,5396,1);
        Add(1,5371,1,0,0,5016,1,1004,35);
        Add(1,5426,1,0,0,5027,1,976,5);
        Add(1,5322,1,0,0,10019,1,982,2);
        Add(1,5291,1,0,0,7323,100,969,20);
        Add(1,5372,1,0,0,5099,1,5230,1,2747,5,982,15);
        Add(1,5311,1,0,0,5139,5);
        Add(1,5418,1,0,0,5016,1,2261,1,968,1,975,5,1004,35);
        Add(1,5422,1,500000,0,1550,3,1006,20);
        Add(1,5324,1,0,0,5137,1,7063,20,1034,20);
        sleep 10;
        Add(1,5448,1,0,0,521,200,1019,300);
        Add(1,5449,1,0,0,521,200,1019,300);
        Add(1,5332,1,0,0,7019,10,7200,10);
        Add(1,5392,1,100000,0,721,5,7216,25);
        
        Add(1,5393,1,777777,0,2285,5,994,10,7097,25);
        Add(1,5365,1,0,0,574,150,7031,150);
        Add(1,5143,1,0,0,5090,1,1020,300,975,1,982,1);
        Add(1,5020,1,0,0,2215,1,2210,1,7063,20);
        Add(1,5140,1,0,0,5085,1,2244,1,5191,1,7166,50);
        sleep 10;
        Add(1,5069,1,0,0,1022,99);
        Add(1,5185,1,0,0,5061,1,712,100,7194,150,7298,100,520,50,521,50);
        Add(1,5130,1,0,0,1048,100,7564,150,517,30);
        Add(1,5177,1,0,0,706,1,1019,500,7200,10,1049,500,1053,2,980,1);
    
        Add(1,5084,1,0,0,1026,1000,7065,100,945,100,7030,1);
        Add(1,5027,1,0,0,2252,1,1036,400,7001,50,4052,1);
        Add(1,5241,1,0,0,2252,1,1036,400,7001,50,4052,1,978,1);
        Add(1,5240,1,0,0,2252,1,1036,400,7001,50,4052,1,982,1,983,1);
        Add(1,5238,1,0,0,2252,1,1036,400,7001,50,4052,1,975,1);
        sleep 10;
        Add(1,5239,1,0,0,2252,1,1036,400,7001,50,4052,1,982,1);
        Add(1,5242,1,0,0,2252,1,1036,400,7001,50,4052,1,976,1);
        Add(1,5054,1,0,0,2252,1,1054,450,943,1200);
        Add(1,5187,1,0,0,5085,1,5091,1,5117,2,978,1,975,1);
        Add(1,5138,1,0,0,5123,1,5027,1,7337,50,981,1);
        Add(1,5099,1,0,0,7267,300,7171,300,1029,5);
        Add(1,5031,1,0,0,5009,1,5028,1,747,1,999,25);
        Add(1,5081,1,40000,0,2249,1,714,1,969,3);
        Add(1,5073,1,0,0,2285,1,1550,1);
        Add(1,5117,1,50000,0,731,10,748,2,982,1);
        sleep 10;
        Add(1,5183,1,0,0,604,100,916,100,7115,100);
        Add(1,5151,1,0,0,5001,1,978,1,991,200);
        Add(1,2281,1,5000,0,998,20,707,1);
        Add(1,5043,1,0,0,2281,1,1048,50);
        Add(1,5094,1,0,0,968,100,2299,1,1124,1,931,1000);
        Add(1,5196,1,0,0,2208,1,980,1);
        Add(1,5078,1,0,0,5033,1,5064,1);
        Add(1,5004,1,0,0,701,5);
        Add(1,5275,1,0,0,2261,1,914,200,975,1,976,1,981,1);
        
        sleep 10;
        Add(1,5420,1,300000000,0,5430,2,5421,1);
        Add(1,5323,1,0,0,5081,3,7754,1,2128,1);
        Add(1,5806,1,0,0,2280,1,7479,1,2109,1);
        Add(1,5315,1,0,0,2276,1,5135,1,7094,50,7353,50);
        Add(1,5807,1,0,0,5416,1,2211,2,949,100);
        Add(1,5375,1,0,0,5094,1,10018,2,968,5,7440,30);
        Add(1,5370,1,0,0,5302,1,981,5);
        Add(1,5060,1,0,0,2236,1,7151,100,7111,100);
        Add(1,5299,1,0,0,7441,20,949,50,916,15,7115,10,7440,20,7063,10,7200,10,2214,1);
        Add(1,5023,1,0,0,1059,150,907,100,978,1);
        sleep 10;
    
        Add(1,5271,1,0,0,2254,1,723,1,7301,20,999,50,978,1);
        Add(1,5352,1,0,0,5035,1,979,1,938,100);
        Add(1,2293,1,0,0,1049,4);
        Add(1,5194,1,0,0,2208,1,975,1,982,1);
        Add(1,5202,1,0,0,5035,1,1062,100,535,80);
        Add(1,5182,1,0,0,5008,10,5118,1,1060,100,2210,1);
        Add(1,5213,1,0,0,2214,1,983,1,7063,30);
        Add(1,5033,1,0,0,1036,20,2213,1,7065,300,7012,200);
        Add(1,5039,1,0,0,7030,50,978,1,5015,1);
        sleep 10;
        
        Add(1,5195,1,0,0,2208,1,975,1);
        Add(1,5211,1,0,0,5045,1,5083,1,7063,40,7553,1,982,1,975,1);
        Add(1,5208,1,0,0,1550,1,1553,7,1556,7,1554,7,1557,7,1555,7,7015,30);
        Add(1,5083,1,0,0,2244,1,2209,1,10007,1);
        Add(1,2280,1,10000,0,1019,120);
        Add(1,5100,1,0,0,2272,1,7451,4,7433,3,690,10);
        Add(1,5067,1,0,0,5062,1,952,50,1907,1);
        Add(1,5133,1,0,0,5160,1,7106,6,7107,80);
        
        sleep 10;
        Add(1,5064,1,0,0,945,600,7030,1);
        Add(1,2278,1,0,0,705,10,909,10,914,10);
        Add(1,5203,1,0,0,2278,1,1015,1,999,5);
        Add(1,5212,1,0,0,1820,2,5011,1,2651,1,4125,1);
        Add(1,5257,1,0,0,5074,1,2282,1,7064,10,969,5);
        Add(1,5029,1,0,0,7068,300,7033,850,1015,1);
        Add(1,2272,1,911000,0,1019,50,983,1);
        Add(1,5062,1,0,0,2280,1,7197,300,7150,300);
        Add(1,5049,1,0,0,1099,1500);
        Add(1,5287,1,0,0,5062,1,5348,1,978,1);
        sleep 10;
        Add(1,5032,1,0,0,1059,250,2221,1,2227,1,7063,600);
        Add(1,5103,1,0,0,5351,1,10011,1);
        Add(1,5022,1,0,0,7086,1,969,10,999,40,1003,50,984,2);
        Add(1,5395,1,0,0,5045,2,7205,150,983,1,1059,100);
        Add(1,5059,1,0,0,5030,1,7213,100,7217,100,7161,300);
        Add(1,5107,1,0,0,519,50,7031,50,548,50,539,50);
        Add(1,5255,1,0,0,5153,1,741,10,5132,1,5074,1);
        Add(1,5077,1,0,0,2278,1,975,1);
        Add(1,5337,1,0,0,5100,1,7112,25,2617,1);
        
        sleep 10;
        Add(1,5152,1,0,0,2254,1,724,1,7301,20,999,50,978,1);
        Add(1,5305,1,0,0,1214,5,969,10,7799,5);
        Add(1,5413,1,0,0,608,20,1752,1,2261,1,978,1);
        Add(1,5415,1,0,0,5255,1,5024,1);
        Add(1,5318,1,0,0,5035,2,5060,2,741,10,530,50,938,100);
        Add(1,5409,1,0,0,5075,1,7101,5,981,10);
        Add(1,5051,1,0,0,7047,100);
    
        
        
        sleep 10;
        Add(1,5320,1,0,0,5205,1,1009,50,2111,1);
        Add(1,5354,1,0,0,5431,1,12080,1,1629,1);
        Add(1,5811,1,0,0,985,100,2241,10);
        Add(1,5381,1,0,0,5335,1,2236,1);
        Add(1,5397,1,0,0,7325,5,2205,1,7355,1);
        Add(1,5355,1,0,0,7166,100,1059,200);
        Add(1,5243,1,0,0,7446,1,2339,10,1059,70);
        Add(1,5310,1,0,0,5034,1,1971,2,996,6);
        Add(1,5274,1,0,0,2261,1,914,200,980,2,975,1);
        Add(1,5261,1,0,0,5164,1,714,25,2611,50,7799,4);
        sleep 10;
        
        Add(1,5342,1,0,0,5137,1,5040,1,1020,20,7152,5);
        Add(1,5297,1,0,0,5257,1,1472,2,5158,2,7063,40);
        Add(1,5335,1,0,0,741,5,607,5,940,150);
        Add(1,5412,1,0,0,530,20,7035,10);
        Add(1,5343,1,0,0,5137,1,2215,1,1034,25);
        Add(1,5098,1,0,0,1029,10,2297,5,7267,50);
        Add(1,5430,1,50000000,0,5414,1,7135,10,7451,4);
        Add(1,5384,1,0,0,5390,1,975,1);
        Add(1,5316,1,0,0,2226,1,622,10);
        sleep 10;
        Add(1,5289,1,0,0,526,200,7268,1);
        
        Add(1,5301,1,0,0,5191,3,5195,3);
        Add(1,5344,1,0,0,5137,1,7038,20,1060,25);
        Add(1,5345,1,0,0,5137,1,5195,2,1060,45);
        Add(1,5411,1,0,0,5388,1,982,5,7263,2,978,2);
        Add(1,5368,1,0,0,5197,6,7751,25,561,3,2210,1,7063,20);
        Add(1,5385,1,0,0,753,100);
        Add(1,5079,1,0,0,2294,1,7220,400);
        Add(1,5171,1,0,0,4219,1,4114,1,4177,1,4259,1,4212,1,4073,1,4112,1,4081,1,4251,1,4166,1,7511,1000,7563,1000);
        sleep 10;
        Add(1,5256,1,0,0,7510,1,2210,1,7063,50);
        Add(1,5285,1,0,0,7192,200,10011,1);
        Add(1,5357,1,0,0,7510,20);
        Add(1,5188,1,0,0,5027,1,7166,50,7064,1);
        Add(1,2292,1,2000,0,999,50);
        Add(1,5294,1,0,0,7019,5,7567,50);
        Add(1,5115,1,50000,0,983,1,7267,99,749,1);
        Add(1,5284,1,0,0,5302,1,975,1,982,1,5165,1);
        Add(1,5050,1,0,0,5037,1,7064,500);
        Add(1,5206,1,0,0,2269,1,982,1);
        sleep 10;
        Add(1,5197,1,0,0,2208,1,982,1);
        Add(1,5278,1,0,0,2210,1,5192,1,2250,1);
        Add(1,5192,1,0,0,2208,1,976,1);
        Add(1,5121,1,0,0,7263,1,660,1,7099,30,7315,369);
    
    // Shop 2
        Add(2,501,1,0,0,7263,1,660,1,7099,30,7315,369);
    
    // Shop 3
        Add(3,531,1,3,0,512,1,713,1);
        Add(3,532,1,3,0,513,1,713,1);
        Add(3,533,1,3,0,514,1,713,1);
        Add(3,534,1,3,0,515,1,713,1);
    
    // -----------------------------------------------------------
    
    //=====================================================================================
    // ------------------- YOUR SHOPS AND ITEMS SHOPS HAVE BEEN ADDED ---------------------
    //=====================================================================================
    
        freeloop(0);
        set .menu$,"";
        for(set .@i,1; .@i<=getarraysize(.Shops$); set .@i,.@i+1) {
            set .menu$, .menu$+.Shops$[.@i]+":";
            npcshopdelitem "qshop"+.@i,909;
        }
        end;
    
    OnMenu:
        set .@size, getarraysize(@i);
        if (!.@size) set @shop_index, select(.menu$);
        else if (.@size == 1) set @shop_index, @i[0];
        else {
            for(set .@j,0; .@j<.@size; set .@j,.@j+1)
                set .@menu$, .@menu$+.Shops$[@i[.@j]]+":";
            set @shop_index, @i[select(.@menu$)-1];
        }
        deletearray @i[0],getarraysize(@i);
        if (.Shops$[@shop_index] == "") {
            message strcharinfo(0),"An error has occurred.";
            end;
        }
        dispbottom "Select one item at a time.";
        callshop "qshop"+@shop_index,1;
        npcshopattach "qshop"+@shop_index;
        end;
    
    OnBuyItem:
        // .@q[] : RewardID, BoughtAmt, RewardAmt, BaseAmt, ReqZeny, ReqPts, { ReqItem, ReqAmt, ... }
        setarray .@q[0],@bought_nameid[0],((@bought_quantity[0] > .MaxStack)?.MaxStack:@bought_quantity[0]);
        copyarray .@q[3],getd(".q_"+@shop_index+"_"+.@q[0]+"[0]"),getarraysize(getd(".q_"+@shop_index+"_"+.@q[0]));
        set .@q[2],.@q[1]*.@q[3];
        if (!.@q[2] || .@q[2] > 30000) {
            message strcharinfo(0),"You can't purchase that many "+getitemname(.@q[0])+".";
            end;
        }
        mes "[Quest Shop]";
        mes "Reward: ^0055FF"+((.@q[2] > 1)?.@q[2]+"x ":"")+Slot(.@q[0])+"^000000";
        mes "Requirements:";
        disable_items;
        if (.@q[4]) mes " > "+Chk(Zeny,.@q[4]*.@q[1])+(.@q[4]*.@q[1])+" Zeny^000000";
        if (.@q[5]) mes " > "+Chk(getd(.Points$[0]),.@q[5]*.@q[1])+(.@q[5]*.@q[1])+" "+.Points$[1]+" ("+getd(.Points$[0])+"/"+(.@q[5]*.@q[1])+")^000000";
        if (.@q[6]) for(set .@i,6; .@i<getarraysize(.@q); set .@i,.@i+2)
            mes " > "+Chk(countitem(.@q[.@i]),.@q[.@i+1]*.@q[1])+((.ShowID)?"{"+.@q[.@i]+"} ":"")+Slot(.@q[.@i])+" ("+countitem(.@q[.@i])+"/"+(.@q[.@i+1]*.@q[1])+")^000000";
        next;
        setarray @qe[1], getiteminfo(.@q[0],5), getiteminfo(.@q[0],11);
        if (@qe[2] > 0 && ((@qe[1] & EQP_HEAD_LOW) || (@qe[1] & EQP_HEAD_TOP) || (@qe[1] & EQP_HEAD_MID) || (@qe[1] & EQP_COSTUME_HEAD_TOP) || (@qe[1] & EQP_COSTUME_HEAD_MID) || (@qe[1] & EQP_COSTUME_HEAD_LOW) || (@qe[1] & EQP_GARMENT) || (@qe[1] & EQP_COSTUME_GARMENT)))
            set .@preview,1;
        addtimer 1000, strnpcinfo(0)+"::OnEnd";
        while(1) {
            switch(select(" ~ Purchase ^0055FF"+getitemname(.@q[0])+"^000000:"+((.@preview && !@qe[7])?" ~ Preview...":"")+": ~ ^777777Cancel^000000")) {
            case 1:
                if (@qe[0]) {
                    mes "[Quest Shop]";
                    mes "You're missing one or more quest requirements.";
                    close;
                }
                if (!checkweight(.@q[0],.@q[2])) {
                    mes "[Quest Shop]";
                    mes "^FF0000You need "+(((.@q[2]*getiteminfo(.@q[0],6))+Weight-MaxWeight)/10)+" additional weight capacity to complete this trade.^000000";
                    close;
                }
                if (.@q[4]) set Zeny, Zeny-(.@q[4]*.@q[1]);
                if (.@q[5]) setd .Points$[0], getd(.Points$[0])-(.@q[5]*.@q[1]);
                if (.@q[6]) for(set .@i,6; .@i<getarraysize(.@q); set .@i,.@i+2)
                    delitem .@q[.@i],.@q[.@i+1]*.@q[1];
                getitem .@q[0],.@q[2];
                if (.Announce) announce strcharinfo(0)+" has created "+((.@q[2] > 1)?.@q[2]+"x "+getitemname(.@q[0]):callfunc("F_InsertArticle",getitemname(.@q[0])))+"!",0;
                specialeffect2 EF_FLOWERLEAF;
                close;
            case 2:
                setarray @qe[3], getlook(LOOK_HEAD_BOTTOM), getlook(LOOK_HEAD_TOP), getlook(LOOK_HEAD_MID), getlook(LOOK_ROBE), 1;
                if ((@qe[1] & 1) || (@qe[1] & 4096)) changelook LOOK_HEAD_BOTTOM, @qe[2];
                else if ((@qe[1] & 256) || (@qe[1] & 1024)) changelook LOOK_HEAD_TOP, @qe[2];
                else if ((@qe[1] & 512) || (@qe[1] & 2048)) changelook LOOK_HEAD_MID, @qe[2];
                else if ((@qe[1] & 4) || (@qe[1] & 8192)) changelook LOOK_ROBE, @qe[2];
                break;
            case 3:
                close;
            }
        }
    
    OnEnd:
        if (@qe[7]) {
            changelook LOOK_HEAD_BOTTOM, @qe[3];
            changelook LOOK_HEAD_TOP, @qe[4];
            changelook LOOK_HEAD_MID, @qe[5];
            changelook LOOK_ROBE, @qe[6];
        }
        deletearray @qe[0],8;
        end;
    
    function Add {
        if (getitemname(getarg(1)) == "null") {
            debugmes "Quest reward #"+getarg(1)+" invalid (skipped).";
            return;
        }
        setarray .@j[0],getarg(2),getarg(3),getarg(4);
        for(set .@i,5; .@i<getargcount(); set .@i,.@i+2) {
            if (getitemname(getarg(.@i)) == "null") {
                debugmes "Quest requirement #"+getarg(.@i)+" invalid (skipped).";
                return;
            } else
                setarray .@j[.@i-2],getarg(.@i),getarg(.@i+1);
        }
        copyarray getd(".q_"+getarg(0)+"_"+getarg(1)+"[0]"),.@j[0],getarraysize(.@j);
        npcshopadditem "qshop"+getarg(0),getarg(1),((.ShowZeny)?getarg(3):0);
        return;
    }
    
    function Chk {
        if (getarg(0) < getarg(1)) {
            set @qe[0],1;
            return "^FF0000";
        } else
            return "^00FF00";
    }
    
    function Slot {
        set .@s$,getitemname(getarg(0));
        switch(.ShowSlot) {
            case 1: if (!getitemslots(getarg(0))) return .@s$;
            case 2: if (getiteminfo(getarg(0),2) == 4 || getiteminfo(getarg(0),2) == 5) return .@s$+" ["+getitemslots(getarg(0))+"]";
            default: return .@s$;
        }
    }
    }
    
    function    script    qshop    {
        deletearray @i[0],getarraysize(@i);
        for(set .@i,0; .@i<getargcount(); set .@i,.@i+1)
            set @i[.@i],getarg(.@i);
        doevent "quest_shop::OnMenu";
    
    OnInit:
    waitingroom "Quests Shop",0;
    end;
    }
    
    
    // Dummy shop data -- copy as needed.
    //============================================================
    -    shop    qshop1    -1,909:-1
    -    shop    qshop2    -1,909:-1
    -    shop    qshop3    -1,909:-1
    -    shop    qshop4    -1,909:-1
    -    shop    qshop5    -1,909:-1

     

  9. 1 hour ago, Haruka Mayumi said:

    Please see the code.. it has open and close brackets.. you just copied the announce.

    No pub is showing ?  also item null on announce.   Here is the line .

    for(set @i,0; @i < getarraysize( @bought_nameid ); set @i,@i+1)
                    getitem @bought_nameid[@i],@bought_quantity[@i];
    announce strcharinfo(0)+" has bought "+@bought_quantity[@i]+"x "+getitemname(@bought_nameid[@i])+".",bc_all;
                }
                message strcharinfo(0),"Purchased "+getarraysize( @bought_nameid )+" Items.";
                mes "Thank you for shopping.";
            }
        }
    ClearData();
    close;
    }
    OnInit:
    waitingroom "Freebies Here",0;
    end;
    }
    -    script    qwerty    -1,{
    OnPCKillEvent:
         if ( strcharinfo(3) == "guild_vs3" ) {
        set pvppoint,pvppoint+1;
        dispbottom "You have gained 1 Points. Total "+pvppoint+" Point";
    end;

     

  10. On 4/19/2020 at 8:22 PM, Emistry said:

    the script is outdated and not longer recommended due to exploitable in newer version of rathena.

    use this instead.

    https://rathena.org/board/topic/90173-item-and-point-shop/

    or 

    npc/custom/quests/quest_shop.txt

    but why? I like it so much. its neat and easy. what makes it exploitable?

    I would like to request editing this script to put announce please. 

    // Credit to emistry Multi-shop
    // use @pc for check point
    // -------- Dummy data (duplicate as needed) --------
    -    shop    Emistry_Shop    -1,512:100
    // --------------------------------------------------
    prontera,147,169,4    script    Redeem Points    852,{
    function ShopSettings;
    function ValidateCost;
    function CurrencyInfo;
    function ClearData;
    function ValueConvert;
    function ErrorNotice;
    
    mes "Each Shop from the Menu may purchase using ^FF0000Different
    Currency^000000.";
    mes "^00FF00____________________________^000000";
    mes "So,Which shop you would like to look at it";
    next;
    // Menu Selection
    select("Headgear","Foods","Cossumber");
    
    ClearData();
    ShopSettings( @menu );
    npcshopitem "Emistry_Shop",512,100;
    npcshopdelitem "Emistry_Shop",512;
    for(set .@i,0; .@i < getarraysize( @ItemLists ); set .@i,.@i+1)
        npcshopadditem "Emistry_Shop",@ItemLists[.@i],@ItemCost[.@i];
    mes "Okay...wait awhile";
    mes "^00FF00____________________________^000000";
    CurrencyInfo( @Currency$ );
    mes "^00FF00____________________________^000000";
    callshop "Emistry_Shop",1;
    npcshopattach "Emistry_Shop";
    end;
    
    
    function    ShopSettings    {
        switch( getarg(0) ){
            Case 1:
                // Currency [ Item ID / Variable Name ]
                set @Currency$,"6101";
                // Item ID Lists
                setarray @ItemLists
    [0],5137,5359,5181,5379,5210,5376,5374,5421,5361,5377,5288,5401,5314,54
    23,5286,5358,5293,5801,5325,5388,5805,5529,5389,5800; // ITEM ID
                // Item Price
                setarray @ItemCost
    [0],50,50,50,50,50,50,100,50,50,100,50,50,50,100,50,50,50,150,100,50,10
    0,50,50,100; // ITEM COST/AMOUNT
                break;
            Case 2:
                // Currency [ Item ID / Variable Name ]
                set @Currency$,"6101";
                // Item ID Lists
                setarray @ItemLists[0],1815;
                // Item Price
                setarray @ItemCost[0],100;
                break;
            Case 3:
                // Currency [ Item ID / Variable Name ]
                set @Currency$,"6101";
                // Item ID Lists
                setarray @ItemLists[0],2776,12260,14037;
                // Item Price
                setarray @ItemCost[0],500,50,30;
                break;
            // Case 4,5,6.....etc...
            default:
                ErrorNotice( "Invalid Menu Selection for Menu
    "+@menu+"." );
                close;
        }
        
        
    if( @Currency$ == "" )
        ErrorNotice( "Invalid Currency Setting in Menu "+@menu+" ." );
    if( getarraysize( @ItemCost ) != getarraysize( @ItemLists ) ||
    getarraysize( @ItemLists ) != getarraysize( @ItemCost ) )
        ErrorNotice( "Missing or Extra Value of Item or Cost Settings
    in Menu "+@menu+" ." );
    return;
    }
    
    function    ErrorNotice    {
        mes "^FF0000ERROR^000000 - "+getarg(0);
        mes "^00FF00____________________________^000000";
        mes "Inform this Message to ^0000FFGame Staffs^000000
    immediately !";
        close;
    }
    
    function    CurrencyInfo    {
        if( getitemname( atoi( getarg(0) ) ) != "null" ){
            mes "Item Currency : ^FF0000"+getitemname( atoi(
    getarg(0) ) )+"^000000";
            mes "Available Amount : ^0000FF"+ValueConvert(
    countitem( atoi( getarg(0) ) ) )+"^000000";
        }else if( getitemname( atoi( getarg(0) ) ) == "null" ){
            mes "Variable Currency : ^FF0000"+getarg(0)+"^000000";
            mes "Available Amount : ^0000FF"+ValueConvert( getd(
    getarg(0) ) )+"^000000";
        }
    return;
    }
    
    function    ValidateCost    {
        if( getitemname( atoi( getarg(0) ) ) != "null" ){
            if( countitem( atoi( getarg(0) ) ) < getarg(1) ) return
    1;
        }else{
            if( getd( getarg(0) ) < getarg(1) ) return 1;
        }
    return 0;
    }
    
    function ClearData    {
        set @Currency$,"";
        set @TotalCost,0;
        deletearray @bought_nameid[0],getarraysize( @bought_nameid );
        deletearray @bought_quantity[0],getarraysize( @bought_quantity
    );
        deletearray @ItemLists[0],getarraysize( @ItemLists );
        deletearray @ItemCost[0],getarraysize( @ItemCost );
    return;
    }
    
    function    ValueConvert    {
        set .@num, atoi(""+getarg(0));
        if ( .@num == 0 || .@num >= 2147483647 ) return getarg(0);
        set .@l, getstrlen(""+.@num);
        for ( set .@i,0; .@i < .@l; set .@i, .@i + 1 ) {
            set .@num$, .@num % pow(10,.@i+1) / pow(10,.@i) +
    .@num$;
                if ( (.@i+1) % 3 == 0 && .@i+1 != .@l ) set
    .@num$, ","+ .@num$;
        }
        return .@num$;
    }
    
    OnBuyItem:
        ShopSettings( @menu );
        for(set @i,0; @i < getarraysize( @bought_nameid ); set @i,@i+1)
            for(set @j,0; @j < getarraysize( @ItemLists ); set
    @j,@j+1)
                if( @ItemLists[@j] == @bought_nameid[@i] )
                set @TotalCost,@TotalCost + ( @ItemCost[@j] *
    @bought_quantity[@i] );
        mes "^FF0000       BILLING LIST^000000";
        mes "^00FF00____________________________^000000";
        for( set @i,0; @i < getarraysize( @bought_nameid ); set @i,@i+1
    )
                mes "^FF0000"+@bought_quantity[@i]+" x
    ^0000FF"+getitemname( @bought_nameid[@i] )+"^000000";
        mes "^00FF00____________________________^000000";
    
        if( getitemname( atoi( @Currency$ ) ) != "null" )
            mes "Total Cost : ^0000FF"+ValueConvert( @TotalCost )+"
    x "+getitemname( atoi( @Currency$ ) )+"^000000";
        else if( getitemname( atoi( @Currency$ ) ) == "null" ){
            mes "Total Cost : ^0000FF"+ValueConvert( @TotalCost )+"
    "+@Currency$+"^000000";
        }
        
        mes "^00FF00____________________________^000000";
        if( ValidateCost( @Currency$,@TotalCost ) ){
            if( getitemname( atoi( @Currency$ ) ) != "null" )
                mes "[ ^FF0000X^000000 ] Insufficient
    ^0000FF"+getitemname( atoi( @Currency$ ) )+"^000000";
            else{
                mes "[ ^FF0000X^000000 ] Insufficient
    ^0000FF"+@Currency$+"^000000";
            }
        }else{
            if( select( "^0000FFPurchase^000000:Cancel" ) == 1 ){
                if( getitemname( atoi( @Currency$ ) ) != "null"
    )
                    delitem atoi( @Currency$ ),@TotalCost;
                else{
                    set getd( @Currency$ ),getd( @Currency$
    ) - @TotalCost;
                }
                for(set @i,0; @i < getarraysize( @bought_nameid
    ); set @i,@i+1)
                    getitem @bought_nameid
    [@i],@bought_quantity[@i];
                message strcharinfo(0),"Purchased
    "+getarraysize( @bought_nameid )+" Items.";
                mes "Thank you for shopping.";
            }
        }
    ClearData();
    close;
    }
    -    script    qwerty    -1,{
    OnPCKillEvent:
         if ( strcharinfo(3) == "guild_vs3" ) {
        set pvppoint,pvppoint+1;
        dispbottom "You have gained 1 Points. Total "+pvppoint+"
    Point";
    end;
    }
    }
    // ---------------------------------------------------
    -    script    pointscheck    -1,{
    OnInit:
        bindatcmd("pc","pointscheck::OnAtcommand");
        end;
    
    OnAtcommand:
        message strcharinfo(0),"You currently have "+pvppoint+" PvP
    Points";
        end;
        }

     

     

    On 4/19/2020 at 9:34 PM, Haruka Mayumi said:

    unless you dont want players to get the items for free.. go ahead and use it. ^_~

    Go to this Line.. 

    
    			for(set @i,0; @i < getarraysize( @bought_nameid ); set @i,@i+1)
    				getitem @bought_nameid[@i],@bought_quantity[@i];

    and change it into this

    
    			for(set @i,0; @i < getarraysize( @bought_nameid ); set @i,@i+1){
    				getitem @bought_nameid[@i],@bought_quantity[@i];
                    announce strcharinfo(0)+" has bought "+@bought_quantity[@i]+"x "+getitemname(@bought_nameid[@i])+".",bc_all;
    			}

     

    Where to put this as well pleasseeee..

    OnInit:
    waitingroom "Rewards",0;
    end;

  11. Hi guys. I need help on this script. I wish to put announce to all maps when purchased item. 

    i do not how to edit.

    mes "Each Shop from the Menu may purchase using ^FF0000Different Currency^000000.";
    mes "^00FF00____________________________^000000";
    mes "So,Which shop you would like to look at it";
    next;
    // Menu Selection
    select("Headgear","Foods","Cossumber");
    
    ClearData();
    ShopSettings( @menu );
    npcshopitem "Emistry_Shop",512,100;
    npcshopdelitem "Emistry_Shop",512;
    for(set .@i,0; .@i < getarraysize( @ItemLists ); set .@i,.@i+1)
    	npcshopadditem "Emistry_Shop",@ItemLists[.@i],@ItemCost[.@i];
    mes "Okay...wait awhile";
    mes "^00FF00____________________________^000000";
    CurrencyInfo( @Currency$ );
    mes "^00FF00____________________________^000000";
    callshop "Emistry_Shop",1;
    npcshopattach "Emistry_Shop";
    end;
    
    
    function	ShopSettings	{
    	switch( getarg(0) ){
    		Case 1:
    			// Currency [ Item ID / Variable Name ]
    			set @Currency$,"pvppoint";
    			// Item ID Lists
    			setarray @ItemLists[0],5377,5288,5146,5269,5376,5235,5236,5237,5289,5306,5322,5366; // ITEM ID
    			// Item Price
    			setarray @ItemCost[0],200,220,150,400,450,250,250,250,200,250,230,300; // ITEM COST/AMOUNT
    			break;
    		Case 2:
    			// Currency [ Item ID / Variable Name ]
    			set @Currency$,"pvppoint";
    			// Item ID Lists
    			setarray @ItemLists[0],1815;
    			// Item Price
    			setarray @ItemCost[0],100;
    			break;
    		Case 3:
    			// Currency [ Item ID / Variable Name ]
    			set @Currency$,"pvppoint";
    			// Item ID Lists
    			setarray @ItemLists[0],2776,12260,14037;
    			// Item Price
    			setarray @ItemCost[0],500,50,30;
    			break;
    		// Case 4,5,6.....etc...
    		default:
    			ErrorNotice( "Invalid Menu Selection for Menu "+@menu+"." );
    			close;
    	}
    	
    	
    if( @Currency$ == "" )
    	ErrorNotice( "Invalid Currency Setting in Menu "+@menu+" ." );
    if( getarraysize( @ItemCost ) != getarraysize( @ItemLists ) || getarraysize( @ItemLists ) != getarraysize( @ItemCost ) )
    	ErrorNotice( "Missing or Extra Value of Item or Cost Settings in Menu "+@menu+" ." );
    return;
    }
    
    function	ErrorNotice	{
    	mes "^FF0000ERROR^000000 - "+getarg(0);
    	mes "^00FF00____________________________^000000";
    	mes "Inform this Message to ^0000FFGame Staffs^000000 immediately !";
    	close;
    }
    
    function	CurrencyInfo	{
    	if( getitemname( atoi( getarg(0) ) ) != "null" ){
    		mes "Item Currency : ^FF0000"+getitemname( atoi( getarg(0) ) )+"^000000";
    		mes "Available Amount : ^0000FF"+ValueConvert( countitem( atoi( getarg(0) ) ) )+"^000000";
    	}else if( getitemname( atoi( getarg(0) ) ) == "null" ){
    		mes "Variable Currency : ^FF0000"+getarg(0)+"^000000";
    		mes "Available Amount : ^0000FF"+ValueConvert( getd( getarg(0) ) )+"^000000";
    	}
    return;
    }
    
    function	ValidateCost	{
    	if( getitemname( atoi( getarg(0) ) ) != "null" ){
    		if( countitem( atoi( getarg(0) ) ) < getarg(1) ) return 1;
    	}else{
    		if( getd( getarg(0) ) < getarg(1) ) return 1;
    	}
    return 0;
    }
    
    function ClearData	{
    	set @Currency$,"";
    	set @TotalCost,0;
    	deletearray @bought_nameid[0],getarraysize( @bought_nameid );
    	deletearray @bought_quantity[0],getarraysize( @bought_quantity );
    	deletearray @ItemLists[0],getarraysize( @ItemLists );
    	deletearray @ItemCost[0],getarraysize( @ItemCost );
    return;
    }
    
    function	ValueConvert	{
    	set .@num, atoi(""+getarg(0));
    	if ( .@num == 0 || .@num >= 2147483647 ) return getarg(0);
    	set .@l, getstrlen(""+.@num);
    	for ( set .@i,0; .@i < .@l; set .@i, .@i + 1 ) {
    		set .@num$, .@num % pow(10,.@i+1) / pow(10,.@i) + .@num$;
    			if ( (.@i+1) % 3 == 0 && .@i+1 != .@l ) set .@num$, ","+ .@num$;
    	}
    	return .@num$;
    }
    
    OnBuyItem:
    	ShopSettings( @menu );
    	for(set @i,0; @i < getarraysize( @bought_nameid ); set @i,@i+1)
    		for(set @j,0; @j < getarraysize( @ItemLists ); set @j,@j+1)
    			if( @ItemLists[@j] == @bought_nameid[@i] )
    			set @TotalCost,@TotalCost + ( @ItemCost[@j] * @bought_quantity[@i] );
    	mes "^FF0000       BILLING LIST^000000";
    	mes "^00FF00____________________________^000000";
    	for( set @i,0; @i < getarraysize( @bought_nameid ); set @i,@i+1 )
    			mes "^FF0000"+@bought_quantity[@i]+" x ^0000FF"+getitemname( @bought_nameid[@i] )+"^000000";
    	mes "^00FF00____________________________^000000";
    
    	if( getitemname( atoi( @Currency$ ) ) != "null" )
    		mes "Total Cost : ^0000FF"+ValueConvert( @TotalCost )+" x "+getitemname( atoi( @Currency$ ) )+"^000000";
    	else if( getitemname( atoi( @Currency$ ) ) == "null" ){
    		mes "Total Cost : ^0000FF"+ValueConvert( @TotalCost )+" "+@Currency$+"^000000";
    	}
    	
    	mes "^00FF00____________________________^000000";
    	if( ValidateCost( @Currency$,@TotalCost ) ){
    		if( getitemname( atoi( @Currency$ ) ) != "null" )
    			mes "[ ^FF0000X^000000 ] Insufficient ^0000FF"+getitemname( atoi( @Currency$ ) )+"^000000";
    		else{
    			mes "[ ^FF0000X^000000 ] Insufficient ^0000FF"+@Currency$+"^000000";
    		}
    	}else{
    		if( select( "^0000FFPurchase^000000:Cancel" ) == 1 ){
    			if( getitemname( atoi( @Currency$ ) ) != "null" )
    				delitem atoi( @Currency$ ),@TotalCost;
    			else{
    				set getd( @Currency$ ),getd( @Currency$ ) - @TotalCost;
    			}
    			for(set @i,0; @i < getarraysize( @bought_nameid ); set @i,@i+1)
    				getitem @bought_nameid[@i],@bought_quantity[@i];
    			message strcharinfo(0),"Purchased "+getarraysize( @bought_nameid )+" Items.";
    			mes "Thank you for shopping.";
    		}
    	}
    ClearData();
    close;
    }
    -	script	qwerty	-1,{
    OnPCKillEvent:
         if ( strcharinfo(3) == "guild_vs3" ) {
    	set pvppoint,pvppoint+1;
    	dispbottom "You have gained 1 Points. Total "+pvppoint+" Point";
    end;
    }
    }
    // ---------------------------------------------------
    -	script	pointscheck	-1,{
    OnInit:
    	bindatcmd("pc","pointscheck::OnAtcommand");
    	end;
    
    OnAtcommand:
    	message strcharinfo(0),"You currently have "+pvppoint+" PvP Points";
    	end;
    	}

     

  12. Hi guys! how are you doing today? Hope you are well,

    and bless you always for the rest of your life

    whatever you are doing right now. 

    Masters and guru's

    Do you guys have a simply NPC daily reward?

    which acts like a freebies NPC but on a daily basis?

    I just need simple NPC that gives rewards.

    Thank you!

     

     

     

  13. Im having error and the game freezes.

    prontera,164,187,5	script	PVP Warper	657,{
    	for (.@i = 0; .@i < .map_size; .@i++) 
    		.@menu$ = .@menu$ + .map$[.@i] + "("+getmapusers(.map$[.@i])+" user(s))" + ":";
    	.@i = select(.@menu$) - 1;
    	mapannounce .map$[.@i], strcharinfo(0)+ " has entered this PVP room.", bc_map;
    	warp .map$[.@i], 0, 0;
    	end;
    
    	OnInit:
    		setarray .map$, "guild_vs3";
    		.map_size = getarraysize(.map$);
    		end;
    
    	OnPCKillEvent:
    		if( strcharinfo(3) == "guild_vs3" || strcharinfo(3) == "guild_vs2" )
    			announce strcharinfo(0)+" killed "+rid2name(killedrid)+" at "+strcharinfo(3)+".",0;
    		end;
    }

     

  14. Hello guys. Hope you are well despite the Ncov crisis. 

     

    I created a website from a Freeweb.

    How can i put registration on it? I just want the registration.  Is there anyway i can link my free website for registration? Help me please

  15. 9 hours ago, Akkarin said:

    No.

    He didn't say anything about extracting the data from the exe. He said find the msgstringtable.txt file in your translated data folder and edit the line there. It'll be with the other files you downloaded for english text that are probably sitting in your data folder.

    its weird. I slept last night and failed to find it all day. 

    I woke up today and thats the first thing I found. LOL thank you guys

  16. 12 minutes ago, Chaos92 said:

    Im using kRo august 2019. Those files are inside the ragnarok.exe. I can extract its contents but i cant put it inside.  Since nemo only extract contents. but we are very close ?

  17. 1 minute ago, Chaos92 said:

    Depends on your GRF. Your GRF should have msgstringtable.txt using any translation client files.  The files should be in GRF /data folder and to open GRF = can use GRF Editor.

    I looked all over the grf and i did not find msgstringtable. that is why I started looking on the ragnarok exe itself. which I found. I extracted it contents and got the msgstringtable.txt  , Now how can I put these changes back to the ragnarok exe?

×
×
  • Create New...