Ir para conteúdo

zipter98

Herói
  • Total de itens

    2553
  • Registro em

  • Última visita

  • Dias Ganhos

    72

Tudo que zipter98 postou

  1. data/creaturescripts/scripts.
  2. zipter98

    Movements Sql

    nvm já postaram
  3. Teoricamente sim, de 1 em 1 hora. Se não funcionar, teste o primeiro código.
  4. Não se esqueçam de registrar o evento no arquivo .XML dos monstros que poderão spawnar um boss. local config = { chance = 1, --Coloquem apenas números inteiros (1 - 0.0001%). bosses = { --["monster_name"] = "boss", ["Dragon Lord"] = "Demodras", }, } function onSpawn(cid) if isMonster(cid) then addEvent(function() if isCreature(cid) then local boss = config.bosses[getCreatureName(cid)] if boss and math.random(1, 1000000) <= config.chance then local pos = getThingPos(cid) doRemoveCreature(cid) doCreateMonster(boss, pos) end end end, 5) end return true end
  5. <globalevent name="monster1" type="start" event="script" value="nome_do_arquivo.lua"/> <globalevent name="monster2" interval="3600" event="script" value="nome_do_arquivo.lua"/>
  6. Tem a maneira mais prática, que envolve apenas o onSpawn. Entretanto, você precisaria registrar o evento no arquivo XML de todos os monstros do jogo. (creaturescript) function backToPos(cid, pos) if isCreature(cid) then doTeleportThing(cid, pos) addEvent(backToPos, 60 * 60 * 1000, cid, pos) end end function onSpawn(cid) backToPos(cid, getThingPos(cid)) return true end Se achar muito cansativo, há uma outra maneira, que apesar de gastar muita memória no processo, você só precisará registrar 2 tags. (globalevent) function onStartup() for _, m in pairs(getMonstersOnline()) do local value = ":"..getThingPos(m).x.."/"..getThingPos(m).y.."/"..getThingPos(m).z setPlayerStorageValue(m, 9182, value) end return true end function onThink() for _, m in pairs(getMonstersOnline()) do local t = getPlayerStorageValue(m, 9182):sub(2):explode("/") doTeleportThing(m, {x = tonumber(t[1]), y = tonumber(t[2]), z = tonumber(t[3])}) end return true end
  7. Se você instalar essas duas funções nas sources, eu faço o código em Lua.
  8. Isso é bem simples, porém é necessário ter as sources do servidor e instalar as funções onSpawn (tem aqui no fórum, só procurar) e getMonstersOnline (o código desta função tem tanto na OTLand quanto no Tibia King).
  9. Não se preocupem, fazer o que vocês querem é bem simples. Como estou ocupado no momento, mais tarde farei o código para vocês. Pelas sources, é necessário apenas instalar aquele creatureevent que citei (onSpawn).
  10. Provavelmente você esqueceu de configurar alguma coisa (ou configurou errado) na tabela config. Se possível, poste como ficou seu código configurado.
  11. data/creaturescripts/scripts, geralmente spawn.lua. Você deve registrar o evento no arquivo XML do(s) monstro(s). Entretanto, em servidores de pokémon, os pokémons shinies são gerados pelo script apenas adicionando o prefixo "Shiny " no nome. No seu caso, este método não seria possível.
  12. Claro, seria quase o mesmo processo. Porém, neste caso, você teria que configurar uma tabela indicando os monstros e seus respectivos "shinies". Já adianto a ambos: será necessário instalar nas sources o creatureevent onSpawn. Link para a versão 0.3.6 Link para a versão 0.4
  13. OK. Você saberia dizer se há alguma tabela no seu servidor (em algum arquivo da lib) em que os pokémons são configurados para alguma coisa (por exemplo, status e spells, como no PDA)? Se sim, peço que diga o nome desta tabela. Assim, não haverá margens de erros na criação do shiny. Caso contrário, eu posso criar uma função para verificar se o monstro existe (meio gambiarra, mas enfim).
  14. Só que o seu OT é outra base.
  15. Você tem as sources do seu servidor?
  16. Não se esqueça de registrar o evento em login.lua. local config = { vocations = {1, 2, 3, ...}, --IDs das vocações. time = 1, --Exhaust, em minutos. hpPercent = 20, --Porcentagem de vida. toPos = {x = x, y = y, z = z}, --Para onde será teleportado. } function onStatsChange(cid, attacker, type, combat, value) if type == STATSCHANGE_HEALTHLOSS and isPlayer(cid) and isInArray(config.vocations, getPlayerVocation(cid)) then if getPlayerStorageValue(cid, 18182) < os.time() and getCreatureHealth(cid) <= getCreatureMaxHealth(cid) * config.hpPercent / 100 then doTeleportThing(cid, config.toPos) setPlayerStorageValue(cid, 18182, os.time() + config.time * 60) end end return true end
  17. Eu sinceramente não pretendia adaptar o código para outras bases, mas enfim. Sobre o goback, não encontrei nenhum erro que pudesse estar causando isso. Você colocou e configurou a tabela corretamente em configuration.lua? E use este look:
  18. O problema, aparentemente, não está no código do monstro, e sim na tag dele em monsters.xml. Posso ver como você colocou?
  19. @Taiger Se possível, poste tanto o look.lua e o goback.lua. Escrevi o sistema para o PDA 1.9 do Slicer, sem modificações adicionais. Logo, sistemas como o de ícones pode causar problemas.
  20. Hm, tenta o seguinte: Troque: if table ~= "" then min = getSpecialAttack(cid) * table.f * 0.1 --alterado v1.6 max = min + (isSummon(cid) and getMasterLevel(cid) or getPokemonLevel(cid)) if spell == "Selfdestruct" then min = getCreatureHealth(cid) --alterado v1.6 max = getCreatureHealth(cid) end if not isSummon(cid) and not isInArray({"Demon Puncher", "Demon Kicker"}, spell) then --alterado v1.7 doCreatureSay(cid, string.upper(spell).."!", TALKTYPE_MONSTER) end if isNpcSummon(cid) then local mnn = {" use ", " utilize ", " "} local use = mnn[math.random(#mnn)] doCreatureSay(getCreatureMaster(cid), getPlayerStorageValue(cid, 1007)..","..use..""..doCorrectString(spell).."!", TALKTYPE_MONSTER) end else print("Error trying to use move "..spell..", move not specified in the pokemon table.") end por: if spell ~= "Mega Evolution" then if table ~= "" then min = getSpecialAttack(cid) * table.f * 0.1 --alterado v1.6 max = min + (isSummon(cid) and getMasterLevel(cid) or getPokemonLevel(cid)) if spell == "Selfdestruct" then min = getCreatureHealth(cid) --alterado v1.6 max = getCreatureHealth(cid) end if not isSummon(cid) and not isInArray({"Demon Puncher", "Demon Kicker"}, spell) then --alterado v1.7 doCreatureSay(cid, string.upper(spell).."!", TALKTYPE_MONSTER) end if isNpcSummon(cid) then local mnn = {" use ", " utilize ", " "} local use = mnn[math.random(#mnn)] doCreatureSay(getCreatureMaster(cid), getPlayerStorageValue(cid, 1007)..","..use..""..doCorrectString(spell).."!", TALKTYPE_MONSTER) end else print("Error trying to use move "..spell..", move not specified in the pokemon table.") end end Sobre o goback, se possível, poste o código aqui. E aparece algum erro na distro relacionado a este arquivo (quando você tenta usar o pokémon mega)?
  21. Quais bases vocês estão utilizando?
  22. @Zet0N0Murmurouu Se possível, poste a linha 180 de pokemon moves.lua. PS: Você seguiu todos os passos corretamente, certo? @Taiger function doUpdateMoves(cid) if not isCreature(cid) then return true end local summon = getCreatureSummons(cid)[1] local ret = {} table.insert(ret, "12&,") if not summon then for a = 1, 12 do table.insert(ret, "n/n,") end doPlayerSendCancel(cid, table.concat(ret)) addEvent(doUpdateCooldowns, 100, cid) return true end if isTransformed(summon) then --alterado v1.9 moves = movestable[getPlayerStorageValue(summon, 1010)] else moves = getCreatureNameWithProtect(summon) == "Smeargle" and getSmeargleMoveTable(cid) or movestable[getCreatureNameWithProtect(summon)] end for a = 1, 12 do local b = getNewMoveTable(moves, a) if b then table.insert(ret, (b.name:find("Sketch") and "Sketch" or b.name)..",") else local mEvolve if not getCreatureName(summon):find("Mega") and getItemAttribute(getPlayerSlotItem(cid, 8).uid, "megaStone") then if not isInArray(ret, "Mega Evolution,") then table.insert(ret, "Mega Evolution,") mEvolve = true end end if not mEvolve then table.insert(ret, "n/n,") end end end doPlayerSendCancel(cid, table.concat(ret)) addEvent(doUpdateCooldowns, 100, cid) end
  23. As configurações e atributos no programa, não sei dizer. Entretanto, pegue como base um banco (porém, neste caso, a sprite será "invisível"). O necessário é que o jogador possa passar por cima do item e sofrer uma elevação.
  24. Ops, agora vi o erro. Falta de atenção minha, desculpe. Corrigido.
  25. Posso ver como ficou a configuração da tabela? E ela está em configuration.lua, certo? Sobre o pulo, é como eu disse: aquele item terá de ser criado.
  • Quem Está Navegando   0 membros estão online

    • Nenhum usuário registrado visualizando esta página.
×
×
  • Criar Novo...