Jump to content
  • 0

ADDING AMOUNT TO EXCHANGE IN THIS EXCHANGER NPC


Question

Posted
Quote

//**************************************************************************************************
// Created by dev LOOLP
// Version 1.0
// Compatible with rAthena
// Function : automatic item exchange, based on item array, trade, quantity.
// Keeping credit is a matter of respect and thanks
//**************************************************************************************************

prontera,155,185,4    script    Exchanger Board    4_BOARD3,{
setarray .@item, 501,502,503;
setarray .@exchange, 601,602,603; 
setarray .@amount, 1,2,3;

    .@menu = select( 
        (countitem(501)?"- Exchange with "+getitemname(501)+"":""),
        (countitem(502)?"- Exchange with "+getitemname(502)+"":""),
        (countitem(503)?"- Exchange with "+getitemname(503)+"":""),
        "- Nothing"
        );
    switch(.@menu) {
    case 1:
    set .choice, 0;
    delitem .@item[0],1;
    getitem .@exchange[.choice],.@amount[.choice];
        break;
    case 2:
    set .choice, 1;
    delitem .@item[1],1;
    getitem .@exchange[.choice],.@amount[.choice];
        break;
    case 3:
    set .choice, 2;
    delitem .@item[2],1;
    getitem .@exchange[.choice],.@amount[.choice];
        break;
    default:
        mes "[ Exchanger ]";
        mes "There's nothing i can do for you.";
        mes " ";
        mes "Please come back to me later!";
        break;
    }
    end;
    

}

kindly help me on adding amount i want to exchange.. example if i have 100 501.. and id like to exchange all 100 at once .. so i dont have to click the NPC 100times

thanks

2 answers to this question

Recommended Posts

  • 0
Posted

managed to work this by adding     

input @amount,0,100;

the problem now is how will i make for example i input 101 or more..

how will i add a message saying that you can't exchange more than 100 at once 

 

  • 0
Posted (edited)
IF ( @AMOUNT > 100 ){
	// NPC DIALOG HERE IF TRUE //
	// EXAMPLE:
	MES "Nice your input is below 100";
	END; // CLOSE NPC DIALOG
}
//IF FALSE DO THIS
MES "Sorry you cant input more than 100";
END;

 

Edited by Poring King
  • Upvote 1

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...