On token quest shop script (from \npc\custom\quests\thq). How to change the rate conversion of token points to zeny like 1 Token is equivalent to 1M zeny then 10 Token is 10M and so 100 Token to 100M?
Spoiler
// Trades tokens
// getarg(0) - number of tokens to be traded
function script thqs_trade_token {
@type = getarg(0);
if( @type == 4 )
close;
Question
xJhay
On token quest shop script (from \npc\custom\quests\thq). How to change the rate conversion of token points to zeny like 1 Token is equivalent to 1M zeny then 10 Token is 10M and so 100 Token to 100M?
// Trades tokens
// getarg(0) - number of tokens to be traded
function script thqs_trade_token {
@type = getarg(0);
if( @type == 4 )
close;
// 10^0, 10^1, 10^2
@type -= 1;
@price = (10 ** @type);
// 10^3, 10^4, 10^5
@type += 3; // So we can use pow later to determine the qt of Zeny
@prize = (10 ** @type);
if( #Treasure_Token < @price ) {
mes "You don't have enough tokens!";
close;
}
if( Zeny == MAX_ZENY ) {
mes "You can't add more zeny to your character";
close;
}
Zeny += @prize;
#Treasure_Token -= @price;
close;
}
Link to comment
Share on other sites
1 answer to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.