Ir para conteúdo

[Encerrado] [AGS] Guild Task não funcionando


gmstrikker

Posts Recomendados

Encontrei aqui nesse fórum esse sistema incrivel de guild task, onde uma guild tem uma task para matar certos monstros e depois ganham uma recompensa.

O problema é que configurei minha lista de monstros da task, mas quando falo com o NPC ele não entrega nenhuma task, acho que fiz alguma coisa errado...

Sistema full:

 

Fala com NPC:

10:45 Arthur: Strikker, would you like to get some tasks?
10:45 Strikker [20]: tasks
10:45 Arthur: Do you want to start a task, reset a task, finish your task, check your guild's progress or information about guild tasks?
10:46 Strikker [20]: start
10:46 Arthur: I have the following tasks for your guild: . Which one do you want?

 

lib/guildtask_lib.lua

 

-- Storages
GT = {
    kills = 51,
    totalKills = 52,
    task = 53,
    time = 54,


-- Customization starts here

-- Monsters

    monsters = {
        {names = {"Troll"}, totalKills = 2000, money = 600000, points = 1, minPoints = 0},
        {names = {"Rotworm"}, totalKills = 2000, money = 600000, points = 1, minPoints = 1},
        {names = {"Goblin"}, totalKills = 2000, money = 600000, points = 1, minPoints = 2},
        {names = {"Dwarf"}, totalKills = 2000, money = 600000, points = 1, minPoints = 3},
        {names = {"Amazon"}, totalKills = 2000, money = 600000, points = 1, minPoints = 4},
        {names = {"Carrion Worm"}, totalKills = 2000, money = 600000, points = 1, minPoints = 5},
        {names = {"Valkyrie"}, totalKills = 2000, money = 600000, points = 1, minPoints = 6},
        {names = {"Skeleton"}, totalKills = 2000, money = 600000, points = 1, minPoints = 7},
        {names = {"Minotaur"}, totalKills = 2000, money = 600000, points = 1, minPoints = 8},
        {names = {"Ghoul"}, totalKills = 2000, money = 600000, points = 1, minPoints = 9},
        {names = {"Elf"}, totalKills = 2000, money = 600000, points = 1, minPoints = 10},
        {names = {"Dwarf Soldier"}, totalKills = 2000, money = 600000, points = 1, minPoints = 11},
        {names = {"Tarantula"}, totalKills = 2000, money = 600000, points = 1, minPoints = 12},
        {names = {"Cyclops"}, totalKills = 2000, money = 600000, points = 1, minPoints = 13},

        {names = {"Larva"}, totalKills = 2000, money = 600000, points = 1, minPoints = 14},
        {names = {"Nomad"}, totalKills = 2000, money = 600000, points = 1, minPoints = 15},
        {names = {"Tortoise"}, totalKills = 2000, money = 600000, points = 1, minPoints = 16},
        {names = {"Terramite"}, totalKills = 2000, money = 600000, points = 1, minPoints = 17},
        {names = {"Crocodile"}, totalKills = 2000, money = 600000, points = 1, minPoints = 18},

            

            
        {names = {"Scarab"}, totalKills = 40000, money = 800000, points = 1, minPoints = 19},
        {names = {"Kongra"}, totalKills = 40000, money = 800000, points = 1, minPoints = 20},
        {names = {"Sibang"}, totalKills = 40000, money = 800000, points = 1, minPoints = 21},
        {names = {"Mammoth"}, totalKills = 40000, money = 800000, points = 1, minPoints = 22},
        {names = {"Cyclops Drone"}, totalKills = 40000, money = 800000, points = 1, minPoints = 23},
        {names = {"Cyclops Smith"}, totalKills = 40000, money = 800000, points = 1, minPoints = 24},
        {names = {"Demon Skeleton"}, totalKills = 40000, money = 800000, points = 1, minPoints = 25},
        {names = {"Wyvern"}, totalKills = 40000, money = 800000, points = 1, minPoints = 26},
        {names = {"Vampire"}, totalKills = 40000, money = 800000, points = 1, minPoints = 27},
        {names = {"Zombie"}, totalKills = 40000, money = 800000, points = 1, minPoints = 28},
        {names = {"Mutated Rat"}, totalKills = 40000, money = 30000, points = 1, minPoints = 29},
        {names = {"Dwarf Guard"}, totalKills = 40000, money = 800000, points = 1, minPoints = 30},
        {names = {"Dragon"}, totalKills = 40000, money = 800000, points = 1, minPoints = 31},
        {names = {"Ice Witch"}, totalKills = 40000, money = 800000, points = 1, minPoints = 32},
        {names = {"Frost Giantess"}, totalKills = 40000, money = 800000, points = 1, minPoints = 33},
        {names = {"Ice Golem"}, totalKills = 40000, money = 800000, points = 1, minPoints = 34},
        {names = {"Stone Golem"}, totalKills = 40000, money = 800000, points = 1, minPoints = 35},
            
            


        {names = {"Giant Spider"}, totalKills = 60000, money = 1200000, points = 1, minPoints = 36},
        {names = {"Dragon Lord"}, totalKills = 60000, money = 1200000, points = 1, minPoints = 37},
        {names = {"Frost Dragon"}, totalKills = 60000, money = 1200000, points = 1, minPoints = 38},
        {names = {"Wyrm"}, totalKills = 60000, money = 1200000, points = 1, minPoints = 39},
        {names = {"Hydra"}, totalKills = 60000, money = 1200000, points = 1, minPoints = 40},
        {names = {"Warlock"}, totalKills = 60000, money = 1200000, points = 1, minPoints = 41},
        {names = {"Slick Water Elemental"}, totalKills = 60000, money = 1200000, points = 1, minPoints = 42},
        {names = {"Water Elemental"}, totalKills = 60000, money = 1200000, points = 1, minPoints = 43},
        {names = {"Earth Elemental"}, totalKills = 60000, money = 1200000, points = 1, minPoints = 44},
        {names = {"Crystal Spider"}, totalKills = 60000, money = 1200000, points = 1, minPoints = 45},
        {names = {"Black Knight"}, totalKills = 60000, money = 1200000, points = 1, minPoints = 46},
        {names = {"Hero"}, totalKills = 60000, money = 1200000, points = 1, minPoints = 47},
        {names = {"Demon"}, totalKills = 60000, money = 1200000, points = 1, minPoints = 48},
        {names = {"Serpent Spawn"}, totalKills = 60000, money = 1200000, points = 1, minPoints = 49},
        {names = {"Werewolf"}, totalKills = 60000, money = 1200000, points = 1, minPoints = 50},
        {names = {"Destroyer"}, totalKills = 60000, money = 1200000, points = 1, minPoints = 51},
        {names = {"Mutated Tiger"}, totalKills = 60000, money = 1200000, points = 1, minPoints = 52},
        {names = {"Grim Reaper"}, totalKills = 60000, money = 1200000, points = 1, minPoints = 53},
        {names = {"Juggernaut"}, totalKills = 60000, money = 1200000, points = 1, minPoints = 54},
        {names = {"Hand of Cursed Fate"}, totalKills = 60000, money = 1200000, points = 1, minPoints = 55}
    },

-- Other variables

    waitTime = 1440, -- Tempo de espera para começar outra task após entregar uma
}

