SCRIPTS FOR COIN TRADER

Started by justaplayer, Mar 15, 2007, 11:18 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

justaplayer

we are having an error in RoyalRO bout our bank coz when it exceed on 900k zeny the will turn to negative and can't be withdraw no more..... so we are asking you guys to share with us the script for COIN TRADER....


----
just RoyalRO player who's so
happy to help GM....^_^ /sob :shikamaru


please help us....friends.....

yC

try find the script here: http://svn.eathena.ws/svn/ea/

if it's not there, you have to fix it yourself.  I don't there is any scripter here.

dook

great public script by erKURITA:


//| ~~~~~~~~~~~ Information ~~~~~~~~~~~
//| | This is a simple banking npc,   |
//| | which uses coins to store zeny  |
//| | instead of using those global   |
//| | variables :P       |
//| |      |
//| | It's fully customizable, you    |
//| | can exchange the coin ID used   |
//| | at will, it won't affect the    |
//| | script whatsoever =3      |
//| |      |
//| | The prices can also be set, the |
//| | way you like the most, as they  |
//| | won't affect the script either  |
//| |       |
//| | No db/client files modification |
//| | needed, just "Plug&Play" ;P     |
//| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

//| Revision:
//| v.1.0: Released script. No problems or bugs found, at least :P
//| It's your duty to find them now if there are.
//|@minvalue must contain the coin price of the lowest coin value
//|in order for the script to work correctly. By default it's set
//|to the bronze coin

//| Upcomming possible updates:
//| v.2.0: Adding a Mix option in the Zeny to Coin function,
//| where it will allow you to split your desired Zeny into
//| the coins you wish to obtain, without having to go
//| through the other functions to obtain them all. That way
//|you can get them all at once ;3
//|
//|It will also display the total zeny being exchanged,
//|the total coins obtained and the difference between
//|the amount of zeny you've inputted and the sum of
//| the coin's values.


//| Copyright © 2006 erKURITA. All Rights Reserved

