Postado Junho 4, 2012 12 anos Bom, tenho este script de task mas queria acrescentar nele apenas 1 coisa. Quando terminar todas as tasks, ganhar mais uma Storage (100). Vlw darei rep_ Citar tasktabble = { ["rat"] = {storage_start = 200201, storage = 91001,count = 105,exp = 1000,reward = {{2160,1},{2152,20}}}, ["rotworm"] = {storage_start = 200202, storage = 91002,count = 55,exp = 1000,reward = {{2160,1},{2152,20}}} } function CheckTask(cid) for k, v in pairs(tasktabble) do if getPlayerStorageValue(cid,v.storage_start) >= 1 then return true end end return false end function finisheAllTask(cid) local reward = {{2000,1},{2160,20}} local x = true for k, v in pairs(tasktabble) do if tonumber(getPlayerStorageValue(cid,v.storage)) then x = false end end if x == true then doBroadcastMessage('[Task Mission Complete] '..getCreatureName(cid)..' terminou todas as tasks!.') doAddItemsFromList(cid,reward) doItemSetAttribute(doPlayerAddItem(cid, 7369), "name", "Trofeu "..getCreatureName(cid).." completou todas as tasks.") end end function getItemsInContainerById(container, itemid) -- Function By Kydrai local items = {} if isContainer(container) and getContainerSize(container) > 0 then for slot=0, (getContainerSize(container)-1) do local item = getContainerItem(container, slot) if isContainer(item.uid) then local itemsbag = getItemsInContainerById(item.uid, itemid) for i=0, #itemsbag do table.insert(items, itemsbag) end else if itemid == item.itemid then table.insert(items, item.uid) end end end end return items end function doPlayerAddItemStacking(cid, itemid, quant) -- by mkalo local item = getItemsInContainerById(getPlayerSlotItem(cid, 3).uid, itemid) local piles = 0 if #item > 0 then for i,x in pairs(item) do if getThing(x).type < 100 then local it = getThing(x) doTransformItem(it.uid, itemid, it.type+quant) if it.type+quant > 100 then doPlayerAddItem(cid, itemid, it.type+quant-100) end else piles = piles+1 end end else return doPlayerAddItem(cid, itemid, quant) end if piles == #item then doPlayerAddItem(cid, itemid, quant) end end function getItemsFromList(items) -- by vodka local str = '' if table.maxn(items) > 0 then for i = 1, table.maxn(items) do str = str .. items[2] .. ' ' .. getItemNameById(items[1]) if i ~= table.maxn(items) then str = str .. ', ' end end end return str end function doAddItemsFromList(cid,items) -- by vodka if table.maxn(items) > 0 then for i = 1, table.maxn(items) do local count = items[2] while count > 0 do if isItemStackable(items[1]) then doPlayerAddItemStacking(cid, items[1], 1) else doPlayerAddItem(cid, items[1],1) end count = count - 1 end end end end function pairsByKeys(t, f) local a = {} for n in pairs(t) do table.insert(a, n) end table.sort(a, f) local i = 0 local iter = function () i = i + 1 if a == nil then return nil else return a, t[a] end end return iter end
Postado Junho 4, 2012 12 anos depois de: doAddItemsFromList(cid,reward) adicione: setPlayerStorageValue(cid, SUA STORAGE, 1) [*Ninguém será digno do sucesso se não usar suas derrotas para conquistá-lo.*] DISCORD: vodkart#6090
Participe da conversa
Você pode postar agora e se cadastrar mais tarde. Se você tem uma conta, faça o login para postar com sua conta.