seria tipo isso? Não entendi mt bem como será feito p/ nascer boss, então fiz uma talkaction, aí é só vc adapta da maneira que quiser.
data > lib > spawnBoss.lua
BOSS_SPAWN_CONFIG = {
bosses = {
["Boss Thdagger"] = { -- Nome do Boss.
position = {
spawnBoss = {x = 263, y = 349, z = 7 }, -- Onde o boss nascerá.
openTP = {x = 0, y = 0, z = 0}, -- Onde o TP aparecerá.
locationTP = {x = 0, y = 0, z = 0} -- Onde o TP levará o jogador.
},
timeInSeconds = {
closeTP = 60 -- segundos p/ fechar o TP após o boss ter nascido.
}
}
-- Adicione outros bosses aqui se quiser ...
}
}
-- Mostrará a contagem regressiva em cima do TP --
function spawnBossCountdownOnTeleport(bossCreature, teleport, timeToCloseTP)
local bossName = getCreatureName(bossCreature);
if not bossName then
doRemoveItem(getTileItemById(teleport, 1387).uid)
doSendMagicEffect(teleport, CONST_ME_POFF)
return true
end
local timeToCloseTP = tonumber(timeToCloseTP) - 1;
if timeToCloseTP == 0 then
doRemoveItem(getTileItemById(teleport, 1387).uid)
doSendMagicEffect(teleport, CONST_ME_POFF)
return true
end
doSendAnimatedText(teleport, timeToCloseTP, 725)
addEvent(spawnBossCountdownOnTeleport, 1000, bossCreature, teleport, timeToCloseTP);
return true
end
data > talkactions > scripts > spawnBoss.lua
function onSay(cid, words, param, channel)
local bossName = param;
if not BOSS_SPAWN_CONFIG.bosses[bossName] then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Boss nao encontrado! Escreva o nome corretamente, incluindo letras maiuscula/minuscula.")
return true
end
local bossCreature = doCreateMonster(bossName, BOSS_SPAWN_CONFIG.bosses[bossName].position.spawnBoss)
doCreateTeleport(1387, BOSS_SPAWN_CONFIG.bosses[bossName].position.locationTP, BOSS_SPAWN_CONFIG.bosses[bossName].position.openTP)
spawnBossCountdownOnTeleport(bossCreature, BOSS_SPAWN_CONFIG.bosses[bossName].position.openTP, BOSS_SPAWN_CONFIG.bosses[bossName].timeInSeconds.closeTP);
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "BOSS: "..bossName.." foi criado!")
return true
end
data > talkactions > talkactions.xml
<!-- Spawn Boss -->
<talkaction access="5" words="/boss" script="spawnBoss.lua"/>
/boss nome do boss