Jump to content
  • 0

NPC gold room, can anyone help me?


gustabrayan225

Question


  • Group:  Members
  • Topic Count:  12
  • Topics Per Day:  0.27
  • Content Count:  30
  • Reputation:   0
  • Joined:  05/01/24
  • Last Seen:  

Good afternoon ! Can anyone help me.
I need a gold room npc
that drop gold bars, and that can be exchanged for coins
of platinum, gold and bronze, where these coins can be exchanged for zenys. thanks

Link to comment
Share on other sites

1 answer to this question

Recommended Posts

  • 0

  • Group:  Members
  • Topic Count:  61
  • Topics Per Day:  0.02
  • Content Count:  943
  • Reputation:   174
  • Joined:  11/27/14
  • Last Seen:  

Try this i made

// Gold Room Entrance NPC
firstcity,100,100,4	script	Gold Room Entrance	857,{
    mes "[Gold Room NPC]";
    mes "Welcome to the Gold Room!";
    mes "Do you want to enter the Gold Room?";
    if(select("Yes:No") == 2) {
        mes "[Gold Room NPC]";
        mes "Alright, come back if you change your mind.";
        close;
    }
    if (checkweight(969, 1)) { // Ensure the player has at least 1 weight free to collect Gold Bars
        warp "gold_room", 50, 50; // Replace "gold_room" with your actual Gold Room map name
        close;
    } else {
        mes "[Gold Room NPC]";
        mes "You are carrying too much weight!";
        close;
    }
}

// Exchange Gold Bars for Coins NPC
gold_room,50,50,4	script	Exchange NPC	858,{
    mes "[Exchange NPC]";
    mes "I can exchange your Gold Bars for coins.";
    mes "What would you like to do?";
    switch(select("Exchange Gold Bars for Coins:Exchange Coins for Zeny:Cancel")) {
        case 1:
            callfunc("exchange_goldbars");
            break;
        case 2:
            callfunc("exchange_coins");
            break;
        case 3:
            mes "[Exchange NPC]";
            mes "Come back if you change your mind.";
            close;
    }
    close;
}

function script exchange_goldbars {
    mes "[Exchange NPC]";
    mes "How many Gold Bars do you want to exchange?";
    input .@goldbars;
    if (countitem(969) < .@goldbars) {
        mes "You don't have that many Gold Bars.";
        close;
    }
    mes "Which coin do you want to receive?";
    switch(select("Platinum Coin:Gold Coin:Bronze Coin:Cancel")) {
        case 1:
            delitem 969, .@goldbars;
            getitem 671, .@goldbars / 10; // Example exchange rate: 10 Gold Bars = 1 Platinum Coin
            break;
        case 2:
            delitem 969, .@goldbars;
            getitem 673, .@goldbars / 5; // Example exchange rate: 5 Gold Bars = 1 Gold Coin
            break;
        case 3:
            delitem 969, .@goldbars;
            getitem 672, .@goldbars / 1; // Example exchange rate: 1 Gold Bar = 1 Bronze Coin
            break;
        case 4:
            mes "Alright, come back if you change your mind.";
            close;
    }
    mes "Thank you! Here are your coins.";
    close;
}

function script exchange_coins {
    mes "[Exchange NPC]";
    mes "Which coin do you want to exchange for Zeny?";
    switch(select("Platinum Coin:Gold Coin:Bronze Coin:Cancel")) {
        case 1:
            mes "How many Platinum Coins do you want to exchange?";
            input .@platinum;
            if (countitem(671) < .@platinum) {
                mes "You don't have that many Platinum Coins.";
                close;
            }
            delitem 671, .@platinum;
            set zeny, zeny + (.@platinum * 1000000); // Example exchange rate: 1 Platinum Coin = 1,000,000 Zeny
            break;
        case 2:
            mes "How many Gold Coins do you want to exchange?";
            input .@gold;
            if (countitem(673) < .@gold) {
                mes "You don't have that many Gold Coins.";
                close;
            }
            delitem 673, .@gold;
            set zeny, zeny + (.@gold * 100000); // Example exchange rate: 1 Gold Coin = 100,000 Zeny
            break;
        case 3:
            mes "How many Bronze Coins do you want to exchange?";
            input .@bronze;
            if (countitem(672) < .@bronze) {
                mes "You don't have that many Bronze Coins.";
                close;
            }
            delitem 672, .@bronze;
            set zeny, zeny + (.@bronze * 10000); // Example exchange rate: 1 Bronze Coin = 10,000 Zeny
            break;
        case 4:
            mes "Alright, come back if you change your mind.";
            close;
    }
    mes "Thank you! Here is your Zeny.";
    close;
}

 

  • Like 1
Link to comment
Share on other sites

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.

×
×
  • Create New...