Ir para conteúdo

Featured Replies

Postado

Atualmente uso em meu server este script de task:

 

-- Sistema de Task feito por Leoric --

taskstg =
{
kills = 3451,
permission = 3452,
killstotal = 3453,
monster = 3454,
stage = 3455,
points = 3456,
}

timeBetweenTasks = 1 * 1 * 1 -- tempo até poder fazer outra task (24 * 60 * 60 = 24hs)
taskLevel = true -- true se quiser que as tasks sejam feitas por level / false se quiser que elas sejam feitas na ordem
taskMsg = {bool = true, msg = 'Voce acaba de matar monstros suficientes para completar sua task!'} -- bool = false > sem mensagens; bool = true > aviso quando terminar a task
taskEnd = true -- [não tem função no modo Level] se estiver como true, quando o jogador terminar a última task disponível, ele não poderá repeti-la. Se estiver false, ele poderá repetir a última task infinitamente.

taskmonsters =
{
[1] = {'[1]rotworm', killstotal = 10},
[2] = {'[10]carrion worm', killstotal = 20},
[3] = {'[20]cyclops', killstotal = 30},
[4] = {'[30]thornback tortoise', killstotal = 40},
[5] = {'[40]quara constrictor', killstotal = 50},
[6] = {'[50]nightmare', killstotal = 60},
[7] = {'[60]hydra', killstotal = 70},
[8] = {'[70]hellspawn', killstotal = 80},
[9] = {'[80]lost soul', killstotal = 90},
[10] = {'[90]grim reaper', killstotal = 100},
[11] = {'[100]undead dragon', killstotal = 110}
}

taskreward = -- em gps
{
[1] = {money = 350,xp = 500, points = 1},
[2] = {money = 750,xp = 2000, points = 2},
[3] = {money = 1500,xp = 5000, points = 3},
[4] = {money = 2000,xp = 10000, points = 4},
[5] = {money = 3000,xp = 12000, points = 5},
[6] = {money = 5000,xp = 14000,item = 2159,amount = 1, points = 6},
[7] = {money = 7000,xp = 16000,item = 6527,amount = 3, points = 7},
[8] = {money = 9000,xp = 18000,item = 6527,amount = 5, points = 8},
[9] = {money = 11000,xp = 20000,item = 6527,amount = 7, points = 9},
[10] = {money = 13000,xp = 22000,item = 6527,amount = 9, points = 10},
[11] = {money = 15000,xp = 25000,item = 6527,amount = 12, points = 11}
}

function canDoTask(cid)
    local stage = getPlayerStorageValue(cid, taskstg.stage)
    if stage + 1 > #taskmonsters then
        return false
    elseif getPlayerStorageValue(cid,taskstg.permission) <= 0 then
        return true
    elseif getPlayerStorageValue(cid,taskstg.permission) == 1 then
        return false
    elseif getPlayerStorageValue(cid,taskstg.permission) >= os.time(t) then
        return false
    end
    return true
end

function doResetTask(cid)
    setPlayerStorageValue(cid,taskstg.kills,-1)
    setPlayerStorageValue(cid,taskstg.permission,os.time(t) + timeBetweenTasks)
    setPlayerStorageValue(cid,taskstg.killstotal,-1)
    setPlayerStorageValue(cid,taskstg.monster,-1)
    return true
end

function doRewardTask(cid)
    local monster = getPlayerStorageValue(cid,taskstg.monster)
    local reward = taskreward[monster]
    if reward.item then
        doPlayerAddItem(cid,reward.item,(reward.amount and reward.amount or 1))
    end
    if reward.points then
        local points = getPlayerStorageValue(cid, taskstg.points)
        if points == -1 then
            setPlayerStorageValue(cid, taskstg.points, 0)
        end
        setPlayerStorageValue(cid, taskstg.points, reward.points + points)
    end
    if monster and reward then
        doPlayerAddMoney(cid,reward.money)        
        doPlayerAddExperience(cid, reward.xp)
    end    
    return true
end

function isSummon(cid) -- baseada na função do Vodkart
    if getCreatureMaster(cid) ~= nil or getCreatureMaster(cid) == true then
        return true
    end
    return false
end

function doCompleteTask(cid)
    doRewardTask(cid)
    doResetTask(cid)
    return true
end

