Of course, and when you pass, the tree appears again.
function onUse(cid, item, fromPosition, itemEx, toPosition)
queststatus = getPlayerStorageValue(cid, 12900)
if queststatus < 1 then
if item.uid == 12901 then
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You have found a Demon Legs.")
doPlayerAddItem(cid, 2495, 1)
elseif item.uid == 12902 then
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You have found a Rainbow Shield.")
doPlayerAddItem(cid, 8905, 1)
elseif item.uid == 12903 then
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You have found a Spellbook of Dark Mysteries.")
doPlayerAddItem(cid, 8918, 1)
elseif item.uid == 12904 then
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You have found a Royal Crossbow.")
doPlayerAddItem(cid, 8851, 1)
end
doPlayerSetStorageValue(cid, 12900, 1)
else
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "It is empty.")
end
return true
end
this is a short version of demonoakchests.lua its half the amount of lines
local t = {
[12901] = {msg = 'Demon Legs', item = 2495},
[12902] = {msg = 'Rainbow Shield', item = 8905},
[12903] = {msg = 'Spellbook of Dark Mysteries', item = 8918},
[12904] = {msg = 'Royal Crossbow', item = 8851},
}
function onUse(cid, item, fromPosition, itemEx, toPosition)
if getPlayerStorageValue(cid, 12900) < 1 then
if t[item.uid] then
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, 'You have found a '.. t[item.uid].msg)
doPlayerAddItem(cid, t[item.uid].item, 1)
end
doPlayerSetStorageValue(cid, 12900, 1)
else
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, 'It is empty.')
end
return true
end
this is a shorter version of demonoakchests.lua its more half the amount of lines
Lua:local t = { [12901] = {msg = 'Demon Legs', item = 2495}, [12902] = {msg = 'Rainbow Shield', item = 8905}, [12903] = {msg = 'Spellbook of Dark Mysteries', item = 8918}, [12904] = {msg = 'Royal Crossbow', item = 8851}, } function onUse(cid, item, fromPosition, itemEx, toPosition) if getPlayerStorageValue(cid, 12900) < 1 then if t[item.uid] then doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, 'You have found a '.. t[item.uid].msg) doPlayerAddItem(cid, t[item.uid].item, 1) end doPlayerSetStorageValue(cid, 12900, 1) else doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, 'It is empty.') end return true end
can be shortest tho (getItemNameById(itemid) / getItemName(uid)) + a lua string caps function
this is a shorter version of demonoakchests.lua its more half the amount of lines
Lua:local t = { [12901] = {msg = 'Demon Legs', item = 2495}, [12902] = {msg = 'Rainbow Shield', item = 8905}, [12903] = {msg = 'Spellbook of Dark Mysteries', item = 8918}, [12904] = {msg = 'Royal Crossbow', item = 8851}, } function onUse(cid, item, fromPosition, itemEx, toPosition) if getPlayerStorageValue(cid, 12900) < 1 then if t[item.uid] then doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, 'You have found a '.. t[item.uid].msg) doPlayerAddItem(cid, t[item.uid].item, 1) end doPlayerSetStorageValue(cid, 12900, 1) else doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, 'It is empty.') end return true end
can be shortest tho (getItemNameById(itemid) / getItemName(uid)) + a lua string caps function
[19/06/2010 22:34:35] data/npc/scripts/oldrak.lua
[19/06/2010 22:34:35] Description:
[19/06/2010 22:34:35] data/npc/scripts/oldrak.lua:52: attempt to index global 'npcHandler' (a nil value)
[19/06/2010 22:34:35] [Warning - NpcScript::NpcScript] Cannot load script: data/npc/scripts/oldrak.lua
Code:[19/06/2010 22:34:35] data/npc/scripts/oldrak.lua [19/06/2010 22:34:35] Description: [19/06/2010 22:34:35] data/npc/scripts/oldrak.lua:52: attempt to index global 'npcHandler' (a nil value) [19/06/2010 22:34:35] [Warning - NpcScript::NpcScript] Cannot load script: data/npc/scripts/oldrak.lua
I'm getting this, any idea how to fix it?
What distro are you using?
Edit:
The old npc script was working good but i've updated it, now is more compatible with another npc systems. It should work for you now
work for tfs 0.4?
The gravestone is not working for me , no clue why...
It has the correct Unique ID ingame and in Actions.xml.
Also after a player died he cannot enter demon oak again.
All the rest works, any idea how fix this ?
Hi, I have a problem with the script for the Demon Oak Quest. So when I go to do the Demon Oak, the tree - 'Dead Tree' writes: 'wait until my nick finish the quest' may know what's going on? Because I do not really understand
I would be very grateful for your help