• 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!

Help With House price

hucko

Special Order
Joined
May 6, 2011
Messages
79
Reaction score
1
Hey otlanders,

i want to change the price of houses from XXXX gold coin to XX gold nugget

which crystal worth " 10000"
and gold ingot " 1000000 "
and Gold Nugget "100000000 " <<

and about the price in Config,

houseRentAsPrice = true
housePriceAsRent = false
housePriceEachSquare = 100000000 -- it mean 1 gold nugget ? am i right ? --

and about the source i changed it from gold coin to gold nugget but i found that the house will bought by XXXXXXXX gns
 
To edit the methods for house rent and pricing, you need to edit the source. Step one would be to compile a source, then you can start playing around. This forum is crawling of information concerning source editing.

I wish all the luck
Ignazio
 
I usually try to go to the source of the problem, in this case; where do I find the housePriceEachSquare variable in the source, and find my way through there. Why don't you tell me what TFS version you are using, and I'll see if I can help you out.

Ignazio
 
it's TFS 0.3.6 :D

i found this line .. sprintf(houseDescription, "It belongs to %s '%s'. Nobody owns this %s. It costs %d gold coins.", tmp.c_str(), name.c_str(), tmp.c_str(), price);

but after i change it from Gold Coin to Gold Nugget ,

19:21 You see a closed door.
It belongs to house 'Unnamed House #13'. Nobody owns this house. It costs 510065408 gold nuggets.

and if i changed in config to 100 it's show's 91 gold nuggets but it took like 91 gold or something
 
Last edited by a moderator:
I found they use an item attribute called "worth" as money algorithm. I suggest trying to add this worth attribute in the items.xml for nugget.

Code:
    <item id="2160" article="a" name="crystal coin" plural="crystal coins">
        <attribute key="weight" value="10" />
        <attribute key="worth" value="10000" />
    </item>
Code:
    <item id="2157" article="a" name="gold nugget" plural="gold nuggets">
        <attribute key="weight" value="10" />
        <attribute key="worth" value="1000000" />
    </item>

^ For instance, it might work doing that soley.

Ignazio
 
Yea i know dude i made it before but you write 100cc = 1 gold nuggets :D

i making 100 cc = 1 gold ingot
100 gold ingot = 1 gold nugget ;)

which crystal worth " 10000"
and gold ingot " 1000000 "
and Gold Nugget "100000000 " <<

and about the price in Config,

houseRentAsPrice = true
housePriceAsRent = false
housePriceEachSquare = 100000000 -- it mean 1 gold nugget ? am i right ? --

and about the source i changed it from gold coin to gold nugget but i found that the house will bought by XXXXXXXX gns
 
Last edited by a moderator:
Oh, I seem to have misinterpret your intentions. So you simply want to reduce the amount of zero's in the configuration file? Try this;

Find
Code:
m_confNumber[HOUSE_PRICE] = getGlobalNumber("housePriceEachSquare", 1000);

Replace with
Code:
m_confNumber[HOUSE_PRICE] = getGlobalNumber("housePriceEachSquare", 1000) * 100000000;

I hope I understood correctly.

Ignazio
 
20:12 You see a closed door.
It belongs to house 'Unnamed House #5'. Nobody owns this house. It costs -1660092416 gold nuggets.

housePriceEachSquare = 100000000 in my config.lua << shall be reduce now ?>
 
21:39 You see a closed door.
It belongs to house 'Unnamed House #13'. Nobody owns this house. It costs 510065408 gold nugget.
ItemID: [1253].
Position: [X: 1000] [Y: 1008] [Z: 7].



That Mean 91 nugget ..

I want to to be like this :)


21:39 You see a closed door.
It belongs to house 'Unnamed House #13'. Nobody owns this house. It costs 91 gold nugget. instead of 510065408 gold nugget.

there is something wrong too
if you had 9 gn and 100 platinum you can buy this house :(

there is way ? to fix
 
is that correct function ?

Code:
function onUse(cid, item, fromPosition, itemEx, toPosition)
    if item.itemid == ITEM_GOLD_COIN and item.type == ITEMCOUNT_MAX then --Gold Coin to Platinum Coin
        doChangeTypeItem(item.uid, item.type - item.type)
        doPlayerAddItem(cid, ITEM_PLATINUM_COIN, 1)
        doSendAnimatedText(fromPosition, "$", TEXTCOLOR_LIGHTBLUE)
    elseif item.itemid == ITEM_PLATINUM_COIN and item.type == ITEMCOUNT_MAX then --Platinum Coin to Crystal Coin
        doChangeTypeItem(item.uid, item.type - item.type)
        doPlayerAddItem(cid, ITEM_CRYSTAL_COIN, 1)
        doSendAnimatedText(fromPosition, "$", TEXTCOLOR_TEAL)
    elseif item.itemid == ITEM_PLATINUM_COIN and item.type < ITEMCOUNT_MAX then --Platinum Coin to Gold Coin
        doChangeTypeItem(item.uid, item.type - 1)
        doPlayerAddItem(cid, ITEM_GOLD_COIN, ITEMCOUNT_MAX)
        doSendAnimatedText(fromPosition, "$", TEXTCOLOR_YELLOW)
    elseif item.itemid == ITEM_CRYSTAL_COIN and item.type < ITEMCOUNT_MAX then --Crystal Coin to Platinum Coin
        doChangeTypeItem(item.uid, item.type - 1)
        doPlayerAddItem(cid, ITEM_PLATINUM_COIN, ITEMCOUNT_MAX)
        doSendAnimatedText(fromPosition, "$", TEXTCOLOR_LIGHTBLUE)
    elseif item.itemid == ITEM_CRYSTAL_COIN and item.type == ITEMCOUNT_MAX then --Crystal Coin to Ingot
        doChangeTypeItem(item.uid, item.type - item.type)
        doPlayerAddItem(cid, 9971,1)
        doSendAnimatedText(fromPosition, "$", TEXTCOLOR_YELLOW)
    elseif item.itemid == 9971 and item.type < ITEMCOUNT_MAX then --Ingot to Crystal Coin
        doChangeTypeItem(item.uid, item.type - 1)
        doPlayerAddItem(cid, ITEM_CRYSTAL_COIN, ITEMCOUNT_MAX)
        doSendAnimatedText(fromPosition, "$", TEXTCOLOR_TEAL)
    elseif item.itemid == 9971 and item.type == ITEMCOUNT_MAX then --Ingot Coin to Nugget
        doChangeTypeItem(item.uid, item.type - item.type)
        doPlayerAddItem(cid, 2157,1)
        doSendAnimatedText(fromPosition, "$", 204)
    elseif item.itemid == 2157 and item.type < ITEMCOUNT_MAX then --Nugget to Ingot
        doChangeTypeItem(item.uid, item.type - 1)
        doPlayerAddItem(cid, 9971, ITEMCOUNT_MAX)
        doSendAnimatedText(fromPosition, "$", TEXTCOLOR_YELLOW)
      else
        return FALSE
    end
    return TRUE
end
 
try
Code:
local ITEM = {
    ingtcc = 9971,
    nugtoing = 2157
}
function onUse(cid, item, fromPosition, itemEx, toPosition)
    if item.itemid == ITEM_GOLD_COIN and item.type == ITEMCOUNT_MAX then --Gold Coin to Platinum Coin
        doChangeTypeItem(item.uid, item.type - item.type)
        doPlayerAddItem(cid, ITEM_PLATINUM_COIN, 1)
        doSendAnimatedText(fromPosition, "$", TEXTCOLOR_LIGHTBLUE)
    elseif item.itemid == ITEM_PLATINUM_COIN and item.type == ITEMCOUNT_MAX then --Platinum Coin to Crystal Coin
        doChangeTypeItem(item.uid, item.type - item.type)
        doPlayerAddItem(cid, ITEM_CRYSTAL_COIN, 1)
        doSendAnimatedText(fromPosition, "$", TEXTCOLOR_TEAL)
    elseif item.itemid == ITEM_PLATINUM_COIN and item.type < ITEMCOUNT_MAX then --Platinum Coin to Gold Coin
        doChangeTypeItem(item.uid, item.type - 1)
        doPlayerAddItem(cid, ITEM_GOLD_COIN, ITEMCOUNT_MAX)
        doSendAnimatedText(fromPosition, "$", TEXTCOLOR_YELLOW)
    elseif item.itemid == ITEM_CRYSTAL_COIN and item.type < ITEMCOUNT_MAX then --Crystal Coin to Platinum Coin
        doChangeTypeItem(item.uid, item.type - 1)
        doPlayerAddItem(cid, ITEM_PLATINUM_COIN, ITEMCOUNT_MAX)
        doSendAnimatedText(fromPosition, "$", TEXTCOLOR_LIGHTBLUE)
    elseif item.itemid == ITEM_CRYSTAL_COIN and item.type == ITEMCOUNT_MAX then --Crystal Coin to Ingot
        doChangeTypeItem(item.uid, item.type - item.type)
        doPlayerAddItem(cid, 9971,1)
        doSendAnimatedText(fromPosition, "$", TEXTCOLOR_YELLOW)
    elseif item.itemid == ITEM.ingtcc and item.type < ITEMCOUNT_MAX then
        doChangeTypeItem(item.uid, item.type - 1)
        doPlayerAddItem(cid, 2157, 1)
        doSendAnimatedText(fromPosition, "$", TEXTCOLOR_YELLOW)
    elseif item.itemid == ITEM.ingtcc and item.type < ITEMCOUNT_MAX then
        doChangeTypeItem(item.uid, item.type - 1)
        doPlayerAddItem(cid, 2157, 1)
        doSendAnimatedText(fromPosition, "$", TEXTCOLOR_YELLOW)
    elseif item.itemid == ITEM.nugtoing and item.type == ITEMCOUNT_MAX then
        doChangeTypeItem(item.uid, item.type - 1)
        doPlayerAddItem(cid, ITEM.ingtcc,ITEMCOUNT_MAX)
        doSendAnimatedText(fromPosition, "$", TEXTCOLOR_YELLOW)
        return FALSE
    end
    return TRUE
end

actions.xml
Code:
    <!-- Change gold -->
    <action itemid="9971" event="script" value="other/changegold.lua"/>
    <action itemid="2157" event="script" value="other/changegold.lua"/>
 
i think my lua is perfect one .. you can't change from gold nugget to ingot in your lua ..

but that's not the problem ..

i want to change

06:15 You see a closed door.
It belongs to house 'Unnamed House #5'. Nobody owns this house. It costs 1660092416 gold coins.

To


06:15 You see a closed door.
It belongs to house 'Unnamed House #5'. Nobody owns this house. It costs 16 gold nuggets.

Any Help ,@[URL='http://otland.net/members/limos.88909/']Limos[/URL] ?
 
Cant you use:

Code:
sprintf(houseDescription, "It belongs to %s '%s'. Nobody owns this %s. It costs (%d / 1000000) golden nuggets.", tmp.c_str(), name.c_str(), tmp.c_str(), price);

and

Code:
housePriceEachSquare = 100000000
 
now that's happen
Code:
18:00 You see a closed door.
It belongs to house 'Unnamed House #13'. Nobody owns this house. It costs (510065408 / 1000000) golden nuggets.
ItemID: [1253].
Position: [X: 1000] [Y: 1008] [Z: 7].

Funny xD
i discovered something too ..

If players have more than 21 stacks of nuggets some features won't work anymore! It'll error out with 'You don't have enough money or giving the item you want for free ..
 
Back
Top