• TibiaFace

    Tibiaface | Una comunidad Open Tibia donde encontras : mapas, scripts, Otserver, npc y amigos etc ...

    .
    demo menumenu

    Afiliados



    Votar:

    [Sistema] Task System 4.0 (Task system + Daily Task System) (Tfs 0.3.7, 0.4.0 and OTX 2)

    Compartir:

    Ir a la página : 1, 2  Siguiente

    Ver el tema anterior Ver el tema siguiente Ir abajo  Mensaje (Página 1 de 2.)

    [Admin] God Maya

    [Admin] God Maya
    Administrador
    Administrador
    Hola usuarios de tibiaface

    Task system + Daily Task System

    eliminado:



    * Boss Room

    * Rank Task

    * Premios para los 10 primeros a terminar todas las tareas



    Añadido:



    * Sistema de tareas diarias (exclusivo del sistema de tareas diarias y puede conseguir 1x cada 24 horas, voy a explicar más adelante).

    * Task ahora es por progreso, usted no puede salir y volver, tendrá que terminar el task 1 para avanzar a la task 2, así sucesivamente.

    * Puntos de Tarea

    * Nivel para realizar el task

    * Nueva conversación que muestra una ventana de información sobre el nivel de la tarea, premios que recibirá, progreso, etc ...

    * Items para entrega (Si el jugador debe llevar algún elemento junto con la cantidad de monstruo muerto) para finalizar el task

    *Sistema de look Task (Varia de acordo com a sua quantidade de Task Points, podendo ficar por exemplo como "Huntsman", "Ranger", etc...(alterável)

    * Mods y npc más "clean", varias líneas removidas y el sistema es más rápido

    * Voy a añadir "secuencias de comandos adicionales" Cómo:

    -> Tile que sólo pasa quien tenga permiso después de finalizar determinada quest

    -> Npc de Boss Room para entrar y enfrentar al monstruo quien hizo determinada quest





    [+] Resumen del Task system + Daily Task System [+]



    El sistema de tareas : Es el sistema de tareas "original", que es matar cierta cantidad de monstruos (y entregar ciertos elementos <- es configurable), para recibir recompensas como Exp, dinero y objetos.



    Algunos cambios del simple task 3.0 al 4.0 fueron:



    [+] El sistema ahora es por progreso, eso quiere decir que usted tendrá que ir terminando la búsqueda para avanzar a la siguiente.

    [+] El sistema También recibió un cambio, haciendo que las Tasks precisen que el jugador tiene un nivel determinado

    [+] La tabla para la edición es más fácil, haciendo que añada o elimine monstruos con más tranquilidad, incluyendo cambios de las Rewards del Task.



    Daily Task System: É um sistema que desenvolvi para que os jogadores sempre estejam se comunicando com o npc de Task, no caso da Task Diaria, vária de acordo com o level do jogador, por exemplo:



    Los jugadores entre el nivel 6 al 49 pueden caer en uno de estos tres grupos Diarias: Orcos, Tarantulas o Wyverns

    Los jugadores entre nivel 50 al 79 pueden caer en uno de estos tres grupos Diarias: Dragones, Wailing Widows o Ancient Scarabs



    Y por ahí va, claro que usted podrá aumentar las Task Diarias dependiendo del nivel, hice 3 para cada nivel que es para publicar, pero todo eso usted puede aumentar! Dependiendo de su servidor.



    Y sí, se puede hacer la tarea "ORIGINAL" y "TASK "DIARIA" ao mesmo tempo! Ambas são distintas e possuem Rewards diferenciadas!



    En el caso de la Task diaria, teniendo en cuenta que usted comenzó a hacerla el día 08/01 a las 20:00 Hrs, usted tiene hasta el día 09/01 a las 20: 00Hrs para terminarla y recibir la recompensa, si termina antes , la tarea diaria sólo estará disponible para la repetición a partir de esta misma fecha 09/01 20:00 Hrs;



    [+] Si no termina a tiempo, no tiene problema, basta con esperar este horario y comenzar una nueva tarea.

    [+] Si empezó a Daily Task y terminó antes de esta fecha. pero por algún motivo olvidado de entregar y la misma pasó del plazo, no tiene importancia, si usted ha matado a todos los monstruos hasta el 09/01 20:00 Hrs, usted podrá entregar está Task en cualquier horario para recibir sus Rewards y comenzar un task a partir del momento en que usted entregó! ($·&&$%&$%&$&·$$%&).



    [+] Comandos adicionales [+]



    / task - Muestra la información de su tarea actual, como el nombre de la tarea, Level, Rewards, monstruos que usted puede matar, si tiene que entregar algún elemento junto, etc ...

    / task daily - Es básicamente muestra la misma información de la Task Principal, pero muestra también el plazo límite para la entrega del task.

    / task counter - Es un comando que ACTIVA o DESATIVA el contador de monstruos muertos en la task en su Channel.



    [+] Imágenes [+]



    Clic en este enlace para ver algunas imágenes de la tarea: [Tienes que estar registrado y conectado para ver este vínculo]


    [+] Instalacion del Sistema [+]

    Nos vamos a la carpeta Mods y copiamos cualquier archivo y renombramos por Simple Task.xml y pegamos esto dentro

    Código:
    <?xml version="1.0" encoding="ISO-8859-1"?>
    <mod name="Simple Task" version="4.0" author="Vodkart" contact="tibiaking.com" enabled="yes">
    <config name="task_func"><![CDATA[
    task_sys = {
       [1] = {name = "Trolls", start = 176201, monsters_list = {"Troll","Troll champion"}, level = 8, count = 40, points = 0, items = {}, reward = {}, exp = 2000, money = 2000},
       [2] = {name = "rotworms", start = 176202, monsters_list = {"rotworm","carrion worm","Rotworm Queen"}, level = 12, count = 50, points = 0, items = {}, reward = {}, exp = 2500, money = 3000},
       [3] = {name = "cyclops", start = 176203, monsters_list = {"cyclops","cyclops smith","cyclops drone"}, level = 19, count = 60, points = 0, items = {}, reward = {}, exp = 3000, money = 3000},
       [4] = {name = "Green Djinn", start = 176204, monsters_list = {"Green Djinn","Efreet"}, level = 23, count = 80, points = 1, items = {}, reward = {}, exp = 10000, money = 5000},
       [5] = {name = "Blue Djinn", start = 176205, monsters_list = {"Blue Djinn","Marid"}, level = 25, count = 80, points = 1, items = {}, reward = {}, exp = 10000, money = 5000},
       [6] = {name = "pirates", start = 176206, monsters_list = {"Pirate Marauder","Pirate Cutthroat","Pirate Buccaneer","Pirate Corsair"}, level = 30, count = 120, points = 2, items = {}, reward = {}, exp = 10000, money = 5000},
       [7] = {name = "Stone Golems", start = 176207, monsters_list = {"Stone Golem"}, level = 33, count = 130, points = 3, items = {}, reward = {}, exp = 12000, money = 7000},
       [8] = {name = "Carniphilas", start = 176208, monsters_list = {"carniphila"}, level = 36, count = 135, points = 3, items = {}, reward = {}, exp = 8000, money = 8000},
       [9] = {name = "Ice Golems", start = 176209, monsters_list = {"ice golem"}, level = 40, count = 150, points = 2, items = {}, reward = {}, exp = 12000, money = 8200},
       [10] = {name = "Wailing Widows", start = 176210, monsters_list = {"Wailing Widow"}, level = 42, count = 150, points = 3, items = {}, reward = {}, exp = 0, money = 0},
       [11] = {name = "Mutated Rats", start = 176211, monsters_list = {"Mutated Rat"}, level = 46, count = 170, points = 2, items = {}, reward = {}, exp = 8000, money = 8500},
       [12] = {name = "Dragons", start = 176212, monsters_list = {"dragon"}, level = 50, count = 120, points = 1, items = {}, reward = {}, exp = 9000, money = 9000},
       [13] = {name = "Necromancer" ,start = 176213, monsters_list = {"Necromancer"}, level = 60, count = 200, points = 3, items = {}, reward = {}, exp = 20000, money = 15000},
       [14] = {name = "Crystal Spiders" ,start = 176214, monsters_list = {"Crystal Spider"}, level = 63, count = 250, points = 3, items = {}, reward = {}, exp = 25000, money = 11000},
       [15] = {name = "Giant Spider" ,start = 176215, monsters_list = {"Giant Spider","The old widow"}, level = 80, count = 500, points = 0, items = {}, reward = {}, exp = 20000, money = 32000},
       [16] = {name = "Underwater Quaras" ,start = 176216, monsters_list = {"quara predator","quara constrictor","quara hydromancer","quara mantassin","quara pincher"}, level = 82, count = 550, points = 3, items = {}, reward = {}, exp = 22000, money = 15000},
       [17] = {name = "Underwater Quaras Scout" ,start = 176217, monsters_list = {"quara predator scout","quara constrictor scout","quara hydromancer scout","quara mantassin scout","quara pincher scout"}, level = 83, count = 600, points = 3, items = {}, reward = {}, exp = 25000, money = 18000},
       [18] = {name = "Hellspawn" ,start = 176218, monsters_list = {"Hellspawn"}, level = 85, count = 600, points = 4, items = {}, reward = {}, exp = 28000, money = 26000},
       [19] = {name = "Dragon Lords" ,start = 176219, monsters_list = {"Dragon lord"}, level = 88, count = 650, points = 3, items = {}, reward = {}, exp = 30000, money = 35000},
       [20] = {name = "Lizard Dragons" ,start = 176220, monsters_list = {"Lizard Chosen","Lizard Dragon Priest","Lizard High Guard","Lizard Legionnaire", "Lizard Zaogun"}, level = 90, count = 600, points = 4, items = {}, reward = {}, exp = 28000, money = 26000},
       [21] = {name = "Nightmare" ,start = 176221, monsters_list = {"Nightmare","nightmare scion"}, level = 95, count = 650, points = 2, items = {}, reward = {}, exp = 30000, money = 35000},
       [22] = {name = "Hydras" ,start = 176222, monsters_list = {"Hydra"}, level = 100, count = 700, points = 3, items = {}, reward = {}, exp = 40000, money = 40000},
       [23] = {name = "Serpent Spawn" ,start = 176223, monsters_list = {"Serpent Spawn"}, level = 103, count = 720, points = 4, items = {}, reward = {}, exp = 50000, money = 45000},
       [24] = {name = "Hellhounds" ,start = 176224, monsters_list = {"Hellhound"}, level = 107, count = 650, points = 2, items = {}, reward = {}, exp = 30000, money = 35000},
       [25] = {name = "Demons" ,start = 176225, monsters_list = {"Demon"}, level = 110, count = 666, points = 4, items = {}, reward = {}, exp = 66600, money = 66000}
    }
    daily_task = {
       [1] = {name = "Orcs" ,monsters_list = {"Orc Berserker","Orc Rider","Orc Leader","Orc Warlord"}, count = 100, points = 0, reward = {}, exp = 5000, money = 10000},
       [2] = {name = "TarantulaS" ,monsters_list = {"Tarantula"}, count = 120, points = 1, reward = {}, exp = 9000, money = 12000},
       [3] = {name = "Wyvern" ,monsters_list = {"Wyvern"}, count = 125, points = 2, reward = {}, exp = 9000, money = 15000},
       [4] = {name = "Dragons" ,monsters_list = {"Dragon","Dragon Hatchling"}, count = 150, points = 0, reward = {}, exp = 2000, money = 10000},
       [5] = {name = "Wailing Widows" ,monsters_list = {"Wailing Widows"}, count = 200, points = 1, reward = {}, exp = 20000, money = 25000},
       [6] = {name = "Ancient Scarabs" ,monsters_list = {"Ancient Scarab"}, count = 180, points = 5, reward = {}, exp = 22000, money = 18000},
       [7] = {name = "High Class Lizards" ,monsters_list = {"Corrupted Soul","Eternal Guardian","Lizard Chosen","Lizard Dragon Priest","Lizard High Guard","Lizard Legionnaire","Lizard Magistratus","Lizard Noble","Lizard Zaogun"}, count = 300, points = 3, reward = {}, exp = 50000, money = 60000},
       [8] = {name = "Mutated BatS" ,monsters_list = {"Mutated Bat"}, count = 260, points = 2, reward = {}, exp = 40000, money = 55000},
       [9] = {name = "Giant Spiders" ,monsters_list = {"Giant Spider"}, count = 350, points = 3, reward = {}, exp = 60000, money = 70000},
       [10] = {name = "Undead Dragons" ,monsters_list = {"Undead Dragon"}, count = 500, points = 3, reward = {{2173,1}}, exp = 90000, money = 120000},
       [11] = {name = "HydraS" ,monsters_list = {"Hydra"}, count = 600, points = 3, reward = {{2173,1}}, exp = 100000, money = 160000},
       [12] = {name = "Ghastly Dragons" ,monsters_list = {"Ghastly Dragon"}, count = 700, points = 3, reward = {{2173,1}}, exp = 130000, money = 200000}
    }
    task_sys_storages = {176601, 176602, 176603, 176604, 176605, 176606, 176607, 176608} -- task, points, count, daily task, daily count, daily time , daily start, contador
    function getTaskMission(cid)
       return getPlayerStorageValue(cid,task_sys_storages[1]) < 0 and 1 or getPlayerStorageValue(cid,task_sys_storages[1])
    end
    function getDailyTaskMission(cid)
       return getPlayerStorageValue(cid,task_sys_storages[4]) < 0 and 1 or getPlayerStorageValue(cid,task_sys_storages[4])
    end
    function getTaskPoints(cid)
       return getPlayerStorageValue(cid,task_sys_storages[2]) < 0 and 0 or getPlayerStorageValue(cid,task_sys_storages[2])
    end
    function doRandomDailyTask(cid)
       local t = {
          [{6,49}] = {1,3},
          [{50,79}] = {4,6},
          [{80,129}] = {7,9},
          [{130,math.huge}] = {10,12}
       }
       for a , b in pairs(t) do
          if getPlayerLevel(cid) >= a[1] and getPlayerLevel(cid) <= a[2] then
             return math.random(b[1], b[2])
          end
       end
       return 0
    end
    function GetRankTask(cid)
       local ranks = {
          [{1, 20}] = "Huntsman",
          [{21, 50}] = "Ranger",
          [{51, 100}] = "Big Game Hunter",
          [{101, 200}] = "Trophy Hunter",      
          [{201, math.huge}] = "Elite Hunter"
       }
       for v , r in pairs(ranks) do
          if getTaskPoints(cid) >= v[1] and getTaskPoints(cid) <= v[2] then
             return r
          end
       end
       return 0
    end
    function getItemsFromList(items)
       local str = ''
       if table.maxn(items) > 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 doRemoveItemsFromList(cid,items)
       local count = 0
       if table.maxn(items) > 0 then
          for i = 1, table.maxn(items) do
             if getPlayerItemCount(cid,items[i][1]) >= items[i][2] then
             count = count + 1 end
          end
       end
       if count == table.maxn(items) then
          for i = 1, table.maxn(items) do doPlayerRemoveItem(cid,items[i][1],items[i][2]) end
       else
          return false
       end
       return true
    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
    function isSummon(cid)
       if(not isCreature(cid)) then
          return false
       end
       return getCreatureMaster(cid) ~= cid
    end
    ]]></config>
    <event type="login" name="TaskLogin" event="script"><![CDATA[
    function onLogin(cid)
       registerCreatureEvent(cid, "KillTask")
       registerCreatureEvent(cid, "TaskLook")
       return true
    end]]></event>
    <talkaction words="/task;!task" event="buffer"><![CDATA[
    domodlib('task_func')
    param,task,daily = param:lower(), getTaskMission(cid), getDailyTaskMission(cid)
    if isInArray({"counter","contador"},param) then
       setPlayerStorageValue(cid, task_sys_storages[8], getPlayerStorageValue(cid, task_sys_storages[8]) <= 0 and 1 or 0)
       doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE,"[Task System] O contador foi "..(getPlayerStorageValue(cid, task_sys_storages[8]) <= 0 and "ativado" or "desativado")..".") return true
    elseif isInArray({"daily","diaria"},param) then
       if not daily_task[daily] or getPlayerStorageValue(cid, task_sys_storages[7]) <= 0 then
          doPlayerSendCancel(cid, "Desculpe, Mas você não está em nenhuma Daily Task.") return true
       elseif getPlayerStorageValue(cid, task_sys_storages[6]) - os.time() <= 0 and getPlayerStorageValue(cid, task_sys_storages[5]) < daily_task[daily].count then
          doPlayerSendCancel(cid,"Desculpe, Mas Você não terminou a Daily Task a tempo! Por favor volte ao npc e comece uma nova Daily Task!") return true
       end
       return doShowTextDialog(cid, 8983, "[->] CURRENT DAILY TASK INFO [<-]\n\nNome: "..daily_task[daily].name.."\nProgresso: ["..(getPlayerStorageValue(cid, task_sys_storages[5]) < 0 and 0 or getPlayerStorageValue(cid, task_sys_storages[5])).."/"..daily_task[daily].count.."]\nPrazo para entrega: "..os.date("%d %B %Y %X ", getPlayerStorageValue(cid,task_sys_storages[6])).."\nMonstros para caçar: "..getMonsterFromList(daily_task[daily].monsters_list).."\n\n[->] CURRENT TASK REWARDS [<-]\n\nMoney: "..(daily_task[daily].money > 0 and daily_task[daily].money or 0).."\nExperiencia: "..(daily_task[daily].exp > 0 and daily_task[daily].exp or 0).."\nTask Points: "..daily_task[daily].points.."\nItems: "..(#daily_task[daily].reward > 0 and getItemsFromList(daily_task[daily].reward) or "Nenhum item de recompensa")..".")
    end
    if not task_sys[task] or getPlayerStorageValue(cid, task_sys[task].start) <= 0 then
       doPlayerSendCancel(cid, "você não está em nenhuma task.") return true
    end
    return doShowTextDialog(cid, 8983, "-> CURRENT TASK ["..getTaskMission(cid).."/"..#task_sys.."] <-\n\nTask Name: "..task_sys[task].name.."\nTask Level: "..task_sys[task].level.."\nTask Progress: ["..(getPlayerStorageValue(cid, task_sys_storages[3]) < 0 and 0 or getPlayerStorageValue(cid, task_sys_storages[3])).."/"..task_sys[task].count.."]\nMonster To Hunt: "..getMonsterFromList(task_sys[task].monsters_list)..".\nItens Para Entrega: "..(#task_sys[task].items > 0 and getItemsFromList(task_sys[task].items) or "Nenhum")..".\n\n[->] CURRENT TASK REWARDS [<-]\n\nReward Money: "..(task_sys[task].money > 0 and task_sys[task].money or 0).."\nReward Experiencia: "..(task_sys[task].exp > 0 and task_sys[task].exp or 0).."\nReward Points: "..task_sys[task].points.."\nRedward Items: "..(#task_sys[task].reward > 0 and getItemsFromList(task_sys[task].reward) or "Nenhum item de recompensa")..".")
    ]]></talkaction>
    <event type="look" name="TaskLook" event="script"><![CDATA[
    domodlib('task_func')
    function onLook(cid, thing, position, lookDistance)
       if isPlayer(thing.uid) and getTaskPoints(thing.uid) > 0 then
          doPlayerSetSpecialDescription(thing.uid, "\n"..(getPlayerSex(thing.uid) == 0 and "She" or "He").. " is a "..GetRankTask(thing.uid))
       end   
       return true
    end]]></event>
    <event type="kill" name="KillTask" event="script"><![CDATA[
    domodlib('task_func')
    function onKill(cid, target)
       if isPlayer(cid) and isMonster(target) and not isSummon(target) then
          local t,daily = task_sys[getTaskMission(cid)], daily_task[getDailyTaskMission(cid)]
          if t and getPlayerStorageValue(cid, t.start) > 0 and isInArray(t.monsters_list, getCreatureName(target):lower()) and getPlayerStorageValue(cid, task_sys_storages[3]) < t.count then
             setPlayerStorageValue(cid, task_sys_storages[3], getPlayerStorageValue(cid, task_sys_storages[3]) < 0 and 1 or (getPlayerStorageValue(cid, task_sys_storages[3])+1))
             if getPlayerStorageValue(cid, task_sys_storages[8]) <= 0 and getPlayerStorageValue(cid, task_sys_storages[3]) < t.count then
                doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE,"[Task System] defeated Total [" .. getPlayerStorageValue(cid, task_sys_storages[3]) .. "/" .. t.count .. "] da Task do " .. t.name .. ".")
             end
             if getPlayerStorageValue(cid, task_sys_storages[3]) >= t.count then
                doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE,"[Task System] Parabéns! Você terminou a Task do "..t.name..", volte ao npc parece receber sua recompensa.")
             end
          end
          if daily and getPlayerStorageValue(cid, task_sys_storages[7]) > 0 and getPlayerStorageValue(cid, task_sys_storages[6]) - os.time() >= 0 and isInArray(daily.monsters_list, getCreatureName(target):lower()) and getPlayerStorageValue(cid, task_sys_storages[5]) < daily.count then
             setPlayerStorageValue(cid, task_sys_storages[5], getPlayerStorageValue(cid, task_sys_storages[5]) < 0 and 1 or (getPlayerStorageValue(cid, task_sys_storages[5])+1))
             if getPlayerStorageValue(cid, task_sys_storages[8]) <= 0 and getPlayerStorageValue(cid, task_sys_storages[5]) < daily.count then
                doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE,"[Daily Task System] defeated Total [" .. getPlayerStorageValue(cid, task_sys_storages[5]) .. "/" .. daily.count .. "] da Task do " .. daily.name .. ".")
             end
             if getPlayerStorageValue(cid, task_sys_storages[5]) >= daily.count then
                doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE,"[Daily Task System] Parabéns! Você terminou a Task do "..daily.name..", volte ao npc parece receber sua recompensa.")
             end
          end
       end
       return true
    end]]></event>
    </mod>

    ahora nos vamos a la carpeta data/npc/scrips copiamos cualquier archivo y renombramos por simple_task.lua y pegamos esto dentro

    Código:
    domodlib('task_func')
    local keywordHandler = KeywordHandler:new()
    local npcHandler = NpcHandler:new(keywordHandler)
    NpcSystem.parseParameters(npcHandler)
    local talkState = {}
    function onCreatureAppear(cid) npcHandler:onCreatureAppear(cid) end
    function onCreatureDisappear(cid) npcHandler:onCreatureDisappear(cid) end
    function onCreatureSay(cid, type, msg) npcHandler:onCreatureSay(cid, type, msg) end
    function onThink() npcHandler:onThink() end
    function creatureSayCallback(cid, type, msg)
       if(not npcHandler:isFocused(cid)) then
          return false
       end
       local talkUser,msg, str,rst = NPCHANDLER_CONVbehavior == CONVERSATION_DEFAULT and 0 or cid, msg:lower(),"",""
       local task,daily, hours = getTaskMission(cid),getDailyTaskMission(cid), 24
       if isInArray({"task","tasks","missao","mission"}, msg) then
          if task_sys[task] then
             if getPlayerStorageValue(cid, task_sys[task].start) <= 0 then
                if getPlayerLevel(cid) >= task_sys[task].level then
                   setPlayerStorageValue(cid, task_sys[task].start, 1)
                   npcHandler:say("[Task System] Parabéns, agora você está participando da Task do "..task_sys[task].name.." e deverá matar "..task_sys[task].count.." desta lista: "..getMonsterFromList(task_sys[task].monsters_list)..". "..(#task_sys[task].items > 0 and "Ah e por favor me traga "..getItemsFromList(task_sys[task].items).." para mim." or "").."" , cid)
                else
                   npcHandler:say("Desculpe, Mas você precisa alcançar level "..task_sys[task].level.." para poder participar da Task dos "..task_sys[task].name.."!", cid)
                end
             else
                npcHandler:say("Desculpe, Mas você atualmente está na task "..task_sys[task].name..". Você pode {entregar} caso já tenha terminado.", cid)
             end
          else
             npcHandler:say("Desculpe, Mas por enquanto não tenho mais nenhuma task para você!", cid)
          end
       elseif isInArray({"diaria","daili","daily","dayli","diario"}, msg) then
          if getPlayerStorageValue(cid, task_sys_storages[6]) - os.time() > 0 then
             npcHandler:say("Desculpe, você deve esperar até "..os.date("%d %B %Y %X ", getPlayerStorageValue(cid,task_sys_storages[6])).." para iniciar uma nova task diaria!", cid) return true
          elseif daily_task[daily] and getPlayerStorageValue(cid, task_sys_storages[5]) >= daily_task[daily].count then
             npcHandler:say("Desculpe, você tem task para {entregar} !", cid) return true
          end
          local r = doRandomDailyTask(cid)
          if r == 0 then
             npcHandler:say("Desculpe, mas você não tem level para completar nenhuma Task diaria.", cid) return true
          end
          setPlayerStorageValue(cid, task_sys_storages[4], r)
          setPlayerStorageValue(cid, task_sys_storages[6], os.time()+hours*3600)
          setPlayerStorageValue(cid, task_sys_storages[7], 1)
          setPlayerStorageValue(cid, task_sys_storages[5], 0)
          local dtask = daily_task[r]
          npcHandler:say("[Daily Task System] Parabéns, agora você está participando da Task Diaria do "..dtask.name.." e deverá matar "..dtask.count.." monstros desta lista: "..getMonsterFromList(dtask.monsters_list).." até "..os.date("%d %B %Y %X ", getPlayerStorageValue(cid,task_sys_storages[6]))..". Boa sorte!" , cid)
       elseif isInArray({"receber","reward","recompensa","report","reportar","entregar","entrega"}, msg) then
          local v, k = task_sys[task], daily_task[daily]
          if v then -- original task
             if getPlayerStorageValue(cid, v.start) > 0 then
                if getPlayerStorageValue(cid,task_sys_storages[3]) >= v.count then
                   if #v.items > 0 and not doRemoveItemsFromList(cid, v.items) then
                      npcHandler:say("Desculpe, Mas você também precisa entregar os itens desta lista: "..getItemsFromList(v.items), cid) return true
                   end
              if v.exp > 0 then doPlayerAddExp(cid, v.exp) str = str.."".. (str == "" and "" or ", ") .." "..v.exp.." de exp" end
                  if v.points > 0 then setPlayerStorageValue(cid, task_sys_storages[2], (getTaskPoints(cid)+v.points)) str = str.."".. (str == "" and "" or ", ") .." + "..v.points.."task points" end
                  if v.money > 0 then doPlayerAddMoney(cid, v.money) str = str.."".. (str == "" and "" or ", ") ..""..v.money.." gps" end
                  if table.maxn(v.reward) > 0 then GiveRewardsTask(cid, v.reward) str = str.."".. (str == "" and "" or ", ") ..""..getItemsFromList(v.reward) end
                   npcHandler:say("Obrigado pela sua ajuda Recompensas: "..(str == "" and "nenhuma" or ""..str.."").." por ter completado a task do "..v.name, cid)
                   setPlayerStorageValue(cid, task_sys_storages[3], 0)
                   setPlayerStorageValue(cid, task_sys_storages[1], (task+1))
                else
                   npcHandler:say("Desculpe, Mas você ainda não terminou a sua task do "..v.name..". Preciso que mate mais "..(getPlayerStorageValue(cid, task_sys_storages[3]) < 0 and v.count or -(getPlayerStorageValue(cid,task_sys_storages[3])-v.count)).." Destes monstros terriveis!", cid)
                end
             end
          end
          if k then -- daily task
             if getPlayerStorageValue(cid, task_sys_storages[7]) > 0 then
                if getPlayerStorageValue(cid, task_sys_storages[5]) >= k.count then
                if k.exp > 0 then doPlayerAddExp(cid, k.exp) rst = rst.."".. (rst == "" and "" or ", ") .." "..k.exp.." de exp" end
                  if k.points > 0 then setPlayerStorageValue(cid, task_sys_storages[2], (getTaskPoints(cid)+k.points)) rst = rst.."".. (rst == "" and "" or ", ") .." + "..k.points.."task points" end
                  if k.money > 0 then doPlayerAddMoney(cid, k.money) rst = rst.."".. (rst == "" and "" or ", ") ..""..k.money.." gps" end
                  if table.maxn(k.reward) > 0 then GiveRewardsTask(cid, k.reward) rst = rst.."".. (rst == "" and "" or ", ") ..""..getItemsFromList(k.reward) end
                   npcHandler:say("Obrigado pela sua ajuda! Recompensas: "..(rst == "" and "nenhuma" or ""..rst.."").." por ter completado a task do "..k.name, cid)
                   setPlayerStorageValue(cid, task_sys_storages[4], 0)
                   setPlayerStorageValue(cid, task_sys_storages[5], 0)
                   setPlayerStorageValue(cid, task_sys_storages[7], 0)
                   else
                   npcHandler:say("Desculpe, Mas você ainda não terminou a sua task diaria do "..k.name..". Preciso que mate mais "..(getPlayerStorageValue(cid, task_sys_storages[5]) < 0 and k.count or -(getPlayerStorageValue(cid,task_sys_storages[5])-k.count)).." Destes monstros!", cid)
                end
             end
          end
       elseif msg == "no" then
          selfSay("Tudo bem então", cid)
          talkState[talkUser] = 0
          npcHandler:releaseFocus(cid)
       end
       return true
    end
    npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
    npcHandler:addModule(FocusModule:new())

    ahora nos vamos a Data/Npc copiamos cualquier archivo y renombramos por Ludger.xml y pegamos esto dentro

    Código:
    <?xml version="1.0"?>
    <npc name="Ludger" script="data/npc/scripts/simple_task.lua" walkinterval="50000" floorchange="0">
    <health now="100" max="100"/>
    <look type="129" head="95" body="116" legs="121" feet="115" addons="3"/>
    <parameters>
    <parameter key="message_greet" value="Ola |PLAYERNAME|. Deseja fazer uma {task} ou {daily} task? Ou quer {entregar} sua task e receber premios por ela!" />
    </parameters>
    </npc>

    [+] configuración [+]

    patron original task

    Código:

    task_sys = {
       [1] = {name = "Trolls", start = 176201, monsters_list = {"Troll","Troll champion"}, level = 8, count = 40, points = 0, items = {}, reward = {}, exp = 2000, money = 2000}
    }

    1] -> El número entre corchetes [] significa que el orden de las tareas, como la tarea es para el progreso siempre se inicia en 1 y se pro [2], y así sucesivamente.

    name -> Es el nombre de la tarea del jugador va a hacer.

    start -> es el almacenamiento que indicará si el jugador comenzó a tareas

    monster_list = {} -> es el nombre de los monstruos que el jugador debe cazar para completar la tarea

    level -> Es el nivel requerido para iniciar tareas

    count -> El número de monstruos que el jugador tiene que matar para completar la tarea

    point -> Aquí determinan cuántos puntos de tareas el jugador recibirá la tarea completa

    items = {} -> Aquí se determina además de matar a los monstruos, el jugador tendrá que entregar tema también! Si sólo tiene colocar el {ITEM_ID, CANTIDAD} EX:

    Código:
    items = {{2173,1}{2160,10},{2493,2}}

    rewad -> Aquí determina si el jugador recibirá elementos para completar la tarea, los mismos artículos fórmula / \

    Código:
    reward = {{2520,1},{2173,1}}

    exp -> Si el jugador recibirá Exp para terminar la tarea. 0 o cantidad de exp

    Money -> Si el jugador recibirá dinero para terminar la tarea. 0 o cantidad de dinero

    Daily Task System

    Código:
    daily_task = {
       [1] = {name = "Orcs" ,monsters_list = {"Orc Berserker","Orc Rider","Orc Leader","Orc Warlord"}, count = 100, points = 0, reward = {}, exp = 5000, money = 10000}
    }

    Se sigue el patrón de la tarea original, pero que no tiene que entregar los artículos a la APN!

    ¿Cómo funciona la asignación aleatoria de nivel de acuerdo con el Daily task?

    Buscar por tabla en MODS

    Código:
    local t = {
          [{6,49}] = {1,3},
          [{50,79}] = {4,6},
          [{80,129}] = {7,9},
          [{130,math.huge}] = {10,12}
       }
    entre las llaves y corchetes es el nivel del jugador para las Daily Task, Usted puede agregar cuántas usted desea!

    Digamos que:

    [{6,49}] = {1,3} -> Esto significa que entre el nivel 6 al jugador 49a pueden caer en el número diario de tareas 1 (ORC), 2 (Tarantulas) o 3 (Wyvern)!

    [{50,79}] = {4,6} -> ¿Quieres decir entre el nivel 50-79, el jugador puede caer en el número de tareas diarias 4 (dragones), 5 (Wailing Widows) o 6 (escarabajos antiguos)!

    ...

    [{130} math.huge] = {10,12} -> ¿Se refiere al nivel de jugador de 130 o más pueden caer en el número de tareas diarias 10 (Undead Dragons), 11 (hidras) o 12 (Ghastly Dragons)!

    Look Rank System

    Buscar por tabla en MODS

    Código:
    local ranks = {
          [{1, 20}] = "Huntsman",
          [{21, 50}] = "Ranger",
          [{51, 100}] = "Big Game Hunter",
          [{101, 200}] = "Trophy Hunter",      
          [{201, math.huge}] = "Elite Hunter"
       }

    Entre 1-20 Task points la fila será Huntsman

    Entre 21-50 Tareas de tarea la fila será Ranger

    Entre 51-100 Puntos de Tareas el rango será Big Game Hunter

    etc ...

    ¡Cambie como quiera!



    [Sistema] Task System 4.0 (Task system + Daily Task System) (Tfs 0.3.7, 0.4.0 and OTX 2) YNU5B25
    +9
    potinho
    ioke
    wizinx
    Darwiinxp
    chili bizc
    kamus9629
    darksenki
    Sotomayor
    [Admin] God Maya
    13 participantes
    http://www.tibiaface.com

    Sotomayor

    Sotomayor
    Miembro
    Miembro
    Se ve simple el script pero muy detallado lo voy a probar para implementarlo en servidor de nuevo gracias saludos!



    No funciona el task counter, no marca el progreso que llevas de los monsters y cuando matas los 40 trolls no entrega nada solo te dice que mates los 40 trolls esta re bueno el mod pero me anda fallando y no me indica errores en la consola Sad tfs 0.4

    Listo! Solucionado el problema era una linea en el mod se las dejo aqui por si les sucede lo mismo tienen que remplazarla y listo!

    esta: if isPlayer(cid) and isMonster(target) and not isSummon(target) then

    por esta: if isPlayer(cid) and isMonster(target) then

    y ya! aun asi muchas gracias maya por el aporte exceleente

    +9
    potinho
    ioke
    wizinx
    Darwiinxp
    chili bizc
    kamus9629
    darksenki
    Sotomayor
    [Admin] God Maya
    13 participantes

    darksenki

    darksenki
    Miembro
    Miembro
    mmm tiene error para contar las kill si editas por separado creaturescript te daras cuenta es aparte del error del summon

    +9
    potinho
    ioke
    wizinx
    Darwiinxp
    chili bizc
    kamus9629
    darksenki
    Sotomayor
    [Admin] God Maya
    13 participantes

    kamus9629

    kamus9629
    Nuevo Miembro
    Nuevo Miembro
    [21/01/2020 23:09:08] [Warning - Npc::loadFromXml] Cannot load npc file (data/npc/Ludger.xml).
    [21/01/2020 23:09:08] Info: failed to load external entity "data/npc/Ludger.xml"

    +9
    potinho
    ioke
    wizinx
    Darwiinxp
    chili bizc
    kamus9629
    darksenki
    Sotomayor
    [Admin] God Maya
    13 participantes

    [Admin] God Maya

    [Admin] God Maya
    Administrador
    Administrador
    kamus9629 escribió:[21/01/2020 23:09:08] [Warning - NpcFromXml] Cannot load npc file (data/npc/Ludger.xml).
    [21/01/2020 23:09:08] Info: failed to load external entity "data/npc/Ludger.xml"

    por el error que se ve parece ser que el npc no se encuentra en la direccion que indica



    [Sistema] Task System 4.0 (Task system + Daily Task System) (Tfs 0.3.7, 0.4.0 and OTX 2) YNU5B25
    +9
    potinho
    ioke
    wizinx
    Darwiinxp
    chili bizc
    kamus9629
    darksenki
    Sotomayor
    [Admin] God Maya
    13 participantes
    http://www.tibiaface.com

    chili bizc

    chili bizc
    Miembro
    Miembro
    funciono todo y excelente mod pero una preguntita, el task rank, donde se puede ver? le da los puntos al player pero donde veo el rango que tienen?

    +9
    potinho
    ioke
    wizinx
    Darwiinxp
    chili bizc
    kamus9629
    darksenki
    Sotomayor
    [Admin] God Maya
    13 participantes

    [Admin] God Maya

    [Admin] God Maya
    Administrador
    Administrador
    chili bizc escribió:funciono todo y excelente mod pero una preguntita, el task rank, donde se puede ver? le da los puntos al player pero donde veo el rango que tienen?

    aqui tienes donde se ve al darle look al player

    Código:


    <event type="look" name="TaskLook" event="script"><![CDATA[
    domodlib('task_func')
    function onLook(cid, thing, position, lookDistance)
      if isPlayer(thing.uid) and getTaskPoints(thing.uid) > 0 then
          doPlayerSetSpecialDescription(thing.uid, "\n"..(getPlayerSex(thing.uid) == 0 and "She" or "He").. " is a "..GetRankTask(thing.uid))
      end 
      return true
    end]]></event>



    [Sistema] Task System 4.0 (Task system + Daily Task System) (Tfs 0.3.7, 0.4.0 and OTX 2) YNU5B25
    +9
    potinho
    ioke
    wizinx
    Darwiinxp
    chili bizc
    kamus9629
    darksenki
    Sotomayor
    [Admin] God Maya
    13 participantes
    http://www.tibiaface.com

    chili bizc

    chili bizc
    Miembro
    Miembro
    Gracias Maya, ya lo probe y no da el rango al darle look al player ni aparece algun error en consola

    +9
    potinho
    ioke
    wizinx
    Darwiinxp
    chili bizc
    kamus9629
    darksenki
    Sotomayor
    [Admin] God Maya
    13 participantes

    Darwiinxp

    Darwiinxp
    Nuevo Miembro
    Nuevo Miembro
    Me salen estos errores:
    Código:
    [0:22:20.324] [Error - LuaInterface::loadFile] data/npc/scripts/simple_task.lua:90: ')' expected near '∩'
    [0:22:20.326] [Warning - NpcEvents::NpcEvents] Cannot load script: data/npc/scripts/simple_task.lua
    [0:22:20.327] data/npc/scripts/simple_task.lua:90: ')' expected near '∩'

    +9
    potinho
    ioke
    wizinx
    Darwiinxp
    chili bizc
    kamus9629
    darksenki
    Sotomayor
    [Admin] God Maya
    13 participantes

    chili bizc

    chili bizc
    Miembro
    Miembro
    Busca otro .lua de otra npc y copiaby pega las 2 ultimas lineas en el simple_task.lua y revisa que no falten parentesis

    +9
    potinho
    ioke
    wizinx
    Darwiinxp
    chili bizc
    kamus9629
    darksenki
    Sotomayor
    [Admin] God Maya
    13 participantes

    Darwiinxp

    Darwiinxp
    Nuevo Miembro
    Nuevo Miembro
    chili bizc escribió:Busca otro .lua de otra npc y copiaby pega las 2 ultimas lineas en el simple_task.lua y revisa que no falten parentesis

    Me funciono bro, Thx!

    +9
    potinho
    ioke
    wizinx
    Darwiinxp
    chili bizc
    kamus9629
    darksenki
    Sotomayor
    [Admin] God Maya
    13 participantes

    Darwiinxp

    Darwiinxp
    Nuevo Miembro
    Nuevo Miembro
    Maya instale este sistema, uso TFS 0.4, no me marca error en consola ni nada. Según el Npc te asigna la task (daily) no he testeado la task normal pero supongo esta igual.
    Te dice lo que tienes que matar y todo. Al usar el comando !task dice que no estoy haciendo ninguna task. Regreso al Npc y dice que debo terminar la task que inicie en el plazo que me dan.. bueno intento hacerla, ejemplo task son 600 hydras, mato unas 100 o las que sean, regreso al npc y dice que necesito matar 600, como si no hubiese matado ni 1
    Puedes ayudarme? como que nadamas te cambia el storage o no se, de que si estas haciendo la task, pero al intentar hacerla pues no la estas haciendo y en !task dice que no estas en ninguna

    Simple Task (Mods):

    +9
    potinho
    ioke
    wizinx
    Darwiinxp
    chili bizc
    kamus9629
    darksenki
    Sotomayor
    [Admin] God Maya
    13 participantes

    chili bizc

    chili bizc
    Miembro
    Miembro
    Que tal maya, sucedio que un player estaba haciendo task y salio un error en consola
    [Tienes que estar registrado y conectado para ver este vínculo]
    Le paso que al matar al mob de la task en este caso fue "nightmare" al dejarlo sin hp no caia muerto el mob y se quedaba atacando el player ybel mob decia 0 hp y arrojaba ese error de la imagen repetidamente
    Perdon por la foto pero la tome desde teamviewer

    y el player al momento de pedir task o entregar no le responde nada el npc, quiere volver a pedir TASK y dice q debe terminar nightmare, pero sale igual en vida 0 cuando lo mata y aaparece el error de la iamgen, tomo dialy task, hizo conteo, termino fue a entregar y no le respondio nada el npc para entregarla

    volvio a pasar con otro player pero con daily task de frost dragon, lo mismo que el mob no se moria y la consola arrojaba error infinitamente jaja

    Saludos!
    Código:
    <?xml version="1.0" encoding="ISO-8859-1"?>
    <mod name="Simple Task" version="4.0" author="Vodkart" contact="tibiaking.com" enabled="yes">
    <config name="task_func"><![CDATA[
    task_sys = {
       [1] = {name = "Rats", start = 176201, monsters_list = {"Rat","cave rat"}, level = 8, count = 20, points = 0, items = {}, reward = {}, exp = 2000, money = 2000},
       [2] = {name = "rotworms", start = 176202, monsters_list = {"rotworm","carrion worm","Rotworm Queen"}, level = 12, count = 50, points = 0, items = {}, reward = {}, exp = 2500, money = 3000},
       [3] = {name = "cyclops", start = 176203, monsters_list = {"cyclops","cyclops smith","cyclops drone"}, level = 19, count = 60, points = 0, items = {}, reward = {}, exp = 3000, money = 3000},
       [4] = {name = "Green Djinn", start = 176204, monsters_list = {"Green Djinn","Efreet"}, level = 23, count = 80, points = 1, items = {}, reward = {}, exp = 10000, money = 5000},
       [5] = {name = "Blue Djinn", start = 176205, monsters_list = {"Blue Djinn","Marid"}, level = 25, count = 80, points = 1, items = {}, reward = {}, exp = 10000, money = 5000},
       [6] = {name = "Bog raiders", start = 176206, monsters_list = {"Bog raider"}, level = 30, count = 120, points = 2, items = {}, reward = {}, exp = 10000, money = 5000},
       [7] = {name = "mutated humans", start = 176207, monsters_list = {"mutated human"}, level = 33, count = 130, points = 3, items = {}, reward = {}, exp = 12000, money = 7000},
       [8] = {name = "Magicians", start = 176208, monsters_list = {"dark magician","mad scientist","Dark Apprentice"}, level = 36, count = 135, points = 3, items = {}, reward = {}, exp = 12000, money = 8000},
       [9] = {name = "Cults", start = 176209, monsters_list = {"Novice Of The Cult","Acolyte Of The Cult","Adept Of The Cult","Enlightened Of The Cult"}, level = 40, count = 150, points = 2, items = {}, reward = {}, exp = 12000, money = 8200},
       [10] = {name = "Heros", start = 176210, monsters_list = {"Hero"}, level = 42, count = 150, points = 3, items = {}, reward = {}, exp = 50000, money = 15000},
       [11] = {name = "Wyrms", start = 176211, monsters_list = {"Wyrm"}, level = 46, count = 170, points = 3, items = {}, reward = {}, exp = 80000, money = 18500},
       [12] = {name = "Dragons", start = 176212, monsters_list = {"dragon","dragon hatchling"}, level = 50, count = 120, points = 3, items = {}, reward = {}, exp = 90000, money = 19000},
       [13] = {name = "Necromancer" ,start = 176213, monsters_list = {"Necromancer"}, level = 60, count = 200, points = 3, items = {}, reward = {}, exp = 120000, money = 30000},
       [14] = {name = "Black knights" ,start = 176214, monsters_list = {"Black Knight"}, level = 63, count = 250, points = 3, items = {}, reward = {}, exp = 175000, money = 40000},
       [15] = {name = "Nightmare" ,start = 176215, monsters_list = {"nightmare"}, level = 80, count = 350, points = 3, items = {}, reward = {{6391,1}}, exp = 200000, money = 62000},
       [16] = {name = "Warlocks" ,start = 176216, monsters_list = {"Warlock"}, level = 82, count = 150, points = 3, items = {}, reward = {{2157,1}}, exp = 322000, money = 150000},
       [17] = {name = "frost dragons" ,start = 176217, monsters_list = {"Frost Dragon","frost dragon hatchling"}, level = 83, count = 400, points = 3, items = {}, reward = {{2157,1}}, exp = 250000, money = 180000},
       [18] = {name = "Hellspawn" ,start = 176218, monsters_list = {"Hellspawn"}, level = 85, count = 250, points = 4, items = {}, reward = {{2157,1},{9693,1}}, exp = 280000, money = 200000},
       [19] = {name = "Dragon Lords" ,start = 176219, monsters_list = {"Dragon lord","dragon lord hatchling"}, level = 88, count = 650, points = 3, items = {}, reward = {{2157,2}}, exp = 350000, money = 350000},
       [20] = {name = "Lizard Dragons" ,start = 176220, monsters_list = {"Lizard Chosen","Lizard Dragon Priest","Lizard High Guard","Lizard Legionnaire", "Lizard Zaogun"}, level = 90, count = 600, points = 4, items = {}, reward = {{2157,1},{12644,1}}, exp = 428000, money = 450000},
       [21] = {name = "Purple Turtle" ,start = 176221, monsters_list = {"Purple Turtle"}, level = 95, count = 150, points = 4, items = {}, reward = {{2157,2},{2346,1}}, exp = 400000, money = 500000},
       [22] = {name = "Hydras" ,start = 176222, monsters_list = {"Hydra"}, level = 100, count = 400, points = 4, items = {}, reward = {{2157,3},{7737,1},{2346,1}}, exp = 450000, money = 650000},
       [23] = {name = "Serpent Spawn" ,start = 176223, monsters_list = {"Serpent Spawn","medusa"}, level = 103, count = 520, points = 6, items = {}, reward = {{2157,4},{8851,1}}, exp = 750000, money = 850000},
       [24] = {name = "Grim reapers" ,start = 176224, monsters_list = {"Grim reaper"}, level = 107, count = 350, points = 6, items = {}, reward = {{2157,4},{8885,1}}, exp = 850000, money = 900000},
       [25] = {name = "Demons" ,start = 176225, monsters_list = {"Demon"}, level = 110, count = 666, points = 20, items = {}, reward = {{2157,10},{2495,1},{6527,8}}, exp = 950000, money = 950000}
    }
    daily_task = {
       [1] = {name = "Orcs" ,monsters_list = {"Orc Berserker","Orc","Orc warrior","Orc spearman"}, count = 100, points = 1, reward = {{2157,1}}, exp = 50000, money = 100000},
       [2] = {name = "Cyclops" ,monsters_list = {"cyclops","cyclops smith","cyclops drone"}, count = 120, points = 1, reward = {{2157,1}}, exp = 90000, money = 120000},
       [3] = {name = "Green djinns" ,monsters_list = {"Green djinn"}, count = 125, points = 2, reward = {{2157,1}}, exp = 90000, money = 150000},
       [4] = {name = "Dragons" ,monsters_list = {"Dragon","Dragon Hatchling"}, count = 150, points = 2, reward = {{2157,1}}, exp = 200000, money = 200000},
       [5] = {name = "bog raiders" ,monsters_list = {"bog raider"}, count = 200, points = 2, reward = {{2157,1}}, exp = 200000, money = 250000},
       [6] = {name = "Ancient Scarabs" ,monsters_list = {"Ancient Scarab"}, count = 180, points = 5, reward = {{2157,1}}, exp = 220000, money = 280000},
       [7] = {name = "High Class Lizards" ,monsters_list = {"Corrupted Soul","Eternal Guardian","Lizard Chosen","Lizard Dragon Priest","Lizard High Guard","Lizard Legionnaire","Lizard Magistratus","Lizard Noble","Lizard Zaogun"}, count = 300, points = 3, reward = {{2157,1}}, exp = 250000, money = 360000},
       [8] = {name = "Mutated human" ,monsters_list = {"Mutated Human"}, count = 260, points = 3, reward = {{2157,1}}, exp = 340000, money = 455000},
       [9] = {name = "Giant Spiders" ,monsters_list = {"Giant Spider"}, count = 200, points = 3, reward = {{2157,1}}, exp = 460000, money = 570000},
       [10] = {name = "Frost dragons" ,monsters_list = {"Frost Dragon"}, count = 700, points = 4, reward = {{2157,4}}, exp = 600000, money = 520000},
       [11] = {name = "HydraS" ,monsters_list = {"Hydra"}, count = 700, points = 4, reward = {{2157,4}}, exp = 600000, money = 560000},
       [12] = {name = "Chraks" ,monsters_list = {"Chrak"}, count = 550, points = 4, reward = {{2157,4}}, exp = 600000, money = 500000}
    }
    task_sys_storages = {176601, 176602, 176603, 176604, 176605, 176606, 176607, 176608} -- task, points, count, daily task, daily count, daily time , daily start, contador
    function getTaskMission(cid)
       return getPlayerStorageValue(cid,task_sys_storages[1]) < 0 and 1 or getPlayerStorageValue(cid,task_sys_storages[1])
    end
    function getDailyTaskMission(cid)
       return getPlayerStorageValue(cid,task_sys_storages[4]) < 0 and 1 or getPlayerStorageValue(cid,task_sys_storages[4])
    end
    function getTaskPoints(cid)
       return getPlayerStorageValue(cid,task_sys_storages[2]) < 0 and 0 or getPlayerStorageValue(cid,task_sys_storages[2])
    end
    function doRandomDailyTask(cid)
       local t = {
          [{6,49}] = {1,3},
          [{50,79}] = {4,6},
          [{80,129}] = {7,9},
          [{130,math.huge}] = {10,12}
       }
       for a , b in pairs(t) do
          if getPlayerLevel(cid) >= a[1] and getPlayerLevel(cid) <= a[2] then
             return math.random(b[1], b[2])
          end
       end
       return 0
    end
    function GetRankTask(cid)
       local ranks = {
          [{1, 20}] = "Huntsman",
          [{21, 50}] = "Ranger",
          [{51, 100}] = "Big Game Hunter",
          [{101, 200}] = "Trophy Hunter",      
          [{201, math.huge}] = "Reaper Hunter"
       }
       for v , r in pairs(ranks) do
          if getTaskPoints(cid) >= v[1] and getTaskPoints(cid) <= v[2] then
             return r
          end
       end
       return 0
    end
    function getItemsFromList(items)
       local str = ''
       if table.maxn(items) > 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 doRemoveItemsFromList(cid,items)
       local count = 0
       if table.maxn(items) > 0 then
          for i = 1, table.maxn(items) do
             if getPlayerItemCount(cid,items[i][1]) >= items[i][2] then
             count = count + 1 end
          end
       end
       if count == table.maxn(items) then
          for i = 1, table.maxn(items) do doPlayerRemoveItem(cid,items[i][1],items[i][2]) end
       else
          return false
       end
       return true
    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
    function isSummon(cid)
       if(not isCreature(cid)) then
          return false
       end
       return getCreatureMaster(cid) ~= cid
    end
    ]]></config>
    <event type="login" name="TaskLogin" event="script"><![CDATA[
    function onLogin(cid)
       registerCreatureEvent(cid, "KillTask")
       registerCreatureEvent(cid, "TaskLook")
       return true
    end]]></event>
    <talkaction words="/task;!task" event="buffer"><![CDATA[
    domodlib('task_func')
    param,task,daily = param:lower(), getTaskMission(cid), getDailyTaskMission(cid)
    if isInArray({"counter","contador"},param) then
       setPlayerStorageValue(cid, task_sys_storages[8], getPlayerStorageValue(cid, task_sys_storages[8]) <= 0 and 1 or 0)
       doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE,"[Task System] O contador foi "..(getPlayerStorageValue(cid, task_sys_storages[8]) <= 0 and "ativado" or "desativado")..".") return true
    elseif isInArray({"daily","diaria"},param) then
       if not daily_task[daily] or getPlayerStorageValue(cid, task_sys_storages[7]) <= 0 then
          doPlayerSendCancel(cid, "Desculpe, Mas você não está em nenhuma Daily Task.") return true
       elseif getPlayerStorageValue(cid, task_sys_storages[6]) - os.time() <= 0 and getPlayerStorageValue(cid, task_sys_storages[5]) < daily_task[daily].count then
          doPlayerSendCancel(cid,"Desculpe, Mas Você não terminou a Daily Task a tempo! Por favor volte ao npc e comece uma nova Daily Task!") return true
       end
       return doShowTextDialog(cid, 8983, "[->] CURRENT DAILY TASK INFO [<-]\n\nNome: "..daily_task[daily].name.."\nProgresso: ["..(getPlayerStorageValue(cid, task_sys_storages[5]) < 0 and 0 or getPlayerStorageValue(cid, task_sys_storages[5])).."/"..daily_task[daily].count.."]\nPrazo para entrega: "..os.date("%d %B %Y %X ", getPlayerStorageValue(cid,task_sys_storages[6])).."\nMonstros para caçar: "..getMonsterFromList(daily_task[daily].monsters_list).."\n\n[->] CURRENT TASK REWARDS [<-]\n\nMoney: "..(daily_task[daily].money > 0 and daily_task[daily].money or 0).."\nExperiencia: "..(daily_task[daily].exp > 0 and daily_task[daily].exp or 0).."\nTask Points: "..daily_task[daily].points.."\nItems: "..(#daily_task[daily].reward > 0 and getItemsFromList(daily_task[daily].reward) or "Nenhum item de recompensa")..".")
    end
    if not task_sys[task] or getPlayerStorageValue(cid, task_sys[task].start) <= 0 then
       doPlayerSendCancel(cid, "você não está em nenhuma task.") return true
    end
    return doShowTextDialog(cid, 8983, "-> CURRENT TASK ["..getTaskMission(cid).."/"..#task_sys.."] <-\n\nTask Name: "..task_sys[task].name.."\nTask Level: "..task_sys[task].level.."\nTask Progress: ["..(getPlayerStorageValue(cid, task_sys_storages[3]) < 0 and 0 or getPlayerStorageValue(cid, task_sys_storages[3])).."/"..task_sys[task].count.."]\nMonster To Hunt: "..getMonsterFromList(task_sys[task].monsters_list)..".\nItens Para Entrega: "..(#task_sys[task].items > 0 and getItemsFromList(task_sys[task].items) or "Nenhum")..".\n\n[->] CURRENT TASK REWARDS [<-]\n\nReward Money: "..(task_sys[task].money > 0 and task_sys[task].money or 0).."\nReward Experiencia: "..(task_sys[task].exp > 0 and task_sys[task].exp or 0).."\nReward Points: "..task_sys[task].points.."\nRedward Items: "..(#task_sys[task].reward > 0 and getItemsFromList(task_sys[task].reward) or "Nenhum item de recompensa")..".")
    ]]></talkaction>
    <event type="look" name="TaskLook" event="script"><![CDATA[
    domodlib('task_func')
    function onLook(cid, thing, position, lookDistance)
       if isPlayer(thing.uid) and getTaskPoints(thing.uid) > 0 then
          doPlayerSetSpecialDescription(thing.uid, "\n"..(getPlayerSex(thing.uid) == 0 and "She" or "He").. " is a "..GetRankTask(thing.uid))
       end  
       return true
    end]]></event>
    <event type="kill" name="KillTask" event="script"><![CDATA[
    domodlib('task_func')
    function onKill(cid, target)
       if isPlayer(cid) and isMonster(target) then
          local t,daily = task_sys[getTaskMission(cid)], daily_task[getDailyTaskMission(cid)]
          if t and getPlayerStorageValue(cid, t.start) > 0 and isInArray(t.monsters_list, getCreatureName(target):lower()) and getPlayerStorageValue(cid, task_sys_storages[3]) < t.count then
             setPlayerStorageValue(cid, task_sys_storages[3], getPlayerStorageValue(cid, task_sys_storages[3]) < 0 and 1 or (getPlayerStorageValue(cid, task_sys_storages[3])+1))
             if getPlayerStorageValue(cid, task_sys_storages[8]) <= 0 and getPlayerStorageValue(cid, task_sys_storages[3]) < t.count then
                doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE,"[Task System] defeated Total [" .. getPlayerStorageValue(cid, task_sys_storages[3]) .. "/" .. t.count .. "] la Task de " .. t.name .. ".")
             end
             if getPlayerStorageValue(cid, task_sys_storages[3]) >= t.count then
                doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE,"[Task System] Felicidades! usted termino la task de "..t.name..", vaya con el npc para recibir su recompensa.")
             end
          end
          if daily and getPlayerStorageValue(cid, task_sys_storages[7]) > 0 and getPlayerStorageValue(cid, task_sys_storages[6]) - os.time() >= 0 and isInArray(daily.monsters_list, getCreatureName(target):lower()) and getPlayerStorageValue(cid, task_sys_storages[5]) < daily.count then
             setPlayerStorageValue(cid, task_sys_storages[5], getPlayerStorageValue(cid, task_sys_storages[5]) < 0 and 1 or (getPlayerStorageValue(cid, task_sys_storages[5])+1))
             if getPlayerStorageValue(cid, task_sys_storages[8]) <= 0 and getPlayerStorageValue(cid, task_sys_storages[5]) < daily.count then
                doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE,"[Daily Task System] defeated Total [" .. getPlayerStorageValue(cid, task_sys_storages[5]) .. "/" .. daily.count .. "] la Task de " .. daily.name .. ".")
             end
             if getPlayerStorageValue(cid, task_sys_storages[5]) >= daily.count then
                doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE,"[Daily Task System] Felicidades! usted termino la task de "..daily.name..", ve con el npc para la recompensa.")
             end
          end
       end
       return true
    end]]></event>
    </mod>

    +9
    potinho
    ioke
    wizinx
    Darwiinxp
    chili bizc
    kamus9629
    darksenki
    Sotomayor
    [Admin] God Maya
    13 participantes

    wizinx

    wizinx
    Miembro
    Miembro
    para tfs 1.2 :C?

    +9
    potinho
    ioke
    wizinx
    Darwiinxp
    chili bizc
    kamus9629
    darksenki
    Sotomayor
    [Admin] God Maya
    13 participantes

    [Admin] God Maya

    [Admin] God Maya
    Administrador
    Administrador
    wizinx escribió:para tfs 1.2 :C?

    para esa version tenemos a la venta el siguiente sistema

    [Tienes que estar registrado y conectado para ver este vínculo]



    [Sistema] Task System 4.0 (Task system + Daily Task System) (Tfs 0.3.7, 0.4.0 and OTX 2) YNU5B25
    +9
    potinho
    ioke
    wizinx
    Darwiinxp
    chili bizc
    kamus9629
    darksenki
    Sotomayor
    [Admin] God Maya
    13 participantes
    http://www.tibiaface.com

    ioke

    ioke
    Miembro
    Miembro
    seria genial si en vez de progresivo pudiera elegir que tas kieres hacer solo eso si kiero hacer task de demon y tengo nivel hacerla si no es un poco rollo tener ke ir pasando task 1 a 1

    +9
    potinho
    ioke
    wizinx
    Darwiinxp
    chili bizc
    kamus9629
    darksenki
    Sotomayor
    [Admin] God Maya
    13 participantes
    http://baiakciteron.sytes.net

    [Admin] God Maya

    [Admin] God Maya
    Administrador
    Administrador
    ioke escribió:seria genial si en vez de progresivo pudiera elegir que tas kieres hacer solo eso si kiero hacer task de demon y tengo nivel hacerla si no es un poco rollo tener ke ir pasando task 1 a 1

    pongale a esta linea

    Código:

    level = 8

    cambiele a 0 en todas las lineas



    [Sistema] Task System 4.0 (Task system + Daily Task System) (Tfs 0.3.7, 0.4.0 and OTX 2) YNU5B25
    +9
    potinho
    ioke
    wizinx
    Darwiinxp
    chili bizc
    kamus9629
    darksenki
    Sotomayor
    [Admin] God Maya
    13 participantes
    http://www.tibiaface.com

    ioke

    ioke
    Miembro
    Miembro
    necesito que puedas elegir la task que quieres

    +9
    potinho
    ioke
    wizinx
    Darwiinxp
    chili bizc
    kamus9629
    darksenki
    Sotomayor
    [Admin] God Maya
    13 participantes
    http://baiakciteron.sytes.net

    potinho

    potinho
    Nuevo Miembro
    Nuevo Miembro
    My mod is reseting task, no error in console

    [Sistema] Task System 4.0 (Task system + Daily Task System) (Tfs 0.3.7, 0.4.0 and OTX 2) 1642354012930-png


    Código:
    <?xml version="1.0" encoding="ISO-8859-1"?>
    <mod name="Simple Task" version="4.0" author="Vodkart" contact="tibiaking.com" enabled="yes">
    <config name="task_func"><![CDATA[
    task_sys = {
        [1] = {name = "Trolls", start = 176201, monsters_list = {"Troll"}, level = 8, count = 40, points = 1, items = {}, reward = {}, exp = 20000, money = 2000},
        [2] = {name = "rotworms", start = 176202, monsters_list = {"rotworm"}, level = 12, count = 50, points = 1, items = {}, reward = {}, exp = 25000, money = 3000},
        [3] = {name = "Minotaurs", start = 176216, monsters_list = {"minotaur","minotaur guard","minotaur archer","minotaur mage"}, level = 15, count = 150, points = 2, items = {}, reward = {}, exp = 30000, money = 10000},
        [4] = {name = "cyclops", start = 176203, monsters_list = {"cyclops"}, level = 19, count = 60, points = 2, items = {}, reward = {{2486,1}}, exp = 30000, money = 3000},
        [5] = {name = "Dwarves", start = 176210, monsters_list = {"dwarf","dwarf soldier","dwarf guard","dwarf geomancer"}, level = 42, count = 150, points = 4, items = {}, reward = {}, exp = 200000, money = 15000},
        [6] = {name = "Terror Birds", start = 176206, monsters_list = {"Terror Bird"}, level = 30, count = 120, points = 3, items = {}, reward = {}, exp = 100000, money = 5000},
        [7] = {name = "Stone Golems", start = 176207, monsters_list = {"Stone Golem"}, level = 33, count = 130, points = 4, items = {}, reward = {}, exp = 120000, money = 7000},
        [8] = {name = "Carniphilas", start = 176208, monsters_list = {"carniphila"}, level = 36, count = 135, points = 4, items = {}, reward = {}, exp = 80000, money = 8000},
        [9] = {name = "Elephants", start = 176209, monsters_list = {"elephant"}, level = 40, count = 150, points = 4, items = {}, reward = {}, exp = 120000, money = 8200},
        [10] = {name = "Green Djinn", start = 176204, monsters_list = {"Green Djinn","Efreet"}, level = 23, count = 80, points = 3, items = {}, reward = {}, exp = 100000, money = 5000},
        [11] = {name = "Blue Djinn", start = 176205, monsters_list = {"Blue Djinn","Marid"}, level = 25, count = 80, points = 3, items = {}, reward = {}, exp = 100000, money = 5000},
        [12] = {name = "Necromancer" ,start = 176213, monsters_list = {"Necromancer"}, level = 60, count = 200, points = 5, items = {}, reward = {}, exp = 200000, money = 15000},
        [13] = {name = "Bonebeasts" ,start = 176214, monsters_list = {"Bonebeast"}, level = 63, count = 250, points = 5, items = {}, reward = {}, exp = 250000, money = 11000},
        [14] = {name = "Vampires", start = 176211, monsters_list = {"vampire"}, level = 46, count = 170, points = 5, items = {}, reward = {}, exp = 80000, money = 8500},
        [15] = {name = "Dragons", start = 176212, monsters_list = {"dragon"}, level = 50, count = 120, points = 5, items = {}, reward = {}, exp = 90000, money = 9000},
        [16] = {name = "Heroes", start = 176240, monsters_list = {"Hero"}, level = 50, count = 320, points = 7, items = {}, reward = {}, exp = 200000, money = 30000},
        [17] = {name = "Giant Spider" ,start = 176215, monsters_list = {"Giant Spider","The old widow"}, level = 80, count = 500, points = 6, items = {}, reward = {}, exp = 200000, money = 32000},
        [18] = {name = "Hellspawn" ,start = 176232, monsters_list = {"Hellspawn"}, level = 80, count = 500, points = 7, items = {}, reward = {}, exp = 300000, money = 52000},
        [19] = {name = "Dragon Lords" ,start = 176219, monsters_list = {"Dragon lord"}, level = 88, count = 650, points = 6, items = {}, reward = {}, exp = 35000, money = 35000},
        [20] = {name = "Hydras" ,start = 176222, monsters_list = {"Hydra"}, level = 100, count = 700, points = 7, items = {{4850,10}}, reward = {}, exp = 400000, money = 40000},
        [21] = {name = "Serpent Spawn" ,start = 176223, monsters_list = {"Serpent Spawn"}, level = 103, count = 720, points = 7, items = {{2445,1}}, reward = {}, exp = 500000, money = 45000},
        [22] = {name = "Behemoths" ,start = 176224, monsters_list = {"Behemoth"}, level = 108, count = 800, points = 8, items = {}, reward = {}, exp = 5000000, money = 200000},
        [23] = {name = "Demons" ,start = 176225, monsters_list = {"Demon"}, level = 110, count = 6666, points = 20, items = {}, reward = {{2495,1}}, exp = 6660000, money = 500000},
        [24] = {name = "Ashmunrah" ,start = 176233, monsters_list = {"Ashmunrah"}, level = 110, count = 500, points = 20, items = {}, reward = {}, exp = 1500000, money = 200000},
        [25] = {name = "Rahemos" ,start = 176234, monsters_list = {"Rahemos"}, level = 110, count = 500, points = 20, items = {}, reward = {}, exp = 1500000, money = 200000},
        [26] = {name = "Thalas" ,start = 176235, monsters_list = {"Thalas"}, level = 110, count = 500, points = 20, items = {}, reward = {}, exp = 1500000, money = 200000},
        [27] = {name = "Dipthrah" ,start = 176236, monsters_list = {"Dipthrah"}, level = 110, count = 500, points = 20, items = {}, reward = {}, exp = 1500000, money = 200000},
        [28] = {name = "Mahrdis" ,start = 176237, monsters_list = {"Mahrdis"}, level = 110, count = 500, points = 20, items = {}, reward = {}, exp = 1500000, money = 200000},
        [29] = {name = "Omruc" ,start = 176238, monsters_list = {"Omruc"}, level = 110, count = 500, points = 20, items = {}, reward = {}, exp = 1500000, money = 200000},
        [30] = {name = "Morguthis" ,start = 176239, monsters_list = {"Morguthis"}, level = 110, count = 500, points = 20, items = {}, reward = {}, exp = 1500000, money = 200000},
        [31] = {name = "Orshabaals" ,start = 176226, monsters_list = {"Orshabaal"}, level = 120, count = 300, points = 10, items = {}, reward = {{2341,1},{5114,1}}, exp = 9960000, money = 800000},
        [32] = {name = "Ferumbras" ,start = 176227, monsters_list = {"Ferumbras"}, level = 130, count = 100, points = 10, items = {}, reward = {{5161,1}}, exp = 6660000, money = 666000},
        [33] = {name = "Golden Knights" ,start = 176228, monsters_list = {"Golden Knight"}, level = 200, count = 100, points = 10, items = {}, reward = {{2646,1}}, exp = 10660000, money = 900000},
        [34] = {name = "Cacheros" ,start = 176229, monsters_list = {"Cachero"}, level = 200, count = 500, points = 10, items = {}, reward = {{2646,1}}, exp = 10000000, money = 300000},
        [35] = {name = "Eternal Oblivions" ,start = 176230, monsters_list = {"Eternal Oblivion"}, level = 500, count = 200, points = 10, items = {}, reward = {{2646,1}}, exp = 10000000, money = 300000},
        [36] = {name = "Infernus" ,start = 176231, monsters_list = {"Infernus"}, level = 200, count = 300, points = 15, items = {}, reward = {{5149,3}}, exp = 10000000, money = 300000}
    }
    daily_task = {
        [1] = {name = "Orcs" ,monsters_list = {"Orc Berserker","Orc Rider","Orc Leader","Orc Warlord", "Orc", "Orc Spearman", "Orc Warrior"}, count = 100, points = 2, reward = {}, exp = 50000, money = 10000},
        [2] = {name = "Rotworms" ,monsters_list = {"Rotworm"}, count = 220, points = 2, reward = {}, exp = 90000, money = 12000},
        [3] = {name = "Cyclops" ,monsters_list = {"Cyclops"}, count = 165, points = 3, reward = {}, exp = 9000, money = 15000},
        [4] = {name = "Minotaurs" ,monsters_list = {"minotaur","minotaur guard","minotaur archer","minotaur mage"}, count = 185, points = 3, reward = {}, exp = 90000, money = 15000},
        [5] = {name = "Ghouls" ,monsters_list = {"Ghoul"}, count = 150, points = 3, reward = {}, exp = 90000, money = 11000},
        [6] = {name = "Dragons" ,monsters_list = {"Dragon"}, count = 150, points = 3, reward = {}, exp = 20000, money = 10000},
        [7] = {name = "Vampires" ,monsters_list = {"Vampire"}, count = 200, points = 3, reward = {}, exp = 200000, money = 25000},
        [8] = {name = "Ancient Scarabs" ,monsters_list = {"Ancient Scarab"}, count = 180, points = 5, reward = {}, exp = 220000, money = 18000},
        [9] = {name = "Behemoths" ,monsters_list = {"Behemoth"}, count = 300, points = 5, reward = {}, exp = 500000, money = 60000},
        [10] = {name = "Heroes" ,monsters_list = {"Hero"}, count = 260, points = 5, reward = {}, exp = 400000, money = 55000},
        [11] = {name = "Black Knights" ,monsters_list = {"Black Knight"}, count = 260, points = 5, reward = {}, exp = 400000, money = 55000},
        [12] = {name = "Giant Spiders" ,monsters_list = {"Giant Spider"}, count = 350, points = 5, reward = {}, exp = 60000, money = 70000},
        [13] = {name = "Warlocks" ,monsters_list = {"Warlock"}, count = 700, points = 5, reward = {{2173,1}}, exp = 90000, money = 120000},
        [14] = {name = "Hydras" ,monsters_list = {"Hydra"}, count = 700, points = 5, reward = {}, exp = 100000, money = 160000},
        [15] = {name = "Dragon Lords" ,monsters_list = {"Dragon Lord"}, count = 400, points = 5, reward = {{2445,1}}, exp = 1300000, money = 200000},
        [16] = {name = "Frost Dragons" ,monsters_list = {"Frost Dragon"}, count = 400, points = 5, reward = {{2445,1}}, exp = 1300000, money = 200000},
        [17] = {name = "Serpent Spawns" ,monsters_list = {"Serpent Spawn"}, count = 400, points = 5, reward = {{2445,1}}, exp = 1300000, money = 200000},
        [18] = {name = "Juggernauts" ,monsters_list = {"Juggernaut"}, count = 600, points = 5, reward = {{5156,1}}, exp = 1000000, money = 200000},
        [19] = {name = "Undead Dragons" ,monsters_list = {"Undead Dragon"}, count = 600, points = 8, reward = {{5154,1}}, exp = 1000000, money = 200000},
        [20] = {name = "Hellhounds" ,monsters_list = {"Hellhound"}, count = 600, points = 8, reward = {{5159,1}}, exp = 1000000, money = 200000},
        [21] = {name = "Cacheros" ,monsters_list = {"Cachero"}, count = 600, points = 10, reward = {}, exp = 10000000, money = 300000}
     
    }
    task_sys_storages = {176601, 176602, 176603, 176604, 176605, 176606, 176607, 176608} -- task, points, count, daily task, daily count, daily time , daily start, contador
    function getTaskMission(cid)
        return getPlayerStorageValue(cid,task_sys_storages[1]) < 0 and 1 or getPlayerStorageValue(cid,task_sys_storages[1])
    end
    function getDailyTaskMission(cid)
        return getPlayerStorageValue(cid,task_sys_storages[4]) < 0 and 1 or getPlayerStorageValue(cid,task_sys_storages[4])
    end
    function getTaskPoints(cid)
        return getPlayerStorageValue(cid,task_sys_storages[2]) < 0 and 0 or getPlayerStorageValue(cid,task_sys_storages[2])
    end
    function doRandomDailyTask(cid)
        local t = {
            [{6,80}] = {1,5},
            [{81,149}] = {6,12},
            [{150,250}] = {13,17},
            [{251,math.huge}] = {18,21}
        }
        for a , b in pairs(t) do
            if getPlayerLevel(cid) >= a[1] and getPlayerLevel(cid) <= a[2] then
                return math.random(b[1], b[2])
            end
        end
        return 0
    end
    function GetRankTask(cid)
        local ranks = {
            [{1, 20}] = "Huntsman",
            [{21, 50}] = "Ranger",
            [{51, 100}] = "Big Game Hunter",
            [{101, 200}] = "Senior Hunter",      
            [{201, math.huge}] = "Extreme Hunter"
        }
        for v , r in pairs(ranks) do
            if getTaskPoints(cid) >= v[1] and getTaskPoints(cid) <= v[2] then
                return r
            end
        end
        return 0
    end
    function getItemsFromList(items)
        local str = ''
        if table.maxn(items) > 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 doRemoveItemsFromList(cid,items)
        local count = 0
        if table.maxn(items) > 0 then
            for i = 1, table.maxn(items) do
                if getPlayerItemCount(cid,items[i][1]) >= items[i][2] then
                count = count + 1 end
            end
        end
        if count == table.maxn(items) then
            for i = 1, table.maxn(items) do doPlayerRemoveItem(cid,items[i][1],items[i][2]) end
        else
            return false
        end
        return true
    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
    function isSummon(cid)
        if(not isCreature(cid)) then
            return false
        end
        return getCreatureMaster(cid) ~= cid
    end
    ]]></config>
    <event type="login" name="TaskLogin" event="script"><![CDATA[
    function onLogin(cid)
        registerCreatureEvent(cid, "KillTask")
        registerCreatureEvent(cid, "TaskLook")
        return true
    end]]></event>
    <talkaction words="/task;!task" event="buffer"><![CDATA[
    domodlib('task_func')
    param,task,daily = param:lower(), getTaskMission(cid), getDailyTaskMission(cid)
    if isInArray({"counter","contador"},param) then
        setPlayerStorageValue(cid, task_sys_storages[8], getPlayerStorageValue(cid, task_sys_storages[8]) <= 0 and 1 or 0)
        doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE,"[Task System] The counter was "..(getPlayerStorageValue(cid, task_sys_storages[8]) <= 0 and "enabled" or "disabled")..".") return true
    elseif isInArray({"daily","diaria"},param) then
        if not daily_task[daily] or getPlayerStorageValue(cid, task_sys_storages[7]) <= 0 then
            doPlayerSendCancel(cid, "Sorry, but you are not on any Task Daily.") return true
        elseif getPlayerStorageValue(cid, task_sys_storages[6]) - os.time() <= 0 and getPlayerStorageValue(cid, task_sys_storages[5]) < daily_task[daily].count then
            doPlayerSendCancel(cid,"Sorry, you didn't finish the Daily Task in time! Please go back to NPC Task and start a new Daily Task.") return true
        end
        return doShowTextDialog(cid, 1961, "[->] CURRENT DAILY TASK INFO [<-]\n\nName: "..daily_task[daily].name.."\nProgress: ["..(getPlayerStorageValue(cid, task_sys_storages[5]) < 0 and 0 or getPlayerStorageValue(cid, task_sys_storages[5])).."/"..daily_task[daily].count.."]\nDelivery time: "..os.date("%d %B %Y %X ", getPlayerStorageValue(cid,task_sys_storages[6])).."\nMonsters to hunt: "..getMonsterFromList(daily_task[daily].monsters_list).."\n\n[->] CURRENT TASK REWARDS [<-]\n\nMoney: "..(daily_task[daily].money > 0 and daily_task[daily].money or 0).."\nExperience: "..(daily_task[daily].exp > 0 and daily_task[daily].exp or 0).."\nTask Points: "..daily_task[daily].points.."\nItems: "..(#daily_task[daily].reward > 0 and getItemsFromList(daily_task[daily].reward) or "None")..".")
    end
    if not task_sys[task] or getPlayerStorageValue(cid, task_sys[task].start) <= 0 then
        doPlayerSendCancel(cid, "You are not on any task.") return true
    end
    return doShowTextDialog(cid, 1961, "-> TASK POINTS [" .. getTaskPoints(cid).. "] <- \n\n-> CURRENT TASK ["..getTaskMission(cid).."/"..#task_sys.."] <-\n\nTask Name: "..task_sys[task].name.."\nTask Level: "..task_sys[task].level.."\nTask Progress: ["..(getPlayerStorageValue(cid, task_sys_storages[3]) < 0 and 0 or getPlayerStorageValue(cid, task_sys_storages[3])).."/"..task_sys[task].count.."]\nMonster To Hunt: "..getMonsterFromList(task_sys[task].monsters_list)..".\nItens Para Entrega: "..(#task_sys[task].items > 0 and getItemsFromList(task_sys[task].items) or "None")..".\n\n[->] CURRENT TASK REWARDS [<-]\n\nReward Money: "..((tonumber(task_sys[task].money) and tonumber(task_sys[task].money) > 0) and task_sys[task].money or 0).."\nReward Experience: "..((tonumber(task_sys[task].exp) and tonumber(task_sys[task].exp) > 0) and task_sys[task].exp or 0).."\nReward Points: "..task_sys[task].points.."\nReward Items: "..(#task_sys[task].reward > 0 and getItemsFromList(task_sys[task].reward) or "None")..".")
    ]]></talkaction>
    <event type="look" name="TaskLook" event="script"><![CDATA[
    domodlib('task_func')
    function onLook(cid, thing, position, lookDistance)
        if isPlayer(thing.uid) and getTaskPoints(thing.uid) > 0 then
            doPlayerSetSpecialDescription(thing.uid, "\n"..(getPlayerSex(thing.uid) == 0 and "She" or "He").. " is a "..GetRankTask(thing.uid))
        end  
        return true
    end]]></event>
    <event type="kill" name="KillTask" event="script"><![CDATA[
    domodlib('task_func')
    function onKill(cid, target)
        if isPlayer(cid) and isMonster(target) then
            local t,daily = task_sys[getTaskMission(cid)], daily_task[getDailyTaskMission(cid)]      
            if t and getPlayerStorageValue(cid, t.start) > 0 and isInArray(t.monsters_list, getCreatureName(target):lower())then
                local ab = getPlayerStorageValue(cid, task_sys_storages[3]) == -1 and tonumber(0) or tonumber(getPlayerStorageValue(cid, task_sys_storages[3]))
                if tonumber(ab) and tonumber(ab) < t.count then
                    setPlayerStorageValue(cid, task_sys_storages[3], ab <= 0 and tonumber(1) or tonumber(ab+1))
                    if getPlayerStorageValue(cid, task_sys_storages[8]) <= 0 and tonumber(getPlayerStorageValue(cid, task_sys_storages[3])) and tonumber(getPlayerStorageValue(cid, task_sys_storages[3])) < t.count then
                        doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE,"[Task System] You defeated Total [" .. tonumber(getPlayerStorageValue(cid, task_sys_storages[3])) .. "/" .. t.count .. "] of the Task of the " .. t.name .. ".")
                    end
                    if tonumber(getPlayerStorageValue(cid, task_sys_storages[3])) >= t.count then
                        doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE,"[Task System] Congratulations! You have finished the Task of "..t.name..", go back to NPC to get your reward.")
                    end
                end
            end
            if daily and getPlayerStorageValue(cid, task_sys_storages[7]) > 0 and getPlayerStorageValue(cid, task_sys_storages[6]) - os.time() >= 0 and isInArray(daily.monsters_list, getCreatureName(target):lower()) then
                local cd = getPlayerStorageValue(cid, task_sys_storages[5]) == -1 and tonumber(0) or tonumber(getPlayerStorageValue(cid, task_sys_storages[5]))
                if tonumber(cd) and cd < daily.count then
                    setPlayerStorageValue(cid, task_sys_storages[5], cd <= 0 and tonumber(1) or tonumber(cd+1))
                    if getPlayerStorageValue(cid, task_sys_storages[8]) <= 0 and tonumber(getPlayerStorageValue(cid, task_sys_storages[5])) < daily.count then
                        doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE,"[Daily Task System] You defeated Total [" .. tonumber(getPlayerStorageValue(cid, task_sys_storages[5])) .. "/" .. daily.count .. "] of the Task of the " .. daily.name .. ".")
                    end
                    if tonumber(getPlayerStorageValue(cid, task_sys_storages[5])) >= daily.count then
                        doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE,"[Daily Task System] Congratulations! You have finished the Task of "..daily.name..", go back to NPC to get your reward.")
                    end
                end
            end
            return true
        end
        return true
    end]]></event>
    </mod>

    +9
    potinho
    ioke
    wizinx
    Darwiinxp
    chili bizc
    kamus9629
    darksenki
    Sotomayor
    [Admin] God Maya
    13 participantes

    [Admin] God Maya

    [Admin] God Maya
    Administrador
    Administrador
    potinho escribió:My mod is reseting task, no error in console

    [Sistema] Task System 4.0 (Task system + Daily Task System) (Tfs 0.3.7, 0.4.0 and OTX 2) 1642354012930-png


    Código:
    <?xml version="1.0" encoding="ISO-8859-1"?>
    <mod name="Simple Task" version="4.0" author="Vodkart" contact="tibiaking.com" enabled="yes">
    <config name="task_func"><![CDATA[
    task_sys = {
        [1] = {name = "Trolls", start = 176201, monsters_list = {"Troll"}, level = 8, count = 40, points = 1, items = {}, reward = {}, exp = 20000, money = 2000},
        [2] = {name = "rotworms", start = 176202, monsters_list = {"rotworm"}, level = 12, count = 50, points = 1, items = {}, reward = {}, exp = 25000, money = 3000},
        [3] = {name = "Minotaurs", start = 176216, monsters_list = {"minotaur","minotaur guard","minotaur archer","minotaur mage"}, level = 15, count = 150, points = 2, items = {}, reward = {}, exp = 30000, money = 10000},
        [4] = {name = "cyclops", start = 176203, monsters_list = {"cyclops"}, level = 19, count = 60, points = 2, items = {}, reward = {{2486,1}}, exp = 30000, money = 3000},
        [5] = {name = "Dwarves", start = 176210, monsters_list = {"dwarf","dwarf soldier","dwarf guard","dwarf geomancer"}, level = 42, count = 150, points = 4, items = {}, reward = {}, exp = 200000, money = 15000},
        [6] = {name = "Terror Birds", start = 176206, monsters_list = {"Terror Bird"}, level = 30, count = 120, points = 3, items = {}, reward = {}, exp = 100000, money = 5000},
        [7] = {name = "Stone Golems", start = 176207, monsters_list = {"Stone Golem"}, level = 33, count = 130, points = 4, items = {}, reward = {}, exp = 120000, money = 7000},
        [8] = {name = "Carniphilas", start = 176208, monsters_list = {"carniphila"}, level = 36, count = 135, points = 4, items = {}, reward = {}, exp = 80000, money = 8000},
        [9] = {name = "Elephants", start = 176209, monsters_list = {"elephant"}, level = 40, count = 150, points = 4, items = {}, reward = {}, exp = 120000, money = 8200},
        [10] = {name = "Green Djinn", start = 176204, monsters_list = {"Green Djinn","Efreet"}, level = 23, count = 80, points = 3, items = {}, reward = {}, exp = 100000, money = 5000},
        [11] = {name = "Blue Djinn", start = 176205, monsters_list = {"Blue Djinn","Marid"}, level = 25, count = 80, points = 3, items = {}, reward = {}, exp = 100000, money = 5000},
        [12] = {name = "Necromancer" ,start = 176213, monsters_list = {"Necromancer"}, level = 60, count = 200, points = 5, items = {}, reward = {}, exp = 200000, money = 15000},
        [13] = {name = "Bonebeasts" ,start = 176214, monsters_list = {"Bonebeast"}, level = 63, count = 250, points = 5, items = {}, reward = {}, exp = 250000, money = 11000},
        [14] = {name = "Vampires", start = 176211, monsters_list = {"vampire"}, level = 46, count = 170, points = 5, items = {}, reward = {}, exp = 80000, money = 8500},
        [15] = {name = "Dragons", start = 176212, monsters_list = {"dragon"}, level = 50, count = 120, points = 5, items = {}, reward = {}, exp = 90000, money = 9000},
        [16] = {name = "Heroes", start = 176240, monsters_list = {"Hero"}, level = 50, count = 320, points = 7, items = {}, reward = {}, exp = 200000, money = 30000},
        [17] = {name = "Giant Spider" ,start = 176215, monsters_list = {"Giant Spider","The old widow"}, level = 80, count = 500, points = 6, items = {}, reward = {}, exp = 200000, money = 32000},
        [18] = {name = "Hellspawn" ,start = 176232, monsters_list = {"Hellspawn"}, level = 80, count = 500, points = 7, items = {}, reward = {}, exp = 300000, money = 52000},
        [19] = {name = "Dragon Lords" ,start = 176219, monsters_list = {"Dragon lord"}, level = 88, count = 650, points = 6, items = {}, reward = {}, exp = 35000, money = 35000},
        [20] = {name = "Hydras" ,start = 176222, monsters_list = {"Hydra"}, level = 100, count = 700, points = 7, items = {{4850,10}}, reward = {}, exp = 400000, money = 40000},
        [21] = {name = "Serpent Spawn" ,start = 176223, monsters_list = {"Serpent Spawn"}, level = 103, count = 720, points = 7, items = {{2445,1}}, reward = {}, exp = 500000, money = 45000},
        [22] = {name = "Behemoths" ,start = 176224, monsters_list = {"Behemoth"}, level = 108, count = 800, points = 8, items = {}, reward = {}, exp = 5000000, money = 200000},
        [23] = {name = "Demons" ,start = 176225, monsters_list = {"Demon"}, level = 110, count = 6666, points = 20, items = {}, reward = {{2495,1}}, exp = 6660000, money = 500000},
        [24] = {name = "Ashmunrah" ,start = 176233, monsters_list = {"Ashmunrah"}, level = 110, count = 500, points = 20, items = {}, reward = {}, exp = 1500000, money = 200000},
        [25] = {name = "Rahemos" ,start = 176234, monsters_list = {"Rahemos"}, level = 110, count = 500, points = 20, items = {}, reward = {}, exp = 1500000, money = 200000},
        [26] = {name = "Thalas" ,start = 176235, monsters_list = {"Thalas"}, level = 110, count = 500, points = 20, items = {}, reward = {}, exp = 1500000, money = 200000},
        [27] = {name = "Dipthrah" ,start = 176236, monsters_list = {"Dipthrah"}, level = 110, count = 500, points = 20, items = {}, reward = {}, exp = 1500000, money = 200000},
        [28] = {name = "Mahrdis" ,start = 176237, monsters_list = {"Mahrdis"}, level = 110, count = 500, points = 20, items = {}, reward = {}, exp = 1500000, money = 200000},
        [29] = {name = "Omruc" ,start = 176238, monsters_list = {"Omruc"}, level = 110, count = 500, points = 20, items = {}, reward = {}, exp = 1500000, money = 200000},
        [30] = {name = "Morguthis" ,start = 176239, monsters_list = {"Morguthis"}, level = 110, count = 500, points = 20, items = {}, reward = {}, exp = 1500000, money = 200000},
        [31] = {name = "Orshabaals" ,start = 176226, monsters_list = {"Orshabaal"}, level = 120, count = 300, points = 10, items = {}, reward = {{2341,1},{5114,1}}, exp = 9960000, money = 800000},
        [32] = {name = "Ferumbras" ,start = 176227, monsters_list = {"Ferumbras"}, level = 130, count = 100, points = 10, items = {}, reward = {{5161,1}}, exp = 6660000, money = 666000},
        [33] = {name = "Golden Knights" ,start = 176228, monsters_list = {"Golden Knight"}, level = 200, count = 100, points = 10, items = {}, reward = {{2646,1}}, exp = 10660000, money = 900000},
        [34] = {name = "Cacheros" ,start = 176229, monsters_list = {"Cachero"}, level = 200, count = 500, points = 10, items = {}, reward = {{2646,1}}, exp = 10000000, money = 300000},
        [35] = {name = "Eternal Oblivions" ,start = 176230, monsters_list = {"Eternal Oblivion"}, level = 500, count = 200, points = 10, items = {}, reward = {{2646,1}}, exp = 10000000, money = 300000},
        [36] = {name = "Infernus" ,start = 176231, monsters_list = {"Infernus"}, level = 200, count = 300, points = 15, items = {}, reward = {{5149,3}}, exp = 10000000, money = 300000}
    }
    daily_task = {
        [1] = {name = "Orcs" ,monsters_list = {"Orc Berserker","Orc Rider","Orc Leader","Orc Warlord", "Orc", "Orc Spearman", "Orc Warrior"}, count = 100, points = 2, reward = {}, exp = 50000, money = 10000},
        [2] = {name = "Rotworms" ,monsters_list = {"Rotworm"}, count = 220, points = 2, reward = {}, exp = 90000, money = 12000},
        [3] = {name = "Cyclops" ,monsters_list = {"Cyclops"}, count = 165, points = 3, reward = {}, exp = 9000, money = 15000},
        [4] = {name = "Minotaurs" ,monsters_list = {"minotaur","minotaur guard","minotaur archer","minotaur mage"}, count = 185, points = 3, reward = {}, exp = 90000, money = 15000},
        [5] = {name = "Ghouls" ,monsters_list = {"Ghoul"}, count = 150, points = 3, reward = {}, exp = 90000, money = 11000},
        [6] = {name = "Dragons" ,monsters_list = {"Dragon"}, count = 150, points = 3, reward = {}, exp = 20000, money = 10000},
        [7] = {name = "Vampires" ,monsters_list = {"Vampire"}, count = 200, points = 3, reward = {}, exp = 200000, money = 25000},
        [8] = {name = "Ancient Scarabs" ,monsters_list = {"Ancient Scarab"}, count = 180, points = 5, reward = {}, exp = 220000, money = 18000},
        [9] = {name = "Behemoths" ,monsters_list = {"Behemoth"}, count = 300, points = 5, reward = {}, exp = 500000, money = 60000},
        [10] = {name = "Heroes" ,monsters_list = {"Hero"}, count = 260, points = 5, reward = {}, exp = 400000, money = 55000},
        [11] = {name = "Black Knights" ,monsters_list = {"Black Knight"}, count = 260, points = 5, reward = {}, exp = 400000, money = 55000},
        [12] = {name = "Giant Spiders" ,monsters_list = {"Giant Spider"}, count = 350, points = 5, reward = {}, exp = 60000, money = 70000},
        [13] = {name = "Warlocks" ,monsters_list = {"Warlock"}, count = 700, points = 5, reward = {{2173,1}}, exp = 90000, money = 120000},
        [14] = {name = "Hydras" ,monsters_list = {"Hydra"}, count = 700, points = 5, reward = {}, exp = 100000, money = 160000},
        [15] = {name = "Dragon Lords" ,monsters_list = {"Dragon Lord"}, count = 400, points = 5, reward = {{2445,1}}, exp = 1300000, money = 200000},
        [16] = {name = "Frost Dragons" ,monsters_list = {"Frost Dragon"}, count = 400, points = 5, reward = {{2445,1}}, exp = 1300000, money = 200000},
        [17] = {name = "Serpent Spawns" ,monsters_list = {"Serpent Spawn"}, count = 400, points = 5, reward = {{2445,1}}, exp = 1300000, money = 200000},
        [18] = {name = "Juggernauts" ,monsters_list = {"Juggernaut"}, count = 600, points = 5, reward = {{5156,1}}, exp = 1000000, money = 200000},
        [19] = {name = "Undead Dragons" ,monsters_list = {"Undead Dragon"}, count = 600, points = 8, reward = {{5154,1}}, exp = 1000000, money = 200000},
        [20] = {name = "Hellhounds" ,monsters_list = {"Hellhound"}, count = 600, points = 8, reward = {{5159,1}}, exp = 1000000, money = 200000},
        [21] = {name = "Cacheros" ,monsters_list = {"Cachero"}, count = 600, points = 10, reward = {}, exp = 10000000, money = 300000}
     
    }
    task_sys_storages = {176601, 176602, 176603, 176604, 176605, 176606, 176607, 176608} -- task, points, count, daily task, daily count, daily time , daily start, contador
    function getTaskMission(cid)
        return getPlayerStorageValue(cid,task_sys_storages[1]) < 0 and 1 or getPlayerStorageValue(cid,task_sys_storages[1])
    end
    function getDailyTaskMission(cid)
        return getPlayerStorageValue(cid,task_sys_storages[4]) < 0 and 1 or getPlayerStorageValue(cid,task_sys_storages[4])
    end
    function getTaskPoints(cid)
        return getPlayerStorageValue(cid,task_sys_storages[2]) < 0 and 0 or getPlayerStorageValue(cid,task_sys_storages[2])
    end
    function doRandomDailyTask(cid)
        local t = {
            [{6,80}] = {1,5},
            [{81,149}] = {6,12},
            [{150,250}] = {13,17},
            [{251,math.huge}] = {18,21}
        }
        for a , b in pairs(t) do
            if getPlayerLevel(cid) >= a[1] and getPlayerLevel(cid) <= a[2] then
                return math.random(b[1], b[2])
            end
        end
        return 0
    end
    function GetRankTask(cid)
        local ranks = {
            [{1, 20}] = "Huntsman",
            [{21, 50}] = "Ranger",
            [{51, 100}] = "Big Game Hunter",
            [{101, 200}] = "Senior Hunter",      
            [{201, math.huge}] = "Extreme Hunter"
        }
        for v , r in pairs(ranks) do
            if getTaskPoints(cid) >= v[1] and getTaskPoints(cid) <= v[2] then
                return r
            end
        end
        return 0
    end
    function getItemsFromList(items)
        local str = ''
        if table.maxn(items) > 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 doRemoveItemsFromList(cid,items)
        local count = 0
        if table.maxn(items) > 0 then
            for i = 1, table.maxn(items) do
                if getPlayerItemCount(cid,items[i][1]) >= items[i][2] then
                count = count + 1 end
            end
        end
        if count == table.maxn(items) then
            for i = 1, table.maxn(items) do doPlayerRemoveItem(cid,items[i][1],items[i][2]) end
        else
            return false
        end
        return true
    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
    function isSummon(cid)
        if(not isCreature(cid)) then
            return false
        end
        return getCreatureMaster(cid) ~= cid
    end
    ]]></config>
    <event type="login" name="TaskLogin" event="script"><![CDATA[
    function onLogin(cid)
        registerCreatureEvent(cid, "KillTask")
        registerCreatureEvent(cid, "TaskLook")
        return true
    end]]></event>
    <talkaction words="/task;!task" event="buffer"><![CDATA[
    domodlib('task_func')
    param,task,daily = param:lower(), getTaskMission(cid), getDailyTaskMission(cid)
    if isInArray({"counter","contador"},param) then
        setPlayerStorageValue(cid, task_sys_storages[8], getPlayerStorageValue(cid, task_sys_storages[8]) <= 0 and 1 or 0)
        doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE,"[Task System] The counter was "..(getPlayerStorageValue(cid, task_sys_storages[8]) <= 0 and "enabled" or "disabled")..".") return true
    elseif isInArray({"daily","diaria"},param) then
        if not daily_task[daily] or getPlayerStorageValue(cid, task_sys_storages[7]) <= 0 then
            doPlayerSendCancel(cid, "Sorry, but you are not on any Task Daily.") return true
        elseif getPlayerStorageValue(cid, task_sys_storages[6]) - os.time() <= 0 and getPlayerStorageValue(cid, task_sys_storages[5]) < daily_task[daily].count then
            doPlayerSendCancel(cid,"Sorry, you didn't finish the Daily Task in time! Please go back to NPC Task and start a new Daily Task.") return true
        end
        return doShowTextDialog(cid, 1961, "[->] CURRENT DAILY TASK INFO [<-]\n\nName: "..daily_task[daily].name.."\nProgress: ["..(getPlayerStorageValue(cid, task_sys_storages[5]) < 0 and 0 or getPlayerStorageValue(cid, task_sys_storages[5])).."/"..daily_task[daily].count.."]\nDelivery time: "..os.date("%d %B %Y %X ", getPlayerStorageValue(cid,task_sys_storages[6])).."\nMonsters to hunt: "..getMonsterFromList(daily_task[daily].monsters_list).."\n\n[->] CURRENT TASK REWARDS [<-]\n\nMoney: "..(daily_task[daily].money > 0 and daily_task[daily].money or 0).."\nExperience: "..(daily_task[daily].exp > 0 and daily_task[daily].exp or 0).."\nTask Points: "..daily_task[daily].points.."\nItems: "..(#daily_task[daily].reward > 0 and getItemsFromList(daily_task[daily].reward) or "None")..".")
    end
    if not task_sys[task] or getPlayerStorageValue(cid, task_sys[task].start) <= 0 then
        doPlayerSendCancel(cid, "You are not on any task.") return true
    end
    return doShowTextDialog(cid, 1961, "-> TASK POINTS [" .. getTaskPoints(cid).. "] <- \n\n-> CURRENT TASK ["..getTaskMission(cid).."/"..#task_sys.."] <-\n\nTask Name: "..task_sys[task].name.."\nTask Level: "..task_sys[task].level.."\nTask Progress: ["..(getPlayerStorageValue(cid, task_sys_storages[3]) < 0 and 0 or getPlayerStorageValue(cid, task_sys_storages[3])).."/"..task_sys[task].count.."]\nMonster To Hunt: "..getMonsterFromList(task_sys[task].monsters_list)..".\nItens Para Entrega: "..(#task_sys[task].items > 0 and getItemsFromList(task_sys[task].items) or "None")..".\n\n[->] CURRENT TASK REWARDS [<-]\n\nReward Money: "..((tonumber(task_sys[task].money) and tonumber(task_sys[task].money) > 0) and task_sys[task].money or 0).."\nReward Experience: "..((tonumber(task_sys[task].exp) and tonumber(task_sys[task].exp) > 0) and task_sys[task].exp or 0).."\nReward Points: "..task_sys[task].points.."\nReward Items: "..(#task_sys[task].reward > 0 and getItemsFromList(task_sys[task].reward) or "None")..".")
    ]]></talkaction>
    <event type="look" name="TaskLook" event="script"><![CDATA[
    domodlib('task_func')
    function onLook(cid, thing, position, lookDistance)
        if isPlayer(thing.uid) and getTaskPoints(thing.uid) > 0 then
            doPlayerSetSpecialDescription(thing.uid, "\n"..(getPlayerSex(thing.uid) == 0 and "She" or "He").. " is a "..GetRankTask(thing.uid))
        end  
        return true
    end]]></event>
    <event type="kill" name="KillTask" event="script"><![CDATA[
    domodlib('task_func')
    function onKill(cid, target)
        if isPlayer(cid) and isMonster(target) then
            local t,daily = task_sys[getTaskMission(cid)], daily_task[getDailyTaskMission(cid)]      
            if t and getPlayerStorageValue(cid, t.start) > 0 and isInArray(t.monsters_list, getCreatureName(target):lower())then
                local ab = getPlayerStorageValue(cid, task_sys_storages[3]) == -1 and tonumber(0) or tonumber(getPlayerStorageValue(cid, task_sys_storages[3]))
                if tonumber(ab) and tonumber(ab) < t.count then
                    setPlayerStorageValue(cid, task_sys_storages[3], ab <= 0 and tonumber(1) or tonumber(ab+1))
                    if getPlayerStorageValue(cid, task_sys_storages[8]) <= 0 and tonumber(getPlayerStorageValue(cid, task_sys_storages[3])) and tonumber(getPlayerStorageValue(cid, task_sys_storages[3])) < t.count then
                        doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE,"[Task System] You defeated Total [" .. tonumber(getPlayerStorageValue(cid, task_sys_storages[3])) .. "/" .. t.count .. "] of the Task of the " .. t.name .. ".")
                    end
                    if tonumber(getPlayerStorageValue(cid, task_sys_storages[3])) >= t.count then
                        doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE,"[Task System] Congratulations! You have finished the Task of "..t.name..", go back to NPC to get your reward.")
                    end
                end
            end
            if daily and getPlayerStorageValue(cid, task_sys_storages[7]) > 0 and getPlayerStorageValue(cid, task_sys_storages[6]) - os.time() >= 0 and isInArray(daily.monsters_list, getCreatureName(target):lower()) then
                local cd = getPlayerStorageValue(cid, task_sys_storages[5]) == -1 and tonumber(0) or tonumber(getPlayerStorageValue(cid, task_sys_storages[5]))
                if tonumber(cd) and cd < daily.count then
                    setPlayerStorageValue(cid, task_sys_storages[5], cd <= 0 and tonumber(1) or tonumber(cd+1))
                    if getPlayerStorageValue(cid, task_sys_storages[8]) <= 0 and tonumber(getPlayerStorageValue(cid, task_sys_storages[5])) < daily.count then
                        doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE,"[Daily Task System] You defeated Total [" .. tonumber(getPlayerStorageValue(cid, task_sys_storages[5])) .. "/" .. daily.count .. "] of the Task of the " .. daily.name .. ".")
                    end
                    if tonumber(getPlayerStorageValue(cid, task_sys_storages[5])) >= daily.count then
                        doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE,"[Daily Task System] Congratulations! You have finished the Task of "..daily.name..", go back to NPC to get your reward.")
                    end
                end
            end
            return true
        end
        return true
    end]]></event>
    </mod>


    no entiendo



    [Sistema] Task System 4.0 (Task system + Daily Task System) (Tfs 0.3.7, 0.4.0 and OTX 2) YNU5B25
    +9
    potinho
    ioke
    wizinx
    Darwiinxp
    chili bizc
    kamus9629
    darksenki
    Sotomayor
    [Admin] God Maya
    13 participantes
    http://www.tibiaface.com

    Nekokan

    Nekokan
    Miembro
    Miembro
    hola,

    estoy usando forgotten server tfs 4.1 y esté no tiene carpeta de mods...
    he probado crearla en Data -> mods y entonces crear el archivo Simple Task.xml

    pero me sigue dando este error.
    data/npc/scripts/simple_task.lua
    data/npc/scripts/simple_task.lua:1: attempt to call global 'domodlib' (a nil value)

    al parecer no llega a reconocer la función de
    > domodlib('task_func')

    no encuentra el archivo y por eso no la reconoce? tampoco entiendo que no tenga la carpeta, alguien sabe?

    +9
    potinho
    ioke
    wizinx
    Darwiinxp
    chili bizc
    kamus9629
    darksenki
    Sotomayor
    [Admin] God Maya
    13 participantes

    zerochile

    zerochile
    Miembro
    Miembro
    Nekokan escribió:hola,

    estoy usando forgotten server tfs 4.1 y esté no tiene carpeta de mods...
    he probado crearla en Data -> mods y entonces crear el archivo Simple Task.xml

    pero me sigue dando este error.
    data/npc/scripts/simple_task.lua
    data/npc/scripts/simple_task.lua:1: attempt to call global 'domodlib' (a nil value)

    al parecer no llega a reconocer la función de
    > domodlib('task_func')

    no encuentra el archivo y por eso no la reconoce? tampoco entiendo que no tenga la carpeta, alguien sabe?

    COMOOOO?!
    Como que tfs 4.1? ¿eso existe...? Laughing

    +9
    potinho
    ioke
    wizinx
    Darwiinxp
    chili bizc
    kamus9629
    darksenki
    Sotomayor
    [Admin] God Maya
    13 participantes
    http://venore-war.sytes.net

    Nekokan

    Nekokan
    Miembro
    Miembro
    zerochile escribió:
    Nekokan escribió:hola,

    estoy usando forgotten server tfs 4.1 y esté no tiene carpeta de mods...
    he probado crearla en Data -> mods y entonces crear el archivo Simple Task.xml

    pero me sigue dando este error.
    data/npc/scripts/simple_task.lua
    data/npc/scripts/simple_task.lua:1: attempt to call global 'domodlib' (a nil value)

    al parecer no llega a reconocer la función de
    > domodlib('task_func')

    no encuentra el archivo y por eso no la reconoce? tampoco entiendo que no tenga la carpeta, alguien sabe?

    COMOOOO?!
    Como que tfs 4.1? ¿eso existe...? Laughing

    noooo disculpa, es 1.4
    > The Forgotten Server - Version 1.4.1

    +9
    potinho
    ioke
    wizinx
    Darwiinxp
    chili bizc
    kamus9629
    darksenki
    Sotomayor
    [Admin] God Maya
    13 participantes

    akane

    akane
    Miembro
    Miembro
    sigue sin funcionar el look :C

    +9
    potinho
    ioke
    wizinx
    Darwiinxp
    chili bizc
    kamus9629
    darksenki
    Sotomayor
    [Admin] God Maya
    13 participantes

    [Admin] God Maya

    [Admin] God Maya
    Administrador
    Administrador
    poncex escribió:sigue sin funcionar el look :C

    que version de ot estas usando que version de consola



    [Sistema] Task System 4.0 (Task system + Daily Task System) (Tfs 0.3.7, 0.4.0 and OTX 2) YNU5B25
    +9
    potinho
    ioke
    wizinx
    Darwiinxp
    chili bizc
    kamus9629
    darksenki
    Sotomayor
    [Admin] God Maya
    13 participantes
    http://www.tibiaface.com

    Contenido patrocinado


    +9
    potinho
    ioke
    wizinx
    Darwiinxp
    chili bizc
    kamus9629
    darksenki
    Sotomayor
    [Admin] God Maya
    13 participantes

    Ver el tema anterior Ver el tema siguiente Volver arriba  Mensaje (Página 1 de 2.)

    Ir a la página : 1, 2  Siguiente

    Permisos de este foro:
    No puedes responder a temas en este foro.

     

    BienvenidosTibiaFace es una comunidad de Open Tibia. Para participar debes estar registrado (click para Regístrate).