Tworzymy plik "DracoyleStatue.lua" w folderze "actions/scripts/tools"
DracoyleStatue.lua
Code:
local changeStatue = {
[9949] = {9948},
}
function onUse(cid, item, fromPosition, itemEx, toPosition)
if changeStatue[itemEx.itemid] ~= nil then
local newId = changeStatue[itemEx.itemid][math.random(#changeStatue[itemEx.itemid])]
doTransformItem(itemEx.uid,newId)
doPlayerSendTextMessage(cid,MESSAGE_INFO_DESCR,"You change a "..getItemNameById(newId))
end
return FALSE
end
W pliku "actions.xml" w folderze "actions" dodajemy :
actions.xml
Code:
<action itemid="2149" event="script" value="tools/DracoyleStatue.lua"/>