Hey Otland!
I have huge problem with gold nuggets. The convertion works perfectly to me, from cc to gold nuggets, but npc can't see the value of that nuggets, and key="worth" in items.xml is not anymore in TFS 1.2 . Anyone know how to make gold nuggets visible to npc?
Thanks for reply, and best regards!
My changegold.lua
I have huge problem with gold nuggets. The convertion works perfectly to me, from cc to gold nuggets, but npc can't see the value of that nuggets, and key="worth" in items.xml is not anymore in TFS 1.2 . Anyone know how to make gold nuggets visible to npc?
Thanks for reply, and best regards!
My changegold.lua
Lua:
local config = {
[ITEM_GOLD_COIN] = {changeTo = ITEM_PLATINUM_COIN},
[ITEM_PLATINUM_COIN] = {changeBack = ITEM_GOLD_COIN, changeTo = ITEM_CRYSTAL_COIN},
[ITEM_CRYSTAL_COIN] = {changeBack = ITEM_PLATINUM_COIN, changeTo = ITEM_GOLD_NUGGET},
[ITEM_GOLD_NUGGET] = {changeBack = ITEM_CRYSTAL_COIN}
}
function onUse(player, item, fromPosition, target, toPosition, isHotkey)
local coin = config[item:getId()]
if coin.changeTo and item.type == 100 then
item:remove()
player:addItem(coin.changeTo, 1)
elseif coin.changeBack then
item:remove(1)
player:addItem(coin.changeBack, 100)
else
return false
end
return true
end