Jump to content
  • 0

Question

Posted
Spoiler

 

prontera,138,224,5    script    Potion Trader    982,{
    set @name$,"[^FF0000"+strnpcinfo(1)+"^000000]";

    mes @name$;
    mes "I can convert your Siege White Potion to Siege Blue Potion and Siege Blue Potion to Siege White Potion.";
    next;
    mes "^FF0000Please make sure you have enough item slot for this transaction.^000000";
    mes "^FF0000We (GM TEAM) are not responsible of any loss or if you drop the exchange items.^000000";

next;
    mes "^0000EE2 Siege White Potion^000000 = ^FF00001 Siege Blue Potion";
    mes "^0000EE2 Siege Blue Potion^000000 = ^FF00001 Siege White Potion";
    next;
    switch(select("^0000EE(Siege White Potion)^000000 to ^FF0000(Siege Blue Potion):^0000EE(Siege Blue Potion)^000000 to ^FF0000(Siege White Potion)")) {

        case 1:
            next;
            mes @name$;
            mes "How many "+getitemname(11504)+" do you want?";
            input .@item_count ;
            if( .@item_count == 0 ) close;
            if(countitem(11503) >= 5001){
            mes " ";
            mes "Your Inventory is full";
            mes "Your "+getitemname(11503)+" is more than 5,000  put some in storage";
            close;
            }
            delitem 11503,(.@item_count*2);
            getitem 11504,.@item_count;
            next;
            mes @name$;
            mes "There you go! You got your "+.@item_count+"x "+getitemname(11504)+". Hope to see you again!";
            close;
        case 2:
            next;
            mes @name$;
            mes "How many "+getitemname(11503)+" do you want?";
            input .@item_count ;
            if( .@item_count == 0 ) close;
            if(countitem(11504) >= 5001){
            mes " ";
            mes "Your Inventory is full";
            mes "Your "+getitemname(11504)+" is more than 5,000  put some in storage";
            close;
            }
            delitem 11504,(.@item_count*2);
            getitem 11503,.@item_count;
            next;
            mes @name$;
            mes "There you go! You got your "+.@item_count+"x "+getitemname(11503)+". Hope to see you again!";
            close;
}
}

 

I'm having this error on npc whenever i input wrong number of potions.  can anyone help me with this.. thank you.

hhhhhhhhhhhhhhhhh.JPG

1 answer to this question

Recommended Posts

  • 0
Posted

Ok try this . Not tested but it should be work
 

prontera,138,224,5    script    Potion Trader    982,{

	mes "NPC Name";
	mes "Dialog";
	next;
	mes "^0000EE2 Siege White Potion^000000 = ^FF00001 Siege Blue Potion";
    mes "^0000EE2 Siege Blue Potion^000000 = ^FF00001 Siege White Potion";
	switch(select("^0000EE(Siege White Potion)^000000 to ^FF0000(Siege Blue Potion):^0000EE(Siege Blue Potion)^000000 to ^FF0000(Siege White Potion)")) {
			case 1:
					if( countitem( .@ItemID1 ) >= 2 ){
							mes "How many will be traded into "+getitemname( .@ItemID2 )+"?";
							input .@Count,0,countitem( .@ItemID1 );
							if( .@Count < 2 ) close;
							set .@Amount,( .@Count / 2 );
							delitem .@ItemID1,( .@Amount * 2 );
							getitem .@ItemID2,.@Amount;
							mes "Done.";
					}
					mes "Sorry you don't have enough item";
					end;
			case 2:
					if( countitem( .@ItemID2 ) >= 2 ){
							mes "How many will be traded into "+getitemname( .@ItemID1 )+"?";
							input .@Count,0,countitem( .@ItemID2 );
							if( .@Count < 2 ) close;
							set .@Amount,( .@Count / 2 );
							delitem .@ItemID2,( .@Amount * 2 );
							getitem .@ItemID1,.@Amount;
							mes "Done.";
					}
					mes "Sorry you don't have enough item";
					end;
	}
	
// Controls
OnInit:
        set .@ItemID1,11503;
        set .@ItemID2,11504;
}

 

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...