summaryrefslogblamecommitdiff
path: root/npc/merchants/ammo_dealer.txt
blob: 56870d6336936f89a71e8de448a3002ccd32c594 (plain) (tree)
1
2
3
4
5
6
7
8
9
                                                              
                      
                                                              
                           
                                                              
       


                                                              
                  
                                                              

                                          


                                              

                                                              
                                                            
 
                     
                                        










                                                                                                                  




                                                                            







                                                              
         








                                                 


                                         
                     
                                                     

                     
                                                          
                         

                                                            
             
                     

                                                       
             



                                       
                     
                                           
                                      
                                    
                      

                                                                                                                   
                                                                                                                                     
                              
                        






                                                       

                              
                




                                                   
                      
         
 
//===== Athena Script ========================================
//= Bullet Dealer Tony
//===== By ===================================================
//= Playtester, Paradox924X
//===== Version ==============================================
//= 1.3
//===== Compatible With ======================================
//= eAthena SVN with jAthena scripting engine and . variables
//===== Description ==========================================
//= Bullet trader.
//===== Comments =============================================
//= 1.0 First version [Playtester]
//= 1.1 Converted from Aegis [Paradox924X]
//= 1.2 More optimized conversion [Legionaire]
//= 1.2a Removed .GATs [Lupus]
//= 1.3 Fixed [Playtester]
//============================================================

que_ng,187,156,3	script	Bullet Dealer Tony	86,{

	mes "[Tony]";
	if (BaseJob == Job_Gunslinger) {
		mes "I'm Bullet-tooth Tony!";
		mes "Whenever your out of bullets,";
		mes "Visit me!!!";
		next;
		mes "[Tony]";
		mes "Now~! Friend~Companion~ Buddy~";
		mes "What do you need?!";
		mes "Choose anything~!";
		mes "And pay money~!";
		next;
		switch(select("Poison Sphere:Flare Sphere:Lighting Sphere:Blind Sphere:Freezing Sphere:Cancel")) {
			case 1: callfunc "Bullet_Trade",937,10,13205; break;
			case 2: callfunc "Bullet_Trade",7097,2,13203; break;
			case 3: callfunc "Bullet_Trade",7053,3,13204; break;
			case 4: callfunc "Bullet_Trade",1024,5,13206; break;
			case 5: callfunc "Bullet_Trade",7054,2,13207; break;
			case 6:
				mes "[Tony]";
				mes "Mmm~ Okay~";
				mes "Please visit again~";
				mes "I, Bullet-tooth Tony,";
				mes "Will always be here~!!!";
				close;
		}
	}
	mes "I'm a trader who supplies";
	mes "Gunslingers with trade items.";
	mes "I am called Bullet-tooth Tony.";
	next;
	mes "[Tony]";
	mes "I don't think you are a Gunslinger";
	mes "So just look around";
	mes "and go.";
	close;
}

function	script	Bullet_Trade	{
	mes "[Tony]";
	mes "Input the amount you wish to purchase.";
	next;
	mes "[Tony]";
	mes "We trade 30 "+getitemname(getarg(2))+"s for";
	mes "1 Phracon,";
	mes "1 Emveretarcon,";
	mes "and "+getarg(1)+" "+getitemname(getarg(0))+".";
	next;
	mes "[Tony]";
	mes "The maximum number you can trade is 500.";
	mes "If you want to cancel, input 0.";
	next;
	input .@input;
	set @tony,.@input;
	set @tony1,.@input;
	set @tony2,.@input * getarg(1);
	mes "[Tony]";
	if (.@input < 1 || .@input > 500) {
		mes "Invalid Amount!";
		mes "Enter again~!";
		close;
	} else if ((countitem(1010) >= @tony) && (countitem(1011) >= @tony1) && (countitem(getarg(0)) >= @tony2)) {
		if (checkweight(getarg(2),.@input * 30) == 0) {
			mes "I cannot give it to you because your inventory is full. Come back after your inventory has more space.";
			close;
		} else {
			mes "Oh~ Good!";
			mes "Trade number checked!";
			mes "I'll trade immediately.";
			delitem 1010,@tony;
			delitem 1011,@tony1;
			delitem getarg(0),@tony2;
			getitem getarg(2),.@input * 30;
			close;
		}
	} else {
		mes "Tsk Tsk~";
		mes "You do not have";
		mes "enough items for the";
		mes "items you want to trade.";
		mes "Prepare again and come back.";
		close;
	}
}