Zorenia
Hoster of Zorenia
Guys..!
got some problems with the Demon oak chest reward.
Got 4 chests:
- Demon legs (uid= 12901)
- Rainbow shield (uid= 12902)
- Royal crossbow (uid=12903)
- Spellbook of dark~ (uid= 12904)
The problem is; if I choose demon legs or Rainbow shields everything works fine. But.. if I choose royal crossbow I get a demon legs, and if I choose for the spellbook I get a Rainbow shield. It's strange but I set on none script that on that id's (12903 and 12904) you should get a demon legs or rainbow shield. Maybe I missed.. a little detail, should be easy to fix. But I can't find it!
Chest script:
actions:
got some problems with the Demon oak chest reward.
Got 4 chests:
- Demon legs (uid= 12901)
- Rainbow shield (uid= 12902)
- Royal crossbow (uid=12903)
- Spellbook of dark~ (uid= 12904)
The problem is; if I choose demon legs or Rainbow shields everything works fine. But.. if I choose royal crossbow I get a demon legs, and if I choose for the spellbook I get a Rainbow shield. It's strange but I set on none script that on that id's (12903 and 12904) you should get a demon legs or rainbow shield. Maybe I missed.. a little detail, should be easy to fix. But I can't find it!
Chest script:
Lua:
function onUse(cid, item, fromPosition, itemEx, toPosition)
local chest = {
rewards = {
[12901] = 2495, — Demon Legs
[12902] = 8905, — Rainbow Shield
[12904] = 8918, — Spellbook of Dark Mysteries
[12903] = 8851 — Royal Crossbow
},
storageId = 50090
}
if chest.rewards[item.uid] ~= nil then
if getPlayerStorageValue(cid, chest.storageId) == -1 then
doPlayerSendTextMessage(cid,22,”You have found a “.. getItemNameById(chest.rewards[item.uid]) ..”.”)
doPlayerAddItem(cid, chest.rewards[item.uid], 1)
setPlayerStorageValue(cid, chest.storageId, 1)
else
doPlayerSendTextMessage(cid,22,”It is empty.”)
end
end
return true
end
actions:
Lua:
<action uniqueid="12901" event="script" value="quests/demonoakchest2.lua" /> — Demon Legs —
<action uniqueid="12902" event="script" value="quests/demonoakchest2.lua" /> /> — Rainbow Shield —
<action uniqueid="12904" event="script" value="quests/demonoakchest2.lua" /> /> — Spellbook of Dark Mysteries —
<action uniqueid="12903" event="script" value="quests/demonoakchest2.lua" /> /> — Royal Crossbow —