local config = {
time = 20 -- 20 hours
}
local t = {
["rat"] = 44001 -- monster and storage
}
function onKill(cid, target, damage, flags)
local k = getCreatureName(target)
local m = t[string.lower(k)]
if( (damage == true or bit.band(flags, 1) == 1) and (isMonster(target) and m) ) then
if(getCreatureStorage(cid, m) < 0) then
doCreatureSetStorage(cid, m, 1)
addEvent(doCreatureSetStorage, config.time * 60 * 60 * 1000, m, -1)
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Congratulations! You have " .. config.time .. " hours to open the reward chest!")
end
end
return true
end