Jump to content
  • 0

Coin Exchanger Exploit


Question

Posted (edited)

Well based on some scripts tha i found on google i made my own coin excanger and goues like this

quiz_02,49,386,4	script	Coin Buyer	790,{

set @sPrice,10000;
mes "Hello, i can trade your silver coins for 10k of zeny. Wanna deal?";
next;
menu "Sure, lets get rich",Cfz,"No thanks.",nothx;    
Cfz:
if(countitem(675)<1)goto no_item;
input @amount;
delitem 675,1*@amount;
set Zeny,Zeny+(@amount*@sPrice);
close;
no_item:
mes "You dont have enough coins.";
close;
nothx:
mes "You are welcome anyway";
close;

}

everything works fine, or it looks like it, BUT when a player types 100,000 the coiner gives 1B of zeny DDD:!

so may i ask

how to make the max value to input be 10,000 and no more D:?!

thanks in advance

 

edit:

i tryied with input_max_value: 10000

but it did not work ):

 

second edit:

i fixed, the script ended like this, i just added the min and max value to the input instead, i got it from scripts_eathena.ttx

quiz_02,49,386,4	script	Coin Buyer	790,{

set @sPrice,10000;
mes "Hello, i can trade your silver coins for 10k of zeny. Wanna deal?";
next;
menu "Sure, lets get rich",Cfz,"No thanks.",nothx;    
Cfz:
if(countitem(675)<1)goto no_item;
input @amount,0,10000;
delitem 675,1*@amount;
set Zeny,Zeny+(@amount*@sPrice);
close;
no_item:
mes "You dont have enough coins.";
close;
nothx:
mes "You are welcome anyway";
close;

}

Now this is how it will work

iIf player deals:

1 Silver = 10,000z

10 Silver = 100,000z

100 Silver = 1,000,000z

1,000 Silver = 10,000,000z

10,000 Silver = 100,000,000z

>10,000 Will take only 10,000 coins and give the proper amount (100,000,000z) of zeny.

 

Even no one readed/see this before i fix it, i will say thanks anyways :D!

Edited by Kido

4 answers to this question

Recommended Posts

Posted (edited)
quiz_02,49,386,4	script	Coin Buyer	790,{

set @sPrice,10000;
set @coins,countitem(675);

mes "Hello, i can trade your silver coins for 10k of zeny. Wanna deal?";
next;
menu "Sure, lets get rich",Cfz,"No thanks.",nothx;  
  
Cfz:
if(@coins)<1)goto no_item;
input @amount;

if(@amount > @coins)goto no_item; // Check if the amount of coins is valid. You can not say 1000 coins when you only have 500 ^^

delitem 675,@amount;
set Zeny,Zeny+(@amount*@sPrice);
close;

no_item:
mes "You dont have enough coins.";
close;

nothx:
mes "You are welcome anyway";
close;

}

Only a suggestion ^^ But adding a check for the coins could be usefull ^^ so a player can not abuse ^^

Edited by Netsrot
Posted (edited)

thanks for the suggestion, but i would just add a different no_item so the npc may say something different if the player tryied to claim more zeny by giving more than 10,000 coins, like this:

quiz_02,49,386,4	script	Coin Buyer	790,{

set @sPrice,10000;
set @coins,countitem(675);

mes "Hello, i can trade your silver coins for 10k of zeny. Wanna deal?";
next;
menu "Sure, lets get rich",Cfz,"No thanks.",nothx;  
  
Cfz:
if(@coins)<1)goto no_item;
input @amount;

if(@amount > @coins)goto over_item;

delitem 675,@amount;
set Zeny,Zeny+(@amount*@sPrice);
close;

//added this when trying to give more than the maxium amount you want to trade
no_item:
mes "You dont have enough coins.";
close;

over_item:
mes "You have too many coins, im not rich to give you that great amount of zeny..."
close;

nothx:
mes "You are welcome anyway";
close;

}

Thanks again :)

Edited by Kido
Posted (edited)

An other suggestion ^^ 

 

Change the price in item_db, then that coin can be sold to every NPC ^^

 

Regards ^^

 

Nets ^^

 

PS: Little change to the text in over_item, cause the player just tried to abuse !!! Your text, well ^^ 

Edited by Netsrot

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