Postado Agosto 31, 2017 7 anos Queria uma script Exemplo Quando o ADM Falar "!Invasao Local "monster" < pode ser qualquer monster !Invasao Local "EMBAIXO DO DP" Monster "Bakukoy" leva 6 segundos para a invasao iniciar/e ela fica acontecendo por 7 minutos se ninguem matar retira todos os bixos O rei de seu proprio destino é aquele que luta pela gloria do amanhã! Discord : ZoR#9373
Postado Setembro 1, 2017 7 anos Solução Em talkactions/scripts crie um arquivo.lua: placeinvasion.lua Mostrar conteúdo oculto local config = { ["EMBAIXO DO DP"] = {x=1,y=1,z=1}, --["LOCAL"] = configure as posições ["NO ESTADIO DO VASCO"] = {x=1,y=1,z=1}, ["PALACIO DO PLANALTO"] = {x=1,y=1,z=1}, ["NA CASA DE TEMER"] = {x=1,y=1,z=1} } local init_time = {6, "sec"} local invasion_time = {1, "min"} function onSay(cid, words, param) local check, p = false, getPlayerPosition(cid) if(param == '') then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Command requires param.") doSendMagicEffect(p, CONST_ME_POFF) return true end local t = string.explode(param, ",") if not config[t[1]] then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Place not found.") doSendMagicEffect(p, CONST_ME_POFF) return true end if not t[2] or not monsterExists(t[2]) then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Monster not found.") doSendMagicEffect(p, CONST_ME_POFF) return true end local monsters = {} if not t[3] then t[3] = 1 end doBroadcastMessage("Invasion " .. t[1] .. " in " .. init_time[1] .. " " .. init_time[2] .. ".", MESSAGE_EVENT_ADVANCE) addEvent(function() for i = 1, tonumber(t[3]) do local m = doSummonCreature(t[2], config[t[1]]) table.insert(monsters, m) end end, mathtime(init_time)*1000) addEvent(function() if #monsters > 0 then for i = 1, #monsters do if isMonster(monsters[i]) then check = true doRemoveCreature(monsters[i]) end end end if check == true then doBroadcastMessage(t[2] .. "".. (tonumber(t[3]) > 1 and "s" or "") .. " returned to the depths.", MESSAGE_EVENT_ADVANCE) end end, mathtime(invasion_time)*1000) return true end function mathtime(table) -- by dwarfer local unit = {"sec", "min", "hour", "day"} for i, v in pairs(unit) do if v == table[2] then return table[1]*(60^(v == "day" and 2 or i-1))*(v == "day" and 24 or 1) end end return "Error: Bad declaration in mathtime function." end function monsterExists(name) local file = "data/monster/monsters.xml" local openFile = io.open(file, "r") local m_name, getName, getFile, m_file = 0, 0, 0, 0 local monsterExists, fileExists = false, false if openFile ~= nil then for line in io.lines(file) do if line:find('name=".*".*') and line:find('file=".*".*') then getName = string.match(line, 'name=".*".*') getFile = string.match(line, 'file=".*".*') if getName and getFile then m_name = string.sub(getName, string.find(getName, '="') + 2, (string.find(getName, '" ') or string.find(getName, '"f') or 1) - 1) m_file = string.sub(getFile, string.find(getFile, '="') + 2, (string.find(getFile, '"/') or string.find(getFile, '" ') or 1) - 1) if m_name:lower() == name:lower() then monsterExists = true mfile = io.open("data/monster/" .. m_file, "r") if mfile ~= nil then fileExists = true mfile:close() end end end end end openFile:close() end return monsterExists and fileExists or false end Em talkactions.xml, adicione a tag: <talkaction words="!invasion" event="script" value="placeinvasion.lua"/> Exemplo para usar o comando: !invasion NO ESTADIO DO VASCO,Demon,50 Contato: Email: dwarfer@sapo.pt Discord: Dwarfer#2715
Postado Setembro 1, 2017 7 anos Autor 100% Funcional! O rei de seu proprio destino é aquele que luta pela gloria do amanhã! Discord : ZoR#9373
Postado Julho 4, 2018 6 anos Só tem um problema... Se eu colocar mais de 6 monster só vai 6... Tem como arrumar? Pra fazer a invasão em um raio
Participe da conversa
Você pode postar agora e se cadastrar mais tarde. Se você tem uma conta, faça o login para postar com sua conta.