Ir para conteúdo

Featured Replies

Postado
2 horas atrás, Vodkart disse:

xml é mods no caso?

nn, tipo isso n é global events? como coloca no xml de global events?
eu coloquei isso aq     <globalevent name="othersboss" script="othersboss.lua" />, mas n sei como coloca n

  • Respostas 41
  • Visualizações 5.5k
  • Created
  • Última resposta

Top Posters In This Topic

Most Popular Posts

  • local config = { name = "Shuryu Boss", pos = {x = 60, y = 63, z = 3}, time = 20 } function onThink(interval, lastExecution) doCreateMonster(config.name, config.pos) broadcastMessage("O "..config.

  • Quem estiver com esse erro:   attempt to call global 'getCreatureByName' (a nil value)     Testem o código dessa forma:   local config = { name = "Shuryu Boss", p

  • @BangxD Então acho que vou fazer melhor, já que dependendo da hora vai ser determinado boss, vou fazer que nem o "arauto" do League of Legends.   Se estiverem atacando o arauto os players te

Posted Images

Postado
8 minutos atrás, Orientalz disse:

nn, tipo isso n é global events? como coloca no xml de global events?
eu coloquei isso aq     <globalevent name="othersboss" script="othersboss.lua" />, mas n sei como coloca n

@Orientalz   tenta assim     

<globalevent name="othersboss" interval="1000" event="script" value="othersboss.lua"/>

 

Postado
2 horas atrás, Vodkart disse:

 

deixa eu ver como ficou seu código editado...

Spoiler

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  

 

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.

Conteúdo Similar

Estatísticas dos Fóruns

  • Tópicos 96.9k
  • Posts 519.6k

Informação Importante

Confirmação de Termo