• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

House Cost - TFS 1.3

Lucifer

Active Member
Joined
Dec 27, 2014
Messages
145
Reaction score
33
Location
Sweden
How can i make so the houses cost Gold nuggets and not Gold coins?

Tfs 1.3
 
Solution
S
sorry forgot a bracket
Code:
      const int32_t housePrice = (g_config.getNumber(ConfigManager::HOUSE_PRICE) / 1000000);
        if (housePrice != -1) {
            ss << " It costs " << (houseTiles.size() * housePrice) << " golden nuggets.";
        }
    }
should work properly now
I have already make gold nuggets to a value my problem is this

It belongs to house 'House #04'. Nobody owns this house. It costs 66000 gold nugget.

I have changed the text from gold coin to gold nugget but the cost is on gold coin, so i need to change to gold nugget.

1 gold nugget is = 10000000 gold coins
 
First idk how the goldnugget worth 1x10^7 it should be even number because currency starts from 100 gold then 100 plat anyway idk i will set it for 1000000
CTRL +F and find this in you house.cpp
Code:
void House::updateDoorDescription() const
under it you will find this
Code:
    std::ostringstream ss;
    if (owner != 0) {
        ss << "It belongs to house '" << houseName << "'. " << ownerName << " owns this house.";
    } else {
        ss << "It belongs to house '" << houseName << "'. Nobody owns this house.";

        const int32_t housePrice = g_config.getNumber(ConfigManager::HOUSE_PRICE);
        if (housePrice != -1) {
            ss << " It costs " << (houseTiles.size() * housePrice) << " gold coins.";
        }
    }
change it to this :
Code:
    std::ostringstream ss;
    if (owner != 0) {
        ss << "It belongs to house '" << houseName << "'. " << ownerName << " owns this house.";
    } else {
        ss << "It belongs to house '" << houseName << "'. Nobody owns this house.";

        const int
        const int32_t housePrice = g_config.getNumber(ConfigManager::HOUSE_PRICE) / 1000000);
        if (housePrice != -1) {
            ss << " It costs " << (houseTiles.size() * housePrice) << " golden nuggets.";
        }
    }
if you want to currency to increase just increase 00 after in the number after (ConfigManager::HOUSE_PRICE)
 
Code:
1>c:\users\egzon\vcpkg\forgottenserver\src\house.cpp(114): warning C4114: same type qualifier used more than once
1>c:\users\egzon\vcpkg\forgottenserver\src\house.cpp(114): error C2734: 'int32_t': 'const' object must be initialized if not 'extern'
1>c:\users\egzon\vcpkg\forgottenserver\src\house.cpp(114): error C2146: syntax error: missing ';' before identifier 'housePrice'
1>c:\users\egzon\vcpkg\forgottenserver\src\house.cpp(114): error C2065: 'housePrice': undeclared identifier
1>c:\users\egzon\vcpkg\forgottenserver\src\house.cpp(114): error C2059: syntax error: ')'
1>c:\users\egzon\vcpkg\forgottenserver\src\house.cpp(115): error C2065: 'housePrice': undeclared identifier
1>c:\users\egzon\vcpkg\forgottenserver\src\house.cpp(116): error C2065: 'housePrice': undeclared identifier

Line : 114 to 116 @Shadow_
Code:
      const int32_t housePrice = g_config.getNumber(ConfigManager::HOUSE_PRICE) / 1000000);
        if (housePrice != -1) {
            ss << " It costs " << (houseTiles.size() * housePrice) << " golden nuggets.";
        }
    }
 
sorry forgot a bracket
Code:
      const int32_t housePrice = (g_config.getNumber(ConfigManager::HOUSE_PRICE) / 1000000);
        if (housePrice != -1) {
            ss << " It costs " << (houseTiles.size() * housePrice) << " golden nuggets.";
        }
    }
should work properly now
 
Solution
Back
Top