Solutions
-
Kyle Bellini's post in (SPELL) Spell com Cooldown was marked as the answerOlá,
Testa aí e me fala se está como quer. Coloquei uma mensagem tbm avisando os segundos pro jogador saber.
-
Kyle Bellini's post in [CreatureScript] Monstro que vira TP nao esta nascendo ao iniciar o sv! was marked as the answerÉ bem simples, fiz um aqui pra ti:
local config = { bossPos = {x = 1091, y = 920, z = 7}, -- Position que o monstro será criado bossName = "Boss Monster" -- Nome do monstro } function onStartup() doCreateMonster(config.bossName, config.bossPos) return true end
No seu globalevents.xml você adiciona essa tag:
<globalevent name="CreateBoss" type = "start" event="script" value="createboss.lua"/>
-
Kyle Bellini's post in Spell - Que tira Stun was marked as the answerSó removi algumas coisas, e organizei um pouco o código. Testa aí e me fala.
local config = { cooldown = 45, -- Cooldown para utilizar a spell novamente effect = 27, -- Efeito ao utilizar a spell storage = 5891, -- Storage responsável pelo cooldown } function onCastSpell(cid, var) if exhaustion.check(cid, config.storage) then doPlayerSendCancel(cid, "Aguarde " .. exhaustion.get(cid, config.storage) .. " segundos para usar a spell novamente.") return false end doCreatureSetNoMove(cid, false) doSendMagicEffect(getCreaturePosition(cid), config.effect) exhaustion.set(cid, config.storage, config.cooldown) return true end
-
Kyle Bellini's post in (Resolvido)Teleport aparecer Em X Local somente ao matar 2 ''boss'' Gerador. was marked as the answerEstou sem internet, por isso só consegui olhar hoje auhauha
Caso não tenha conseguido ainda, eu fiz uma Action (acredito que seja melhor). O jogador irá dar USE no item que tiver a actionid, se não tiver bosses vivos um portal será aberto, senão, uma mensagem aparecerá informando que ainda estão vivos. Eu coloquei alguns comentários no script, pra facilitar o entendimento.
As posições você vai pegar uma da ponta superior esquerda, e uma da ponta inferior direita. Utilizando sua imagem de exemplo:
https://i.imgur.com/OT8wbks.png
Crie um arquivo .lua dentro da pasta (Data > Actions > Scripts) , copie todo o código e cole no arquivo criado.
Agora em actions.xml, adicione esta tag:
<action actionid="2683" event="script" value="nome do arquivo criado.lua"/> -- Em actionid="2683" coloque um valor que não esteja sendo utilizado
Após adicionar, este deve ser o resultado (RIP qualidade):
Portal.mp4 -
Kyle Bellini's post in (Resolvido)End expected to close"If" near <eof> was marked as the answerera só adicionar um end pro if indicado no erro:
local balls = getItemsInContainerById(bp.uid, 11829) ------ Ultraball if #balls >= 1 then for _, ball in pairs (balls) do local x = icons[getItemAttribute(ball, "poke")] doTransformItem(ball, x.on) doItemSetAttribute(ball, "ball", "Icone") doItemSetAttribute(ball, "morta", "no") doItemSetAttribute(ball, "Icone", "yes") end end local balls = getItemsInContainerById(bp.uid, 11831) --- Ultraball morta if #balls >= 1 then for _, ball in pairs (balls) do local x = icons[getItemAttribute(ball, "poke")] doTransformItem(ball, x.off) doItemSetAttribute(ball, "ball", "Icone") doItemSetAttribute(ball, "morta", "yes") doItemSetAttribute(ball, "Icone", "yes") end end ------------------------------ local balls = getItemsInContainerById(bp.uid, 11835) ------ Superball if #balls >= 1 then for _, ball in pairs (balls) do local x = icons[getItemAttribute(ball, "poke")] doTransformItem(ball, x.on) doItemSetAttribute(ball, "ball", "Icone") doItemSetAttribute(ball, "morta", "no") doItemSetAttribute(ball, "Icone", "yes") end end local balls = getItemsInContainerById(bp.uid, 11837) --- Superball morta if #balls >= 1 then for _, ball in pairs (balls) do local x = icons[getItemAttribute(ball, "poke")] doTransformItem(ball, x.off) doItemSetAttribute(ball, "ball", "Icone") doItemSetAttribute(ball, "morta", "yes") doItemSetAttribute(ball, "Icone", "yes") end end
-
Kyle Bellini's post in (Resolvido)[C]: in function 'doSendMagicEffect' was marked as the answerCaso o do amigo acima não funcione, teste com esse:
local voc = {716, 717, 718, 719, 720, 721, 722, 723, 724, 725} -- ID das vocações que poderão usar o Pergaminho. local corpse = {3058} local id = 26684 -- Id do edo pergaminho local edo = { ["[EDO TENSEI] Anbu"] = {hp = 50000, maxhp = 50000, corpse = 3058, chance = 100}, -- Nome do Edo, HP do Edo quando summoned, max hp do edo , corpo do edo, chance de falhar. } function onUse(cid, item, frompos, item2, topos) if(not(isInArray(voc, getPlayerVocation(cid)))) then return doPlayerSendTextMessage(cid, 25, "Voce nao tem a vocacao nescessaria") end if(not(isInArray(corpse, item2.itemid))) then doPlayerSendTextMessage(cid, MESSAGE_STATUS_DEFAULT, "voce precisa usar o pergaminho em um corpse") doSendMagicEffect(getThingPos(cid), 21) return true end local perga = doPlayerAddItem(cid, id, 1) for edo_tensei, v in pairs(edo) do if item2.itemid == v.corpse then if math.random(0,100) <= v.chance then doSendMagicEffect(getThingPos(cid), 21) doPlayerSendTextMessage(cid, 27, "".. edo_tensei .. " foi selado nesse pergaminho.") doRemoveItem(item.uid, 1) doRemoveItem(item2.uid, 1) doItemSetAttribute(perga, "namepet", edo_tensei) doItemSetAttribute(perga, "description", "Neste pergaminho foi selado um ".. edo_tensei ..".") doItemSetAttribute(perga, "lifepet", v.hp) doItemSetAttribute(perga, "maxlifepet", v.maxhp) else doPlayerSendTextMessage(cid, 27, "O pergaminho falhou") end end end return true end