Jump to content
  • 0

need help about setting ammount of item


Question

Posted

about this part of my script

mes "[ ^336699Coin Master^000000 ]";
 mes "Very well. Here is the list on how much each coin is worth:";
 mes "50x ^99CCCCMithril Coin^000000: 1 Ancient Coin";
 mes "Do you Want To Trade??";
 if (select("Yes I want.:Not now.")-1) close;
 if(countitem(674)<50)
 delitem 674,50;
 getitem 7959,1;
 goto L_Thanks;

i want to add that they will enter the ammount of mithril coin they will convert it to ancient coin

because 50 mithril coin=1 ancient coin

here is my full script


// Made by MoonlightRO \\
// Source: http://www.eathena.ws/board/index.php?showtopic=251759 \\
// Don't take my creation as your own >.> \\

merullian,99,98,5 script Coin Trader 860,{

cutin "kafra_08",2;
mes "[ ^336699Coin Master^000000 ]";
mes "What do you want to do today?";
menu "Coins -> Zeny",L_Coins,"Zeny -> Coins",L_Zeny,"Coins -> Ancient Coins",L_ancientcoins,"Nevermind",L_No;

L_Coins:
next;
mes "[ ^336699Coin Master^000000 ]";
mes "Very well. Here is the list on how much each coin is worth:";
mes "^996633Bronze Coin^000000: 50,000,000m Zeny";
mes "^666666Silver Coin^000000: 100,000,000m Zeny";
mes "^FFFF66Gold Coin^000000: 150,000,000m Zeny";
mes "^99CCCCMithril Coin^000000: 200,000,000m Zeny";
mes "Tell me, what coin would you like to exchange?";
next;
menu "^996633Bronze Coin^000000",M_Bronze,"^666666Silver Coin^000000",M_Silver,"^FFFF66Gold Coin^000000",M_Gold,"^99CCCCMithril Coin^000000",M_Mithril;



M_Bronze:
next;
mes "[ ^336699Coin Master^000000 ]";
mes "How many coins would you like to give up?";
set @mamount,0;
input @mamount;
if (@mamount < 0) goto L_No;
if (countitem(673) < @mamount) goto L_No;
set Zeny,(zeny + (50000000* @mamount));
delitem 673,@mamount;
goto L_Thanks;

M_Silver:
next;
mes "[ ^336699Coin Master^000000 ]";
mes "How many coins would you like to give up?";
set @mamount,0;
input @mamount;
if (@mamount < 0) goto L_No;
if (countitem(675) < @mamount) goto L_No;
set Zeny,(zeny + (100000000* @mamount));
delitem 675,@mamount;
goto L_Thanks;

M_Gold:
next;
mes "[ ^336699Coin Master^000000 ]";
mes "How many coins would you like to give up?";
set @mamount,0;
input @mamount;
if (@mamount < 0) goto L_No;
if (countitem(671) < @mamount) goto L_No;
set Zeny,(zeny + (150000000* @mamount));
delitem 671,@mamount;
goto L_Thanks;

M_Mithril:
next;
mes "[ ^336699Coin Master^000000 ]";
mes "How many coins would you like to give up?";
set @mamount,0;
input @mamount;
if (@mamount < 0) goto L_No;
if (countitem(674) < @mamount) goto L_No;
set Zeny,(zeny + (200000000* @mamount));
delitem 674,@mamount;
goto L_Thanks;

L_Zeny:
next;
mes "[ ^336699Coin Master^000000 ]";
mes "Very well. Here is the list on how much each coin is worth:";
mes "^996633Bronze Coin^000000: 50,000,000m Zeny";
mes "^666666Silver Coin^000000: 100,000,000m Zeny";
mes "^FFFF66Gold Coin^000000: 150,000,000m Zeny";
mes "^99CCCCMithril Coin^000000: 200,000,000m Zeny";
mes "Tell me, what coin would you like to get?";
next;
menu "^996633Bronze Coin^000000",M_Bronze1,"^666666Silver Coin^000000",M_Silver1,"^FFFF66Gold Coin^000000",M_Gold1,"^99CCCCMithril Coin^000000",M_Mithril1;



M_Bronze1:
next;
mes "[ ^336699Coin Master^000000 ]";
mes "How many coins would you like?";
set @mamount,0;
input @mamount;
if (zeny < 0) goto L_No;
if (zeny < (10* @mamount)) goto L_No;
set Zeny,(zeny - (50000000* @mamount));
getitem 673,@mamount;
goto L_Thanks;

M_Silver1:
next;
mes "[ ^336699Coin Master^000000 ]";
mes "How many coins would you like?";
set @mamount,0;
input @mamount;
if (zeny < 0) goto L_No;
if (zeny < (100000000* @mamount)) goto L_No;
set Zeny,(zeny - (100000000* @mamount));
getitem 675,@mamount;
goto L_Thanks;

M_Gold1:
next;
mes "[ ^336699Coin Master^000000 ]";
mes "How many coins would you like?";
set @mamount,0;
input @mamount;
if (zeny < 0) goto L_No;
if (zeny < (150000000* @mamount)) goto L_No;
set Zeny,(zeny - (150000000* @mamount));
getitem 671,@mamount;
goto L_Thanks;

M_Mithril1:
next;
mes "[ ^336699Coin Master^000000 ]";
mes "How many coins would you like?";
set @mamount,0;
input @mamount;
if (zeny < 0) goto L_No;
if (zeny < (200000000* @mamount)) goto L_No;
set Zeny,(zeny - (200000000* @mamount));
getitem 674,@mamount;
goto L_Thanks;

L_ancientcoins:
next;
mes "[ ^336699Coin Master^000000 ]";
mes "Very well. Here is the list on how much each coin is worth:";
mes "50x ^99CCCCMithril Coin^000000: 1 Ancient Coin";
mes "Do you Want To Trade??";
if (select("Yes I want.:Not now.")-1) close;
if(countitem(674)<50)
delitem 674,50;
getitem 7959,1;

goto L_Thanks;


L_Thanks:
mes "[ ^336699Coin Master^000000 ]";
mes "Pleasure doing business with you.";
close2;
cutin "", 255;
close;

L_No:
mes "[ ^336699Coin Master^000000 ]";
mes "Okay~ Bye!";
close2;
cutin "", 255;
close;
}

4 answers to this question

Recommended Posts

Posted

sir emistry...i found a bug from your script.i have 100 mithril coin...then i entered 10 in the input number..then it gave me 10 ancient coins and my 100 mithril coin is still to my inventory

Posted

ouch..

you change

input .@Input,0,countitem( 674 );

into this

input .@Input,50,countitem( 674 );

and there is another.

change

set .@Amount,( .@Input % 50 );

into this

set .@Amount,( .@Input / 50 );

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