function doStartTask(cid)
	local lvl = getPlayerLevel(cid)
	if lvl < 10 then
		local killstotal = taskmonsters[1].killstotal
		setPlayerStorageValue(cid,taskstg.monster,1)
		setPlayerStorageValue(cid,taskstg.killstotal,killstotal)
		setPlayerStorageValue(cid,taskstg.permission,1)
		setPlayerStorageValue(cid,taskstg.kills,0)
	elseif lvl < 20 then
		local killstotal = taskmonsters[2].killstotal
		setPlayerStorageValue(cid,taskstg.monster,2)
		setPlayerStorageValue(cid,taskstg.killstotal,killstotal)
		setPlayerStorageValue(cid,taskstg.permission,1)
		setPlayerStorageValue(cid,taskstg.kills,0)
	elseif lvl < 30 then
		local killstotal = taskmonsters[3].killstotal
		setPlayerStorageValue(cid,taskstg.monster,3)
		setPlayerStorageValue(cid,taskstg.killstotal,killstotal)
		setPlayerStorageValue(cid,taskstg.permission,1)
		setPlayerStorageValue(cid,taskstg.kills,0)
	elseif lvl < 40 then
		local killstotal = taskmonsters[4].killstotal
		setPlayerStorageValue(cid,taskstg.monster,4)
		setPlayerStorageValue(cid,taskstg.killstotal,killstotal)
		setPlayerStorageValue(cid,taskstg.permission,1)
		setPlayerStorageValue(cid,taskstg.kills,0)
	elseif lvl < 50 then
		local killstotal = taskmonsters[5].killstotal
		setPlayerStorageValue(cid,taskstg.monster,5)
		setPlayerStorageValue(cid,taskstg.killstotal,killstotal)
		setPlayerStorageValue(cid,taskstg.permission,1)
		setPlayerStorageValue(cid,taskstg.kills,0)
	elseif lvl < 60 then
		local killstotal = taskmonsters[6].killstotal
		setPlayerStorageValue(cid,taskstg.monster,6)
		setPlayerStorageValue(cid,taskstg.killstotal,killstotal)
		setPlayerStorageValue(cid,taskstg.permission,1)
		setPlayerStorageValue(cid,taskstg.kills,0)
	elseif lvl < 70 then
		local killstotal = taskmonsters[7].killstotal
		setPlayerStorageValue(cid,taskstg.monster,7)
		setPlayerStorageValue(cid,taskstg.killstotal,killstotal)
		setPlayerStorageValue(cid,taskstg.permission,1)
		setPlayerStorageValue(cid,taskstg.kills,0)
	elseif lvl < 80 then
		local killstotal = taskmonsters[8].killstotal
		setPlayerStorageValue(cid,taskstg.monster,8)
		setPlayerStorageValue(cid,taskstg.killstotal,killstotal)
		setPlayerStorageValue(cid,taskstg.permission,1)
		setPlayerStorageValue(cid,taskstg.kills,0)
	elseif lvl < 90 then
		local killstotal = taskmonsters[9].killstotal
		setPlayerStorageValue(cid,taskstg.monster,9)
		setPlayerStorageValue(cid,taskstg.killstotal,killstotal)
		setPlayerStorageValue(cid,taskstg.permission,1)
		setPlayerStorageValue(cid,taskstg.kills,0)
	elseif lvl < 100 then
		local killstotal = taskmonsters[10].killstotal
		setPlayerStorageValue(cid,taskstg.monster,10)
		setPlayerStorageValue(cid,taskstg.killstotal,killstotal)
		setPlayerStorageValue(cid,taskstg.permission,1)
		setPlayerStorageValue(cid,taskstg.kills,0)
        else
		local killstotal = taskmonsters[11].killstotal
		setPlayerStorageValue(cid,taskstg.monster,11)
		setPlayerStorageValue(cid,taskstg.killstotal,killstotal)
		setPlayerStorageValue(cid,taskstg.permission,1)
		setPlayerStorageValue(cid,taskstg.kills,0)
	end
	return true
end

Queria que os jogadores com 3000 task points (independente do level) pudessem ter acesso a uma cave especial onde matariam um boss...

Será que é difícil, não entendo mto de script, seria por storage? 

Resolvido por Vodkart

Ir para solução
  • Respostas 7
  • Visualizações 788
  • Created
  • Última resposta

Top Posters In This Topic

Most Popular Posts

  • local keywordHandler = KeywordHandler:new() local npcHandler = NpcHandler:new(keywordHandler) NpcSystem.parseParameters(npcHandler) local talkState = {} function onCreatureAppear(cid) npcHandler:onCre

  • é simples, os points é por storage ai vc poderia fazer assim na entrada da cave   local points = getPlayerStorageValue(cid, 3456) if points < 3000 then -- msg não pode entrar na cave

Postado

é simples, os points é por storage

ai vc poderia fazer assim na entrada da cave

 

local points = getPlayerStorageValue(cid, 3456)
if points < 3000 then
-- msg não pode entrar na cave
end
-- teleportar jogador pra dentro da cave

 

vodkart_logo.png

[*Ninguém será digno do sucesso se não usar suas derrotas para conquistá-lo.*]

 

DISCORDvodkart#6090

 

Participe da conversa

Você pode postar agora e se cadastrar mais tarde. Se você tem uma conta, faça o login para postar com sua conta.

Visitante
Responder

Quem Está Navegando 0

  • Nenhum usuário registrado visualizando esta página.

Estatísticas dos Fóruns

  • Tópicos 96.9k
  • Posts 519.6k

Informação Importante

Confirmação de Termo