Ir para conteúdo

Bodak Reborn

Membro
  • Registro em

  • Última visita

Tudo que Bodak Reborn postou

  1. Corrigi de novo, tenta lá.
  2. Código corrigido, não precisa mais do script do movements e movements.xml.
  3. Você tem a função "doGuildAddEnemy" em seu servidor?
  4. function doMarkPos(cid, posx, posy, posz) setPlayerStorageValue(cid, 19000, posx) setPlayerStorageValue(cid, 19001, posy) setPlayerStorageValue(cid, 19002, posz) end function getMarkPos(cid) return {x=getPlayerStorageValue(cid, 19000), y=getPlayerStorageValue(cid, 19001), z=getPlayerStorageValue(cid, 19002)} end local config = { newPos = {x = 1019, y = 1555, z = 7}, -- posição para onde os jogadores irão. tpPos = {x = 1050, y = 1560, z = 7}, -- posição onde será criado o teleporte. exhaust = 0.8, target = getCreatureTarget(cid), storage = 115820, } function onCastSpell(cid, var) local pos = getCreaturePosition(cid) if getMarkPos(cid).x < 1 then doMarkPos(cid, pos.x, pos.y, pos.z) end if getPlayerStorageValue(cid, config.exhaust) < os.time() then if getMarkPos(cid).x > 0 then doCreateTeleport(1387, getMarkPos(cid), config.tpPos) doTeleportThing(cid, config.newPos) setPlayerStorageValue(cid, config.storage, config.exhaust + os.time()) end else doPlayerSendCancel(cid, "You are exhausted") end return true end Peguei a função de salvar a posição em um post daqui do fórum mesmo. Créditos: Skydangerous
  5. local config = { newPos = {x = 1019, y = 1555, z = 7}, -- posição para onde os jogadores irão. tpPos = {x = 1050, y = 1560, z = 7}, -- posição onde será criado o teleporte. tptoPos = {x = 1000, y = 2000, z = 7}, -- posição para onde o jogador será levado ao entrar no teleport. exahaust = 0.8, -- em segundos. storage = 115820, target = getCreatureTarget(cid), } function onCastSpell(cid, var) if getPlayerStorageValue(cid, config.exhaust) < os.time() then doTeleportThing(cid, config.newPos) doTeleportThing(config.target, config.newPos) doCreateTeleport(1387, config.tptoPos, config.tpPos) setPlayerStorageValue(cid, config.exhaust, config.time + os.time()) else doPlayerSendCancel(cid, "You are exhausted") end return true end
  6. O que acontece se ele não conseguir entrar no portal em 20 segundos?
  7. O jogador que castou a spell vai junto?
  8. Não. A spell, o que ela faz, como ela funciona... ela teleporta? Quem? Por quanto tempo? Tipo isso.
  9. Como funciona a skill?
  10. Não conheço narutibia, caso o script dê erro, tente dar mais detalhes. Ficou muito vago pra mim, me baseei pelo seu script. local config = { newPos = {x = 1019, y = 1555, z = 7}, time = 10, exahaust = 0.8, -- em segundos. storage = 115820, target = getCreatureTarget(cid), posTarget = getPlayerPosition(target), } local function teleport(cid, pos) if isCreature(cid) then doTeleportThing(cid, getClosestFreeTile(cid, pos)) doSendMagicEffect(getPlayerPosition(cid), 196) end end function onCastSpell(cid, var) if getPlayerStorageValue(cid, config.exhaust) < os.time() then setPlayerStorageValue(cid, config.exhaust, config.time + os.time()) else doPlayerSendCancel(cid, "You are exhausted") end doTeleportThing(config.target, config.newPos) addEvent(teleport, time*1000, config.target, config.posTarget) return true end
  11. function onStepIn(cid, item, position, fromPosition) local M = { [1] = {"Cyclops",{x=710, y=1083, z=14}}, [2] = {"Demon",{x=710, y=1084, z=14}}, [3] = {"Hydra",{x=710, y=1082, z=14}}, [4] = {"Dragon",{x=710, y=1081, z=14}} } local storage = 13311 local time_summon = 3 -- tempo em minutos para sumonar novamente. local effect = 13 -- effect que dará no local que o monstro for sumonado. if not isPlayer(cid) then return FALSE elseif getGlobalStorageValue(storage) >= os.time() then return FALSE end for i = 1, #M do doCreateMonster(M[i][1], M[i][2]) doSendMagicEffect(M[i][2], effect) end doCreatureSay(cid, "OMG, a trap!", 19) setGlobalStorageValue(storage, os.time()+time_summon*60) return TRUE end
  12. Sobre o script, funcionou? Storage: Já tem no código. doPlayerSetStorageValue(pid, 822066, -1)
  13. Desculpa pela demora. function onStepIn(cid, item, position, fromPosition) local M = { [1] = {"Cyclops",{x=710, y=1083, z=14}}, [2] = {"Demon",{x=710, y=1084, z=14}}, [3] = {"Hydra",{x=710, y=1082, z=14}}, [4] = {"Dragon",{x=710, y=1081, z=14}} } local storage = 13311 local time_summon = 3 if not isPlayer(cid) then return FALSE elseif getGlobalStorageValue(storage) >= os.time() then return FALSE end for i = 1, #M do doCreateMonster(M[i][1], M[i][2]) end doCreatureSay(cid, "OMG, a trap!", 19) setGlobalStorageValue(storage, os.time()+time_summon*60) return TRUE end
  14. Um minuto. Testa ai: movements/scripts nome_arquivo.lua movements.xml Coloque o action id na saída do teleport, ou na entrada. O importante é que quem for entrar no evento, passe por esse tile. Lembrando que tu pode definir um action id no tile à sua frente com o comando /attr action numero
  15. O_O Estou muito confuso, o script tá dando storage global, logo, todo mundo tem o storage, logo, todo mundo recebe a mensagem.. Abre um teleport quando vai começar o evento, é isso?
  16. Como as pessoas entram no evento? TP, andando, etc
  17. Manda a mensagem para todos os jogadores online?
  18. Woops. Editei de novo, testa lá.
  19. Só para eu testar uma coisa, troque a primeira letra de "Cyclops" para maiúsculo, assim: [1] = {"cyclops",{x=710, y=1083, z=14}}, por [1] = {"Cyclops",{x=710, y=1083, z=14}},
  20. Bodak Reborn postou uma resposta no tópico em Suporte Tibia OTServer
    Np. =)
  21. Editei o comentário, testa lá.
  22. Np. =) Foi mal pela demora, tinha esquecido de te responder.
  23. Não esqueça de mudar o id da box no código. function onUse(cid, item, fromPosition, itemEx, toPosition) local rewarditems = { {id = 2472, chance = 17, count = 1}, -- start with the lowest chances {id = 2498, chance = 17, count = 1}, {id = 2645, chance = 17, count = 1}, {id = 2421, chance = 8, count = 1}, {id = 2514, chance = 13, count = 1}, -- start with the lowest chances {id = 2470, chance = 10, count = 1}, {id = 2646, chance = 5, count = 1}, {id = 2523, chance = 3, count = 1}, -- start with the lowest chances {id = 2522, chance = 4, count = 1}, {id = 2471, chance = 2, count = 1}, {id = 2496, chance = 2, count = 1}, {id = 8977, chance = 2, count = 1} } local box = xx --ID da box. local chance = math.random(1,100) for i = 1, #rewarditems, 1 do if(chance < rewarditems[i].chance) then local info = getItemInfo(rewarditems[i].id) if(rewarditems[i].count > 1) then text = rewarditems[i].count .. " " .. info.plural else text = info.article .. " " .. info.name end if item.itemid == box then doPlayerAddItem(cid, rewarditems[i].id, rewarditems[i].count) doPlayerRemoveItem(cid, box, 1) doSendMagicEffect(getThingPos(cid), CONST_ME_POFF) text = "You have received " .. text .. "." else text = "You have failed to open your mystery box. The item is to heavy or you have not enough space to take it." end doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, text) return true else chance = chance - rewarditems[i].chance end end end
  24. Bodak Reborn postou uma resposta no tópico em Suporte Tibia OTServer
    data/scripts/creaturescripts/scripts nome_do_arquivo.lua function onKill(cid, target, lastHit) local config = { nome = ("Exemplo1", "Exemplo2"), --Nome do boss. sto = 10203, --Storage. } if isInArray (config.nome, getCreatureName(target)) then setPlayerStorageValue (cid, config.sto, -1) end return true end creaturescripts.xml <event type="kill" name="killBoss" event="script" value="nome_do_arquivo.lua"/> login.lua registerCreatureEvent(cid, "killBoss")

Informação Importante

Confirmação de Termo