Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- shaman = {
- "@4858080","@4665162","@4669167","@4665304","@4666393","@4668170","@4674901","@4677540","@4677664",
- '<C><P D="illu-niveau.png,340,140,defilante_mort.png,153,100,defilante_vitesse.png,642,100" /><Z><S><S L="394" H="68" X="199" Y="370" T="3" P="0,0,0,9999,0,0,0,0" /><S P="0,0,0.3,0.2,0,0,0,0" L="10" o="e46f1c" X="394" c="3" Y="448" T="12" H="406" /><S L="400" H="63" X="600" Y="369" T="9" P="0,0,,,,0,0,0" /><S H="406" L="10" o="62b9e5" X="404" c="3" Y="448" T="12" P="0,0,0.3,0.2,0,0,0,0" /><S P="0,0,0.3,0.2,0,0,0,0" L="48" o="" H="10" Y="213" T="12" X="400" /><S P="0,0,0.3,0.2,0,0,0,0" L="91" o="e46f1c" X="46" Y="246" T="12" H="11" /><S L="91" o="62b9e5" X="754" H="11" Y="246" T="12" P="0,0,0.3,0.2,0,0,0,0" /><S P="0,0,0,0,10,0,0,0" L="94" o="" X="46" Y="255" T="12" H="12" /></S><D><DS Y="194" X="400" /></D><O><O C="11" Y="100" P="0" X="153" /><O C="11" Y="100" X="642" P="0" /></O></Z></C>'
- }
- langs={
- ES={
- help={"<font size='18'><p align='center'><B>#ShamanBattle</B></p></font><font size='12'>\nShamanBattle es un minijuego creado por <j>Eliaseeg <n>& <j>Aritxy<n>. Consiste en matar todos los chamanes sin que te maten, el último que quede vivo, gana.\n\n<p align='center'><font size='16'><b>Índice</b></font></p><br><br><font size='14'><a href='event:help'><g>1) <n>Información</a><br><a href='event:Comandos'><g>2) <n>Comandos.</a><br><a href='event:Equipo'><g>3) <n>Equipo.</a></a> \n\n\n\n\n\n\n<font size='9'><R>Reporta cualquier error a Eliaseeg o Aritxy.</r>",
- "<font size='18'><p align='center'><B>Comandos</B></p></font><font size='12'>\nÉsta es la página de los comandos. Los siguientes comandos son los añadidos al juego.\n\n\n<b>!perfil usuario</b><j> - <n>Te muestra el perfil del usuario.\n<b>!perfil me</b><j> - <n>Muestra tu perfil.\n<b>!ranking/leaderboard/top/scoreboard</b><j> - <n>Muestra el ranking.\n<b>!title numero</b><j> - <n>Cambia tú título.\n<b>!afk\n\n<font size='18'><p align='center'><B>Hotkeys</B></p></font>\n<b>P</b><j> - <n> Muestra/cierra el perfil\n<b>H</b><j> - <n>Muestra/cierra la ayuda.\n<b>L</b><j> - <n>Muestra/cierra el ranking",
- "<g><font size='18'><p align='center'><B>Títulos</B></p></font>1) <n>Iniciado <g>2) <n>Sobreviviente\n<g>3) <n>Cañon *-* <g>4) <n>Shaman\n<g>5) <n>Coleccionador <g>6) <n>Camper\n<g>7) <n>El salvador <g>8) <n>Graduado\n<g>9) <n>Hábil <g>10) <n>Inmortal\n<g>11) <n>Ratón de acero <g>12) <n>Superviviente\n<g>13) <n>Iluminado <g>14) <n>Dios de Survivor\n<g>15) <n>Maestro Cervecero <g>16) <n>Tejedor de niebla\n<g>17) <n>Escapista <g>18) <n>Perseguidor\n<g>19) <n>El mejor <g>20) <n>Asesino en serie\n<g>21) <n>INMORTAL :0",
- "<font size='18'><p align='center'><b>Equipo</b></p></font>\n<font size='18'><p align='center'><B>Administradores</B></p></font><br><font size='12' color='#EB1D51'><b>Eliaseeg</b> <J>-<n> Tiene todos los permisos. Se encarga del mantenimiento y mejoras de ShamanBattle\n<font color='#EB1D51'><b>Aritxy</b> <J>-<n> Tiene todos los permisos. </font>\n\n<font size='18'><p align='center'><B>Mapcrews</B></p></font>\nNo hay. :("};
- level_up = "<BV><b>₪</b> ¡%s subió al nivel <CH>%s",
- welcome = "<n>¡Hola %s! bienvenid@ a <ch>#ShamanBattle! <n>Presiona <ch>H <n>o escribe <ch>!help <n>para ver una lista de información.",
- spirit_warning = "<R>¡Has usado %d / %d <R>chispas disponibles!",
- xp = "<BV>Has ganado <CH>%s <BV>de experiencia <G>(<BV>Nivel: <CH>%d<G>)",
- newRound = "<CH>Una nueva ronda comenzó, mata a todos los demás chamanes para obtener la victoria.",
- battleName = "#<CH>Shaman<font color='#FEB1FC'>battle<font> <g>| <BV>Mata a todos los demás chamanes <g>| <n>Tiempo: <v>%s <g>| <n>Chamanes restantes: <v>%s \n",
- map = "<n>Ahora jugando el mapa de: <V>%s<n> con el codigo: <J>%s<BL> - <BV>P%s",
- winRound = "<CH>%s <n>ganó la ronda! <g>(<n>Nivel: <CH>%d<g>).",
- inv = "La ronda empieza en <v>%s",
- profiletext = "<font size='13'>\n\n\<bl><p align='center'>«%s»</p><br><bl>• Tribu: <ch>%s<br><bl>• Rondas ganadas: <ch>%s<br><bl>• Nivel: <ch>%s<br><bl>• Experiencia restante: <ch>%s<br><bl>• Muertes: <ch>%s<br><br><bl>• Títulos desbloqueados <g>(baja el scroll para ver más títulos)<bl>: <br><bl>%s",
- profile = "<p align='center'><font size='17' color='#%s'>%s",
- unlock_title = "<bv><b>₪</b> %s ha desbloqueado el titulo <j>«%s»",
- change_title = "<bv><b>₪</b> Tú nuevo título será: <j>«%s».",
- },
- EN={
- help={"<font size='18'><p align='center'><B>#ShamanBattle</B></p></font><font size='12'>\nShamanBattle is a minigame created by <j>Eliaseeg <n>& <j>Aritxy<n>. Your objective is to kill all shamans, last mouse alive wins the round.\n\n<p align='center'><font size='16'><b>Index</b></font></p><br><br><font size='14'><a href='event:help'><g>1) <n>Information</a><br><a href='event:Comandos'><g>2) <n>Commands</a><br><a href='event:Equipo'><g>3) <n>Team</a></font>\n\n\n\n\n\n<font size='9'><R>Report any bugs to Eliaseeg or Aritxy.</r>",
- "<font size='18'><p align='center'><B>Commands</B></p></font><font size='12'>\nThis page is for commands, the following commands are added in game.\n\n\n<b>!perfil user</b><j> - <n>Shows the user's profile\n<b>!perfil me</b><j> - <n>Sampe profile.\n<b>!ranking/leaderboard/top/scoreboard</b><j> - <n>Shows the rankings.\n<b>!title number</b><j> - <n>Changes your title.\n<b>!afk\n\n<font size='18'><p align='center'><B>Hotkeys</B></p></font>\n<b>P</b><j> - <n> Shows/closes the profile.\n<b>H</b><j> - <n>Shows/closes the help.\n<b>L</b><j> - <n>Shows/closes the ranking.",
- "<g><font size='18'><p align='center'><B>Titles</B></p></font>1) <n>Initiated <g>2) <n>Survivor\n<g>3) <n>Cannon *-* <g>4) <n>Shaman\n<g>5) <n>Collector <g>6) <n>Camper\n<g>7) <n>El salvador <g>8) <n>Graduated\n<g>9) <n>Business <g>10) <n>Immortal\n<g>11) <n>Mouse of steel <g>12) <n>Super Survivor\n<g>13) <n>Iluminated <g>14) <n>God of Survivor\n<g>15) <n>Brewmaster<g>16) <n>Weaver Fogger\n<g>17) <n>Escapist <g>18) <n>Tracker\n<g>19) <n>Best <g>20) <n>Serial Murderer\n<g>21) <n>IMMORTAL :0",
- "<font size='18'><p align='center'><b>Team</b></p></font>\n<font size='18'><p align='center'><B>Administrators</B></p></font><br><font size='12' color='#EB1D51'><b>Eliaseeg</b> <J>-<n> Will be responsible for maintenance and improvements of ShamanBattle\n<font color='#EB1D51'><b>Aritxy</b> <J>-<n> Has license. </font>\n\n<font size='18'><p align='center'><B>Mapcrews</B></p></font>\nNone. :("};
- level_up = "<BV><b>₪</b> %s is now level <CH>%s!",
- welcome = "<n>Hi %s! Welcome to <ch>#ShamanBattle! <n>Type <ch>!help <n>or press <ch>H <n>for information.",
- spirit_warning = "<R>You used %d / %d spirits allowed!",
- xp = "<BV>You won <CH>%s <BV>xp <G>(<BV>Level: <CH>%d<G>)",
- newRound = "<CH>A new round has begun, kill everyone to win!",
- battleName = "#<CH>Shaman<font color='#FEB1FC'>battle<font> <g>| <BV>Kill everyone to win <g>| <n>Time: <v>%s <g>| <n>Shamans: <v>%s \n",
- map = "<n>Now playing the map of: <V>%s<n> Code: <J>%s<BL> - <BV>P%s",
- winRound = "<CH>%s <n>has won the round! <g>(<n>Level: <CH>%d<g>).",
- inv = "The round starts in <v>%s",
- profiletext = "<font size='13'>\n\n<p align='center'>«%s»</p><br><bl>• Tribe: <ch>%s<br><bl>• Rounds won: <ch>%s<br><bl>• Level: <ch>%s<br><bl>• Xp left: <ch>%s<br><bl>• Times killed: <ch>%s<br><br><bl>• Unlocked titles: <g>(Scroll down to see all titles)<bl>:<br><bl>%s",
- profile = "<p align='center'><font size='17' color='#%s'>%s",
- unlock_title = "<bv><b>₪</b> %s has unlocked the title <j>«%s»",
- change_title = "<bv><b>₪</b> Your new title is: <j>«%s».",
- },
- TR={
- help={"<font size='18'><p align='center'><B>#ShamanBattle</B></p></font><font size='12'>\nShamanBattle minioyunu <j>Eliaseeg <n>& <j>Aritxy<n> tarafından yapılmış bir oyundur. Amacınız tüm şamanları öldürmek.Hayatta kalan fare kazanır\n\n<p align='center'><font size='16'><b>Dizin</b></font></p><br><br><font size='14'><a href='event:help'><g>1) <n>Bilgi</a><br><a href='event:Comandos'><g>2) <n>Komutlar</a><br><a href='event:Equipo'><g>3) <n>Takım</a></font>\n\n\n\n\n\n<font size='9'><R>Sorunları bildirmek için Eliaseeg veya Aritxy ile iletişime geçin.</r>",
- "<font size='18'><p align='center'><B>Komutlar</B></p></font><font size='12'>\nBu sayfadaki komutlar, aşağıdaki komutlar için minioyuna eklenmiştir.\n\n\n<b>!profil,perfil kullanıcı</b><j> - <n>Kullanıcı Profili Görüntüler\n<b>!profil,perfil me</b><j> - <n>Kendi Profilinizi Görüntüler.\n<b>!ranking/leaderboard/top/scoreboard</b><j> - <n>Sıralamayı Gösterir.\n<b>!title numara</b><j> - <n>Titlenizi Değiştirir.\n<b>!afk\n\n<font size='18'><p align='center'><B>Kısayol tuşları</B></p></font>\n<b>P</b><j> - <n> Profili Gösterir/Kapatır.\n<b>H</b><j> - <n>Yardım Sekmesini Gösterir/Kapatır\n<b>L</b><j> - <n>Sıralamayı Gösterir/Kapatır.",
- "<g><font size='18'><p align='center'><B>Titleler</B></p></font>1) <n>Initiated <g>2) <n>Survivor\n<g>3) <n>Cannon *-* <g>4) <n>Shaman\n<g>5) <n>Collector <g>6) <n>Camper\n<g>7) <n>El salvador <g>8) <n>Graduated\n<g>9) <n>Business <g>10) <n>Immortal\n<g>11) <n>Mouse of steel <g>12) <n>Super Survivor\n<g>13) <n>Iluminated <g>14) <n>God of Survivor\n<g>15) <n>Brewmaster<g>16) <n>Weaver Fogger\n<g>17) <n>Escapist <g>18) <n>Tracker\n<g>19) <n>Best <g>20) <n>Serial Murderer\n<g>21) <n>IMMORTAL :0",
- "<font size='18'><p align='center'><b>Takım</b></p></font>\n<font size='18'><p align='center'><B>Adminler</B></p></font><br><font size='12' color='#EB1D51'><b>Eliaseeg</b> <J>-<n> Sorumlu olacak bakım ve iyileştirmeler için ShamanBattle\n<font color='#EB1D51'><b>Aritxy</b> <J>-<n> Tarafından Lisanslandırılmıstır.. </font>\n\n<font size='18'><p align='center'><B>Mapcrews</B></p></font>\nYok. :("};
- level_up = "<BV><b>₪</b> %s şimdi <CH>%s seviyede!",
- welcome = "<n>Merhaba %s! <ch>#ShamanBattle! Minioyununa Hoş Geldiniz <n>Yardım için <ch>!help <n>veya <ch>H <n>tuşuna basarak bilgi alabilirsin.",
- spirit_warning = "<R>Kullandığınız %d / %d spirits izinleri!",
- xp = "<CH>%s <BV>xp <BV>kazandı. <G>(<BV>Level: <CH>%d<G>)",
- newRound = "<CH>Yeni bir tur başladı, herkesi öldürmek için kazanın!",
- battleName = "#<CH>Shaman<font color='#FEB1FC'>Battle<font> <g>| <BV>Herkes Öldürerek Kazadığı: <g>| <n>Zaman: <v>%s <g>| <n>Şaman: <v>%s \n",
- map = "<n>Harita Şimdi Açılıyor: <V>%s<n> Kod: <J>%s<BL> - <BV>P%s",
- winRound = "<CH>%s <n>roundu kazandı! <g>(<n>Level: <CH>%d<g>).",
- inv = "Yeni Round Başlıyor <v>%s",
- profiletext = "<font size='13'>\n\n<bl><p align='center'>«%s»</p><br><bl>• Kazandığı Round: <ch>%s<br><bl>• Level: <ch>%s<br><bl>• Xp left: <ch>%s<br><bl>• Öldürdüğü Kişi Sayısı: <ch>%s<br><br><bl>• Açtığı Titleler: <g>(Tüm başlıkları görmek için aşağı doğru ilerleyin)<bl>:<br><bl>%s",
- profile = "<p align='center'><font size='17' color='#%s'>%s",
- unlock_title = "<bv><b>₪</b> %s ünvanı kazandı. <j>«%s»",
- change_title = "<bv><b>₪</b> Yeni Title: <j>«%s».",
- }
- }
- local images = {
- newPlayer = "2opfIg6.png"
- }
- local obj = {1,2,3,4,5,6,7,8,9,10,21,22,23,25,26,27,28,32,44};
- local chamanes=0
- local id1
- local time = 0
- local data={}
- local invb = true
- local invtime = 0
- local perfil = false
- local color = 0x191919
- local map = true
- local titles = {"Initiated","Survivor","Cannon *-*","Shaman","Collector","Camper","El Salvador","Graduated","Business","Immortal","Mouse of steel","Super Survivor","Iluminated","God of Survivor","Brewmaster","Weaver Fogger","Escapist","Persecuter","The Best ", "Serial Murderer", "IMMORTAL :0"}
- local admins = {"Eliaseeg"}
- local mapcrews = {"Stheblindd"}
- function inTable(t,a)if type(t)=="table" then for x,y in pairs(t)do if a==y then return true end end return false end end
- function main()
- tfm.exec.disableAutoNewGame(true)
- tfm.exec.disableAutoTimeLeft(true)
- tfm.exec.disableAllShamanSkills(true)
- tfm.exec.disableAutoShaman(true)
- tfm.exec.disableAfkDeath(true)
- for i, command in ipairs ({"perfil","p","stats", "title","help","profile","leaderboard","rank","top","scoreboard","afk","lang","langue","ranking"}) do
- system.disableChatCommandDisplay(command,true)
- end
- startGame()
- end
- function startGame()
- local newMap;
- repeat
- newMap = shaman[math.random(#shaman)];
- until newMap ~= tfm.get.room.currentMap
- tfm.exec.newGame (newMap)
- end
- function eventNewGame()
- shamanBattle()
- time = 127
- chamanes = 0
- ui.removeTextArea(6,nil)
- ui.removeTextArea(7,nil)
- for name,player in pairs(tfm.get.room.playerList) do
- message(string.format(getTrans(name).map, tfm.get.room.xmlMapInfo.author, tfm.get.room.currentMap, tfm.get.room.xmlMapInfo.permCode))
- if data[name].afk == true then
- tfm.exec.killPlayer(name)
- end
- end
- end
- function message(s,p)
- tostring(s)
- if tfm.get.room.name:sub(2,2)=="" then
- print(s)
- else
- tfm.exec.chatMessage(s,p)
- end
- end
- function getColour(name)
- local adm = inTable(admins,name)
- if adm then
- color = 'EB1D51'
- else
- color = 'C2C2DA'
- end
- return color
- end
- function getTransMessage()
- return langs[idioma] or langs.ES
- end
- function eventNewPlayer(name)
- if not data[name] then
- data[name]={}
- data[name].perfil = false
- data[name].rank = false
- data[name].help = false
- data[name].wins = 0
- data[name].muertes = 0
- data[name].spirits = 0
- data[name].paginah = 1
- data[name].idioma = "ES"
- data[name].nTime = 5
- data[name].stat={1,150,0}
- -- Nivel, xp faltante, xp actual
- data[name].titles={true}for i=2,#titles do data[name].titles[i]=false end
- data[name].title=titles[1]
- end
- local adm = inTable(admins,name)
- ui.addTextArea(0,"<p align='center'><a href='event:help'><b>?</b></a></p>",name,780,25,16,16,nil,0x324650,nil,true)
- for key=1,100 do
- tfm.exec.bindKeyboard(name,key,true,true)
- message(string.format(getTransMessage().welcome, name), name)
- id1 = tfm.exec.addImage(images.newPlayer, "!1", 400-771, 200-420, name)
- end
- if adm then
- data[name].titles={true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true}for i=21,#titles do data[name].titles[i]=true end
- data[name].title=titles[16]
- data[name].stat={100,1500,2000}
- end
- end
- for p in pairs(tfm.get.room.playerList) do
- eventNewPlayer(p)
- end
- function getTrans(name)
- return langs[data[name].idioma] or langs.ES
- end
- function addTextArea(id,text,p,x,y,w,h,bac,boc,alpha,scroll,espinfo)
- ui.addTextArea(id,text,p,x,y,w,h,0x324650,0x27373F,1,true,true)
- ui.addTextArea(id+8000,"<font size='14'><p align='center'>"..espinfo.."</p>",p,x,y,w,20,0x27373F,0x27373F,1,true,true)
- ui.addTextArea(id+7000,"<p align='center'><a href='event:close'>Cerrar</a></p>",p,x,y+h+5,w,20,0x324650,0x27373F,1,true)
- end
- function removeTextArea(id,player)
- ui.removeTextArea(8000+id,player)
- ui.removeTextArea(7000+id,player)
- ui.removeTextArea(id,player)
- end
- function eventLoop(ct,rt)
- time = time-0.5
- local timed = string.format("%.2d:%.2d",time/60%60, time%60)
- for p in pairs(tfm.get.room.playerList) do
- data[p].nTime = data[p].nTime-0.5
- tfm.exec.setUIMapName(string.format(getTrans(p).battleName, timed, chamanes))
- end
- if time <= 0 then
- startGame()
- end
- if invb == true then
- invtime = invtime-0.5
- for p in pairs(tfm.get.room.playerList) do
- ui.addTextArea(2,string.format(getTrans(p).inv, math.floor(invtime)),name,310,25,nil,nil,0x990000,0x990000,0.6,true)
- end
- end
- if invtime == 0 then
- invb = false
- makeShamans(true)
- invtime=7
- for p in pairs(tfm.get.room.playerList) do
- tfm.exec.setNameColor(p, math.random(0x000000, 0xFFFFFF))
- ui.removeTextArea(2,p)
- end
- end
- --[[for name in pairs(tfm.get.room.playerList) do
- if data[name].nTime <= 0 then
- tfm.exec.removeImage(id1)
- end
- end]]
- end
- function shamanBattle(name)
- invb = true
- invtime = 7
- time = 125
- tfm.exec.setGameTime(127)
- for name in pairs(tfm.get.room.playerList) do
- data[name].spirits = 0
- message(getTrans(name).newRound)
- tfm.exec.setNameColor(name,0xC2C2DA)
- end
- end
- function eventChatCommand(name, command)
- local args={}
- local adm = inTable(admins,name)
- local mc = inTable(mapcrews,name)
- for arg in command:gmatch("[^%s]+") do
- table.insert(args,arg:lower())
- end
- if args[1] == "stats" or args[1] == "perfil" or args[1] == "p" or args[1]=="profile" and data[capitalize(args[2])] then
- getPerfil(capitalize(args[2]), name)
- elseif args[1] == "lang" and args[2] == "en" then
- data[name].idioma = "EN"
- print('hello')
- elseif args[1] == "lang" and args[2] == "es" then
- data[name].idioma = "ES"
- print('hola')
- elseif args[1] == "lang" and args[2] == "tr" then
- data[name].idioma = "TR"
- print('merhaba')
- elseif args[1]=="rank" or args[1]=="leaderboard" or args[1]=="top" or args[1]=="scoreboard" or args[1]=="ranking" then
- leaderboard(name)
- elseif args[1]=="title" then
- if args[2] then
- changetitle(name, tonumber(args[2]))
- end
- elseif args[1]=="help" then
- ui.addTextArea(9,getTrans(name).help[data[name].paginah],name,100,40,600,300,0x26353d,0x26353d,nil,true);
- ui.addTextArea(10,"<p align='center'><J><a href='event:previous'><B>←</B></a> <G>(Prev)</p>",name,330,355,nil,16,0x26353d,0x26353d,nil,true);
- ui.addTextArea(11,"<p align='center'><G>(Next) <J><a href='event:next'><B>→</B></a></p>",name,400,355,nil,16,0x26353d,0x26353d,nil,true);
- ui.addTextArea(12,"<p align='center'><R><a href='event:closex'><b>☓</b></a> <G>(Close)</p>",name,640,355,nil,16,0x26353d,0x26353d,nil,true);
- ui.addTextArea(13,"<p align='center'><J>"..data[name].paginah.."<G>/<J>"..#getTrans(name).help.."<G></p> Pages",name,100,355,nil,16,0x26353d,0x26353d,nil,true);
- data[name].help = true
- elseif args[1]=="perfil" or args[1]=="p" and args[2]=="me" then
- getPerfil(name,name)
- elseif args[1]=="afk" then
- if not data[name].afk == true then
- data[name].afk = true
- message("You are afk, afk for desactive it.",name)
- tfm.exec.killPlayer(name)
- elseif data[name].afk == true then
- data[name].afk = false
- message("You aren't afk",name)
- end
- elseif args[1]=="insert" and args[2]=="map" and args[3] and mc or adm then
- print("test")
- table.insert(shaman, args[3])
- end
- end
- function eventPlayerDied(name)
- chamanes = chamanes - 1
- data[name].muertes = data[name].muertes +1
- alive()
- end
- function eventPlayerLeft(name)
- chamanes = chamanes - 1
- end
- function eventPlayerWon(p)
- levelup(p,math.random(80, 120))
- end
- function eventTextAreaCallback(id, name, callback)
- if callback=="close" then
- removeTextArea(0,p,true)
- elseif callback=="cperfil" then
- removeTextArea(0,p,true)
- elseif callback=="help" then
- eventChatCommand(name, "help")
- elseif callback=="closex" then
- data[name].paginah=1
- data[name].help = false
- for id=9,13 do
- ui.removeTextArea(id,name)
- ui.removeTextArea(6969+id,name)
- ui.removeTextArea(7979+id,name)
- end
- elseif callback=="next" and data[name].paginah<#getTrans(name).help then
- data[name].paginah=(data[name].paginah)+1
- ui.updateTextArea(9,getTrans(name).help[data[name].paginah],name)
- ui.updateTextArea(13,"<p align='center'><J>"..data[name].paginah.."<G>/<J>"..#getTrans(name).help.."<G></p> Pages",name)
- elseif callback=="previous" and data[name].paginah>1 then
- data[name].paginah=data[name].paginah-1
- ui.updateTextArea(9,getTrans(name).help[data[name].paginah],name)
- ui.updateTextArea(13,"<p align='center'><J>"..data[name].paginah.."<G>/<J>"..#getTrans(name).help.."<G></p> Pages",name)
- elseif callback=="Comandos" then
- data[name].paginah=2
- ui.updateTextArea(9,getTrans(name).help[data[name].paginah],name)
- ui.updateTextArea(13,"<p align='center'><J>"..data[name].paginah.."<G>/<J>"..#getTrans(name).help.."<G></p> Pages",name)
- elseif callback=="Equipo" then
- data[name].paginah=4
- ui.updateTextArea(9,getTrans(name).help[data[name].paginah],name)
- ui.updateTextArea(13,"<p align='center'><J>"..data[name].paginah.."<G>/<J>"..#getTrans(name).help.."<G></p> Pages",name)
- end
- end
- function eventSummoningEnd(name,Obje,xPosition,yPosition,angle,xSpeed,ySpeed,other)
- if Obje==44 then
- tfm.exec.killPlayer(name)
- message("Without totem",name)
- elseif Obje==24 then
- data[name].spirits=data[name].spirits+1
- if data[name].spirits>3 then
- data[name].muertes = data[name].muertes +1
- tfm.exec.killPlayer(name)
- else
- message(string.format(getTrans(name).spirit_warning, data[name].spirits, 3),name)
- end
- end
- for index,objs in pairs(obj) do
- if objs == Obje then
- tfm.exec.removeObject(other.id)
- end
- end
- end
- function eventKeyboard(name,key,down,x,y)
- if key==80 and data[name].perfil then
- removeTextArea(0,p,true)
- elseif key==80 and data[name].rank then
- removeTextArea(0,p,true)
- getPerfil(name,name)
- elseif key==80 and data[name].rank and data[name].help then
- removeTextArea(0,p,true)
- eventTextAreaCallback(id, name, "closex")
- data[name].rank=false
- elseif key==80 then
- getPerfil(name,name)
- elseif key == 76 and data[name].rank then
- removeTextArea(0,p,true)
- data[name].rank=false
- elseif key == 76 and data[name].perfil then
- removeTextArea(0,p,true)
- leaderboard(name)
- elseif key == 76 then
- leaderboard(name)
- elseif key == 72 and data[name].help then
- eventTextAreaCallback(id, name, "closex")
- elseif key == 72 and data[name].perfil then
- removeTextArea(0,p,true)
- eventChatCommand(name,"help")
- elseif key == 72 and data[name].rank then
- removeTextArea(0,p,true)
- eventChatCommand(name,"help")
- data[name].rank=false
- elseif key == 72 then
- eventChatCommand(name,"help")
- end
- end
- -- Tools
- function makeShamans(boolean)
- tfm.exec.disableAutoShaman(boolean)
- chamanes = 0
- if boolean == true then
- for p in pairs(tfm.get.room.playerList) do
- chamanes = chamanes + 1
- tfm.exec.setShaman(p)
- end
- end
- end
- function chamanalive()
- for name,player in pairs(tfm.get.room.playerList) do
- if player.isShaman and not player.isDead then
- chaman=name
- end
- end
- return chaman
- end
- function alive()
- if chamanes == 1 then
- local chaman=chamanalive()
- if tfm.get.room.playerList[chaman].isShaman and not tfm.get.room.playerList[chaman].isDead then
- time = 10
- tfm.exec.setGameTime(10)
- tfm.exec.giveCheese(chaman)
- tfm.exec.playerVictory(chaman)
- data[chaman].wins = data[chaman].wins +1
- for p in pairs(tfm.get.room.playerList) do
- message(string.format(getTrans(p).winRound, chaman, data[chaman].stat[1]))
- end
- end
- end
- if chamanes == 0 then
- time = 5
- end
- end
- function levelup(p,e)
- if tfm.get.room.playerList[p] and tonumber(e)~=nil then
- e=tonumber(e)
- data[p].stat[3]=e
- if data[p].stat[3]>=data[p].stat[2] and data[p].stat[1]<100 then
- repeat
- data[p].stat[1]=data[p].stat[1]+1
- data[p].stat[3]=data[p].stat[3]-data[p].stat[2]
- data[p].stat[2]=150+54*data[p].stat[1]
- if data[p].stat[2]>data[p].stat[3] then
- data[p].stat[2]=data[p].stat[2]-data[p].stat[3]
- end
- until data[p].stat[3]<data[p].stat[2] or data[p].stat[1]==100
- for player in pairs(tfm.get.room.playerList) do
- message(string.format(getTrans(player).level_up, p, data[p].stat[1]), player)
- unlockTitle(p)
- end
- else
- data[p].stat[2]=data[p].stat[2]-data[p].stat[3]
- data[p].stat[3]=0
- message(string.format(getTrans(p).xp, e, data[p].stat[1]), p)
- end
- if data[p].stat[1]==100 then
- data[p].stat[2]=0
- end
- end
- end
- function leaderboard(name)
- scores = {}
- for name, player in pairs(data) do
- if data[name] then
- table.insert (scores, {name=name, score=data[name].wins, level=data[name].stat[1]})
- end
- end
- table.sort (scores,
- function (x,y)
- return x.score > y.score
- end
- )
- local message = "\n\n<font size='15'><BV>Nombre <g> - <j>Wins <g> - <CH>Nivel\n\n"
- for i,score in ipairs(scores) do
- message = message.."<font size='15'><G>"..i.. ") <BV>" .. score.name .. " <BL>-<j> " .. score.score .. " <BL>-<CH> "..score.level.."</font>\n"
- end
- addTextArea(0,message,p,160,60,540,260,0x324650,0x27373F,1,true,"<v><b>Ranking</b>")
- end
- function capitalize(word)
- if word then
- if word:find("+") then
- return string.upper(word:sub(1,2)) .. string.lower (word:sub(3));
- else
- return string.upper(word:sub(1,1)) .. string.lower (word:sub(2));
- end
- end
- end
- function getPerfil(profile,n)
- if tfm.get.room.playerList[profile] then
- local perfil=string.format(getTrans(profile).profiletext, data[profile].title, tfm.get.room.playerList[profile].tribeName or "<r>No tiene", data[profile].wins, data[profile].stat[1], data[profile].stat[2], data[profile].muertes, returntitles(profile))
- data[n].perfil=true
- addTextArea(0,perfil,pp,275,75,250,200,0x324650,0x27373F,1,true,string.format(getTrans(profile).profile, getColour(profile), profile))
- end
- end
- function desbtitle(p,n)
- if tfm.get.room.playerList[p] and titles[n] then
- if data[p].titles[n]==false then
- data[p].titles[n]=true
- data[p].title=titles[n]
- message(string.format(getTrans(p).unlock_title, p, titles[n]), n)
- end
- end
- end
- function changetitle(p,n)
- if tfm.get.room.playerList[p] and titles[n] then
- if data[p].titles[n] then
- data[p].title=titles[n]
- message(string.format(getTrans(p).change_title, titles[n]), n)
- end
- end
- end
- function unlockTitle(p)
- if tfm.get.room.playerList[p] then
- if data[p].wins>=1 then desbtitle(p,4)end if data[p].wins>=10 then desbtitle(p,5)end
- if data[p].wins>=25 then desbtitle(p,6)end if data[p].wins>=40 then desbtitle(p,7)end
- if data[p].wins>=60 then desbtitle(p,8)end if data[p].wins>=80 then desbtitle(p,9)end if data[p].wins>=100 then desbtitle(p,10)end
- if data[p].stat[1]>1 then desbtitle(p,11)end if data[p].stat[1]>=10 then desbtitle(p,12)end
- if data[p].stat[1]>=20 then desbtitle(p,13)end if data[p].stat[1]>=30 then desbtitle(p,14)end
- if data[p].stat[1]>=40 then desbtitle(p,15)end if data[p].stat[1]>=50 then desbtitle(p,16)end
- if data[p].stat[1]>=60 then desbtitle(p,17)end if data[p].stat[1]>=70 then desbtitle(p,18)end
- if data[p].stat[1]>=80 then desbtitle(p,19)end if data[p].stat[1]>=90 then desbtitle(p,20)end
- if data[p].stat[1]>=100 then desbtitle(p,21)end
- end
- end
- function returntitles(p)
- if tfm.get.room.playerList[p] then
- local playertitles={}
- for a=1,#titles do
- if data[p].titles[a] then
- table.insert(playertitles,"<g> "..tostring(a).." - «"..titles[a].."»")
- end
- end
- return table.concat(playertitles,"\n",1)
- end
- end
- main()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement