Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --Variaveis--
- intervalMaps = {"@6964592"}
- mapas = {6940835,6940872,6939230,6939743,6932947,6931137,6933370,6933386,6939573,6939693,6939230,6939558,6939573,6939583,6939322,6947704,6960338,6960316,6961814,6954653}
- shaman = ""
- data = {}
- p={}
- skip = 0
- betaTesters = {"Contistente","Rianmojang","Brenower","Laagaadoo","Guhzumaki"}
- time_click = 0;
- vivos = 0;
- message=false
- g_time = 0;
- --Funções--
- tfm.exec.disableAutoNewGame(true)
- tfm.exec.disableAutoTimeLeft(true)
- tfm.exec.disableAllShamanSkills(true)
- textarea=ui.addTextArea
- function ui.addTextArea(id,text,targetPlayer,x,y,width,height,backgroundColor,borderColor,backgroundAlpha,emboss)
- --if not backgroundColor then backgroundColor=0x324650 end
- --if not borderColor then borderColor=0x000001 end
- if emboss then
- textarea(6969+id,"",targetPlayer,x,y+1,width,height,0x000001,0x000001,backgroundAlpha)
- textarea(7979+id,"",targetPlayer,x,y-1,width,height,0x6A8FA2,0x6A8FA2,backgroundAlpha)
- end
- textarea(id,text,targetPlayer,x,y,width,height,backgroundColor,borderColor,backgroundAlpha)
- end
- function split(t,s)
- local a={}
- for i,v in string.gmatch(t,string.format("[^%s]+",s or "%s")) do
- table.insert(a,i)
- end
- return a
- end
- function eventNewPlayer(name)
- system.bindMouse(name,true)
- p[name]={
- rounds=0,
- Mwins=0,
- Swins=0,
- kills=0,
- killer=0,
- killsK=0,
- kSkip=0,
- lvl=1,
- sp=20,
- xp=0,
- mXp=50,
- skiped=false,
- }
- for i,v in pairs(data) do
- if v[1] == name then
- p[name] = v[2]
- end
- end
- table.insert(data,{name, p[name]})
- tfm.exec.chatMessage("<VP>→</VP> <V>[Message]</V> <N><CE>Bem-vindo ao explosion v2.7.7</CE></N>",name)
- tfm.exec.chatMessage("<VP>→</VP> <V>[Message]</V> <N><J>Caso você não esteja vendo a explosão <br>vá em opções e ative os efeitos especiais.</J></N>",name)
- tfm.exec.chatMessage("<VP>→</VP> <V>[Help]</V> <B><J>Comandos:</J></B><br><BL>→</BL> <VP>!help</VP> - abre a janela de ajuda<br><BL>→</BL> <VP>!ajuda</VP> - abre a janela de ajuda<br><BL>→</BL> <VP>!p</VP> <J>[Nome]</J> - abre o perfil de um jogador, sem o nome abre o seu.<br><BL>→</BL> <VP>!r</VP> - abre o ranking.",name)
- tfm.exec.chatMessage("<VP>→</VP> <V>[Message]</V> <N>Este minigame foi desenvolvido por <V>Contistente</V> & <V>Rianmojang</V>.</N>",name)
- tfm.exec.chatMessage("<VP>→</VP> <ROSE>[Atenção]</ROSE> <VP>Olhe oque temos de novo no tópico:<br>http://atelier801.com/topic?f=6&t=839504</VP>",name)
- eventChatCommand(name,'help')
- if not game then
- tfm.exec.newGame(mapas[math.random(#mapas)])
- end
- end
- function eventChatCommand(name, cmd)
- local arg = split(cmd, " ")
- if arg[1] == "help" or arg[1] == "ajuda" then
- tfm.exec.chatMessage("<VP>→</VP> <V>[Help]</V> <J>Olhe a janela que abriu na sua tela.</J>",name)
- ui.addTextArea(0,"",name,300,45,200,300,nil,0x324650,nil,true)
- ui.addTextArea(1,'<B><J><font size="13">Como jogar',name,310,48,175,20,nil,0x324650,nil,true)
- ui.addTextArea(2,'<p align="center"><R><a href="event:close">X</a>',name,466,50,16,16,0x324650,0x324650,nil,true)
- ui.addTextArea(3,"<B><font size='12'>O jogo consiste em um shaman que é o <CE>Assassino</CE> ele mata os ratos soltando <VP>explosões</VP> pelo mapa ao <VP>clickar na tela</VP>, e os <CE>Ratos</CE> precisam <R>sobreviver até o tempo acabar</R> para vencer.",name,305,85,190,250,0x0e232b,0x0e232b,nil,true)
- end
- if arg[1] == "r" then
- eventRanking(name);
- end
- if arg[1] == "skip" then
- if p[name].skiped then
- tfm.exec.chatMessage("<R>Você só pode dar skip uma vez por partida.</R>",name)
- else
- skip = skip+1;
- tfm.exec.chatMessage(name.." votou para trocar de assassino. ("..skip.."/"..math.floor(#p/2)..")")
- p[name].skiped = true
- end
- end
- if arg[1] == "shop" then
- beta = false
- for i,v in pairs(betaTesters) do
- if v == name then
- beta = true
- end
- end
- if beta then
- tfm.exec.chatMessage("<VP>→</VP> <V>[Shop]</V> <J>Olhe a janela que abriu na sua tela.</J>",name)
- ui.addTextArea(0,"",name,300,45,200,300,nil,0x324650,nil,true)
- ui.addTextArea(1,'<B><J><font size="13">Loja',name,310,48,175,20,nil,0x324650,nil,true)
- ui.addTextArea(2,'<p align="center"><R><a href="event:close">X</a>',name,466,50,16,16,0x324650,0x324650,nil,true)
- ui.addTextArea(3,"<B><font size='12'>",name,305,85,190,250,0x0e232b,0x0e232b,nil,true)
- else
- tfm.exec.chatMessage("<VP>→</VP> <V>[Beta Game]</V> <R>Apenas beta testers tem essa permissão e a loja está em manutenção.</R>",name)
- end
- end
- if arg[1] == "p" then
- tfm.exec.chatMessage("<VP>→</VP> <V>[Profile]</V> <J>Olhe a janela que abriu na sua tela.</J>",name)
- if arg[2] then
- nome = arg[2]:lower():gsub('%a', string.upper, 1) -- guarda na variavel
- else
- nome = name
- end
- if tfm.get.room.playerList[nome] then
- ui.addTextArea(0,"",name,300,45,200,300,nil,0x324650,nil,true)
- ui.addTextArea(1,'<B><J><font size="13">'..nome,name,310,48,175,20,nil,0x324650,nil,true)
- ui.addTextArea(2,'<p align="center"><R><a href="event:close">X</a>',name,466,50,16,16,0x324650,0x324650,nil,true)
- ui.addTextArea(3,"<B><font size='15'><J>Rato:</J></font></p><font size='12'>Rodadas jogadas: "..p[nome].rounds.."<br>Vitórias: "..p[nome].Mwins.."<br>Derrotas: "..p[nome].kills.."",name,305,85,190,120,0x0e232b,0x0e232b,nil,true)
- ui.addTextArea(4,"<B><font size='15'><J>Assassino:</J></font></p><font size='12'>Rodadas jogadas: "..p[nome].killer.."<br>Vitórias: "..p[nome].Swins.."<br>Derrotas: "..p[nome].killsK.."<br>Vezes puladas: "..p[nome].kSkip,name,305,220,190,120,0x0e232b,0x0e232b,nil,true)
- else
- tfm.exec.chatMessage("<VP>→</VP> <V>[Message]</V> <R>"..nome.." não se encontra em sala ou não existe.</R>",name)
- end
- end
- end
- function eventPlayerLeft(name)
- if name == shaman and game then
- newMap()
- end
- end
- function newMap()
- tfm.exec.newGame(mapas[math.random(#mapas)])
- end
- function eventNewGame()
- newShaman()
- time_click = 2;
- tfm.exec.setGameTime(math.random(60,150))
- tfm.exec.snow(100)
- end
- function eventPlayerDied(name)
- vivos=vivos-1;
- if game then
- p[name].kills = p[name].kills+1;
- end
- if vivos == 2 and g_time > 50000 then
- tfm.exec.setGameTime(51)
- end
- if vivos == 1 and g_time > 30000 then
- tfm.exec.setGameTime(31)
- end
- if vivos == 0 and game then
- jogadores={}
- for i in pairs(tfm.get.room.playerList) do
- table.insert(jogadores,i)
- end
- tfm.exec.chatMessage("<VP>→</VP> <V>[Message]</V> O assassino <VP>"..shaman.."</VP> é o vencedor.")
- p[shaman].Swins = p[shaman].Swins+1;
- rec = math.random(3,10)
- p[shaman].xp = p[shaman].xp+rec
- tfm.exec.chatMessage("Você recebeu "..rec.." xp por vencer.",shaman)
- if p[shaman].xp >= p[shaman].mXp then
- p[shaman].xp = p[shaman].xp-p[shaman].mXp
- p[shaman].lvl = p[shaman].lxl+1;
- p[shaman].mXp = p[shaman].mXp*math.random(2,4)
- tfm.exec.chatMessage("<J>Agora "..shaman.." é nivel "..p[shaman].lvl.."</J>")
- end
- newMap()
- end
- end
- function newShaman()
- vivos=0
- for i,v in pairs(tfm.get.room.playerList) do
- if v.isShaman then
- shaman = i
- skip = 0
- end
- vivos=vivos+1;
- end
- if vivos > 2 then
- game = true
- for i in pairs(tfm.get.room.playerList) do
- if i ~= shaman then
- p[i].rounds = p[i].rounds+1;
- end
- p[i].skiped = false
- tfm.exec.giveMeep(i)
- end
- p[shaman].killer = p[shaman].killer+1;
- p[shaman].kills = p[shaman].kills-1;
- tfm.exec.killPlayer(shaman)
- tfm.exec.setPlayerScore(shaman,0,false)
- tfm.exec.chatMessage("<VP>→</VP> <V>[Message]</V> <N><CE>"..shaman.."</CE> é o assassino.</N>")
- else
- game = false
- tfm.exec.newGame(intervalMaps[math.random(#intervalMaps)])
- tfm.exec.chatMessage("<VP>→</VP> <V>[Message]</V> <N><R>É necessário 3 jogadores.</N>")
- end
- end
- function eventMouse(name,x,y)
- if time_click == 0 and name == shaman and game then
- tfm.exec.explosion (x, y, p[name].sp, 100, true)
- tfm.exec.displayParticle(12,x,y)
- for i=1,25 do
- tfm.exec.displayParticle(0,x,y,math.random(-6,6),math.random(-6,6))
- end
- time_click = 2
- end
- end
- function eventTextAreaCallback(id,name,link)
- if link=="close" then
- for id=0,61 do
- ui.removeTextArea(id,name)
- ui.removeTextArea(6969+id,name)
- ui.removeTextArea(7979+id,name)
- end
- end
- end
- function eventLoop(t,r)
- g_time = r
- if t >= 3000 then
- if time_click > 0 and game then
- ui.addTextArea(8,'<p align="center"><B><VP>'..math.floor(time_click/2),nil,6,380,20,20,0,0,0,true)
- time_click = time_click-1;
- elseif time_click == 0 then
- ui.removeTextArea(8,nil)
- end
- if vivos == 0 then
- newMap()
- vivos=1
- end
- end
- if r < 1000 and game then
- for i,v in pairs(tfm.get.room.playerList) do
- if not v.isDead and game then
- tfm.exec.giveCheese(i)
- tfm.exec.playerVictory(i)
- p[i].Mwins = p[i].Mwins+1;
- tfm.exec.chatMessage("<VP>→</VP> <V>[Message]</V> <VP>"..i.."</VP> é o vencedor.")
- p[shaman].killsK = p[shaman].killsK+1;
- rec = math.random(3,10)
- p[i].xp = p[i].xp+rec
- tfm.exec.chatMessage("Você recebeu "..rec.." xp por vencer.",i)
- end
- if p[i].xp >= p[i].mXp then
- p[i].xp = p[i].xp-p[i].mXp
- p[i].lvl = p[i].lxl+1;
- p[i].mXp = p[i].mXp*math.random(2,4)
- tfm.exec.chatMessage("<J>Agora "..i.." é nivel "..p[i].lvl.."</J>")
- p[i].sp = p[i].sp+1;
- end
- end
- vivos=vivos-1;
- end
- if t >= 3000 and skip >= math.random(#p/2) and game then
- jogadores = {}
- for i in pairs(tfm.get.room.playerList) do
- table.insert(jogadores,i)
- end
- tfm.exec.setPlayerScore(jogadores[math.random(#jogadores)],16,false)
- tfm.exec.chatMessage("<VP>→</VP> <V>[Message]</V> <J>A vez do assassino <BL>"..shaman.."</BL> foi pulada.</J>")
- p[shaman].kSkip = p[shaman].kSkip+1;
- newMap()
- end
- end
- function eventRanking(name)
- tfm.exec.chatMessage("<VP>→</VP> <V>[Rank]</V> <J>Olhe a janela que abriu na sua tela.</J>",name)
- tfm.exec.chatMessage("<VP>→</VP> <V>[Message]</V> <R><B>Legenda do ranking:</B></R><br><BL>→</BL> VCR - Vitórias como rato.<br><BL>→</BL> DCR - Derrotas como rato.<br><BL>→</BL> VCA - Vitórias como assassino.<br><BL>→</BL> DCA - Derrotas como assassino.",name)
- local sc = {}
- ids = {}
- for name, player in pairs(tfm.get.room.playerList) do
- sc[#sc+1] = {n=name,s=player.score,r=p[name].rounds,vcr=p[name].Mwins,dcr=p[name].kills,vca=p[name].Swins,dca=p[name].killsK}
- end
- table.sort(sc,function(a,b) return a.dca>b.dca end)
- table.sort(sc,function(a,b) return a.vca>b.vca end)
- table.sort(sc,function(a,b) return a.dcr>b.dcr end)
- table.sort(sc,function(a,b) return a.vcr>b.vcr end)
- y = 20
- id = 50
- ui.addTextArea(0,"",name,120,45,500,340,nil,0x324650,nil,true)
- ui.addTextArea(1,'<p align="center"><B><J><font size="13">Ranking',name,130,48,475,20,nil,0x324650,nil,true)
- ui.addTextArea(2,'<p align="center"><R><a href="event:close">Fechar</a>',name,130,360,475,20,0x324650,0x324650,nil,true)
- str=''
- for k,v in pairs(sc) do
- if k < 9 then
- id = id+1;
- table.insert(ids, id)
- y = y+35
- str = "<N><J>"..k.."°</J> | <V>"..v.n.."</V> | Rodadas: <V>"..v.r.."</V> | VCR: <V>"..v.vcr.."</V> | DCR: <V>"..v.dcr.."</V> | VCA: <V>"..v.vca.."</V> | DCA: <V>"..v.dca.."</V></N><br>"
- ui.addTextArea(id,str,name,130,y+30,475,20,0x0e232b,0x0e232b,nil,true)
- end
- end
- return str
- end
- for all in pairs(tfm.get.room.playerList) do
- eventNewPlayer(all)
- end
- tfm.exec.setRoomMaxPlayers(30)
- newMap()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement