Ir para conteúdo

geanmarcell

Membro
  • Registro em

  • Última visita

Histórico de Curtidas

  1. Gostei
    geanmarcell deu reputação a 9k22 em Raid Automática (por horário)   
    Versão Testada: 8.6 TFS 0.4



    Versão recomendada: 8.6 TFS 0.3.6 ~ 0.4



    Tipo do script: Globalevents


    Bem, procurei aqui no fórum e não encontrei, vou compartilhar aqui o'que muitos procuravam e não encontravam, uma RAID altomatica que aconteçe 1x todas as semanas (configuravel).

    Em data/globalevents/script crie um arquivo com extensão .lua e adicione:


    --[[ - hora deve ser exata SERVER - para fazer o raid tera que ser ex: 00 hour(horas) e 00 minu (minutos) - para fazer a raid na data e hora no tempo exato, uso "exact" - para fazer a raid ocorrer todas as semanas (pelo menos 1x na semana) uso "weekly" - o nome dos dias sao ultilizados apenas para o tipo semanal que devera ser - "monday", "tuesday", "wednesday", "thursday", "friday", "saturday", "sunday" - tambem devem estar dentro de uma matriz-> {} ]] local raids = { [1] = { name = 'Morgaroth', type = 'weekly', days = {'friday'}, hour = 16, minu = 00 }, [2] = { name = 'Ferumbras', type = 'weekly', days = {'tuesday'}, hour = 18, minu = 00 } } local last_execsutes = {} function onThink(interval, lastExecution, thinkInterval) local static_time = os.time() for k, raid in ipairs(raids) do if (raid.type == 'weekly') then local day = os.date("%A", static_time):lower() if isInArray(raid.days, day) then local hour = tonumber(os.date("%H", static_time)) if (raid.hour == hour) then local minute = tonumber(os.date("%M", static_time)) if (raid.minu == minute) then local day_number = tonumber(os.date("%d", static_time)) if (last_execsutes[k] ~= day_number) then last_execsutes[k] = day_number doExecuteRaid(raid.name) end end end end elseif (raid.type == 'exact') then local month = tonumber(os.date("%m", static_time)) if (raid.date.month == month) then local day = tonumber(os.date("%d", static_time)) if (raid.date.day == day) then local hour = tonumber(os.date("%H", static_time)) if (raid.hour == hour) then local minute = tonumber(os.date("%M", static_time)) if (raid.minu == minute) then if (last_execsutes[k] ~= day) then last_execsutes[k] = day doExecuteRaid(raid.name) end end end end end end end return true end Bem, como podem ver, eu fiz apenas 2 como exemplo, você pode adicionar mais, só não esqueça de colocar o }, no anterior. Agora em data/globalevents/globalevents.xml adicione: <globalevent name="raids" interval="15000" event="script" value="raid.lua"/> Ps: não mecha no interval! Agora em data/raids crie um arquivo .xml com o nome Morgaroth "Morgaroth.xml" e adicione isto lá dentro: <?xml version="1.0" encoding="utf-8"?> <raid> <!-- // Raid System by 5mok3 // Nao mude o intervalo da raid, apenas em globalevents vocce podera mudar --> <!--Announcements--> <announce delay="1000" type="Event" message="The ancient volcano on Goroma slowly becomes active once again." /> <announce delay="30000" type="Event" message="There is an evil presence at the volcano of Goroma." /> <announce delay="60000" type="Event" message="Evil Cultists have called an ancient evil into the volcano on Goroma. Beware of its power mortals." /> <!--Single Spawns--> <singlespawn delay="60000" name="Morgaroth" x="32063" y="32612" z="14" /> </raid> Crie outro no mesmo lugar com extenção .xml com o nome Ferumbras "Ferumbras.xml" e adicione: <?xml version="1.0" encoding="utf-8"?> <raid> <!-- // Raid System by 5mok3 // Nao mude o intervalo da raid, apenas em globalevents vocce podera mudar --> <!--Announcements--> <announce delay="1000" type="Event" message="The seals on Ferumbras old cidatel are glowing. Prepare for HIS return mortals." /> <announce delay="50000" type="Event" message="Ferumbras return is at hand. The Edron Academy calls for Heroes to fight that evil." /> <announce delay="60000" type="Event" message="Ferumbras has returned to his citadel once more. Stop him before its too late." /> <!--Single Spawns--> <singlespawn delay="60000" name="Ferumbras" x="32124" y="32687" z="4" /> </raid> Mude o x=" " y=" " z=" " para o local aonde o monstro irá nascer... Em raids/raids.xml adicione: <raid name="Morgaroth" file="Morgaroth.xml" interval2="30" margin="1000" enabled="yes"/> <raid name="Ferumbras" file="Ferumbras.xml" interval2="30" margin="1000" enabled="yes"/> PS: não mude o interval2. Agora caso você queira que apareça um broadcast quando o Tal player matar o boss, faça o seguinte. Em creaturescript/scripts e crie um arquivo .lua e adicione: local monstrolol = {"Morgaroth","Ferumbras"} function onKill(cid, target, lastHit) if isInArray(monstrolol,getCreatureName(target)) then doBroadcastMessage("O jogador "..getCreatureName(cid).." killed the powerful boss "..getCreatureName(target).."!") end return true end Em creaturescript/creaturescript.xml adicione: <event type="kill" name="killboss" event="script" value="NOME_DO_SCRIPT.lua"/> Para finalizar, em creaturescript/login.lua adicione: registerCreatureEvent(cid, "killboss")

    Adicionado vídeo tutorial de como adicionar novas raids a pedido de nosso membro GabrielSv.


    Créditos: 5mok3 90%
    .............. Subyth 10%

Informação Importante

Confirmação de Termo