SOLVED:
Thanks to Xeraphus for his expertise.
This is the working hota.lua
Distro: OTServ 0.6.4 STABLE
Client: 8.6
Problem:
I've edited my gold changer script to work with the helmet of the ancients, but nothing happens when I right-click the items.
Scripts:
hota.lua
actions.xml
EDIT:
Noticed, I've added "== 1" to the itemid (what a tard, lol)
Even so, I don't really know how to solve this puzzle since "count" didn't change anything.
Thanks to Xeraphus for his expertise.
This is the working hota.lua
Code:
local HOTA_FINISHED = 2343
local HOTA_UNFINISHED = 2342
local ANCIENT_GEM = 2363
function onUse(cid, item, fromPosition, itemEx, toPosition)
if(getPlayerFlagValue(cid, PLAYERFLAG_CANNOTPICKUPITEM)) then
return false
end
if (item.itemid == HOTA_UNFINISHED) and (getPlayerItemCount(cid, ANCIENT_GEM) >= 1) then
doPlayerRemoveItem(cid, ANCIENT_GEM, 1)
doTransformItem(item.uid, HOTA_FINISHED, 1)
doSendMagicEffect(fromPosition, CONST_ME_MAGIC_RED)
doPlayerSendTextMessage(cid, 19, "The ancient helmet is complete!")
elseif (item.itemid == HOTA_FINISHED) then
doTransformItem(item.uid, HOTA_UNFINISHED, 1)
doPlayerAddItem(cid, ANCIENT_GEM, 1)
doSendMagicEffect(fromPosition, CONST_ME_POFF)
end
return true
end
Distro: OTServ 0.6.4 STABLE
Client: 8.6
Problem:
I've edited my gold changer script to work with the helmet of the ancients, but nothing happens when I right-click the items.
Scripts:
hota.lua
Code:
local HOTA_FINISHED = 2343
local HOTA_UNFINISHED = 2342
local ANCIENT_GEM = 2363
function onUse(cid, item, fromPosition, itemEx, toPosition)
if(getPlayerFlagValue(cid, PLAYERFLAG_CANNOTPICKUPITEM)) then
return false
end
if(HOTA_UNFINISHED and ANCIENT_GEM == 1) then
doRemoveItem(cid, HOTA_UNFINISHED, 1)
doRemoveItem(cid, ANCIENT_GEM, 1)
doPlayerAddItem(cid, HOTA_FINISHED, 1)
doSendMagicEffect(frompos, CONST_ME_MAGIC_RED)
doPlayerSendTextMessage(cid, 180, "The ancient helmet is complete!")
elseif(HOTA_FINISHED == 1) then
doRemoveItem(cid, HOTA_FINISHED, 1)
doPlayerAddItem(cid, HOTA_UNFINISHED, 1)
doPlayerAddItem(cid, ANCIENT_GEM, 1)
doSendMagicEffect(frompos, CONST_ME_POFF)
end
return true
end
actions.xml
Code:
<action itemid="2343" script="custom/hota.lua"/>
<action itemid="2342" script="custom/hota.lua"/>
<action itemid="2363" script="custom/hota.lua"/>
EDIT:
Noticed, I've added "== 1" to the itemid (what a tard, lol)
Even so, I don't really know how to solve this puzzle since "count" didn't change anything.
Last edited: