/*==================================================Bankerby Zephy====================================================Description: A banker NPC for exchanging an item for zeny,vice versa, and storage of said item withoutusing a SQL database.====================================================Additional Notes: - Make sure you take into consideration your input_max_value in /conf/script.conf.====================================================Changelog: 1.0 - Initial Release==================================================*/ - script Banker -1,{ mes .npc_name$; mes "You currently have "+ #banknote +" "+ getitemname(.note_id) +"s in your account."; mes " "; mes "What would you like to do?"; next; // Main Menu switch(select("Deposit "+ getitemname(.note_id) +"s:Withdraw "+ getitemname(.note_id) +"s:Exchange "+ getitemname(.note_id) +"s:Cancel")) { case 1: // Deposit item mes .npc_name$; mes "How many "+ getitemname(.note_id) +"s would you like to deposit?"; input @banknotedeposit; // Input amount to be stored if (@banknotedeposit =< 0) { // Checks if the player enters a number less than or equal to 0 mes .npc_name$; mes "Please enter a number greater than zero."; close; } if (@banknotedeposit > countitem(.note_id)) { // Checks if the player has item amount mes .npc_name$; mes "You do not have enough "+ getitemname(.note_id) +"s."; close; } #banknote = #banknote+@banknotedeposit; // Adds amount to current storage amount delitem .note_id,@banknotedeposit; // Deletes items mes .npc_name$; mes "I have deposited your "+ getitemname(.note_id) +"s."; mes "Come again soon."; close; case 2: // Withdraw item mes .npc_anme$; mes "How many "+ getitemname(.note_id) +"s would you like to withdraw?"; input @banknotewithdraw; // Input amount to be withdrawn if (@banknotewithdraw =< 0) { // Checks if the player enters a number less than or equal to 0 mes .npc_name$; mes "Please enter a number greater than zero."; close; } if (@banknotewithdraw > #banknote) { // Checks if the player has enough of the item in the storage mes .npc_name$; mes "You only have "+ #banknote +" "+ getitemname(.note_id) +"s in your account."; close; } #banknote = #banknote-@banknotewithdraw; // Reduces storage amount by amount withdrawn getitem .note_id,@banknotewithdraw; // Receive item mes .npc_name$; mes "I have withdrawn "+ @banknotewithdraw +" "+ getitemname(.note_id) +"s from your account."; mes "Come again soon."; close; case 3: // Exchange items switch(select("Zeny ---> "+ getitemname(.note_id) +":"+ getitemname(.note_id) +" ---> Zeny:Back")) { case 1: // Zeny to item mes .npc_name$; mes "Please input the amount of zeny to exchange for "+ getitiemname(.note_id) +"s,"; input @zenyexchange; // Input amount of zeny if (@zenyexchange < .note_price) { // Checks if amount entered is less than the set .note_price mes .npc_name$; mes "The exchange rate is "+ .note_price +" zeny per "+ .note_id +"."; close; } if (Zeny < @zenyexchange) { // Checks if player has enough zeny mes .npc_name$; mes "Please come back with more zeny or enter another value."; close; } Zeny =- @zenyexchange; // Reduces zeny by amount inputted @pricea = @zenyexchange/.note_price; // Sets note amount getitem .note_id,@pricea; // Gives player notes mes .npc_name$; mes "I have exchanged "+ @zenyexchange +" zeny for "+ @pricea +" "+ getitemname(.note_id) +"s."; mes "Come again soon."; close; case 2: // Item to zeny mes .npc_name$; mes "Please input the amount of "+ getitemname(.note_id) +"s you would like to exchange for zeny."; input @noteexchange; // Input amount of items if (@noteexchange < countitem(.note_id)) { // Checks if player has enough of the item mes .npc_name$; mes "Please come back with more "+ getitemanme(.note_id) +" or enter another value."; close; } if ((@noteexchange*.note_price)+Zeny > @maxzeny) { // Checks if the player will reach their max zeny mes .npc_name$; mes "Sorry, but you can not exchange this number of "+ getitemname(.note_id) +"s "; mes "because you will exceed the maximum amount of zeny you can hold."; close; } delitem .note_id,@noteexchange; // Deletes notes by amount inputted @priceb = @noteexchange*.noteprice; // Sets zeny amount Zeny =+ @priceb; // Gives player zeny next; mes .npc_name$; mes "I have exchanged "+ @noteexchange +" "+ getitemname(.note_id) +"s for "+ @priceb +" zeny."; mes "Come again soon."; close; case 3: break; } case 4: // Cancel mes .npc_name$; mes "Come again soon."; close; } // Configuration OnInit: .npc_name$ = "[^0000CCBanker^000000]"; // NPC name .note_id = 0; // Bank note ID .note_price = 0; // Bank note price, in zeny .maxzeny = 2000000000; // Maximum amount of zeny a player can hold in your server} // Duplicates//===============================================================prontera,150,150,3 duplicate(Banker) Banker#prt 4_m_khkyel