Ir para conteúdo

Bodak Reborn

Membro
  • Registro em

  • Última visita

Tudo que Bodak Reborn postou

  1. Cara, eu não mexo com lua há meses, pode estar muito errado, mas pelo menos eu tentei. movements/scripts/nome_arquivo.lua function onEquip (cid, item, slot) if getPlayerSlotItem(cid, 5).itemid == 12707 or getPlayerSlotItem(cid, 6).itemid == 12707 then return true else return false, doPlayerSendTextMessage (cid, 19, "Você deve estar equipado com um "..getItemNameById (12707)..".") end if getPlayerSlotItem (cid, 10).itemid = 12916 then return true else return false, doPlayerSendTextMessage (cid, 19, getItemNameById (12916).." não é utilizada neste arco.") end end movements/movements.xml <movevent type="Equip" itemid="12707" slot="left;right" event="script" value="nome_arquivo.lua"/> <movevent type="Equip" itemid="12916" slot="ammo" event="script" value="nome_arquivo.lua"/>
  2. Isso já existe, se chama Golden Arena. Dá uma pesquisada.
  3. @churupetinha, eu testei e está funcionando, deve ser o seu TFS. O código está em TFS 1.0.
  4. Talkactions, substitui pelo seu código atual.
  5. Bodak Reborn postou uma resposta no tópico em Suporte Tibia OTServer
    Coloque o cid na função getMarkPos, em doTeleportThing.
  6. local function doMarkPos(cid, posx, posy, posz) setPlayerStorageValue(cid, 19000, posx) setPlayerStorageValue(cid, 19001, posy) setPlayerStorageValue(cid, 19002, posz) end local function removeTeleport(pos) tp = getTileItemById(pos, 1387).uid doRemoveItem(tp, 1) doSendMagicEffect(pos, 2) end local teleportar_para = {x = 1244, y = 731, z = 6} local combat = createCombatObject() setCombatParam(combat, COMBAT_PARAM_EFFECT, 10) setCombatParam(combat, COMBAT_PARAM_AGGRESSIVE, false) local function x(p, d) local t = {{x=p.x,y=p.y-1,z=p.z},{x=p.x+1,y=p.y,z=p.z},{x=p.x,y=p.y+1,z=p.z},{x=p.x-1,y=p.y,z=p.z}} return t[d+1] end function onCastSpell(cid, var) local pos = getCreaturePosition(cid) local criar_tp = pos doCreateTeleport(1387, teleportar_para, criar_tp) doMarkPos (cid, pos.x, pos.y, pos.z) local tp = getTileItemById(criar_tp, 1387).uid doItemSetAttribute(tp, "aid", 5678) --doTeleportThing(cid, teleportar_para, true) --Tira essa linha se nao for teleportar o player q usou a magia automaticamente. if getPlayerStorageValue(cid, 5677) == 1 then doPlayerSendCancel(cid, "Você não pode usar tal magia aqui") return false end for i = 1, 5 do addEvent(doSendMagicEffect, i*1000, criar_tp, 134) end addEvent(removeTeleport, 5000, criar_tp) return doCombat(cid, combat, var) end
  7. Tu seta a storage do player na spell, então bota a função que eu te passei no script da spell...
  8. Global storage ou player storage? Como o castle acaba? Seria possível me passar o script?
  9. A função é essa: local function doMarkPos(cid, posx, posy, posz) setPlayerStorageValue(cid, 19000, posx) setPlayerStorageValue(cid, 19001, posy) setPlayerStorageValue(cid, 19002, posz) end Coloque-a no script que marca o storage do player.
  10. Cara, o problema não é o efeito, é a variável POS que não existe.
  11. Está faltando a parte que você seta o storage do player. Eu acho importante você citar de quem você pegou o script, para não "desmerecer" o trabalho da pessoa.
  12. Passa o script do broadcast e o XML.
  13. Seu servidor não deve ter... qual a função usada no login.lua ou no levelup para reajustar a velocidade do jogador?
  14. Não... se tiver algum deles vivo, não vai nascer outro. Tu configurou a área certo? (from e to)
  15. Ué, acabei de testar e funcionou... Tu colocou apenas 3 monstros?
  16. Crie uma variável "pos".
  17. local combat = createCombatObject() setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE) setCombatParam(combat, COMBAT_PARAM_EFFECT, 134) setCombatFormula(combat, COMBAT_FORMULA_LEVELMAGIC, -165.2, 1, -165.2, 1) function onCastSpell(cid, var) local waittime = 2 local storage = 5868 if exhaustion.check(cid, storage) then doCreatureSay(cid, "Aguarde " .. exhaustion.get(cid, storage) .. " segundos para usar a spell novamente.", TALKTYPE_MONSTER) return false end local position1 = {x=getThingPosition(getCreatureTarget(cid)).x+0, y=getThingPosition(getCreatureTarget(cid)).y+1, z=getThingPosition(getCreatureTarget(cid)).z} doSendMagicEffect(position1, 245) doSendMagicEffect(pos, eff) doCreatureSay(cid, "RASEN FURIE MENMA", TALKTYPE_MONSTER) exhaustion.set(cid, storage, waittime) doCombat(cid, combat1, var) return doCombat(cid, combat, var) end
  18. No momento não posso testar, então fiz deste modo por ser mais garantido. O código tá feio, não repara, please. globalevents/scripts nome_arquivo.lua local monster = { [1] = {name = "Moltres", respawnPos = {x = 1049, y = 1052, z = 7}}, [2] = {name = "Zapdos", respawnPos = {x = 1049, y = 1052, z = 7}}, [3] = {name = "Articuno", respawnPos = {x = 1049, y = 1052, z = 7}}, } local from = {x = 1040, y = 1047, z = 7} -- canto superior esquerdo da área do boss. local to = {x = 1059, y = 1061, z = 7} -- canto inferior direito da área do boss. local function haveMonster (monsterName) for x = from.x, to.x do for y = from.y, to.y do for z = from.z, to.z do local pos = {x = x, y = y, z = z, stackpos = 253} local monsterTile = getThingfromPos(pos).uid if isMonster (monsterTile) and getCreatureName (monsterTile) == monsterName then return true end end end end end function onThink(interval, lastExecution) local randomMonster = math.random (#monster) if not haveMonster (monster[1].name) and not haveMonster (monster[2].name) and not haveMonster (monster[3].name) then doSummonCreature (monster[randomMonster].name, monster[randomMonster].respawnPos) doBroadcastMessage (""..monster[randomMonster].name.." acaba de nascer!") end return true end XML: <globalevent name="bossSpawn" interval="14400" event="script" value="nome_arquivo.lua"/>
  19. local running = false function Uheal(cid) running = false doCreatureAddHealth(cid, 300000) doSendMagicEffect(getCreaturePosition(cid), CONST_ME_MAGIC_BLUE) doCreatureSay(cid, "Gaz'haragoth HEALS himself!", TALKTYPE_ORANGE_2) return true end function onThink(cid) local hp = (getCreatureHealth(cid)/getCreatureMaxHealth(cid))*100 if (hp < 5.5 and not running) then doCreatureSay(cid, "Gaz'haragoth begins to draw on the nightmares to HEAL himself!", TALKTYPE_ORANGE_2) running = true addEvent(Uheal, 7000, cid) end return true end
  20. Bodak Reborn postou uma resposta no tópico em Suporte Tibia OTServer
    O script tá incompleto e eu não entendi o problema.
  21. @Sepultura, crie um novo tópico com este pedido, outros membros podem querer o mesmo script que você.
  22. Okay, não entendi muito bem o sentido disso, but... globalevents/scripts nome_arquivo.lua local boss = "Demon" -- nome do boss. local pos = {x = 1150, y = 1052, z = 7} -- posição em que ele vai nascer. local storage = 94726 function onTimer(cid, interval, lastExecution) if getGlobalStorageValue (storage) < 1 then doSummonCreature(boss, pos) setGlobalStorageValue (storage, 1) end return true end XML: <globalevent name="bossRespawnOnce" time="12:30" event="script" value="nome_arquivo.lua"/> Desta forma o script vai ser executado todos os dias às 12:30, porém, o boss só vai nascer uma vez.
  23. Bodak Reborn postou uma resposta no tópico em Suporte Tibia OTServer
    É ipairs, errei ali. Tenta assim: function onCreatureTurn(creature) end function msgcontains(txt, str) return (string.find(txt, str) and not string.find(txt, '(%w+)' .. str) and not string.find(txt, str .. '(%w+)')) end local talkState = {} local focus = 0 local talk_start = 0 function onCreatureSay(cid, type, msg) local msg = string.lower(msg) local talkUser = NPCHANDLER_CONVBEHAVIOR == CONVERSATION_DEFAULT and 0 or cid local tables = { [12127] = {preco = 10, storage = 1212, storagese = 1213, tempo = 24 * 60 * 60, pokemon = "Arcanine"} } local tb = 0 for k, v in ipairs (tables) do if getPlayerItemCount (cid, k) >= 1 then tb = tables[k] break end end local temp = os.time() + tb.tempo if not (getDistanceToCreature(cid) <= 3) then return true end if msgcontains(string.lower(msg), 'hi') then if focus ~= 0 and focus ~= cid then selfSay(getCreatureName(cid) .. ' aguarde...') return true else focus = cid talk_start = os.clock() end end if msgcontains(string.lower(msg), 'hi') then selfSay('Oi! Voce deseja {checar}, {entregar} ou {retirar}?') talkState[talkUser] = 1 elseif msgcontains(string.lower(msg), 'checar') and talkState[talkUser] == 1 then if tb ~= 0 then if getPlayerStorageValue(cid, tb.storage) < temp then selfSay('Seu pokemon ja esta pronto.') else selfSay('Ainda falta [' .. getPlayerStorageValue(cid, tb.storage) < temp ..'], Para seu pokemon esta pronto') talkState[talkUser] = 0 focus = 0 tchau = true end end elseif msgcontains(string.lower(msg), 'entregar') and talkState[talkUser] == 1 then if tb ~= 0 then if getPlayerStorageValue(cid, tb.storagese) > 1 then selfSay('Voce já tem um ovo comigo, espere terminar') return true end if getPlayerItemCount(cid, 2160) < tb.preco then selfSay('Voce nao tem dinheiro necessesario para compeltar essa acao') return true end doPlayerRemoveItem(cid, tb, 1) setPlayerStorageValue(cid, tb.storage, temp) setPlayerStorageValue(cid, tb.storagese, 1) selfSay('Seu ovo estara pronto em breve, toda vez que possivel cheque o ovo para acompanhar o progresso!') talkState[talkUser] = 0 focus = 0 tchau = true else selfSay('Voce nao tem nenhum ovo listado') return true end elseif msgcontains(string.lower(msg), 'retirar') and talkState[talkUser] == 1 then if tb ~= 0 then if getPlayerStorageValue(cid, tb.storage) < temp then setPlayerStorageValue(cid, tb.storagese, -1) addPokeToPlayer(cid, tb.pokemon, 0) selfSay('Uau, seu ovo foi chocado parabens agora voce tem um ' ..tb.pokemon..'.') talkState[talkUser] = 0 focus = 0 tchau = true return true end end if tchau then tchau = false doCreatureSetLookDir(getThis(), lookNpcDir) selfSay('Tchau.') end end end function onThink() if focus ~= 0 then if getDistanceToCreature(focus) > 3 then tchau = true focus = 0 end if (os.clock() - talk_start) > 15 then if focus > 0 then tchau = true focus = 0 end end doNpcSetCreatureFocus(focus) end if tchau then tchau = false selfSay('Tchau.') end end
  24. Bodak Reborn postou uma resposta no tópico em Suporte Tibia OTServer
    Tem como fazer assim: for k, v in ipairs (tables) do if getPlayerItemCount (cid, k) then -- o que vai acontecer caso ele tenha algum ovo. break else -- o que vai acontecer caso ele não tenha nenhum ovo. end end

Informação Importante

Confirmação de Termo