Líderes
Conteúdo Popular
Exibindo conteúdo com a maior reputação em 09/16/21 em todas áreas
-
(Resolvido)Sala de boss por alavanca
2 pontosachei que seu codigo ja fazia isso. local config = { cooldown = 60 * 60 * 20, -- in seconds - (Make it 'seconds * minutes * hours' - its will be '60 * 60 * 20' for 20 hours) (player cooldown) cooldown_storage = 808856, storage_control = 78484, duration = 10, -- time till reset, in minutes (lever cooldown) level_req = 8, -- minimum level to do quest min_players = 1, -- minimum players to join quest lever_id = 1945, -- id of lever before pulled pulled_id = 1946 -- id of lever after pulled } local player_positions = { [1] = {fromPos = Position(33395, 32662, 6), toPos = Position(33395, 32658, 6)}, [2] = {fromPos = Position(33395, 32663, 6), toPos = Position(33395, 32658, 6)}, [3] = {fromPos = Position(33395, 32663, 6), toPos = Position(33395, 32658, 6)}, [4] = {fromPos = Position(33395, 32665, 6), toPos = Position(33395, 32658, 6)}, [5] = {fromPos = Position(33394, 32662, 6), toPos = Position(33395, 32658, 6)} } local monsters = { [1] = {pos = Position(33396, 32642, 6), name = "scarlett etzel"} } local quest_range = {fromPos = Position(33386, 32639, 6), toPos = Position(33405, 32659, 6)} -- see image in thread for explanation local exit_position = Position(33395, 32671, 6) -- Position completely outside the quest area function getPlayersInBossRoom() local spectators, t = Game.getSpectators(Position(33396, 32649, 6), false, false, 10, 10, 10, 10),{} for _, spectatorCreature in ipairs(spectators) do if spectatorCreature:isPlayer() then t[#t+1] = spectatorCreature end end return t end function doKickPlayerBoss(id) local players = getPlayersInBossRoom() if #players == 0 then return true end if Game.getStorageValue(config.storage_control) == id then for _, cid in pairs(players) do local participant = Player(cid) participant:teleportTo(exit_position) exit_position:sendMagicEffect(CONST_ME_TELEPORT) participant:sendTextMessage(22,"voce nao matou o boss a tempo.") end Game.setStorageValue(config.storage_control, 0) end end function doResetTheBossDukeKrule(position, cid_array) local tile = Tile(position) local item = tile and tile:getItemById(config.pulled_id) if not item then return end local monster_names = {} for key, value in pairs(monsters) do if not isInArray(monster_names, value.name) then monster_names[#monster_names + 1] = value.name end end for i = 1, #monsters do local creatures = Tile(monsters[i].pos):getCreatures() for key, creature in pairs(creatures) do if isInArray(monster_names, creature:getName()) then creature:remove() end end end for i = 1, #player_positions do local creatures = Tile(player_positions[i].toPos):getCreatures() for key, creature in pairs(creatures) do if isInArray(monster_names, creature:getName()) then creature:remove() end end end for key, cid in pairs(cid_array) do local participant = Player(cid) if participant and isInRange(participant:getPosition(), quest_range.fromPos, quest_range.toPos) then participant:teleportTo(exit_position) exit_position:sendMagicEffect(CONST_ME_TELEPORT) end end item:transform(config.lever_id) end local function removeBoss() local specs, spec = Game.getSpectators(Position(33396, 32649, 6), false, false, 10, 10, 10, 10) for j = 1, #specs do spec = specs[j] if spec:getName():lower() == 'scarlett etzel' then spec:remove() end end end function onUse(player, item, fromPosition, target, toPosition, isHotkey) if player:getStorageValue(config.cooldown_storage) >= os.time() then player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "try tomorrow") return true end if #getPlayersInBossRoom() > 0 then return player:sendCancelMessage("ja exitem jogadores dentro do evento.") end local participants, pull_player = {}, false for i = 1, #player_positions do local fromPos = player_positions[i].fromPos local tile = Tile(fromPos) if not tile then print(">> ERROR: Annihilator tile does not exist for Position(" .. fromPos.x .. ", " .. fromPos.y .. ", " .. fromPos.z .. ").") return player:sendCancelMessage("There is an issue with this quest. Please contact an administrator.") end local creature = tile:getBottomCreature() if creature then local participant = creature:getPlayer() if not participant then return player:sendCancelMessage(participant:getName() .. " is not a valid participant.") end if participant:getLevel() < config.level_req then return player:sendCancelMessage(participant:getName() .. " is not the required level.") end if participant.uid == player.uid then pull_player = true end participants[#participants + 1] = {participant = participant, toPos = player_positions[i].toPos} end end if #participants < config.min_players then return player:sendCancelMessage("You do not have the required amount of participants.") end if not pull_player then return player:sendCancelMessage("You are in the wrong position.") end for i = 1, #monsters do local toPos = monsters[i].pos if not Tile(toPos) then print(">> ERROR: Annihilator tile does not exist for Position(" .. toPos.x .. ", " .. toPos.y .. ", " .. toPos.z .. ").") return player:sendCancelMessage("There is an issue with this quest. Please contact an administrator.") end removeBoss() Game.createMonster(monsters[i].name, monsters[i].pos, false, true) end local cid_array = {} for i = 1, #participants do participants[i].participant:teleportTo(participants[i].toPos) participants[i].toPos:sendMagicEffect(CONST_ME_TELEPORT) cid_array[#cid_array + 1] = participants[i].participant.uid player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You have 10 minutes to kill and loot this boss. Otherwise you will lose that chance and will be kicked out.") end item:transform(config.pulled_id) player:setStorageValue(config.cooldown_storage, os.time() + config.cooldown) local r = math.random(1, 9999) Game.setStorageValue(config.storage_control, r) addEvent(doKickPlayerBoss, config.duration * 60 * 1000, r) addEvent(doResetTheBossDukeKrule, config.duration * 60 * 1000, toPosition, cid_array) return true end2 pontos
-
(Resolvido)Reflect
(Resolvido)Reflect
Rogex Joyz e um outro reagiu a Vodkart por uma resposta no tópico
2 pontoslocal config = { storage = 3411101, percent = 70 } math.percent = function (value, percentage) return math.ceil(math.floor(value)*math.floor(percentage)/100) end function onStatsChange(cid, attacker, type, combat, value) if value >= 1 and (type == STATSCHANGE_HEALTHLOSS or (getCreatureCondition(cid, CONDITION_MANASHIELD) and type == STATSCHANGE_MANALOSS)) then if getPlayerStorageValue(cid,config.storage) == 1 and isCreature(attacker) then local atk, me = math.percent(value, config.percent), math.percent(value, (100 - config.percent)) -- aqui por exemplo vai devolver 70% do atack para o que atacou e 30% para mim doSendAnimatedText(getCreaturePosition(cid),"REFLECT "..atk, 215) doSendAnimatedText(getCreaturePosition(attacker),"-"..atk, 215) doCreatureAddHealth(attacker, -atk, true) doCreatureAddHealth(cid, -me, true) setPlayerStorageValue(cid,config.storage, 0) return false end end return true end2 pontos -
Telara Layout Znote AAC + Ascar Layout Znote AAC
Telara Layout Znote AAC + Ascar Layout Znote AAC
FlamesAdmin e um outro reagiu a
Alexv45por uma resposta no tópico2 pontosOlá Venho compartilhar o Layout Telara & Ascar para Znote ACC, as páginas são todas funcionais Telara Layout Vivo: Veja aqui Ascar Layout Vivo: Veja aqui download telara: GitHub download ascar: GitHub E muitos outros temas por vir, quando eu tiver tempo farei mais Telara Ascar2 pontos -
(Resolvido)Sala de boss por alavanca
2 pontoslocal config = { cooldown = 60 * 60 * 20, -- in seconds - (Make it 'seconds * minutes * hours' - its will be '60 * 60 * 20' for 20 hours) (player cooldown) cooldown_storage = 808856, duration = 10, -- time till reset, in minutes (lever cooldown) level_req = 8, -- minimum level to do quest min_players = 1, -- minimum players to join quest lever_id = 1945, -- id of lever before pulled pulled_id = 1946 -- id of lever after pulled } local player_positions = { [1] = {fromPos = Position(33395, 32662, 6), toPos = Position(33395, 32658, 6)}, [2] = {fromPos = Position(33395, 32663, 6), toPos = Position(33395, 32658, 6)}, [3] = {fromPos = Position(33395, 32663, 6), toPos = Position(33395, 32658, 6)}, [4] = {fromPos = Position(33395, 32665, 6), toPos = Position(33395, 32658, 6)}, [5] = {fromPos = Position(33394, 32662, 6), toPos = Position(33395, 32658, 6)} } local monsters = { [1] = {pos = Position(33396, 32642, 6), name = "scarlett etzel"} } local quest_range = {fromPos = Position(33386, 32639, 6), toPos = Position(33405, 32659, 6)} -- see image in thread for explanation local exit_position = Position(33395, 32671, 6) -- Position completely outside the quest area function doResetTheBossDukeKrule(position, cid_array) local tile = Tile(position) local item = tile and tile:getItemById(config.pulled_id) if not item then return end local monster_names = {} for key, value in pairs(monsters) do if not isInArray(monster_names, value.name) then monster_names[#monster_names + 1] = value.name end end for i = 1, #monsters do local creatures = Tile(monsters[i].pos):getCreatures() for key, creature in pairs(creatures) do if isInArray(monster_names, creature:getName()) then creature:remove() end end end for i = 1, #player_positions do local creatures = Tile(player_positions[i].toPos):getCreatures() for key, creature in pairs(creatures) do if isInArray(monster_names, creature:getName()) then creature:remove() end end end for key, cid in pairs(cid_array) do local participant = Player(cid) if participant and isInRange(participant:getPosition(), quest_range.fromPos, quest_range.toPos) then participant:teleportTo(exit_position) exit_position:sendMagicEffect(CONST_ME_TELEPORT) end end item:transform(config.lever_id) end local function removeBoss() local specs, spec = Game.getSpectators(Position(33396, 32649, 6), false, false, 10, 10, 10, 10) for j = 1, #specs do spec = specs[j] if spec:getName():lower() == 'scarlett etzel' then spec:remove() end end end function onUse(player, item, fromPosition, target, toPosition, isHotkey) if player:getStorageValue(config.cooldown_storage) >= os.time() then player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "try tomorrow") return true end local spectators = Game.getSpectators(Position(33396, 32649, 6), false, false, 10, 10, 10, 10) for _, spectatorCreature in ipairs(spectators) do if spectatorCreature:isPlayer() then return player:sendCancelMessage("ja exitem jogadores dentro do evento.") end end local participants, pull_player = {}, false for i = 1, #player_positions do local fromPos = player_positions[i].fromPos local tile = Tile(fromPos) if not tile then print(">> ERROR: Annihilator tile does not exist for Position(" .. fromPos.x .. ", " .. fromPos.y .. ", " .. fromPos.z .. ").") return player:sendCancelMessage("There is an issue with this quest. Please contact an administrator.") end local creature = tile:getBottomCreature() if creature then local participant = creature:getPlayer() if not participant then return player:sendCancelMessage(participant:getName() .. " is not a valid participant.") end if participant:getLevel() < config.level_req then return player:sendCancelMessage(participant:getName() .. " is not the required level.") end if participant.uid == player.uid then pull_player = true end participants[#participants + 1] = {participant = participant, toPos = player_positions[i].toPos} end end if #participants < config.min_players then return player:sendCancelMessage("You do not have the required amount of participants.") end if not pull_player then return player:sendCancelMessage("You are in the wrong position.") end for i = 1, #monsters do local toPos = monsters[i].pos if not Tile(toPos) then print(">> ERROR: Annihilator tile does not exist for Position(" .. toPos.x .. ", " .. toPos.y .. ", " .. toPos.z .. ").") return player:sendCancelMessage("There is an issue with this quest. Please contact an administrator.") end removeBoss() Game.createMonster(monsters[i].name, monsters[i].pos, false, true) end local cid_array = {} for i = 1, #participants do participants[i].participant:teleportTo(participants[i].toPos) participants[i].toPos:sendMagicEffect(CONST_ME_TELEPORT) cid_array[#cid_array + 1] = participants[i].participant.uid player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You have 10 minutes to kill and loot this boss. Otherwise you will lose that chance and will be kicked out.") end item:transform(config.pulled_id) player:setStorageValue(config.cooldown_storage, os.time() + config.cooldown) addEvent(doResetTheBossDukeKrule, config.duration * 60 * 1000, toPosition, cid_array) return true end2 pontos
-
(Resolvido)Sala de boss por alavanca
2 pontos-- <action actionid="4627" event="script" value="bosses/scarlet_boss.lua"/> adicionar no actions.xml local posInicio = {x = 33385, y = 32638, z = 6} --pos inicio da sala local posFim = {x = 33406, y = 32660, z = 6}--pos final inicio da sala local posExitTime = {x = 33393, y = 32671, z = 6}-- pos para onde o player vai sair local function verificaPlayers() for x = posInicio.x, posFim.x do for y = posInicio.y, posFim.y do if isPlayer(getThingFromPos({x = x, y = y, z = posInicio.z, stackpos = 253}).uid) then return 1 end end end end local function verificaBoss() for x = posInicio.x, posFim.x do for y = posInicio.y, posFim.y do if isMonster(getThingFromPos({x = x, y = y, z = posInicio.z, stackpos = 253}).uid) then doRemoveCreature(getThingFromPos({x = x, y = y, z = posInicio.z, stackpos = 253}).uid) end end end end local function removePlayersTime() for x = posInicio.x, posFim.x do for y = posInicio.y, posFim.y do local remove, clean = true, true local pos = {x = x, y = y, z = posInicio.z} local m = getTopCreature(pos).uid if m ~= 0 and isPlayer(m) then doTeleportThing(m, posExitTime) end end end doSendMagicEffect(posExitTime, 10) return true end function onUse(cid, item, frompos, item2, topos) -- Lever Boss if item.aid == 4627 then -- action id da alavanca local playerChecked = false local teleportToRoom = false local stoExhaust = 424148 -- staorage de segurança para exhaust local stoExhaustPlayer = getPlayerStorageValue(cid, stoExhaust) if stoExhaustPlayer > os.time() then doPlayerSendCancel(cid, "You have to wait " .. stoExhaustPlayer - os.time() .. " seconds to try again.") return true end if verificaPlayers() then doPlayerSendCancel(cid, "There are other players inside the room at the moment.") doSendMagicEffect(topos,2) setPlayerStorageValue(cid, stoExhaust, os.time()+5) return true end local config = { [1] = {pos = {x = 33395, y = 32661, z = 6}}, --posições dos pisos [2] = {pos = {x = 33394, y = 32662, z = 6}}, [3] = {pos = {x = 33395, y = 32662, z = 6}}, [4] = {pos = {x = 33396, y = 32662, z = 6}}, [5] = {pos = {x = 33395, y = 32663, z = 6}}, } local storageTime = 424149 -- storage de tempo do boss for i, v in pairs(config) do if isPlayer(getTopCreature(config[i].pos).uid) then player = getTopCreature(config[i].pos).uid if getPlayerStorageValue(player, storageTime) > os.time() then time = (getPlayerStorageValue(player, storageTime)-os.time())/60 str = "minutes" if time > 60 then time = time/60 str = "hours" end if player == cid then name = "You" else name = getCreatureName(player) end doPlayerSendCancel(cid, name .. " need to wait more " .. math.floor(time+0.5) .. " " .. str .. " to do again.") doSendMagicEffect(topos,2) return true end if player == cid then playerChecked = true end end end if playerChecked then for i, v in pairs(config) do if isPlayer(getTopCreature(config[i].pos).uid) then player = getTopCreature(config[i].pos).uid doSendMagicEffect(getCreaturePosition(player), 2) doTeleportThing(player, {x = 33396, y = 32656, z = 6}) -- posiçao que player vai cair setPlayerStorageValue(player, storageTime, os.time()+72000) -- tempo de 20 horas teleportToRoom = true end end if teleportToRoom then stopEvent(ResetArea) verificaBoss() doSendMagicEffect({x = 33396, y = 32642, z = 6}, 10) -- efeito que vai aparece no monstro quando ele nasce, mesma posiçao onde nasce o boss doCreateMonster("Scarlett Etzel", {x = 33396, y = 32642, z = 6}) -- onde o boss nasce e nome do boss ResetArea = addEvent(function() removePlayersTime() end, 10 * 60 * 1000) -- tempo dentro da sala para ser kikado tem tera 10 minutos para matar o boss ou sera teleportado de volta return false end else doPlayerSendCancel(cid, "Wouldn't you like to go too?") doSendMagicEffect(topos,2) end return true end end2 pontos
-
Telhado Venore do Tibia Completo (81 peças)
Veja também: • Telhado Clássico do Tibia Completo [191 peças] TIBIA - TELHADO VENOREAN Estou disponibilizando esse jogo de telhados do Tibia com as peças que faltam. (ainda faltam algumas mas da pra usar de forma completa desse jeito). Façam bom uso! Download: Venorean_roofs_by_nolis.rar Conteúdo do pack:2 pontos
-
(Resolvido)Sala de boss por alavanca
(Resolvido)Sala de boss por alavanca
leonardo gazim reagiu a Kenshiin por uma resposta no tópico
1 pontochego testar oque eu envie ?1 ponto -
Telara Layout Znote AAC + Ascar Layout Znote AAC
Ficou bem maneiro esses temas que você criou amigo, super interessante!!! Aguardo novos temas seus hein? Obrigado por compartilhar no TK. Abraços! ?1 ponto
-
Rust Remover (8.6x)
1 pontoNome: Rust Remover Tipo de script: Action Versão: 8.6x Procurei, procurei e procurei mais não encontrei aqui no fórum nada parecido, intão resolvi postar! Pode ser usado para remover a ferrugem da Rusty Armor ou Rusty Legs. Em data/action/scripts crie um arquivo .lua com o nome rustremover e adicione: local breakChance = 60 local rustyItems = { [9808] = {2464, 2465, 2483, 2463, 2476}, --common rusty armor [9809] = {2464, 2465, 2483, 2463, 2476, 8891, 2487}, --semi-rare rusty armor [9810] = {2465, 2463, 2476, 8891, 2487, 2466, 2492, 2472}, --rare rusty armor [9811] = {2468, 2648, 2478, 2647, 2477}, --common rusty legs [9812] = {2468, 2648, 2478, 2647, 2477, 2488}, --semi-rare rusty legs [9813] = {2468, 2648, 2478, 2647, 2477, 2488, 2470}, --rare rusty legs [9814] = {2511, 2510, 2530, 2509, 2513, 2515}, --common rusty shield [9815] = {2511, 2510, 2530, 2509, 2513, 2515, 2516, 2519}, --semi-rare rusty shield [9816] = {2511, 2510, 2530, 2509, 2513, 2515, 2516, 2519, 2520, 2514}, --rare rusty shield [9817] = {2643, 3982, 5462, 7457}, --common rusty boots [9818] = {2643, 3982, 5462, 7457, 2195}, --semi-rare rusty boots [9819] = {2643, 3982, 5462, 7457, 2195, 2645}, --rare rusty boots [9820] = {2458, 2460, 2480, 2481, 2457, 2491}, --common rusty helmet [9821] = {2458, 2460, 2480, 2481, 2457, 2491, 2497}, --semi rare rusty helmet [9822] = {2458, 2460, 2480, 2481, 2457, 2491, 2497, 2475, 2498} --rare rusty helmet } function onUse(cid, item, fromPosition, itemEx, toPosition) if rustyItems[itemEx.itemid] ~= nil then if math.random(100) <= breakChance then doRemoveItem(itemEx.uid) doPlayerSendTextMessage(cid,MESSAGE_INFO_DESCR,"You broke it.") doSendMagicEffect(getCreaturePosition(cid),34) else local newId = rustyItems[itemEx.itemid][math.random(#rustyItems[itemEx.itemid])] doTransformItem(itemEx.uid,newId) doPlayerSendTextMessage(cid,MESSAGE_INFO_DESCR,"You removed the rust, revealing a "..getItemNameById(newId)) doSendMagicEffect(getCreaturePosition(cid),66) end doRemoveItem(item.uid,1) return TRUE end return FALSE end Agora em Action/action.xml e adicione: <action itemid="9930" script="tools/rustremover.lua"/> 9930 = Id do rustremover (pode ser alterado) rustremover.rar Créditos: Otproject 100%1 ponto
-
Telhado Venore do Tibia Completo (81 peças)
Telhado Venore do Tibia Completo (81 peças)
Cat reagiu a Rogex Joyz por uma resposta no tópico
1 pontoIsso vai me ajudar tanto que você nem imagina Obrigado *-*1 ponto -
Event BOSS
1 pontoposition é 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 end1 ponto
-
Event BOSS
Event BOSS
Orientalz reagiu a hiquezerah por uma resposta no tópico
1 ponto@Orientalz tenta assim <globalevent name="othersboss" interval="1000" event="script" value="othersboss.lua"/>1 ponto -
Event BOSS
1 ponto@BangxD Não testei boss_hours = { ["10:00"] = {boss_name = "Demon", pos = {fromPosition = {x=1011, y=910, z=7}, toPosition = {x=1024, y=915, z=7}}, time = 20, extra_time = 10}, ["11:00"] = {boss_name = "Rat", pos = {fromPosition = {x=1011, y=910, z=7}, toPosition = {x=1024, y=915, z=7}}, time = 20, extra_time = 10}, ["12:00"] = {boss_name = "Hydra", pos = {fromPosition = {x=1011, y=910, z=7}, toPosition = {x=1024, y=915, z=7}}, time = 20, 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 end1 ponto