Ir para conteúdo

Featured Replies

  • Respostas 29
  • Visualizações 1.4k
  • Created
  • Última resposta

Top Posters In This Topic

Most Popular Posts

  • local config = {     storage = 9721,     time = 5,                                --Tempo para fazer a quest, em minutos.     interval = 15,                           --Tempo para poder usar a alavanc

  • eu não entendo você edita direto oque você quer  você queria que tinha que ter tempo para matar 1 boss só agora é os 6 boss e se tempo acabar os players seria teletransportados esse script

  • local config = {     storage = 9721,     time = 5,                                --Tempo para fazer a quest, em minutos.     interval = 15,                           --Tempo para poder usar a alavanc

Postado

eu não entendo você edita direto oque você quer 

você queria que tinha que ter tempo para matar 1 boss só

agora é os 6 boss

e se tempo acabar os players seria teletransportados

local tb_players = {
      {pos = {x=1126,y=1152,z=7, stackpos=253},topos = {x=1127,y=1153,z=8}, effect = 10,tempo = 15,retorno = {x=1095,y=1062,z=8}},
      {pos = {x=1125,y=1152,z=7, stackpos=253},topos = {x=1126,y=1153,z=8}, effect = 10,tempo = 15,retorno = {x=1095,y=1063,z=8}},
}
--[[{pos = {x=1126,y=1152,z=7, stackpos=253} -- posição do player
,topos = {x=1127,y=1153,z=8},  -- posição para onde player vai ir
effect = 10, -- effect no play
tempo = 15, -- tempo em segundos
retorno = {x=1095,y=1062,z=8}},]] -- para onde player vai ser envidado se acabar o tempo

local tb_boss = {
    {name = "Annihilon",pos = {x=1121,y=1151,z=8}, effect = 10,tempo = 20}, -- nome posição do boss e effect e tempo que ele vai ficar
    {name = "Annihilon",pos = {x=1121,y=1153,z=8}, effect = 10,tempo = 20}, -- nome posição do boss e effect e tempo que ele vai ficar
	{name = "Annihilon",pos = {x=1121,y=1155,z=8}, effect = 10,tempo = 20}, -- nome posição do boss e effect e tempo que ele vai ficar
    {name = "Annihilon",pos = {x=1129,y=1151,z=8}, effect = 10,tempo = 20}, -- nome posição do boss e effect e tempo que ele vai ficar
	{name = "Annihilon",pos = {x=1129,y=1153,z=8}, effect = 10,tempo = 20}, -- nome posição do boss e effect e tempo que ele vai ficar
    {name = "Annihilon",pos = {x=1129,y=1155,z=8}, effect = 10,tempo = 20}  -- nome posição do boss e effect e tempo que ele vai ficar
}

local check_quest,playes_ids,boss = 0,{},{}
function onUse(cid, item, fromPosition, itemEx, toPosition)
if check_quest ~= 0 then
doPlayerSendTextMessage(cid,22,"já tem gente nessa quest")
return true
end
local plataforma = 0
for k,valor in pairs(tb_players) do
all = getThingfromPos(valor.pos)
if all.itemid > 0 and isPlayer(all.uid) then
plataforma = plataforma+ all.itemid
end
end
if plataforma == #tb_players then
check_quest = 1
for i = 1,#tb_players do
all_pos_play = getThingfromPos(tb_players[i].pos)
playes_ids[i] = getCreatureByName(getCreatureName(all_pos_play.uid))
doTeleportThing(all_pos_play.uid,tb_players[i].topos)
end
doTransformItem(item.uid,item.itemid == 1945 and 1946 or 1945)
for i = 1,#tb_boss do
boss[i] = doCreateMonster(tb_boss[i].name,tb_boss[i].pos)
addEvent(removerBoss,tb_boss[i].tempo*1000,boss,i)
end
reRead(0)
else
doPlayerSendCancel(cid,"precisa de "..#tb_players.." players")
end
return true
end

function removerBoss (boss,i)
if isCreature(boss[i]) then
doSendMagicEffect(getThingPos(boss[i]),tb_boss[i].effect)
doRemoveCreature(boss[i])
if  i == #boss then
reRead(2)
end
else
table.remove (boss)
if #boss == 0 then
reRead(1)
end
end
end

function reRead(x)
for i = 1,#playes_ids do
if x == 0 and isPlayer (playes_ids[i]) then
doPlayerSendTextMessage(playes_ids[i],22,"você tem "..tb_boss[1].tempo.." segundos para matar boss")
doSendMagicEffect(tb_players[i].topos,tb_players[i].effect)
elseif x == 1 and isPlayer (playes_ids[i]) then
check_quest = 0
doPlayerSendTextMessage(playes_ids[i],22,"parabéns por ter matado boss")
elseif x == 2 and isPlayer (playes_ids[i]) then
check_quest = 0
doPlayerSendTextMessage(playes_ids[i],22,"o seu tempo acabou agora sera teletraspostado em "..tb_players[i].tempo.." segundos")
addEvent(reRead,tb_players[i].tempo*1000,3)
elseif x == 3 and isPlayer (playes_ids[i]) then
doTeleportThing(playes_ids[i],tb_players[i].retorno)
doSendMagicEffect(tb_players[i].retorno,tb_players[i].effect)
end
end
end 

esse script vai funcionar na seguinte forma você

tem tempo para matar os boss e se não matar no tempo certo

sera teletransportado dps de segundos do tempo configurado

agora se matar todos não vai ser teletransportados

e vai verificar se tem gente na quest

vai fazer alavanca se mover assim que entra na quest

vai verificar os player que ta na quest esta online se não morreu

e já ta nas suas coordenadas  

outros efeitos no player e no boss msg ect

 

se quer um boss só para segurar tempo e os outros só só para aumentar os bicho 

use esse script 

local tb_players = {
    {pos = {x=1126,y=1152,z=7, stackpos=253},topos = {x=1127,y=1153,z=8}, effect = 10,tempo = 15,retorno = {x=1095,y=1062,z=8}},
    {pos = {x=1125,y=1152,z=7, stackpos=253},topos = {x=1126,y=1153,z=8}, effect = 10,tempo = 15,retorno = {x=1095,y=1063,z=8}},
}
local tb_boss = {
    {name = "Annihilon",pos = {x=1121,y=1151,z=8}, effect = 10,tempo = 20},
    {name = "Annihilon",pos = {x=1121,y=1153,z=8}, effect = 10,tempo = 20},
    	{name = "Annihilon",pos = {x=1121,y=1155,z=8}, effect = 10,tempo = 20},
    {name = "Annihilon",pos = {x=1129,y=1151,z=8}, effect = 10,tempo = 20},
    	{name = "Annihilon",pos = {x=1129,y=1153,z=8}, effect = 10,tempo = 20},
    {name = "Annihilon",pos = {x=1129,y=1155,z=8}, effect = 10,tempo = 20}
}

local bossMaster = {name = "Dragon",pos = {x=x,y=y,z=z, stackpos=253}, effect = 10,tempo = 20}

local check_quest,playes_ids,boss = 0,{},{}

function onUse(cid, item, fromPosition, itemEx, toPosition)
    if check_quest ~= 0 then
        doPlayerSendTextMessage(cid,22,"já tem gente nessa quest")
        return true
    end
    local plataforma = 0
    for k,valor in pairs(tb_players) do
        all = getThingfromPos(valor.pos)
        if all.itemid > 0 and isPlayer(all.uid) then
            plataforma = plataforma+ all.itemid
        end
    end
    if plataforma == #tb_players then
        check_quest = 1
        for i = 1,#tb_players do
            all_pos_play = getThingfromPos(tb_players[i].pos)
            playes_ids[i] = getCreatureByName(getCreatureName(all_pos_play.uid))
            doTeleportThing(all_pos_play.uid,tb_players[i].topos)
        end
        doTransformItem(item.uid,item.itemid == 1945 and 1946 or 1945)
        for i = 1,#tb_boss do
            boss[i] = doCreateMonster(tb_boss[i].name,tb_boss[i].pos)
            addEvent(removerBoss,tb_boss[i].tempo*1000,boss,i)
        end
        reRead(0)
        bicho = doCreateMonster(bossMaster.name,bossMaster.pos)
        addEvent(boss_da_freente,bossMaster.tempo*1000,bicho)
    else
        doPlayerSendCancel(cid,"precisa de "..#tb_players.." players")
    end
    return true
end

function removerBoss (boss,i)
    if isCreature(boss[i]) then
        doSendMagicEffect(getThingPos(boss[i]),tb_boss[i].effect)
        doRemoveCreature(boss[i])
    end
end

function reRead(x)
    for i = 1,#playes_ids do
        if x == 0 and isPlayer (playes_ids[i]) then
            doPlayerSendTextMessage(playes_ids[i],22,"você tem "..tb_boss[1].tempo.." segundos para matar boss")
            doSendMagicEffect(tb_players[i].topos,tb_players[i].effect)
        elseif x == 1 and isPlayer (playes_ids[i]) then
            check_quest = 0
            doPlayerSendTextMessage(playes_ids[i],22,"parabéns por ter matado boss")
        elseif x == 2 and isPlayer (playes_ids[i]) then
            check_quest = 0
            doPlayerSendTextMessage(playes_ids[i],22,"o seu tempo acabou agora sera teletraspostado em "..tb_players[i].tempo.." segundos")
            addEvent(reRead,tb_players[i].tempo*1000,3)
        elseif x == 3 and isPlayer (playes_ids[i]) then
            check_quest = 0
            doTeleportThing(playes_ids[i],tb_players[i].retorno)
            doSendMagicEffect(tb_players[i].retorno,tb_players[i].effect)
        end
    end
end

function boss_da_freente (bicho)
    if isCreature(bicho) then
        doRemoveCreature(bicho)
        reRead(2)
    else
        reRead(1)
    end
end

 

mais nesse segundo script

você tem que editar

bossMaster

local bossMaster = {name = "Dragon",pos = {x=x,y=y,z=z, stackpos=253}, effect = 10,tempo = 20}

boss principal que controla tempo se matar ele ganha quest

Editado por elton123 (veja o histórico de edições)

Postado
  • Solução
local config = {
    storage = 9721,
    time = 5,                                --Tempo para fazer a quest, em minutos.
    interval = 15,                           --Tempo para poder usar a alavanca novamente, em minutos.
    timerPos = {x = x, y = y, z = z},        --Posição onde o tempo restante aparecerá.
    monster = {
        name = "monster_name",               --Nome do monstro.
        pos = {
            {x = x, y = y, z = z},           --Posições onde ele vai nascer.
            {x = x, y = y, z = z},
            {x = x, y = y, z = z},
            --etc
        },
    },
    player = {
        {{x = x, y = y, z = z}, {x = x, y = y, z = z}},      --{{posição onde o player deve ficar}, {para onde será teleportado}},
        {{x = x, y = y, z = z}, {x = x, y = y, z = z}},
        {{x = x, y = y, z = z}, {x = x, y = y, z = z}},
        --etc
    },
    area = {{x = x, y = y, z = z}, {x = x, y = y, z = z}},   --{{posição superior esquerda da área}, {posição inferior direita da área}},
}
local cidPos = {}
function clearArea()
    for x = config.area[1].x, config.area[2].x do
        for y = config.area[1].y, config.area[2].y do
            local pos = {x = x, y = y, z = config.area[1].z}
            local pid = getTopCreature(pos).uid
            if pid > 0 then
                if isPlayer(pid) then
                    doTeleportThing(pid, config.player[cidPos[pid]][1] or getTownTemplePosition(getPlayerTown(pid)))
                    doPlayerSendTextMessage(pid, MESSAGE_STATUS_CONSOLE_RED, "You didn't get to the reward room in time.")
                else
                    doRemoveCreature(pid)
                end
            end
        end
    end
    setGlobalStorageValue(config.storage, os.time() + config.interval * 60)
end
function checkPlayer()
    for x = config.area[1].x, config.area[2].x do
        for y = config.area[1].y, config.area[2].y do
            local pos = {x = x, y = y, z = config.area[1].z}
            local pid = getTopCreature(pos).uid
            if isPlayer(pid) then
                return true
            end
        end
    end
    return false
end
function convert(time)
    return {minutes = math.floor(time / 60), seconds = time - math.floor(time / 60) * 60}
end
function timer(time)
    if time < 0 or not checkPlayer() then
        return true
    end
    doSendAnimatedText(config.timerPos, convert(time).minutes..":"..convert(time).seconds, 215)
    addEvent(timer, 1000, time - 1)
end
function onUse(cid)
    if getGlobalStorageValue(config.storage) > os.time() then
        return doPlayerSendCancel(cid, "Wait "..convert(getGlobalStorageValue(config.storage) - os.time()).minutes.."min and "..convert(getGlobalStorageValue(config.storage) - os.time()).seconds.."secs.")
    elseif checkPlayer() then
        return doPlayerSendCancel(cid, "There's player(s) doing the quest right now.")
    end
    local p = {}
    for _, pos in pairs(config.player) do
        local pid = getTopCreature(pos[1]).uid
        if isPlayer(pid) then
            p[#p + 1] = pid
            cidPos[pid] = _
        end
    end
    if #p < #config.player then
        return doPlayerSendCancel(cid, "There's some player(s) missing.")
    end
    for i = 1, #p do
        doTeleportThing(p[i], config.player[cidPos[p[i]]][2])
        doPlayerSendTextMessage(p[i], 27, "Good luck!")
    end
    for _, pos in pairs(config.monster.pos) do
        doCreateMonster(config.monster.name, pos)
    end
    timer(config.time)
    addEvent(function()
        clearArea()
    end, config.time * 60 * 1000)
    return true
end

Editado por zipter98 (veja o histórico de edições)

não respondo pms solicitando suporte em programação/scripting

Postado
  • Autor

Quando aperto alavanca já aprece isso 

 

There's some player(s) missing = Há algum jogador (s) desaparecida

 

 

Esqueci de editar algo? e quando o tempo acabar pra onde o player vai?

 

local config = {
storage = 9721,
time = 2, --Tempo para fazer a quest, em minutos.
interval = 2, --Tempo para poder usar a alavanca novamente, em minutos.
timerPos = {x = 1127, y = 1152, z = 7}, --Posição onde o tempo restante aparecerá.
monster = {
name = "Annihilon", --Nome do monstro.
pos = {
{x = 1121, y = 1151, z = 8}, --Posições onde ele vai nascer.
{x = 1121, y = 1153, z = 8},
{x = 1121, y = 1155, z = 8},
{x = 1129, y = 1151, z = 8},
{x = 1129, y = 1153, z = 8},
{x = 1129, y = 1155, z = 8},
},
},
player = {
{{x = 1126, y = 1152, z = 7}, {x = 1127, y = 1153, z = 8}}, --{{posição onde o player deve ficar}, {para onde será teleportado}},
{{x = 1125, y = 1152, z = 7}, {x = 1126, y = 1153, z = 8}},
--etc
},
area = {{x = 1121, y = 1150, z = 8}, {x = 1129, y = 1156, z = 8}}, --{{posição superior esquerda da área}, {posição inferior direita da área}},
}
local cidPos = {}
function clearArea()
for x = config.area[1].x, config.area[2].x do
for y = config.area[1].y, config.area[2].y do
local pos = {x = x, y = y, z = config.area[1].z}
local pid = getTopCreature(pos).uid
if pid > 0 then
if isPlayer(pid) then
doTeleportThing(pid, config.player[cidPos[pid]][1] or getTownTemplePosition(getPlayerTown(pid)))
doPlayerSendTextMessage(pid, MESSAGE_STATUS_CONSOLE_RED, "Você não conseguil completar a Anihi")
else
doRemoveCreature(pid)
end
end
end
end
setGlobalStorageValue(config.storage, os.time() + config.interval * 60)
end
function checkPlayer()
for x = config.area[1].x, config.area[2].x do
for y = config.area[1].y, config.area[2].y do
local pos = {x = x, y = y, z = config.area[1].z}
local pid = getTopCreature(pos).uid
if isPlayer(pid) then
return true
end
end
end
return false
end
function convert(time)
return {minutes = math.floor(time / 60), seconds = time - math.floor(time / 60) * 60}
end
function timer(time)
if time < 0 or not checkPlayer() then
return true
end
doSendAnimatedText(config.timerPos, convert(time).minutes..":"..convert(time).seconds, 215)
addEvent(timer, 1000, time - 1)
end
function onUse(cid)
if getGlobalStorageValue(config.storage) > os.time() then
return doPlayerSendCancel(cid, "Espere "..convert(getGlobalStorageValue(config.storage) - os.time()).minutes.."min and "..convert(getGlobalStorageValue(config.storage) - os.time()).seconds.."secs.")
elseif checkPlayer() then
return doPlayerSendCancel(cid, "Tem player Fazendo a Quest,Aguarde!.")
end
local p = {}
for _, pos in pairs(config.player) do
local pid = getTopCreature(pos).uid
if isPlayer(pid) then
p[#p + 1] = pid
cidPos[pid] = _
end
end
if #p < #config.player then
return doPlayerSendCancel(cid, "There's some player(s) missing.")
end
for i = 1, #p do
doTeleportThing(p, config.player[cidPos[pid]][2])
doPlayerSendTextMessage(p, 27, "Good luck!")
end
for _, pos in pairs(config.monster.pos) do
doCreateMonster(config.monster.name, pos)
end
addEvent(function()
clearArea()
end, config.time * 60 * 1000)
return true
end

Editado por damiaotorres (veja o histórico de edições)

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