Jump to content
  • 0

Token Quest Shop


Question

Posted

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;

    // 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;
}

 

1 answer to this question

Recommended Posts

  • 0
Posted
N_GetZeny1k:
	set #Treasure_Token,#Treasure_Token-1;
	set Zeny, Zeny+1000;
	close;
N_10T:
	if (#Treasure_Token > 9) goto N_GetZeny10k;
	mes "You don't have enough tokens!";
	close;
N_GetZeny10k:
	set #Treasure_Token,#Treasure_Token-10;
	set Zeny, Zeny+10000;
	close;
N_100T:
	if (#Treasure_Token > 99) goto N_GetZeny100k;
	mes "You don't have enough tokens!";
	close;
N_GetZeny100k:
	set #Treasure_Token,#Treasure_Token-100;
	set Zeny, Zeny+100000;
	close;

Look for this one. Just have to change the case names.

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