Postado Março 26, 2021 4 anos Em 26/03/2021 em 16:25, Orientalz disse: Mostrar conteúdo oculto Mostrar conteúdo oculto boss_hours = { ["01:00"] = {boss_name = "Phoenix Boss", pos = {fromPosition = {x=238, y=1142, z=8}, toPosition = {x=1024, y=915, z=7}}, time = 30, extra_time = 10}, ["02:00"] = {boss_name = "Gogeta Boss", pos = {fromPosition = {x=213, y=775, z=7}, toPosition = {x=1024, y=915, z=7}}, time = 30, extra_time = 10}, ["03:00"] = {boss_name = "Dende Boss", pos = {fromPosition = {x=542, y=433, z=6}, toPosition = {x=1024, y=915, z=7}}, time = 30, extra_time = 10}, ["04:00"] = {boss_name = "Phoenix Boss", pos = {fromPosition = {x=238, y=1142, z=8}, toPosition = {x=1024, y=915, z=7}}, time = 30, extra_time = 10}, ["05:00"] = {boss_name = "Gogeta Boss", pos = {fromPosition = {x=213, y=775, z=7}, toPosition = {x=1024, y=915, z=7}}, time = 30, extra_time = 10}, ["06:00"] = {boss_name = "Dende Boss", pos = {fromPosition = {x=542, y=433, z=6}, toPosition = {x=1024, y=915, z=7}}, time = 30, extra_time = 10}, ["07:00"] = {boss_name = "Phoenix Boss", pos = {fromPosition = {x=238, y=1142, z=8}, toPosition = {x=1024, y=915, z=7}}, time = 30, extra_time = 10}, ["08:00"] = {boss_name = "Gogeta Boss", pos = {fromPosition = {x=213, y=775, z=7}, toPosition = {x=1024, y=915, z=7}}, time = 30, extra_time = 10}, ["09:00"] = {boss_name = "Dende Boss", pos = {fromPosition = {x=542, y=433, z=6}, toPosition = {x=1024, y=915, z=7}}, time = 30, extra_time = 10}, ["10:00"] = {boss_name = "Phoenix Boss", pos = {fromPosition = {x=238, y=1142, z=8}, toPosition = {x=1024, y=915, z=7}}, time = 30, extra_time = 10}, ["11:00"] = {boss_name = "Gogeta Boss", pos = {fromPosition = {x=213, y=775, z=7}, toPosition = {x=1024, y=915, z=7}}, time = 30, extra_time = 10}, ["12:00"] = {boss_name = "Dende Boss", pos = {fromPosition = {x=542, y=433, z=6}, toPosition = {x=1024, y=915, z=7}}, time = 30, extra_time = 10}, ["13:00"] = {boss_name = "Phoenix Boss", pos = {fromPosition = {x=238, y=1142, z=8}, toPosition = {x=1024, y=915, z=7}}, time = 30, extra_time = 10}, ["14:00"] = {boss_name = "Gogeta Boss", pos = {fromPosition = {x=213, y=775, z=7}, toPosition = {x=1024, y=915, z=7}}, time = 30, extra_time = 10}, ["15:00"] = {boss_name = "Dende Boss", pos = {fromPosition = {x=542, y=433, z=6}, toPosition = {x=1024, y=915, z=7}}, time = 30, extra_time = 10}, ["16:00"] = {boss_name = "Phoenix Boss", pos = {fromPosition = {x=238, y=1142, z=8}, toPosition = {x=1024, y=915, z=7}}, time = 30, extra_time = 10}, ["17:00"] = {boss_name = "Gogeta Boss", pos = {fromPosition = {x=213, y=775, z=7}, toPosition = {x=1024, y=915, z=7}}, time = 30, extra_time = 10}, ["18:00"] = {boss_name = "Dende Boss", pos = {fromPosition = {x=542, y=433, z=6}, toPosition = {x=1024, y=915, z=7}}, time = 30, extra_time = 10}, ["19:00"] = {boss_name = "Phoenix Boss", pos = {fromPosition = {x=238, y=1142, z=8}, toPosition = {x=1024, y=915, z=7}}, time = 30, extra_time = 10}, ["20:00"] = {boss_name = "Gogeta Boss", pos = {fromPosition = {x=213, y=775, z=7}, toPosition = {x=1024, y=915, z=7}}, time = 30, extra_time = 10}, ["21:00"] = {boss_name = "Dende Boss", pos = {fromPosition = {x=542, y=433, z=6}, toPosition = {x=1024, y=915, z=7}}, time = 30, extra_time = 10}, ["23:45"] = {boss_name = "Phoenix Boss", pos = {fromPosition = {x=238, y=1142, z=8}, toPosition = {x=1024, y=915, z=7}}, time = 30, extra_time = 10}, ["23:00"] = {boss_name = "Gogeta Boss", pos = {fromPosition = {x=213, y=775, z=7}, toPosition = {x=1024, y=915, z=7}}, time = 30, extra_time = 10}, ["00:00"] = {boss_name = "Dende Boss", pos = {fromPosition = {x=542, y=433, z=6}, toPosition = {x=1024, y=915, z=7}}, time = 30, extra_time = 10} } function isWalkable(pos) -- by Nord / editado por Omega if getTileThingByPos({x = pos.x, y = pos.y, z = pos.z, stackpos = 0}).itemid == 0 then return false elseif isCreature(getTopCreature(pos).uid) then return false elseif getTileInfo(pos).protection then return false elseif hasProperty(getThingFromPos(pos).uid, 3) or hasProperty(getThingFromPos(pos).uid, 7) then return false end return true end function getPlayersInBossArea(tb) local t = {} for _, pid in pairs(getPlayersOnline()) do if isInRange(getPlayerPosition(pid), tb.pos.fromPosition, tb.pos.toPosition) then t[#t+1] = pid end end return t end function doRemoveBoss(tb, force) for x = tb.pos.fromPosition.x, tb.pos.toPosition.x do for y = tb.pos.fromPosition.y, tb.pos.toPosition.y do local m = getTopCreature({x=x, y=y, z= tb.pos.fromPosition.z}).uid if m ~= 0 and isMonster(m) then if not force and #getPlayersInBossArea(tb) > 0 then addEvent(doRemoveBoss, tb.extra_time*60*1000, tb, true) return true end doSendMagicEffect(getCreaturePosition(m), 54) -- Efeito no monstro quando for removido doSendMagicEffect(getCreaturePosition(m), 3) -- Efeito no monstro quando for removido doRemoveCreature(m) break end end end end function onThink(interval, lastExecution) hours = tostring(os.date("%X")):sub(1, 5) tb = boss_hours[hours] if tb then local create = true repeat local pos = {x = math.random(tb.pos.fromPosition.x, tb.pos.toPosition.x), y = math.random(tb.pos.fromPosition.y, tb.pos.toPosition.y), z = tb.pos.fromPosition.z} if isWalkable(pos) then doCreateMonster(tb.boss_name, pos) doSendDistanceShoot({x = pos.x - math.random(4, 6), y = pos.y - 5, z = pos.z}, pos, CONST_ANI_FIRE) addEvent(doSendMagicEffect, 150, pos, CONST_ME_HITBYFIRE) addEvent(doSendMagicEffect, 150, pos, CONST_ME_FIREAREA) doSendMagicEffect(pos, CONST_ME_MORTAREA) doBroadcastMessage("O Boss "..tb.boss_name.." nasceu!") addEvent(doRemoveBoss, tb.time*60*1000, tb, false) create = false end until not create end return true end position é sempre do MENOR para o MAIOR... seja X, Y ou Z. testa assim: boss_hours = { ["01:00"] = {boss_name = "Phoenix Boss", pos = {fromPosition = {x=238, y=915, z=7}, toPosition = {x=1024, y=1142, z=8}}, time = 30, extra_time = 10}, ["02:00"] = {boss_name = "Gogeta Boss", pos = {fromPosition = {x=213, y=775, z=7}, toPosition = {x=1024, y=915, z=7}}, time = 30, extra_time = 10}, ["03:00"] = {boss_name = "Dende Boss", pos = {fromPosition = {x=542, y=433, z=6}, toPosition = {x=1024, y=915, z=7}}, time = 30, extra_time = 10}, ["04:00"] = {boss_name = "Phoenix Boss", pos = {fromPosition = {x=238, y=915, z=7}, toPosition = {x=1024, y=1142, z=8}}, time = 30, extra_time = 10}, ["05:00"] = {boss_name = "Gogeta Boss", pos = {fromPosition = {x=213, y=775, z=7}, toPosition = {x=1024, y=915, z=7}}, time = 30, extra_time = 10}, ["06:00"] = {boss_name = "Dende Boss", pos = {fromPosition = {x=542, y=433, z=6}, toPosition = {x=1024, y=915, z=7}}, time = 30, extra_time = 10}, ["07:00"] = {boss_name = "Phoenix Boss", pos = {fromPosition = {x=238, y=915, z=7}, toPosition = {x=1024, y=1142, z=8}}, time = 30, extra_time = 10}, ["08:00"] = {boss_name = "Gogeta Boss", pos = {fromPosition = {x=213, y=775, z=7}, toPosition = {x=1024, y=915, z=7}}, time = 30, extra_time = 10}, ["09:00"] = {boss_name = "Dende Boss", pos = {fromPosition = {x=542, y=433, z=6}, toPosition = {x=1024, y=915, z=7}}, time = 30, extra_time = 10}, ["10:00"] = {boss_name = "Phoenix Boss", pos = {fromPosition = {x=238, y=915, z=7}, toPosition = {x=1024, y=1142, z=8}}, time = 30, extra_time = 10}, ["11:00"] = {boss_name = "Gogeta Boss", pos = {fromPosition = {x=213, y=775, z=7}, toPosition = {x=1024, y=915, z=8}}, time = 30, extra_time = 10}, ["12:00"] = {boss_name = "Dende Boss", pos = {fromPosition = {x=542, y=433, z=6}, toPosition = {x=1024, y=915, z=7}}, time = 30, extra_time = 10}, ["13:00"] = {boss_name = "Phoenix Boss", pos = {fromPosition = {x=238, y=915, z=7}, toPosition = {x=1024, y=1142, z=8}}, time = 30, extra_time = 10}, ["14:00"] = {boss_name = "Gogeta Boss", pos = {fromPosition = {x=213, y=775, z=7}, toPosition = {x=1024, y=915, z=7}}, time = 30, extra_time = 10}, ["15:00"] = {boss_name = "Dende Boss", pos = {fromPosition = {x=542, y=433, z=6}, toPosition = {x=1024, y=915, z=7}}, time = 30, extra_time = 10}, ["16:00"] = {boss_name = "Phoenix Boss", pos = {fromPosition = {x=238, y=915, z=7}, toPosition = {x=1024, y=1142, z=8}}, time = 30, extra_time = 10}, ["17:00"] = {boss_name = "Gogeta Boss", pos = {fromPosition = {x=213, y=775, z=7}, toPosition = {x=1024, y=915, z=7}}, time = 30, extra_time = 10}, ["18:00"] = {boss_name = "Dende Boss", pos = {fromPosition = {x=542, y=433, z=6}, toPosition = {x=1024, y=915, z=7}}, time = 30, extra_time = 10}, ["19:00"] = {boss_name = "Phoenix Boss", pos = {fromPosition = {x=238, y=915, z=7}, toPosition = {x=1024, y=1142, z=8}}, time = 30, extra_time = 10}, ["20:00"] = {boss_name = "Gogeta Boss", pos = {fromPosition = {x=213, y=775, z=7}, toPosition = {x=1024, y=915, z=7}}, time = 30, extra_time = 10}, ["21:00"] = {boss_name = "Dende Boss", pos = {fromPosition = {x=542, y=433, z=6}, toPosition = {x=1024, y=915, z=7}}, time = 30, extra_time = 10}, ["23:45"] = {boss_name = "Phoenix Boss", pos = {fromPosition = {x=238, y=915, z=7}, toPosition = {x=1024, y=1142, z=8}}, time = 30, extra_time = 10}, ["23:00"] = {boss_name = "Gogeta Boss", pos = {fromPosition = {x=213, y=775, z=7}, toPosition = {x=1024, y=915, z=7}}, time = 30, extra_time = 10}, ["00:00"] = {boss_name = "Dende Boss", pos = {fromPosition = {x=542, y=433, z=6}, toPosition = {x=1024, y=915, z=7}}, time = 30, extra_time = 10} } function isWalkable(pos) -- by Nord / editado por Omega if getTileThingByPos({x = pos.x, y = pos.y, z = pos.z, stackpos = 0}).itemid == 0 then return false elseif isCreature(getTopCreature(pos).uid) then return false elseif getTileInfo(pos).protection then return false elseif hasProperty(getThingFromPos(pos).uid, 3) or hasProperty(getThingFromPos(pos).uid, 7) then return false end return true end function getPlayersInBossArea(tb) local t = {} for _, pid in pairs(getPlayersOnline()) do if isInRange(getPlayerPosition(pid), tb.pos.fromPosition, tb.pos.toPosition) then t[#t+1] = pid end end return t end function doRemoveBoss(tb, force) for x = tb.pos.fromPosition.x, tb.pos.toPosition.x do for y = tb.pos.fromPosition.y, tb.pos.toPosition.y do for z = tb.pos.fromPosition.z, tb.pos.toPosition.z do local m = getTopCreature({x=x, y=y, z=z}).uid if m ~= 0 and isMonster(m) then if not force and #getPlayersInBossArea(tb) > 0 then addEvent(doRemoveBoss, tb.extra_time*60*1000, tb, true) return true end doSendMagicEffect(getCreaturePosition(m), 54) -- Efeito no monstro quando for removido doSendMagicEffect(getCreaturePosition(m), 3) -- Efeito no monstro quando for removido doRemoveCreature(m) break end end end end end function onThink(interval, lastExecution) hours = tostring(os.date("%X")):sub(1, 5) tb = boss_hours[hours] if tb then local create = true repeat local pos = {x = math.random(tb.pos.fromPosition.x, tb.pos.toPosition.x), y = math.random(tb.pos.fromPosition.y, tb.pos.toPosition.y), z = tb.pos.fromPosition.z} if isWalkable(pos) then doCreateMonster(tb.boss_name, pos) doSendDistanceShoot({x = pos.x - math.random(4, 6), y = pos.y - 5, z = pos.z}, pos, CONST_ANI_FIRE) addEvent(doSendMagicEffect, 150, pos, CONST_ME_HITBYFIRE) addEvent(doSendMagicEffect, 150, pos, CONST_ME_FIREAREA) doSendMagicEffect(pos, CONST_ME_MORTAREA) doBroadcastMessage("O Boss "..tb.boss_name.." nasceu!") addEvent(doRemoveBoss, tb.time*60*1000, tb, false) create = false end until not create end return true end [*Ninguém será digno do sucesso se não usar suas derrotas para conquistá-lo.*] DISCORD: vodkart#6090
Postado Abril 3, 2021 4 anos @Vodkart Cara, eu testei o primeiro script que tu fez e não funciona pra mim a parte de remover o monstro. Ele fica summonando até dar 8 e ai fica dando erro que não tme mais espaço. tfs 0.4
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.