-- Customization ends here

function doResetGuildTask(guild_id, resetTime)
    for _, stgkey in ipairs({GT.kills, GT.totalKills, GT.task, GT.time}) do
        setGuildStorageValue(guild_id, stgkey, 0)
    end
    if resetTime then
        setGuildStorageValue(guild_id, GT.time, os.time() + GT.waitTime * 60)
    end
    return true
end

function doStartGuildTask(guild_id, task)
    local taskInfo = GT.monsters[task]
    setGuildStorageValue(guild_id, GT.totalKills, taskInfo.totalKills)
    setGuildStorageValue(guild_id, GT.task, task)
    setGuildStorageValue(guild_id, GT.kills, 0)
    return true
end

function getGuildTaskWaitTime(guild)
    local nextTime = getGuildStorageValue(guild, GT.time)
    if nextTime > os.time() then
        return nextTime - os.time()
    else
        return 0
    end
end

function doCompleteGuildTask(guild_id)
    local taskInfo = GT.monsters[getGuildStorageValue(guild_id, GT.task)]
    doGuildAddPoints(guild_id, taskInfo.points)
    doGuildAddBalance(guild_id, taskInfo.money)
    doResetGuildTask(guild_id, true)
    return true
end

 

 

 

O que eu fiz de errado?

Editado por gmstrikker
Link para o comentário
Compartilhar em outros sites

Não cheguei a ler o script, mas no tópico original o nome dos monstros está minusculo, já testou para ver se tem alguma relação?

Também pode ser por estar faltando uma virgula no final dessa linha:

{names = {"Hand of Cursed Fate"}, totalKills = 60000, money = 1200000, points = 1, minPoints = 55}

 

Editado por SirDubstep
Link para o comentário
Compartilhar em outros sites

  • 3 weeks later...
Em 21/09/2018 em 11:38, SirDubstep disse:

Não cheguei a ler o script, mas no tópico original o nome dos monstros está minusculo, já testou para ver se tem alguma relação?

Também pode ser por estar faltando uma virgula no final dessa linha:


{names = {"Hand of Cursed Fate"}, totalKills = 60000, money = 1200000, points = 1, minPoints = 55}

 

 

Coloquei a virgula no final do último, tentei colocar todos os monstros com letras minusculas, como no script padrão e nada mudou

00:43 Arthur The Guild Tasker: I have the following tasks for your guild: . Which one do you want?

Link para o comentário
Compartilhar em outros sites

  • 4 months later...
A questão neste suporte foi encerrada por falta de respostas. Este tópico está fechado e foi movido para Suporte - Tópicos Sem Resposta.

+ Caso a dúvida não tenha sido resolvida você poderá criar outro tópico solicitando ajuda.
* Lembre-se que é permitido dar UP no tópico a cada 24 horas para assim o destacar e manter movimentado.
Link para o comentário
Compartilhar em outros sites

Visitante
Este tópico está impedido de receber novos posts.
  • Quem Está Navegando   0 membros estão online

    • Nenhum usuário registrado visualizando esta página.
×
×
  • Criar Novo...