gonryun.gat,156,131,3 script Zacariath Madhat 110,{


//|~~~~~~~~~ Settings of the NPC: ~~~~~~~~~
set @npcname$,"^999999[Zach]^000000";//|
set @bronzeprice,10000;//|
set @silverprice,100000;//|
set @goldprice,1000000;//|
set @mithrilprice,10000000;//|
set @bronzecoinid,673;//|
set @silvercoinid,677;//|
set @goldcoinid,671;//|
set @mithrilcoinid,674;//|
set @minvalue,@bronzeprice;//|
//|~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

mes @npcname$;
mes "Hi "+strcharinfo(0)+", I'm this town's banker";
mes "I can allow you to exchange your zeny into useful and handy coins, which you can use to make trades between players, or just save them";
next;
mes @npcname$;
mes "^996600Bronze^000000 Coins are worth "+@bronzeprice+"z, ^999999Silver^000000 Coins are worth "+@silverprice+"z, ^FFCC00Gold^000000 Coins "+@goldprice+"z, ^CCCCCCMithril^000000 Coins are worth "+@mithrilprice+"z";
next;
goto L_Menu;

L_Menu:
mes @npcname$;
mes "What do you want to do then?";
menu "Exchange my coins into zeny",L_CoinZeny,"Exchange my zeny into coins",L_ZenyCoin,"Nothing for now, sorry",L_End;

//| Here starts the Coin to Zeny Exchange

L_CoinZeny:

next;
mes @npcname$;
mes "First than anything, what kind of coins are you going to exchange?";
menu "Bronze Coins",L_Bronze,"Silver Coins",L_Silver,"Gold Coins",L_Gold,"Mithril Coins",L_Mithril,"None for now",L_Menu;


L_Bronze:
callsub L_Coincheckout,@bronzecoinid,@bronzeprice;
goto L_CoinZeny;

L_Silver:
callsub L_Coincheckout,@silvercoinid,@silverprice;
goto L_CoinZeny;

L_Gold:
callsub L_Coincheckout,@goldcoinid,@goldprice;
goto L_CoinZeny;

L_Mithril:
callsub L_Coincheckout,@mithrilcoinid,@mithrilprice;
goto L_CoinZeny;

L_Coincheckout:

set @itemid,getarg(0);
if (@itemid == @bronzecoinid) {
set @coinname$,"^996600Bronze^000000";
goto L_PreInputing;
} else if (@itemid == @silvercoinid) {
set @coinname$,"^999999Silver^000000";
goto L_PreInputing;
} else if (@itemid == @goldcoinid) {
set @coinname$,"^FFCC00Gold^000000";
goto L_PreInputing;
} else if (@itemid == @mithrilcoinid) {
set @coinname$,"^CCCCCCMithril^000000";
goto L_PreInputing;
} else
next;

L_PreInputing:

mes @npcname$;
mes "Let's see, how many coins do you want to exchange?";
next;
goto L_Inputing;

L_Inputing:
input @coinamount;

if (@coinamount == 0) {
mes @npcname$;
mes "You didn't input any amount, please retry";
next;
goto L_Inputing;
} else if (countitem(@itemid) < @coinamount) {
mes @npcname$;
mes "You don't have enough coins, please get some";
next;
goto L_Menu;
} else

next;
mes @npcname$;
mes "So, you want to exchange "+@coinamount+" "+@coinname$+" ?";
menu "Yes, I want to exchange this much",L_Proceed,"No, I want to exchange something else",L_CoinZeny,"No, I want to input another number",L_Inputing,"No, I dont want to exchange anything",L_Menu;

L_Proceed:
next;
set @price,getarg(1)*@coinamount;
set Zeny,Zeny+@price;
delitem @itemid,@coinamount;
mes @npcname$;
mes "There we go, here's your money";
next;
return;

//| Here starts the Zeny to Coin exchange.

L_ZenyCoin:
next;
mes @npcname$;
mes "First, how much zeny do you want to exchange";
callsub L_Inputingzeny;
callsub L_Zenycoins;
next;
mes @npcname$;
mes "You can have, with "+@zenyamount+":";
mes "^996600"+@bronzezeny+"^000000 Bronze coins";
mes "^999999"+@silverzeny+"^000000 Silver coins";
mes "^FFCC00"+@goldzeny+"^000000 Gold coins";
mes "or";
mes "^CCCCCC"+@mithrilzeny+"^000000 Mithril coins";
next;
if (@zenyamount < @minvalue) goto L_Moremoney;
goto L_ZenyCoin2;

L_ZenyCoin2:
mes @npcname$;
mes "Which ones do you want? Or do you want a mix of them?";
menu "I want the bronze ones",L_Bronzes,"I want the silver ones",L_Silvers,"I want the gold ones",L_Golds,"I want the mithril ones",L_Mithrils,"Nothing for now, sorry",L_Menu;

L_Bronzes:
if (@bronzezeny == 0) goto L_Moremoney;
callsub L_Zenycheckout,@bronzecoinid,@bronzeprice,@bronzezeny;
goto L_Menu;

L_Silvers:
if (@silverzeny == 0) goto L_Moremoney;
callsub L_Zenycheckout,@silvercoinid,@silverprice,@silverzeny;
goto L_Menu;

L_Golds:
if (@goldzeny == 0) goto L_Moremoney;
callsub L_Zenycheckout,@goldcoinid,@goldprice,@goldzeny;
goto L_Menu;

L_Mithrils:
if (@mithrilzeny == 0) goto L_Moremoney;
callsub L_Zenycheckout,@mithrilcoinid,@mithrilprice,@mithrilzeny;
goto L_Menu;

L_Zenycheckout:
next;
set @itemid,getarg(0);
set @pricea,getarg(1)*getarg(2);
getitem @itemid,getarg(2);
set Zeny,Zeny-@pricea;
mes @npcname$;
mes "There you go, here's your coins";
next;
return;

L_Zenycoins:
set @bronzezeny,@zenyamount/@bronzeprice;
set @silverzeny,@zenyamount/@silverprice;
set @goldzeny,@zenyamount/@goldprice;
set @mithrilzeny,@zenyamount/@mithrilprice;
return;

L_Inputingzeny:

input @zenyamount;
if (@zenyamount == 0) {
mes @npcname$;
mes "You didnt input any amount, please retry";
next;
goto L_Inputingzeny;
} else if (@zenyamount > Zeny) {
mes @npcname$;
mes "The inputted zeny amount is bigger than your actual zeny amount";
mes "Please re-entry another amount";
next;
goto L_Inputingzeny;

} else return;

//| Other labels

L_Moremoney:
mes @npcname$;
mes "You need to get more zeny, I can't give you anything with "+@zenyamount+"z, sorry";
next;
goto L_Menu;

L_End:
next;
mes @npcname$;
mes "Good to see you and hope to see you again. Bye";
close;
}


Druisse

#3
Maybe the coin banker NPC is already in your eathena NPC folder...u may just need to uncomment it...Goodluck..

try browsing through the script_custom.conf file...it could be there..not very sure though...