Code:
local chests =
{
[1002] = {prize = 2087}
}
local status = 12346 -- Storage for quest
local questLevel = 30 -- Level to open chest
function onUse(cid, item, fromPosition, itemEx, toPosition)
local name = getItemNameById(chests[item.uid].prize)
local questStatus = getPlayerStorageValue(cid, status)
local playerPos = getCreaturePosition(cid)
if questStatus == 1 then
doPlayerSendTextMessage(cid,22, "You have already chosen your reward.")
return TRUE
end
if getPlayerLevel(cid) >= questLevel then
doPlayerAddItem(cid, chests[item.uid].prize, 1)
setPlayerStorageValue(cid, status, 1)
doSendMagicEffect(playerPos, CONST_ME_GIFT_WRAPS)
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You have found a ".. name ..".")
else
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You must be atleast level ".. questLevel .." to open this chest.")
end
return TRUE
end
This iy my questscript now and could anyone rescript it so that the wooden key which I receive has the action ID 2000?
And does anyone know what the "[1002]" in the begin of the script means?
Thank you for the reading