0 then for i = 1, table.maxn(items) do str = str .. items[i][2] .. ' ' .. getItemNameById(items[i][1]) if i ~= table.maxn(items) then str = str .. ', ' end end end return str end function getMonsterFromList(monster) local str = '' if #monster > 0 then for i = 1, #monster do str = str .. monster[i] if i ~= #monster then str = str .. ', ' end end end return str end function GiveRewardsTask(cid, items) local backpack = doPlayerAddItem(cid, 1999, 1) -- backpackID for _, i_i in ipairs(items) do local item, amount = i_i[1],i_i[2] if isItemStackable(item) or amount == 1 then doAddContainerItem(backpack, item, amount) else for i = 1, amount do doAddContainerItem(backpack, item, 1) end end end end ]]> = v.level_min and getPlayerStorageValue(cid, v.storage) < v.count then local amount = getPlayerStorageValue(cid, v.storage) <= 0 and 0 or getPlayerStorageValue(cid, v.storage) str = str.."[+] "..v.name .." Task [+]\n\nMonster Count: ["..amount.."/"..v.count.."]\n\nMonsters Killing: "..getMonsterFromList(v.monsters_list)..".\n\nLevel: "..v.level_min.." or More.\n\nCan repeat: ".. ( v.can_repeat == true and "yes" or "no" )..".\n\nRewards: ".. (table.maxn(v.reward) > 0 and getItemsFromList(v.reward) or "Nothing") ..".\n\nExp: ".. (v.exp > 0 and v.exp or 0) ..".\n\nMoney: ".. (v.money > 0 and v.money or 0) ..".\n\n" end end return doShowTextDialog(cid, 8983, str) ]]> = info.level_min then local ret = getPlayerStorageValue(cid, info.storage) <= 0 and 0 or getPlayerStorageValue(cid, info.storage) if ret < info.count then setPlayerStorageValue(cid, info.storage, getPlayerStorageValue(cid, info.storage) <= 0 and 1 or (getPlayerStorageValue(cid, info.storage)+1)) if getPlayerStorageValue(cid, automatic_task_config.defeat_storage) <= 0 and getPlayerStorageValue(cid, info.storage) < info.count then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE,"[Task System] defeated Total [" .. getPlayerStorageValue(cid, info.storage) .. "/" .. info.count .. "] da Task do " .. info.name .. ".") end if getPlayerStorageValue(cid, info.storage) >= info.count then if info.exp > 0 then doPlayerAddExp(cid, info.exp) str = str.."".. (str == "" and "" or ", ") .." "..info.exp.." de exp" end if info.money > 0 then doPlayerAddMoney(cid, info.money) str = str.."".. (str == "" and "" or ", ") ..""..info.money.." gps" end if table.maxn(info.reward) > 0 then GiveRewardsTask(cid, info.reward) str = str.."".. (str == "" and "" or ", ") ..""..getItemsFromList(info.reward) end doPlayerSendTextMessage(cid, automatic_task_config.reward_type, "[Task System] Voce completou a "..info.name.." Task. Obrigado pela sua ajuda!! Suas Recompensas: "..(str == "" and "nenhuma" or str)) if info.can_repeat == true then setPlayerStorageValue(cid, info.storage, 0) end end end end end end return true end]]>