local t = {
[CONST_SLOT_AMMO] = {11111}, --- change items id
}
function onThink()
for _, cid in ipairs(getPlayersOnline()) do
local has = true
for slot, ids in pairs(t) do
if not table.find(ids, getPlayerSlotItem(cid, slot).itemid) then
has = false
break
end
end
if has and getCreatureStorage(cid, 359453) == -1 then
setPlayerStorageValue(cid, 145213, getPlayerStorageValue(cid, 145213) +20)
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Default bonus: your fire attack get increased by 20%.")
doSendMagicEffect(getCreaturePos(cid),1)
setPlayerStorageValue(cid, 359453, 1)
elseif has == false and getCreatureStorage(cid, 359453) == 1 then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Default bonus effect has been lost.")
setPlayerStorageValue(cid, 145213, getPlayerStorageValue(cid, 145213) - 20)
doSendMagicEffect(getCreaturePos(cid),2)
setPlayerStorageValue(cid, 359453, -1)
end
end
return true
end