Ir para conteúdo
  • Cadastre-se

elielder

Membro
  • Total de itens

    169
  • Registro em

  • Última visita

  • Dias Ganhos

    3

Histórico de Curtidas

  1. Gostei
    elielder recebeu reputação de qtoni em ERRO RME ITENS DIFERENTES NO MAPA   
    Boa tarde.

    eu faço o seguinte para não acontecer isso.

    Instalo o Tibia (versão 8.60 no meu caso)
    instalo o RME
    Vou na pasta - C:\Program Files\RME\data
    copio e colo a pasta 860, renomeio para NTO.
    Adiciono o items.otbm e items.xml e adiciono tibia.dat , tibia.spr  (o client).
    Ai vou abrir  o RME
    procuro a pasta tibia para abrir a primeira vez. ( O RME pede pra abrir na versao)
    C:\Program Files (x86)\Tibia
    ai ok, eu abro.
    ai vou File - preference - client version - ai vc seleciona  - C:\Program Files\RME\data\NTO
    ai ele vai atualizar para as sprites do teu client. ai é só dar load no teu mapa.

    se ficou meio confuso peço desculpas, não sei explicar bem.
  2. Obrigado
    elielder deu reputação a Cjaker em Tibia 8.60 Editor   
    Atualização V2
    - Adicionado opção Skills U16 (skills acima de 255)
    - Outfit limit (quebra o limite de outfits 25 pra 65k)
  3. Obrigado
    elielder deu reputação a Vodkart em (Resolvido)Experiencia bonus por Stamina.   
    rateStaminaAboveNormal = 1.2
  4. Gostei
    elielder recebeu reputação de So volto tarde em (Resolvido)Spell - docreaturesetmove   
    ja descobri que é bug na distro otx 2.12, agora to tentando descobrir como arrumar
    Resolvi o problema, pra quem estiver o mesmo erro va em combat.cpp


     

     
  5. Gostei
    elielder recebeu reputação de Sun em (Resolvido)Spell - docreaturesetmove   
    ja descobri que é bug na distro otx 2.12, agora to tentando descobrir como arrumar
    Resolvi o problema, pra quem estiver o mesmo erro va em combat.cpp


     

     
  6. Obrigado
    elielder deu reputação a Kyle Bellini em Spell - Que tira Stun   
    Só 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  
  7. Obrigado
    elielder deu reputação a 139 em Spell - Big Regeneration   
    @elielder

     
    local combat = createCombatObject() setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_HEALING) setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_MAGIC_BLUE) setCombatParam(combat, COMBAT_PARAM_AGGRESSIVE, false) local voc_bonus = { -- valor da cura adicional, ex: 0%, 10%, 50%, 100%, 200% ["Tanque"] = 50, ["Suporte"] = 25, ["Dano"] = 0, } local table_vocs = { -- last_id é o último id da vocação, a tabela precisa estar em ordem crescente. [1] = {last_id = 12, voc = "Naruto", classe = "Dano"}, [2] = {last_id = 20, voc = "Sasuke", classe = "Dano"}, [3] = {last_id = 30, voc = "Chouji", classe = "Tanque"}, [4] = {last_id = 40, voc = "Hidan", classe = "Tanque"}, [5] = {last_id = 50, voc = "Hashirama", classe = "Suporte"}, [6] = {last_id = 60, voc = "Obito", classe = "Suporte"}, } local function getBonus(cid, base) local pvoc = getPlayerVocation(cid) for k, _ in ipairs(table_vocs) do if pvoc <= table_vocs[k].last_id then bonus = voc_bonus[table_vocs[k].classe]/100 + 1 total = base * bonus return total end end end function onGetPlayerMinMaxValues(cid, level, magLevel) local min = ((level*0)+(magLevel*0)+200) local max = ((level*0)+(magLevel*0)+250) return getBonus(cid, min), getBonus(cid, max) end setCombatCallback(combat, CALLBACK_PARAM_SKILLVALUE, "onGetPlayerMinMaxValues") function onCastSpell(cid, var) return doCombat(cid, combat, var) end  
  8. Curtir
    elielder recebeu reputação de Fabi Marzan em Spell - Big Regeneration   
    .Qual servidor ou website você utiliza como base? 
    3996 - 0.4 - 8.60
    Qual o motivo deste tópico? 
    Preciso de uma Big Regeneration por formula (level+ML) aonde cada classe tem uma cura diferente;
    Exemplo:  Tank vai curar 10% a mais que a classe dano - Suporte vai ficar com a cura entre tank e dano - Dano vai curar menos.
    Naruto - Classe Dano - Voc [1 a 10]   
    Sasuke - Classe Dano - Voc [11 a 20]


    Chouji - Classe Tank - Voc [21 a 30]
    Hidan  - Classe Tank - Voc [31 a 40]


    Hashirama - Classe Suporte - - Voc [41 a 50]
    Obito - Classe Suporte - - Voc [51 a 60]
     
     
    Você tem o código disponível? Se tiver publique-o aqui: 
    Essa é  a base do código, só não sei determina pra cada vocação ter uma cura diferente.
    local combat = createCombatObject() setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_HEALING) setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_MAGIC_BLUE) setCombatParam(combat, COMBAT_PARAM_AGGRESSIVE, false) function onGetFormulaValues(cid, level, maglevel) local min = ((level*0)+(maglevel*0)+200) local max = ((level*0)+(maglevel*0)+250) return min, max end setCombatCallback(combat, CALLBACK_PARAM_LEVELMAGICVALUE, "onGetFormulaValues") function onCastSpell(cid, var) local waittime = 1 -- Tempo de exhaustion local storage = 8205 if exhaustion.check(cid, storage) then return false end exhaustion.set(cid, storage, waittime) return doCombat(cid, combat, var) end   
     
     
  9. Obrigado
    elielder deu reputação a FlameArcixt em Verificação por Storage - Spells   
    agora foi
  10. Obrigado
    elielder deu reputação a FlameArcixt em Verificação por Storage - Spells   
    local combat = createCombatObject() setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE) setCombatFormula(combat, COMBAT_FORMULA_LEVELMAGIC, -53.2, 1, -54.2, 1) function onCastSpell(cid, var) local tempocoldown = 3 -- Tempo de exhaustion em segundos local sto = 150000 -- Storage de Spell, nunca usar a mesma em outra spell, a menos que não queira usar duas spell juntas! if exhaustion.check(cid, sto) then doPlayerSendCancel(cid, "Aguarde " .. exhaustion.get(cid, sto) .. " segundos para usar essa spell novamente.") return false end if exhaustion.check(cid, 45645896) then local position1 = {x=getThingPosition(getCreatureTarget(cid)).x, y=getThingPosition(getCreatureTarget(cid)).y-1, z=getThingPosition(getCreatureTarget(cid)).z} local position2 = {x=getThingPosition(getCreatureTarget(cid)).x+2, y=getThingPosition(getCreatureTarget(cid)).y, z=getThingPosition(getCreatureTarget(cid)).z} local position3 = {x=getThingPosition(getCreatureTarget(cid)).x-1, y=getThingPosition(getCreatureTarget(cid)).y+1, z=getThingPosition(getCreatureTarget(cid)).z} local position4 = {x=getThingPosition(getCreatureTarget(cid)).x+3, y=getThingPosition(getCreatureTarget(cid)).y, z=getThingPosition(getCreatureTarget(cid)).z} local position5 = {x=getThingPosition(getCreatureTarget(cid)).x, y=getThingPosition(getCreatureTarget(cid)).y, z=getThingPosition(getCreatureTarget(cid)).z} doSendMagicEffect(position1, 304) doSendMagicEffect(position2, 304) doSendMagicEffect(position3, 302) doSendMagicEffect(position4, 302) doSendMagicEffect(position5, 304) exhaustion.set(cid, sto, tempocoldown) return doCombat(cid, combat, var) else return doPlayerSendCancel(cid, "Você só pode usar essa spell com buff") end end  
  11. Gostei
    elielder deu reputação a MatheusVidaLoka em [Actions] Novo gold   
    Fala galera do Tibia King, hoje venho trazer um actions a vocês, queria dizer que essa action já é velha, mas dei uma olhada no TK e não vi nada a respeito da action, então decidi postar para vocês.




    Qual a função da Action?



    É um novo tipo de gold que cada um vale 1kk, funcionando normal nas compras e vendas de itens em npcs, e nas trocas de crystal coin para o golda nugget (novo gold).




    Bom vamos ao script.




    Vá em data/actions/scripts e abra o arquivo crystal.lua, apague tudo o que está dentro, logo em seguida cole o script abaixo:









    Traduzindo:
    Vermelho: É o id da crystal coin, e a quantidade a ser trocada por 1 gold nugget (Novo Gold).
    Azul: É o id da gold nugget, e a quantidade de gold nugget.




    Logo em seguida, vá novamente em data/actions/scripts copie qualquer arquivo.lua e cole, em seguida renomeie-o para "goldnuggets" sem aspas, abra-o, apague tudo, e cole o script abaixo.




    Traduzindo:
    Laranja: É o que vai dizer quando o player trocar 1 gold nugget por 100 crystal coins.
    Verde: É o id da crystal coin, e a quantidade equivalente a 1 gold nugget.



    Logo em seguida, abra data/actions/actions.xml e adicione a tag abaixo.









    Traduzindo:
    Rosa: É o id do gold nuggets.
    Azul: O nome do arquivo.lua que você salvou.




    Depois disso abra data/items/items.xml, aperte CTRL + F, e digite 2157, ai você vai achar o item Gold Nugget que vai estar assim:








    Substitua tudo por isso:



    <item id="2157" article="a" name="gold nugget" plural="gold nuggets">
    <attribute key="weight" value="10"/>
    <attribute key="worth" value="1000000" />




    Traduzindo:
    Vermelho: Peso do gold nugget.
    Azul: Valor do item (como 1 crystal coin = 10k , 1 gold nugget = 1kk)




    Logo depois vá data/actions/scripts/other e abra o arquivo changegold.lua, susbistitua tudo oque está la dentro por esse script a seguir, e salve:




    -- By MatheusVidaLoka
    local coins = {
    [iTEM_GOLD_COIN] = {
    to = ITEM_PLATINUM_COIN, effect = TEXTCOLOR_YELLOW
    },
    [iTEM_PLATINUM_COIN] = {
    from = ITEM_GOLD_COIN, to = ITEM_CRYSTAL_COIN, effect = TEXTCOLOR_LIGHTBLUE
    },
    [iTEM_CRYSTAL_COIN] = {
    from = ITEM_PLATINUM_COIN, to = 2157, effect = TEXTCOLOR_LIGHTBLUE
    },
    [2157] = {
    from = ITEM_CRYSTAL_COIN, effect = TEXTCOLOR_TEAL
    }



    }



    function onUse(cid, item, fromPosition, itemEx, toPosition)
    if(getPlayerFlagValue(cid, PLAYERFLAG_CANNOTPICKUPITEM)) then
    return false
    end



    local coin = coins[item.itemid]
    if(not coin) then
    return false
    end



    if(coin.to ~= nil and item.type == ITEMCOUNT_MAX) then
    doChangeTypeItem(item.uid, item.type - item.type)
    doPlayerAddItem(cid, coin.to, 1)
    doSendAnimatedText(fromPosition, "$$$", coins[coin.to].effect)
    elseif(coin.from ~= nil) then
    doChangeTypeItem(item.uid, item.type - 1)
    doPlayerAddItem(cid, coin.from, ITEMCOUNT_MAX)
    doSendAnimatedText(fromPosition, "$$$", coins[coin.from].effect)
    end
    return true
    end



    Traduzindo:
    Vermelho: É o id do Gold Nugget.




    Por fim vá em data/actions/actions.xml, pule uma linha qualquer e cole isso, e salve:



    <action itemid="2157" event="script" value="other/changegold.lua"/>




    Traduzindo:
    Azul: É o id do gold nugget.
    Verde: O nome do arquivo que você salvou.

    Server testado em Ot 8.60 e funcionou corretamente.



    Creditos:



    MatheusVidaLoka



    JFLNT




    Se enfringi alguma regra do TK por favor me reporte.




    Desculpe-me pelos mal usos das ferramentas do TK (quotes,spoiler,CODES,etc) pois estou com certos problemas.

  12. Obrigado
    elielder deu reputação a Shiuns em (Resolvido)Colocar delay   
    local globalEvent = 0 local function globalSave(minutes) if minutes <= 0 then doSetGameState(GAMESTATE_SHUTDOWN) os.exit(0) return true end if minutes == 1 then addEvent(doSaveServer, 59000) -- 59 segundos doBroadcastMessage("Global server save in " .. minutes .. " minute, please go to safe zone and logout. The save will not be longer than 1 minute.") elseif minutes <= 3 then doBroadcastMessage("Global server save in " .. minutes .. " minutes, please go to safe zone. The save will not be longer than 1 minute.") else doBroadcastMessage("Global server save in " .. minutes .. " minutes, please go to safe zone. The save will not be longer than 1 minute.") end globalEvent = addEvent(globalSave, 60000, minutes - 1) return true end function onTime(interval, lastExecution) setGlobalStorageValue(48572, 1) return globalSave(math.abs(math.ceil(5))) end  
  13. Gostei
    elielder deu reputação a LeoTK em [Spell] Dano Por Skill   
    Testado : ✔️
    OTX - 0.3.6 / 8.54
     
    Salve galera, bom depois de algum tempo e com ajuda de alguns amigos, consegui trazer para vocês essa função, eu sei que já tem alguns tópicos referente ao assunto, porém sempre com problemas ou nunca explicado de uma forma simples e objetiva.
     
    Para começar vamos ao código
     
    Função
    function onGetFormulaValues(cid, level, skill, attack, factor) local lvl_skill = getPlayerSkillLevel(cid, SKILL_CLUB) local lvl_skill2 = getPlayerSkillLevel(cid, SKILL_FIST) local min = (level * 3 + lvl_skill * 5 + lvl_skill2 * 5) * 3 local max = (level * 3 + lvl_skill * 5 + lvl_skill2 * 5) * 3 return -min, -max end setCombatCallback(combat1, CALLBACK_PARAM_SKILLVALUE, "onGetFormulaValues") Bom essa função vai calcular o level, skill para dar o dano da spell.
     
    Mas vamos a algumas observações e informações sobre ela.
     
    Primeiramente você pode configurar ela para calcular mais de uma skill no caso da função acima esta calculando a club e fist
     
    Para adicionar ou remover skills a ser calculada você vai remover ou adicionar essa linha
    local lvl_skill = getPlayerSkillLevel(cid, SKILL_CLUB) Depois de adicionar ou remover você vai editar essa linha
    local min = (level * 3 + lvl_skill * 5 + lvl_skill2 * 5) * 3 local max = (level * 3 + lvl_skill * 5 + lvl_skill2 * 5) * 3 Então esta calculando o level a skill club e a skill fist mas tanto pode remover a skill fist ou adicionar outra skill ficando assim
     
    Removido
    local min = (level * 3 + lvl_skill * 5) * 3 local max = (level * 3 + lvl_skill * 5) * 3 Adicionado para calcular e somar mais de uma skill para dar o dano ou seja
     
    local min = (level * 3 + lvl_skill * 5 + lvl_skill2 * 5 + lvl_skill3 * 5 + lvl_skill4 * 5) * 3 local max = (level * 3 + lvl_skill * 5 + lvl_skill2 * 5 + lvl_skill3 * 5 + lvl_skill4 * 5) * 3 Assim vai calcular e somar as skills então se tiver 50 de club vai dar um dano se tiver 50 de fist vai somar com a club e o dano vai ser maior e por ai vai com isso da para criar diversos quesitos de rpg por exemplo mestre das armas o jogador treina todas as skills de tipos de armas e a spell vai dar mais dano por conta disso
     
    !! ATENÇÃO !!
    Para o script poder fazer todo esse calculo o jogador precisa estar usando uma arma que upe skill ou seja se ele estiver usando club ele vai calcular a skill do jogador se ele não estiver usando nada nas mãos vai calcular o fist dependendo disso vai afetar no dano que a skill pode dar
     
    Bom é isso espero que vocês gostem, Não esqueça de deixar o feedback se gostou, se foi útil etc...
     
    Créditos:
    @Dwarfer
    @lordzetros
     
  14. Obrigado
    elielder deu reputação a LeoTK em Contrato alguem que entenda de DLL   
    Este tópico foi movido para a seção de Suporte Otserv.
    @elielder eu mesmo postei um cliente 8.6 que já aceita spr e dat estendido sem o uso de dll porém você não disse qual a versão do teu cliente old caso for a 8.6 utilize esse cliente que eu postei
  15. Gostei
    elielder deu reputação a xWhiteWolf em Dodge System 8.54+   
    Ae galera do TK, uns caras ficaram me mandando PM pedindo esse sistema aqui.. aparentemente tem em algum server e eles queriam replicar o sistema no OT deles. Não sei como funciona no outro server mas no script que eu fiz vai funcionar assim:
    Serão 100 livros que você poderá comprar de um npc específico, cada livro te dá 1 ponto a mais na skill Dodge e isso acarreta em 0.3% de chance a mais de desviar de um golpe e tomar só 50% de dano. Infelizmente eu nunca joguei no servidor que foi o pioneiro desse sistema (na vdd eu nem sei qual é) então eu não fiz igual o deles, na realidade o meu só funciona ao perder vida então se o mago usar utamo vita acabou os dodge's dele. Outra coisa importante é que o player tem uma chance rara de dar Dodge no Dodge, ou seja, levando 1/4 do dano. Só vai funcionar para ataques de criaturas, tanto melee quanto spells, ou seja, se o cara passar no fogo não tem chance dele desviar do dano 
    Sem mais delongas, vamos ao script:

    Crie um arquivo chamado dodge.lua na pasta creaturescripts\scripts e coloque isso dentro dele:
     

    agora adicione essa linha no creaturescripts.xml:
    <event type="statschange" name="dodge" event="script" value="dodge.lua"/> em creaturescripts\scripts\login.lua adicione isso antes do ultimo return true:
    registerCreatureEvent(cid, "dodge") if getPlayerStorageValue(cid, 48902) == -1 then         setPlayerStorageValue(cid, 48902, 0)      end agora vá em actions.xml e adicione essa linha aqui:
    <action itemid="1950" script="dodgebook.lua"/> note que vc pode mudar o ID do livro a hora que vc quiser.

    em items.xml, procure o item com o ID que vc irá utilizar e deixe ele assim:
    <item id="1950" article="a" name="Skill Book [DODGE]"> <attribute key="weight" value="1300" /> </item> agora crie um arquivo chamado dodgebook em actions\scripts e coloque isso dentro dele:
  16. Curtir
    elielder deu reputação a FlameArcixt em Sprites Return Of The Saiyans   
    Servidor com sprites próprias, todas pagas, não usam nenhuma sprite de outro jogo, investiram grana e tempo nas sprites pra alguém chegar e ripar, complicado
  17. Curtir
    elielder recebeu reputação de Nysman em (Resolvido)Ajuda com Spells   
    nenhum funcionou.

    Desculpa não conseguir explicar.
    Mas eu quero que apareça as duas mensagem.
    exemplo se o player usar essa magia em um monstro aparece "Voce so pode usar esta magia em players!"
    se o player atacar outro player e essa magia falhar  aparece "Sorry, Mafuba falhou"

    É porque do jeito que a magia está, quando eu ataco um player e ele falha, aparece a mesma mensagem de quando ataco um monstro. Preciso que apareça as duas.

     
    Consegui resolver assim. Se alguem ver algum erro por favor corriga. mas aqui está funcionando perfeitamente.

     
     
  18. Obrigado
    elielder deu reputação a Nysman em (Resolvido)Ajuda com Spells   
    Pode fechar o topico!
  19. Obrigado
    elielder deu reputação a Vodkart em [OTX] New Auto Loot Unlimited Edition 2.0   
    [ + ] Descrição: Autoloot refeito para VERSÃO OTX e adicionado algumas outras funções que estarei explicando ao decorrer do tópico.
     
    [ + ] Se você quer o Autoloot ara Versão TFS clica neste Link: AUTOLOOT TFS
     

     
     
    [ + ] Imagem do comando:
     

     
    [ + ] Features:
     
    [ - ] Você pode ativar ou desativar o autoloot a hora que achar necessário.
    [ - ] Também existe um comando para ativar ou desativar mensagens do loot que o autoloot coleta!
    [ - ] Você pode escolher a cor do texto em que irá aparecer a coleta do loot!
    [ - ] O autoloot informará para você se estiver com pouco slots na sua backpack, e o jogador poderá escolher se quer habilitar ou não está função no autloot.
    [ - ] Versão ilimitada de itens(não ficam armazenadas em storages.
    [ - ] O jogador poderá optar por depositar direto no banco os golds que forem dropados.
     
    [ + ] Instalação:
     
    Primeiramente CRIE uma PASTA VAZIA chamanda "autoloot" em DATA/LOGS, ficando assim:
     

     
    Depois instale o MODS normalmente na pasta MODS do seu servidor.
     

     
    new_perfect_autoloot_otx.xml
     
    Link: https://pastebin.com/raw/CW6jgerg
     
     
     [ + ] Configuração:
     
    Dentro do mods tem essa tabela
    info = { directory = "data/logs/autoloot", -- não mexer Warn_Bp_Slots = 5, -- quando tiver 5 ou menos slots na BP vai avisar o jogador Talkaction_delay = 5, -- em segundos // delay para remover e adicionar item BlockMonsters = {}, -- Lista de monstros que o autoloot nao vai funcionar BlockItemsList = {2123,2515}, -- Lista de itens que o autoloot nao coleta Money_ids = {2148, 2152, 2160}, -- id das moedas do ot Max_Slots = {free = 3, premium = 5}, -- quantidade de itens que podem ser adicionados no autoloot por free e premium Storages = {988801, 988802, 988803, 988804, 988805, 988806, 988807} -- não mexer }  
    Basta ler acima para esclarecer as dúvidas!!
     
    Estarei anexando o autoloot 2.0 versão atualizada para quem tiver preguiça de copiar e colar!!
     
     
     
    new_perfect_autoloot_otx.xml
  20. Curtir
    elielder deu reputação a Belmont em [8.60 OTX] NTO Hard - Full Packet Server   
    @kukas9 Sim, roda no windows também, mas recomendo o Linux
  21. Obrigado
    elielder deu reputação a MaXwEllDeN em Aulas de Scripting Lua   
    Salve rapasiada.
     
    Revivendo aqui pra avisar que corrigi is links das aulas que quebraram quando fizeram atualização do forum.
     
    Não consegui encontrar no fórum a aula 4, de alguma forma ela se perdeu.
     
    Abraços
  22. Obrigado
    elielder recebeu reputação de Belmont em SavePlayer [Avançado]   
    Tente esse.
     
    Vai Em Talkactions.xml E Adicione 
     
     
     
     
    Depois Copie Um Arquivo Lua Renomeia O Nome Retire O Que Tem Dentro E Adicione
     
     
     
    Depois Abra A Pasta Data Do Seu Server Depois Em Lib Depois Abra O Arquivo Lua Database E Adicione
     
     
  23. Gostei
    elielder deu reputação a King Laker em SavePlayer [Avançado]   
    Aqui esta o do save a cada 30s que eu comentei.
     
  24. Gostei
    elielder deu reputação a King Laker em SavePlayer [Avançado]   
    @elielder Aqui esta o do comando !save que eu disse:
    @elielder 
    duvido que o topico seja o seu, por favor poste os devidos creditos.
  25. Gostei
    elielder deu reputação a Vodkart em [MODS] - [8.6] Perfect Zombie System [Automático] [V1.0]   
    Qual dúvida ou erro poste no tópico que estarei respondendo.
     
     
    Obs: Antes que me falem besteiras, coloquei para os GM'S, CM'S E GOD'S não contarem no evento, então testem apenas com jogadores.
     
    Zombie.xml
    <?xml version="1.0" encoding="ISO-8859-1"?> <mod name="Perfect Zombie System" version="8.6" author="Vodkart" contact="tibiaking.com" enabled="yes"> <config name="zombie_config"><![CDATA[ zombie_config = { storages = {172100, 172101, 172102}, -- n edite players = {min = 2, max = 30}, -- min, max players no evento rewards = {items ={{2160,10},{2494,1}}, trophy = 5805}, timeToStartEvent = 30, -- segundos para começar o evento CheckTime = 5, -- tempo que o TP fica aberto para os jogadores adrentarem o evento teleport = {{x=147, y=55, z=7}, {x=125 , y=304, z=7}}, -- position do tp onde aparece, position para onde o jogador vai ao entrar no tp arena = {{x=110,y=297,z=7},{x=145,y=321,z=7}}, -- area positions monster_name = "Zombie Event", timeBetweenSpawns = 20, min_Level = 20 } zombie_days = { ["Monday"] = {"13:00","18:00","20:00","22:00"}, ["Tuesday"] = {"13:00","18:00","22:50","22:00"}, ["Wednesday"] = {"21:57","18:00","20:00","23:17"}, ["Thursday"] = {"13:00","18:00","20:00","22:00"}, ["Friday"] = {"13:00","18:00","21:45","22:00"}, ["Saturday"] = {"13:00","18:00","20:00","22:00"}, ["Sunday"] = {"13:00","18:00","20:00","22:00"} } function removeZombieTp() local t = getTileItemById(zombie_config.teleport[1], 1387).uid return t > 0 and doRemoveItem(t) and doSendMagicEffect(zombie_config.teleport[1], CONST_ME_POFF) end function ZerarStoragesZombie() for _, stor in pairs(zombie_config.storages) do setGlobalStorageValue(stor, 0) end end function getPlayersInZombieEvent() local t = {} for _, pid in pairs(getPlayersOnline()) do if isInRange(getPlayerPosition(pid), zombie_config.arena[1], zombie_config.arena[2]) and getPlayerAccess(pid) < 3 then t[#t+1] = pid end end return t end function getZombieRewards(cid, items) local backpack = doPlayerAddItem(cid, 1999, 1) -- backpackID for _, i_i in ipairs(items) do local item, amount = i_i[1],i_i[2] if isItemStackable(item) or amount == 1 then doAddContainerItem(backpack, item, amount) else for i = 1, amount do doAddContainerItem(backpack, item, 1) end end end end function isWalkable(pos, creature, proj, pz)-- by Nord if getTileThingByPos({x = pos.x, y = pos.y, z = pos.z, stackpos = 0}).itemid == 0 then return false end if getTopCreature(pos).uid > 0 and creature then return false end if getTileInfo(pos).protection and pz then return false, true end local n = not proj and 3 or 2 for i = 0, 255 do pos.stackpos = i local tile = getTileThingByPos(pos) if tile.itemid ~= 0 and not isCreature(tile.uid) then if hasProperty(tile.uid, n) or hasProperty(tile.uid, 7) then return false end end end return true end function HaveCreatureZombie(area, remove) for x = area[1].x - 1, area[2].x + 1 do for y = area[1].y - 1, area[2].y + 1 do local pos = {x=x, y=y, z=area[1].z} local m = getTopCreature(pos).uid if remove ~= false and m ~= 0 and isMonster(m) then doRemoveCreature(m) end end end end function spawnZombie() if #getPlayersInZombieEvent() > 1 then local pos = {x=math.random(zombie_config.arena[1].x, zombie_config.arena[2].x), y=math.random(zombie_config.arena[1].y,zombie_config.arena[2].y), z=zombie_config.arena[1].z} if not isWalkable(pos, false, false, false) then spawnZombie() else doSummonCreature(zombie_config.monster_name, pos) doSendDistanceShoot({x = pos.x - math.random(4, 6), y = pos.y - 5, z = pos.z}, pos, CONST_ANI_FIRE) addEvent(doSendMagicEffect, 150, pos, CONST_ME_HITBYFIRE) addEvent(doSendMagicEffect, 150, pos, CONST_ME_FIREAREA) doSendMagicEffect(pos, CONST_ME_MORTAREA) setGlobalStorageValue(zombie_config.storages[2], getGlobalStorageValue(zombie_config.storages[2]) <= 0 and 1 or getGlobalStorageValue(zombie_config.storages[2])+1) doBroadcastMessage("A zombie has spawned! There is currently " .. getGlobalStorageValue(zombie_config.storages[2]) .. " zombies in the zombie event!", MESSAGE_STATUS_CONSOLE_RED) addEvent(spawnZombie, zombie_config.timeBetweenSpawns *1000) end end end function CheckZombieEvent(delay) if getGlobalStorageValue(zombie_config.storages[1]) ~= (zombie_config.players.max+1) then if delay > 0 and getGlobalStorageValue(zombie_config.storages[1]) < zombie_config.players.max then doBroadcastMessage("Zombie event starting in " .. delay .. " minutes! The teleport will be closed when the event start!", MESSAGE_STATUS_WARNING) elseif delay == 0 and getGlobalStorageValue(zombie_config.storages[1]) < zombie_config.players.min then for _, cid in pairs(getPlayersInZombieEvent()) do doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid))) doSendMagicEffect(getPlayerPosition(cid), CONST_ME_TELEPORT) end removeZombieTp() doBroadcastMessage("The Zombie event could not start because of to few players participating.\n At least " .. zombie_config.players.min .. " players is needed!", MESSAGE_STATUS_WARNING) ZerarStoragesZombie() elseif delay == 0 and getGlobalStorageValue(zombie_config.storages[1]) >= zombie_config.players.min then removeZombieTp() doBroadcastMessage("The Zombie event is now full [" .. getGlobalStorageValue(zombie_config.storages[1]) .. " players]! The event will soon start.") for _, var in pairs(getPlayersInZombieEvent()) do doPlayerSendTextMessage(var, MESSAGE_EVENT_ADVANCE, "The first zombie will spawn in " .. zombie_config.timeToStartEvent .. " seconds! Good luck!") end addEvent(spawnZombie, zombie_config.timeToStartEvent*1000) end addEvent(CheckZombieEvent, 60000, delay-1) end end]]></config> <event type="statschange" name="ZombieStats" event="script"><![CDATA[ domodlib('zombie_config') if isPlayer(cid) and isMonster(attacker) and getCreatureName(attacker) == zombie_config.monster_name then if isInRange(getPlayerPosition(cid), zombie_config.arena[1], zombie_config.arena[2]) then if #getPlayersInZombieEvent() > 1 then doBroadcastMessage(getPlayerName(cid) .. " have been eated by Zombies!", MESSAGE_STATUS_CONSOLE_RED) local corpse = doCreateItem(getPlayerSex(cid) == 1 and 3058 or 6081, 1, getPlayerPosition(cid)) doItemSetAttribute(corpse, "description", "You recognize " .. getCreatureName(cid) .. ". He was killed by "..(isMonster(attacker) and "a "..string.lower(getCreatureName(attacker)) or isCreature(attacker) and getCreatureName(attacker) or "a field item")..".") doSendMagicEffect(getPlayerPosition(cid), CONST_ME_POFF) doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid)), false) doSendMagicEffect(getPlayerPosition(cid), CONST_ME_TELEPORT) if #getPlayersInZombieEvent() == 1 then local winner = getPlayersInZombieEvent()[1] doBroadcastMessage(getCreatureName(winner)..' has survived at zombie event!') local goblet = doPlayerAddItem(winner, zombie_config.rewards.trophy, 1) doItemSetAttribute(goblet, "description", "Awarded to " .. getPlayerName(winner) .. " for winning the Zombie event.") getZombieRewards(winner, zombie_config.rewards.items) doTeleportThing(winner, getTownTemplePosition(getPlayerTown(winner)), false) doSendMagicEffect(getPlayerPosition(winner), CONST_ME_TELEPORT) doBroadcastMessage(getPlayerName(winner).." won the Zombie event! Congratulations!") HaveCreatureZombie(zombie_config.arena, true) ZerarStoragesZombie() end else doBroadcastMessage("No one survived in the Zombie Event.", MESSAGE_EVENT_ADVANCE) HaveCreatureZombie(zombie_config.arena, true) ZerarStoragesZombie() end return false end end return true]]></event> <globalevent name="Zombie_Start" interval="60000" event="script"><![CDATA[ domodlib('zombie_config') function onThink(interval, lastExecution) if zombie_days[os.date("%A")] then local hrs = tostring(os.date("%X")):sub(1, 5) if isInArray(zombie_days[os.date("%A")], hrs) and getGlobalStorageValue(zombie_config.storages[3]) <= 0 then local tp = doCreateItem(1387, 1, zombie_config.teleport[1]) doItemSetAttribute(tp, "aid", 45110) CheckZombieEvent(zombie_config.CheckTime) setGlobalStorageValue(zombie_config.storages[1], 0) setGlobalStorageValue(zombie_config.storages[2], 0) HaveCreatureZombie(zombie_config.arena, true) end end return true end]]></globalevent> <event type="login" name="Zombie_Login" event="script"><![CDATA[ domodlib('zombie_config') function onLogin(cid) registerCreatureEvent(cid, "ZombieBattle") registerCreatureEvent(cid, "ZombieStats") if isInRange(getPlayerPosition(cid), zombie_config.arena[1], zombie_config.arena[2]) then doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid))) end return true end]]></event> <event type="combat" name="ZombieBattle" event="script"><![CDATA[ domodlib('zombie_config') if isPlayer(cid) and isPlayer(target) and isInRange(getPlayerPosition(cid), zombie_config.arena[1], zombie_config.arena[2]) then doPlayerSendCancel(cid, "You may not attack this player.") return false end return true ]]></event> <movevent type="StepIn" actionid ="45110" event="script"><![CDATA[ domodlib('zombie_config') function onStepIn(cid, item, position, fromPosition) if not isPlayer(cid) then return true end if getPlayerAccess(cid) > 3 then return doTeleportThing(cid, zombie_config.teleport[2]) end if getPlayerLevel(cid) < zombie_config.min_Level then doTeleportThing(cid, fromPosition, true) doPlayerSendCancel(cid, "You need to be at least level " .. zombie_config.min_Level .. ".") doSendMagicEffect(getThingPos(cid), CONST_ME_MAGIC_BLUE) return true end if getGlobalStorageValue(zombie_config.storages[1]) <= zombie_config.players.max then doTeleportThing(cid, zombie_config.teleport[2]) setGlobalStorageValue(zombie_config.storages[1], getGlobalStorageValue(zombie_config.storages[1])+1) doBroadcastMessage(getPlayerName(cid) .. " entered the Zombie event! Currently " .. getGlobalStorageValue(zombie_config.storages[1]) .. " players have joined!", MESSAGE_STATUS_CONSOLE_RED) if getGlobalStorageValue(zombie_config.storages[1]) == zombie_config.players.max then setGlobalStorageValue(zombie_config.storages[1], getGlobalStorageValue(zombie_config.storages[1])+1) removeZombieTp() doBroadcastMessage("The Zombie event is now full [" .. getGlobalStorageValue(zombie_config.storages[1])-1 .. " players]! The event will soon start.") for _, var in pairs(getPlayersInZombieEvent()) do doPlayerSendTextMessage(var, MESSAGE_EVENT_ADVANCE, "The first zombie will spawn in " .. zombie_config.timeToStartEvent .. " seconds! Good luck!") end addEvent(spawnZombie, zombie_config.timeToStartEvent*1000) end end return true end]]></movevent> <talkaction words="/zombiestart;!zombiestart" access="5" event="buffer"><![CDATA[ domodlib('zombie_config') if getGlobalStorageValue(zombie_config.storages[3]) > 0 then doPlayerSendCancel(cid, "The event is already starting.") return true elseif not param or not tonumber(param) then doPlayerSendCancel(cid, "Use only numbers.") return true end local param = tonumber(param) <= 0 and 1 or tonumber(param) local tp = doCreateItem(1387, 1, zombie_config.teleport[1]) doItemSetAttribute(tp, "aid", 45110) CheckZombieEvent(tonumber(param)) ZerarStoragesZombie() setGlobalStorageValue(zombie_config.storages[3], 1) HaveCreatureZombie(zombie_config.arena, true) ]]></talkaction> <globalevent name="ZombieDebug-Start" type="start" event="buffer"><![CDATA[ domodlib('zombie_config') ZerarStoragesZombie() return true]]></globalevent> </mod>  
    OBS: Quem serve em milesegundos, mude essa parte:

     
    <globalevent name="Zombie_Start" interval="60" event="script"><![CDATA[  
     
    para
     
    <globalevent name="Zombie_Start" interval="60000" event="script"><![CDATA[  
     
     
    ----------------------------------------------------- // --------------------------------------------------
     
    o monstro você instala em data/monsters
     
    zombie event.xml
    <?xml version="1.0" encoding="UTF-8"?> <monster name="Zombie Event" nameDescription="an zombie event" race="undead" experience="280" speed="100" manacost="0"> <health now="500" max="500"/> <look type="311" corpse="9875"/> <targetchange interval="5000" chance="50"/> <strategy attack="100" defense="0"/> <flags> <flag summonable="0"/> <flag attackable="0"/> <flag hostile="1"/> <flag illusionable="0"/> <flag convinceable="0"/> <flag pushable="0"/> <flag canpushitems="1"/> <flag canpushcreatures="1"/> <flag targetdistance="1"/> <flag staticattack="90"/> <flag runonhealth="0"/> </flags> <attacks> <attack name="melee" interval="2000" min="-35000" max="-35000"/> </attacks> <defenses armor="15" defense="10"/> <immunities> <immunity paralyze="1"/> <immunity invisible="1"/> </immunities> <voices interval="5000" chance="10"> <voice sentence="You wont last long!"/> <voice sentence="Mmmmh.. braains!"/> </voices> <loot> <item id="2148" countmax="1" chance="100000"/><!-- gold coin --> </loot> </monster>  
     
    e a tag em monsters.xml
    <monster name="Zombie Event" file="zombie event.xml"/>  
     Configuração 
     
     
     
     
    Sistema
     
    zombie_config = {
        storages = {172100, 172101}, -- não edite
        players = {min = 2, max = 30}, -- número minimo e máximo para jogadores no evento
        rewards = {items ={{2160,10},{2494,1}}, trophy = 5805}, -- premiações do jogador
        timeToStartEvent = 30, -- segundos para começar o evento após dar start
        CheckTime = 5, -- tempo que o TP fica aberto para os jogadores adrentarem o evento
        teleport = {{x=145, y=50, z=7}, {x=176 , y=54, z=5}}, -- posiçãodo tp onde aparece, posição para onde o jogador vai ao entrar no tp
        arena = {{x=173,y=52,z=5},{x=179,y=56,z=6}}, -- posição começo e final da area do evento
        monster_name = "Zombie Event", -- nome do monstro que será sumonado
        timeBetweenSpawns = 20, -- a cada quantos segundos é dado o respaw time do zombie no evento
        min_Level = 20 -- level minimo para participar do evento
    }
     
     
    Dia e Horário
     

    zombie_days = {
        ["Monday"] = {"13:00","18:00","20:00","22:00"},
        ["Tuesday"] = {"13:00","18:00","20:00","22:00"},
        ["Wednesday"] = {"13:00","18:00","20:00","22:00"},
        ["Thursday"] = {"13:00","18:00","20:00","22:00"},
        ["Friday"] = {"13:00","18:00","20:00","22:00"},
        ["Saturday"] = {"13:00","18:00","20:00","22:00"},
        ["Sunday"] = {"13:00","18:00","20:00","22:00"}
    }
     
     
    ["Dia em inglês"] = {"horário do evento"}
     
     
    Configurando a área:
     

     
    zombie lua.rar
×
×
  • Criar Novo...

Informação Importante

Confirmação de Termo