Postado Agosto 26, 2017 7 anos Queria uma Script que o server sorteia qual monster vai nascer exemplo coloco 9/10 monster na script o server vai e escolhe uma deles pra dar Respawn Queria que esse evento aconteça em 3-/-3 horas Avisa ao server Todo Exemplo "Nasceu X Monster X Local Mate-o" se nao matar o Monster em 1:30 o Server Retira ele. Obrigado. @Dwarfer O rei de seu proprio destino é aquele que luta pela gloria do amanhã! Discord : ZoR#9373
Postado Agosto 27, 2017 7 anos Solução Crie um arquivo em globalevents.lua: Spoiler local t = { monsters = {"Dwarf", "Dwarf Guard", "Dwarf Soldier", "Dwarf Geomancer", "Rotworm", "Cyclops", "Snake", "Troll", "Orc", "Spider"}, position = {x=1, y =1, z=1}, -- edite o local location = "Kazordoon Mines", -- msg onde nasceu o monstro remove_time = {1.5, "hour"} -- edite o tempo para remover } function onThink(interval, lastExecution) local m = t.monsters[math.random(1, #t.monsters)] doBroadcastMessage(m .. " appeared near "..t.location .. "! It will be there for " .. t.remove_time[1] .. " " .. t.remove_time[2] .. ".", MESSAGE_EVENT_ADVANCE) local monster = doSummonCreature(m, t.position) addEvent(function() if isMonster(monster) then doRemoveCreature(monster) doBroadcastMessage(m.. " returned stronger than before to its covil.", MESSAGE_EVENT_ADVANCE) end end, mathtime(t.remove_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 == unit[4] and 2 or i-1))*(v == unit[4] and 24 or 1) end end return error("Bad declaration in mathtime function.") end E adicione a tag no globalevents.xml: <globalevent name="RandomInvasao" interval="10800000" event="script" value="NOMEDOSEUARQUIVO.lua"/> Edite o interval como queira. Tá configurado para acontecer de 3 em 3 horas e remover a cada 1h e meia. Editado Setembro 28, 2017 7 anos por Dwarfer (veja o histórico de edições) Contato: Email: [email protected] Discord: Dwarfer#2715
Postado Setembro 28, 2017 7 anos Em 27/08/2017 em 14:00, Dwarfer disse: Crie um arquivo em globalevents.lua: Ocultar conteúdo local t = { monsters = {"Dwarf", "Dwarf Guard", "Dwarf Soldier", "Dwarf Geomancer", "Rotworm", "Cyclops", "Snake", "Troll", "Orc", "Spider"}, position = {x=1, y =1, z=1}, -- edite o local location = "Kazordoon Mines", -- msg onde nasceu o monstro remove_time = {1.5, "hour"} -- edite o tempo para remover } function onThink(interval, lastExecution) local m = t.monsters[math.random(1, #t.monsters)] doBroadcastMessage(m .. " appeared near "..t.location .. "! It will be there for " .. t.remove_time[1] .. " " .. t.remove_time[2] .. ".", MESSAGE_EVENT_ADVANCE) local monster = doSummonCreature(m, t.position) addEvent(function() if isMonster(monster) then doRemoveCreature(monster) doBroadcastMessage(m.. " returned stronger than before to its covil.", MESSAGE_EVENT_ADVANCE) end end, mathtime(t.remove_time)*1000) return true end function mathtime(table) if table[2] == "sec" then return table[1] elseif table[2] == "min" then return table[1]*60 elseif table[2] == "hour" then return table[1]*60*60 elseif table[2] == "day" then return table[1]*24*60*60 else return print("Error: Bad declaration in mathtime function.") end end E adicione a tag no globalevents.xml: <globalevent name="RandomInvasao" interval="10800000" event="script" value="NOMEDOSEUARQUIVO.lua"/> Edite o interval como queira. Tá configurado para acontecer de 3 em 3 horas e remover a cada 1h e meia. Tem como fazer ela somente 1 monstro?
Postado Setembro 28, 2017 7 anos 1 hora atrás, Mateus Santosss disse: Tem como fazer ela somente 1 monstro? É só deixar apenas um monstro lá: monsters = {"Dwarf"} Contato: Email: [email protected] Discord: Dwarfer#2715
Postado Julho 9, 2018 6 anos Em 27/08/2017 em 14:00, Dwarfer disse: Crie um arquivo em globalevents.lua: Ocultar conteúdo local t = { monsters = {"Dwarf", "Dwarf Guard", "Dwarf Soldier", "Dwarf Geomancer", "Rotworm", "Cyclops", "Snake", "Troll", "Orc", "Spider"}, position = {x=1, y =1, z=1}, -- edite o local location = "Kazordoon Mines", -- msg onde nasceu o monstro remove_time = {1.5, "hour"} -- edite o tempo para remover } function onThink(interval, lastExecution) local m = t.monsters[math.random(1, #t.monsters)] doBroadcastMessage(m .. " appeared near "..t.location .. "! It will be there for " .. t.remove_time[1] .. " " .. t.remove_time[2] .. ".", MESSAGE_EVENT_ADVANCE) local monster = doSummonCreature(m, t.position) addEvent(function() if isMonster(monster) then doRemoveCreature(monster) doBroadcastMessage(m.. " returned stronger than before to its covil.", MESSAGE_EVENT_ADVANCE) end end, mathtime(t.remove_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 == unit[4] and 2 or i-1))*(v == unit[4] and 24 or 1) end end return error("Bad declaration in mathtime function.") end E adicione a tag no globalevents.xml: <globalevent name="RandomInvasao" interval="10800000" event="script" value="NOMEDOSEUARQUIVO.lua"/> Edite o interval como queira. Tá configurado para acontecer de 3 em 3 horas e remover a cada 1h e meia. tem como por pra aparecer todos os sábados é domingo ? 758x426.bmp
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.