Advertisement
Guest User

Untitled

a guest
Mar 22nd, 2018
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 62.93 KB | None | 0 0
  1. function table.concat(list,sep,f,i,j)
  2. local txt = ""
  3. sep = sep or ""
  4. i,j = i or 1,j or #list
  5. for k,v in next,list do
  6. if type(k) ~= "number" and true or (k >= i and k <= j) then
  7. txt = txt .. (f and f(k,v) or v) .. sep
  8. end
  9. end
  10. return string.sub(txt,1,-1-#sep)
  11. end
  12.  
  13. function table.find(list,value,index,f)
  14. for k,v in next,list do
  15. local i = (type(v) == "table" and index and v[index] or v)
  16. if (not f and i or f(i)) == value then
  17. return true,k
  18. end
  19. end
  20. return false,0
  21. end
  22.  
  23. function ui.timerImage(img,x,y,n,bomb,time)
  24. time=time or 5
  25. axis=axis or {100,100}
  26. local img=tfm.exec.addImage(img..".png","&0",x,y,n)
  27. system.newTimer(function()
  28. tfm.exec.removeImage(img,n)
  29. if bomb==true then
  30. tfm.exec.explosion(x,y,20,150)
  31. tfm.exec.displayParticle(12,x,y)
  32. end
  33. end,time*1000,false)
  34. end
  35.  
  36. text={}
  37. lang={}
  38. lang.ar={commands="\n<b><VP>!اسم الشخصية</VP></b> - التحول إلى شخصية محددة\n<b><VP>!random</VP></b> - التحول إلى شخصية عشوائية\n<b><VP>!mouse</VP></b> - العودة إلى فأر مرة أخرى\n\n<b><VP>!guild</VP></b> - فتح قائمة النقابات <font size='10'>(فتح الملف الشخصي لنقابتك إذا كنت عضوًا بنقابة)</font>\n<p align='center'><a href='event:guild'><b><BV>قائمة النقابات</BV></b></a></p>\n<b><VP>!profile</VP></b> [<V><b>الاسم</b></V>] - فتح الملف الشخصي للاعب محدد\n<p align='center'><a href='event:profile'><b><BV>الملف الشخصي</BV></b></a></p>\n<b><VP>!help</VP></b> - فتح قائمة المساعدة\n<p align='center'><a href='event:help'><b><BV>قائمة المساعدة</BV></b></a></p>\n<b><VP>!shop</VP></b> - فتح المتجر\n<p align='center'><a href='event:shop'><b><BV>المتجر</BV></b></a></p>\n<b><VP>!list</VP></b> - فتح قائمة الشخصيات\n<p align='center'><a href='event:characters'><b><BV>قائمة الشخصيات</BV></b></a></p>\n\n",newbadge="لقد حصلت على وسامٍ جديد!",creditsbutton="ائتمان",commandsbutton="الأوامر",gameplaybutton="كيفية اللعب",credits="<p align='center'><font face='Soopafresh' size='30'><u>ائتمان</u></font>\n\n<b><R>•</R></b> صانع النمط\n<b><VP>•</VP></b> أغراض برمجية/صور\n<b><ROSE>•</ROSE></b> رسام\n<b><J>•</J></b> مترجم</p>\n<R><b>Bodykudo<font size='8'><V>#0000</V></font></b></R> هذه اللعبة تمت صناعتها بواسطة\n\nهؤلاء الأشخاص ساعدوا ببعض الأغراض البرمجية والصور\n<VP><b>Bolodefchoco<font size='8'><V>#0000</V></font></b></VP>, <VP><b>Laagaadoo<font size='8'><V>#0000</V></font></b></VP> و <VP><b>Animjarcanin<font size='8'><V>#0000</V></font></b></VP>\n\n<ROSE><b>Chocodivo<font size='8'><V>#0000</V></font></b></ROSE> ساعدت بتصميم الصور",mouse="عليك أن تنتظر للجولة القادمة حتى تصبح فأرًا",items="أ\nغـ\nـر\nا\nض",skills="مـ\nـهـ\nـا\nر\nا\nت",buy="شراء",inRoom="%s في الغرفة",wins="مرات الفوز",losses="مرات الخسارة",rounds="الجولات الملعوبة",stats="الإحصائيات",gm="أعضاء نقابتك",join="الانضمام",closebutton="إغلاق",members="الأعضاء",leave="المغادرة"}
  39. lang.en={commands="\n<b><VP>!Character's Name</VP></b> - Transform to a Certain Character\n<b><VP>!random</VP></b> - Transform to a Random Character\n<b><VP>!mouse</VP></b> - Return back to a Mouse again\n\n<b><VP>!guild</VP></b> - Display the Guilds' menu <font size='10'>(Display your Guild's Profile if you are a part in a guild)</font>\n<p align='center'><a href='event:guild'><b><BV>The Guilds' Menu</BV></b></a></p>\n<b><VP>!profile</VP></b> [<V><b>Name</b></V>] - Display the Player's Profile\n<p align='center'><a href='event:profile'><b><BV>The Profile</BV></b></a></p>\n<b><VP>!help</VP></b> - Display the Help menu\n<p align='center'><a href='event:help'><b><BV>The Help Menu</BV></b></a></p>\n<b><VP>!shop</VP></b> - Display the Shop\n<p align='center'><a href='event:shop'><b><BV>The Shop</BV></b></a></p>\n<b><VP>!list</VP></b> - Display the Characters' list\n<p align='center'><a href='event:characters'><b><BV>The Characters' List</BV></b></a></p>\n\n",newbadge="You Have Got a New Badge!",creditsbutton="Credits",commandsbutton="Commands",gameplaybutton="Gameplay",credits="<p align='center'><font face='Soopafresh' size='30'><u>Credits</u></font>\n\n<b><R>•</R></b> Module Developer\n<b><VP>•</VP></b> Coding/Images Stuff\n<b><ROSE>•</ROSE></b> Artist\n<b><J>•</J></b> Translator</p>\nThis Game was Developed by <R><b>Bodykudo<font size='8'><V>#0000</V></font></b></R>\n\nThose people helped with Some Coding and Images Stuff\n<VP><b>Bolodefchoco<font size='8'><V>#0000</V></font></b></VP>, <VP><b>Laagaadoo<font size='8'><V>#0000</V></font></b></VP> and <VP><b>Animjarcanin<font size='8'><V>#0000</V></font></b></VP>\n\n<ROSE><b>Chocodivo<font size='8'><V>#0000</V></font></b></ROSE> Helped with Drawings",mouse="You have to wait until the next round to become a Mouse",items="I\nt\ne\nm\ns",skills="S\nk\ni\nl\nl\ns",buy="Buy",inRoom="%s in the Room",wins="Wins",losses="Losses",rounds="Played Rounds",stats="Stats",gm="Your guild Members",join="Join",closebutton="Close",members="Members",leave="Leave"}
  40. lang.br={commands="\n<b><VP>!Character's Name</VP></b> - Transform to a Certain Character\n<b><VP>!random</VP></b> - Transform to a Random Character\n<b><VP>!mouse</VP></b> - Return back to a Mouse again\n\n<b><VP>!guild</VP></b> - Display the Guilds menu <font size='10'>(Display your Guild's Profile if you are a part in a guild)</font>\n<p align='center'><a href='event:guild'><b><BV>The Guilds Menu</BV></b></a></p>\n<b><VP>!profile</VP></b> [<V><b>Name</b></V>] - Display the Player's Profile\n<p align='center'><a href='event:profile'><b><BV>The Profile</BV></b></a></p>\n<b><VP>!help</VP></b> - Display the Help menu\n<p align='center'><a href='event:help'><b><BV>The Help Menu</BV></b></a></p>\n<b><VP>!shop</VP></b> - Display the Shop\n<p align='center'><a href='event:shop'><b><BV>The Shop</BV></b></a></p>\n<b><VP>!list</VP></b> - Display the Characters' list\n<p align='center'><a href='event:characters'><b><BV>The Characters' List</BV></b></a></p>\n\n",newbadge="You Have Got a New Badge!",creditsbutton="Credits",commandsbutton="Commands",gameplaybutton="Gameplay",credits="<p align='center'><font face='Soopafresh' size='30'><u>Credits</u></font>\n\n<b><R>•</R></b> Module Developer\n<b><VP>•</VP></b> Coding/Images Stuff\n<b><ROSE>•</ROSE></b> Artist\n<b><J>•</J></b> Translator</p>\nThis Game was Developed by <R><b>Bodykudo<font size='8'><V>#0000</V></font></b></R>\n\nThose people helped with Some Coding and Images Stuff\n<VP><b>Bolodefchoco<font size='8'><V>#0000</V></font></b></VP>, <VP><b>Laagaadoo<font size='8'><V>#0000</V></font></b></VP> and <VP><b>Animjarcanin<font size='8'><V>#0000</V></font></b></VP>\n\n<ROSE><b>Chocodivo<font size='8'><V>#0000</V></font></b></ROSE> Helped with Drawings\n\n<J><b>Bolodefchoco<font size='8'><V>#0000</V></font></b></J><font size='8'>(BR)</font> Helped with Translating The Module",mouse="You have to wait until the next round to become Mouse",items="I\nt\ne\nn\ns",skills="H\na\nb\ni\nl\ni\nd\na\nd\ne\ns",buy="Comprar",inRoom="%s na sala",wins="Vitórias",losses="Derrotas",rounds="Partidas jogadas",stats="Estatísticas",gm="Membros da sua equipe",join="Entrar",closebutton="Fechar",members="Membros",leave="Sair"}
  41. lang.pl={commands="\n<b><VP>!Nazwa Postaci</VP></b> - Zmiana w określoną Postać\n<b><VP>!random</VP></b> - Zmiana w Losową Postać\n<b><VP>!mouse</VP></b> - Powróć do wyglądu zwykłej Myszki\n\n<b><VP>!guild</VP></b> - Pokazuje menu Gildi <font size='10'>(Pokazuje Profil twojej gildii, jeżeli w jakieś jesteś)</font>\n<p align='center'><a href='event:guild'><b><BV>Gildia</BV></b></a></p>\n<b><VP>!profile</VP></b> [<V><b>Nazwa</b></V>] - Pokazuje Profil Gracza\n<p align='center'><a href='event:profile'><b><BV>Profil</BV></b></a></p>\n<b><VP>!help</VP></b> - Pokazuje menu Pomocy\n<p align='center'><a href='event:help'><b><BV>Pomoc</BV></b></a></p>\n<b><VP>!shop</VP></b> - Pokazuje Sklep\n<p align='center'><a href='event:shop'><b><BV>Sklep</BV></b></a></p>\n<b><VP>!list</VP></b> - Pokazuje listę postaci\n<p align='center'><a href='event:characters'><b><BV>Lista Postaci</BV></b></a></p>\n\n",newbadge="Otrzymałeś/-aś nową odznakę!",creditsbutton="Credits",commandsbutton="Komendy",gameplaybutton="Rozgrywka",credits="<p align='center'><font face='Soopafresh' size='30'><u>Credits</u></font>\n\n<b><R>•</R></b> Twórca modułu\n<b><VP>•</VP></b> Programowanie/Obrazki\n<b><ROSE>•</ROSE></b> Artysta\n<b><J>•</J></b> Tłumacz</p>\nTa minigra jest stworzona przez <R><b>Bodykudo<font size='8'><V>#0000</V></font></b></R>\n\nCi ludzie pomogli mi w kodzie i dodawaniu obrazków\n<VP><b>Bolodefchoco<font size='8'><V>#0000</V></font></b></VP>, <VP><b>Laagaadoo<font size='8'><V>#0000</V></font></b></VP> and <VP><b>Animjarcanin<font size='8'><V>#0000</V></font></b></VP>\n\n<ROSE><b>Chocodivo<font size='8'><V>#0000</V></font></b></ROSE> Namalowała kilka obrazków\n\n<J><b>Sebafrancuz<font size='8'><V>#0000</V></font></b></J><font size='8'>(PL)</font> Pomógł w tłumaczeniu modułu",mouse="Musisz poczekać do kolejnej rundy, aby zostać Myszką",items="P\nr\nz\ne\nd\nm\ni\no\nt\ny",skills="S\nk\ni\nl\nl\ne",buy="Kup",inRoom="%s w Pokoju",wins="Wygrane",losses="Przegrane",rounds="Rozegrane Rundy",stats="Statystyki",gm="Członkowie twojej gildi",join="Dołącz",closebutton="Zamknij",members="Członkowie",leave="Opuść"}
  42. lang.nl={commands="\n<b><VP>!Naam van Personage</VP></b> - Transformeer naar een Bepaalde Personage\n<b><VP>!random</VP></b> - Transformeer naar een Random Personage\n<b><VP>!mouse</VP></b> - Transformeer terug naar een Muis\n\n<b><VP>!guild</VP></b> - Toon het Gildemenu <font size='10'>(Toon je Gilde Profile als je deel uitmaakt van een gilde)</font>\n<p align='center'><a href='event:guild'><b><BV>De Gilde Menu</BV></b></a></p>\n<b><VP>!profile</VP></b> [<V><b>Naam</b></V>] - Geef het profiel van de speler weer\n<p align='center'><a href='event:profile'><b><BV>Het Profiel</BV></b></a></p>\n<b><VP>!help</VP></b> - Geef het Help menu weer\n<p align='center'><a href='event:help'><b><BV>Het Help Menu</BV></b></a></p>\n<b><VP>!shop</VP></b> - Toon de winkel\n<p align='center'><a href='event:shop'><b><BV>De Winkel</BV></b></a></p>\n<b><VP>!list</VP></b> - Geef de lijst met Personages weer\n<p align='center'><a href='event:characters'><b><BV>De lijst met Personages</BV></b></a></p>\n\n",newbadge="Je hebt een nieuwe badge!",creditsbutton="Credits",commandsbutton="Commando's",gameplaybutton="Gameplay",credits="<p align='center'><font face='Soopafresh' size='30'><u>Credits</u></font>\n\n<b><R>•</R></b> Moduleontwikkelaar\n<b><VP>•</VP></b> Codering/Afbeeldingen dingen\n<b><ROSE>•</ROSE></b> Artiest\n<b><J>•</J></b> Vertaler</p>\nDeze game is ontwikkeld door <R><b>Bodykudo<font size='8'><V>#0000</V></font></b></R>\n\nDeze mensen hebben geholpen met Codering en Afbeeldingen dingen\n<VP><b>Bolodefchoco<font size='8'><V>#0000</V></font></b></VP>, <VP><b>Laagaadoo<font size='8'><V>#0000</V></font></b></VP> and <VP><b>Animjarcanin<font size='8'><V>#0000</V></font></b></VP>\n\n<ROSE><b>Chocodivo<font size='8'><V>#0000</V></font></b></ROSE> Hielp met tekeningen\n\n<J><b>Distances<font size='8'><V>#0000</V></font></b></J><font size='8'>(NL)</font> Geholpen met het vertalen van de Module",mouse="Je moet wachten tot de volgende ronde om muis te worden",items="D\ni\nn\ng\ne\nn",skills="V\na\na\nr\nd\ni\ng\nh\ne\nd\ne\nn",buy="Kopen",inRoom="%s in de Kamer",wins="Wint",losses="Verliest",rounds="Gespeelde Rondes",stats="Stats",gm="Je Gildeleden",join="Toetreden",closebutton="Sluiten",members="Leden",leave="Verlaten"}
  43. lang.hu={commands="\n<b><VP>!A karakter neve </VP></b> - Átalakulás egy adott karakterré\n<b><VP>!random</VP></b> - Átalakulás egy véletlenszerűen kapott karakterré\n<b><VP>!mouse</VP></b> - Vissza egérré\n\n<b><VP>!guild</VP></b> - Mutasd a Csapat menüjét <font size='10'>(Mutasd a Csapatod profilját, ha tagja vagy egynek)</font>\n<p align='center'><a href='event:guild'><b><BV>Csapat</BV></b></a></p>\n<b><VP>!profile</VP></b> [<V><b>Név</b></V>] - Mutasd a játékos profilját\n<p align='center'><a href='event:profile'><b><BV>Profil</BV></b></a></p>\n<b><VP>!help</VP></b> - Mutasd a Segítség menüt\n<p align='center'><a href='event:help'><b><BV>Segítség</BV></b></a></p>\n<b><VP>!shop</VP></b> - Mutasd a boltot\n<p align='center'><a href='event:shop'><b><BV>Bolt</BV></b></a></p>\n<b><VP>!list</VP></b> - Mutasd a karakterek listáját\n<p align='center'><a href='event:characters'><b><BV>Karakterlista</BV></b></a></p>\n\n",newbadge="Új kitűzőt szereztél!",creditsbutton="Köszönet",commandsbutton="Parancsok",gameplaybutton="Játék",credits="<p align='center'><font face='Soopafresh' size='30'><u>Köszönet</u></font>\n\n<b><R>•</R></b> Modul Fejlesztő\n<b><VP>•</VP></b> Kódolás/Képek\n<b><ROSE>•</ROSE></b> Művész\n<b><J>•</J></b> Fordító</p>\nA játékot fejlesztette: <R><b>Bodykudo<font size='8'><V>#0000</V></font></b></R>\n\nEzek az emberek segítettek még a kódolásban és a képekkel: \n<VP><b>Bolodefchoco<font size='8'><V>#0000</V></font></b></VP>, <VP><b>Laagaadoo<font size='8'><V>#0000</V></font></b></VP> and <VP><b>Animjarcanin<font size='8'><V>#0000</V></font></b></VP>\n\n<ROSE><b>Chocodivo<font size='8'><V>#0000</V></font></b></ROSE> Segített a rajzaival: \n\n<J><b>Toby<font size='8'><V>#3989</V></font></b></J><font size='8'>(HU)</font> Segített lefordítani a modult: ",mouse="A következő pályáig várnod kell, hogy ismét egér lehess!",items="T\n\ná\nr\ng\ny\na\nk",skills="K\né\np\ne\ns\ns\né\ng\ne\nk\nb\nu\ny",buy="Megvesz",inRoom="%s a szobában van.",wins="Győzelmek",losses="Vereségek",rounds="Lejátszott körök",stats="Statisztikák",gm="A csapattagjaid ",join="Csatlakozás",closebutton="Bezárás",members="Tagok",leave="Kilépés"}
  44. lang.fr={commands="\n<b><VP>!Nom du personnage</VP></b> - Transformer en un certain personnage\n<b><VP>!random</VP></b> - Transforme en un personnage aléatoire\n<b><VP>!mouse</VP></b> - Revenir de nouveau en Souris\n\n<b><VP>!guild</VP></b> - Afficher le menu des Guildes <font size='10'>(Affiche le profil de votre Guilde si vous faites partie d'une guilde)</font>\n<p align='center'><a href='event:guild'><b><BV>Le Menu des Guildes</BV></b></a></p>\n<b><VP>!profile</VP></b> [<V><b>Nom</b></V>] - Afficher le profil du joueur \n<p align='center'><a href='event:profile'><b><BV>Le profil</BV></b></a></p>\n<b><VP>!help</VP></b> - Afficher le menu Aide\n<p align='center'><a href='event:help'><b><BV>Le menu Aide</BV></b></a></p>\n<b><VP>!shop</VP></b> - Afficher le magasin\n<p align='center'><a href='event:shop'><b><BV>Le Magasin</BV></b></a></p>\n<b><VP>!list</VP></b> - Afficher la liste des personnages\n<p align='center'><a href='event:characters'><b><BV>La liste des personnages</BV></b></a></p>\n\n",newbadge="Vous avez obtenu un nouveau badge !",creditsbutton="Crédits",commandsbutton="Commandes",gameplaybutton="Gameplay",credits="<p align='center'><font face='Soopafresh' size='30'><u>Crédits</u></font>\n\n<b><R>•</R></b> Développeur du module\n<b><VP>•</VP></b> Codage/Images\n<b><ROSE>•</ROSE></b> Artiste\n<b><J>•</J></b> Traducteur</p>\nCe jeu a été créé par <R><b>Bodykudo<font size='8'><V>#0000</V></font></b></R>\n\nCes personnes ont aidé pour le codage et les images\n<VP><b>Bolodefchoco<font size='8'><V>#0000</V></font></b></VP>, <VP><b>Laagaadoo<font size='8'><V>#0000</V></font></b></VP> and <VP><b>Animjarcanin<font size='8'><V>#0000</V></font></b></VP>\n\n<ROSE><b>Chocodivo<font size='8'><V>#0000</V></font></b></ROSE> Ont aidé avec les dessins\n\n<J><b>Eyeground<font size='8'><V>#0000</V></font></b></J><font size='8'>(FR)</font> Ont aidé à la traduction du module",mouse="Tu dois attendre le prochain tour pour devenir une souris",items="O\nb\nj\ne\nt\ns",skills="C\no\nm\np\né\nt\ne\nn\nc\ne\ns",buy="Acheter",inRoom="%s dans le salon",wins="Victoires",losses="Défaites",rounds="Rounds joués",stats="Statistiques",gm="Tes membres de guilde",join="Rejoindre",closebutton="Fermer",members="Membres",leave="Quitter"}
  45. lang.de={commands="\n<b><VP>!Name des Charakters</VP></b> - Verwandle dich in einen spezifischen Charakter\n<b><VP>!random</VP></b> - Verwandle dich in einen zufälligen Charakter\n<b><VP>!mouse</VP></b> - Verwandle dich in eine Maus zurück\n\n<b><VP>!guild</VP></b> - Zeige das Menü der Gilde <font size='10'>(Zeige das Profil deiner Gilde sofern du Teil einer Gilde bist)</font>\n<p align='center'><a href='event:guild'><b><BV>Menü der Gilde</BV></b></a></p>\n<b><VP>!profile</VP></b> [<V><b>Name</b></V>] - Zeige das Profil des Spielers\n<p align='center'><a href='event:profile'><b><BV>Das Profil</BV></b></a></p>\n<b><VP>!help</VP></b> - Zeige die Hilfe\n<p align='center'><a href='event:help'><b><BV>Die Hilfe</BV></b></a></p>\n<b><VP>!shop</VP></b> - Zeige das Geschäft\n<p align='center'><a href='event:shop'><b><BV>Das Geschäft</BV></b></a></p>\n<b><VP>!list</VP></b> - Zeige die Liste der Charaktere\n<p align='center'><a href='event:characters'><b><BV>Liste der Charaktere</BV></b></a></p>\n\n",newbadge="Du hast ein neues Abzeichen!",creditsbutton="Credits",commandsbutton="Kommandos",gameplaybutton="Gameplay",credits="<p align='center'><font face='Soopafresh' size='30'><u>Credits</u></font>\n\n<b><R>•</R></b> Module Entwickler\n<b><VP>•</VP></b> Kodierung/Bilder\n<b><ROSE>•</ROSE></b> Künstler\n<b><J>•</J></b> Übersetzer</p>\nDieses Spiel wurde entwickelt von <R><b>Bodykudo<font size='8'><V>#0000</V></font></b></R>\n\nDiese Leute haben bei Dingen wie Kodierung und Bildern geholfen\n<VP><b>Bolodefchoco<font size='8'><V>#0000</V></font></b></VP>, <VP><b>Laagaadoo<font size='8'><V>#0000</V></font></b></VP> and <VP><b>Animjarcanin<font size='8'><V>#0000</V></font></b></VP>\n\n<ROSE><b>Chocodivo<font size='8'><V>#0000</V></font></b></ROSE> Half bei Grafiken\n\n<J><b>Perlchen<font size='8'><V>#0000</V></font></b></J><font size='8'>(DE)</font> Half bei der Übersetzung des Module",mouse="Du musst bis zur nächsten Runde warten um folgendes zu sein:Maus",items="I\nt\ne\nm\ns",skills="F\nä\nh\ni\ng\nk\ne\ni\nt\ne\nn",buy="Kaufe",inRoom="%s im Raum",wins="Gewinne",losses="Niederlagen",rounds="Gespielte Runden",stats="Statistiken",gm="Deine Gilden Mitglieder",join="Beitreten",closebutton="Schließen",members="Mitglieder",leave="Verlassen"}
  46. play=false
  47. started=false
  48. mouse={}
  49. open={}
  50.  
  51. for _,v in pairs ({'disableAutoScore','disableAfkDeath','disablePhysicalConsumables','disableAutoNewGame','disableDebugCommand','disableMinimalistMode','disableMortCommand','disableAutoTimeLeft','disableAutoShaman'}) do
  52. tfm.exec[v](true)
  53. end
  54.  
  55. guilds={
  56. ft={name="<font color='#cc0000'>Fairy Tail</font>",members={},inRoom={},notInRoom={},membersNumber=0,inRoomMembers=0,color=0xcc0000,logo="15e15465adb.png",wins=0,losses=0,rounds=0,stats=0},
  57. st={name="<font color='#f9c944'>Sabertooth</font>",members={},inRoom={},notInRoom={},membersNumber=0,inRoomMembers=0,color=0xf9c944,logo="15e154685d3.png",wins=0,losses=0,rounds=0,stats=0},
  58. ls={name="<font color='#6cff73'>Lamia Scale</font>",members={},inRoom={},notInRoom={},membersNumber=0,inRoomMembers=0,color=0x6cff73,logo="15e15467027.png",wins=0,losses=0,rounds=0,stats=0},
  59. bp={name="<font color='#b6deff'>Blue Pegasus</font>",members={},inRoom={},notInRoom={},membersNumber=0,inRoomMembers=0,color=0xb6deff,logo="15e154606d4.png",wins=0,losses=0,rounds=0,stats=0}
  60. }
  61.  
  62. characters={
  63. arana={name="Arana",right={"1622a0e1227"},left={"16229f2d9a9"},x=-35,y=-55,ids=1},
  64. bacchus={name="Bacchus",right={"1622a0e6353"},left={"16229f32add"},x=-35,y=-55,ids=1},
  65. beth={name="Beth",right={"1622a0eb3ed"},left={"16229f37f4d"},x=-35,y=-55,ids=1},
  66. bob={name="Bob",right={"1622a0f04f4"},left={"16229f3cffb"},x=-35,y=-55,ids=1},
  67. cana={name="Cana",right={"1622a0f55e6"},left={"16229f420f4"},x=-35,y=-55,ids=1},
  68. carla={name="Carla",right={"1622a0fa7d8"},left={"16229f471fb"},x=-35,y=-55,ids=1},
  69. elfman={name="Elfman",right={"1622a0ff93a","1622a104a6c"},left={"16229f4c304","16229f5140a"},x=-35,y=-55,ids=2},
  70. erza={name="Erza",right={"1622a109af0"},left={"16229f56537"},x=-35,y=-55,ids=1},
  71. eve={name="Eve",right={"1622a10ebee"},left={"16229f5b950"},x=-35,y=-55,ids=1},
  72. evergreen={name="Evergreen",right={"1622a113d60"},left={"16229f60a09"},x=-35,y=-55,ids=1},
  73. flare={name="Flare",right={"1622a118def"},left={"16229f65afe"},x=-35,y=-55,ids=1},
  74. franmalth={name="Franmalth",right={"1622a11def1"},left={"16229f6ac33"},x=-35,y=-55,ids=1},
  75. frosch={name="Frosch",right={"1622a122fdf"},left={"16229f6fd30"},x=-35,y=-55,ids=1},
  76. gajeel={name="Gajeel",right={"1622a128110"},left={"16229f74e2e"},x=-35,y=-55,ids=1},
  77. gildarts={name="Gildarts",right={"1622a12d225"},left={"16229f79f20"},x=-35,y=-55,ids=1},
  78. gray={name="Gray",right={"1622a1322f6","1622a1373f7"},left={"16229f7f012","16229f840fb"},x=-35,y=-55,ids=2},
  79. happy={name="Happy",right={"1622a13c4e6"},left={"16229f897d7"},x=-35,y=-55,ids=1},
  80. hibiki={name="Hibiki",right={"1622a1415eb"},left={"16229f8e8f1"},x=-35,y=-55,ids=1},
  81. ichiya={name="Ichiya",right={"1622a1466e7"},left={"16229f939f8"},x=-35,y=-55,ids=1},
  82. jackal={name="Jackal",right={"1622a14b83a"},left={"16229f98b02"},x=-35,y=-55,ids=1},
  83. jager={name="Jager",right={"1622a15092f"},left={"16229f9dc19"},x=-35,y=-55,ids=1},
  84. jellal={name="Jellal",right={"1622a155a1e"},left={"16229fa2cf5"},x=-35,y=-55,ids=1},
  85. jenny={name="Jenny",right={"1622a15aafc"},left={"16229fa7e0c"},x=-35,y=-55,ids=1},
  86. jura={name="Jura",right={"1622a15fc0e"},left={"16229facee3"},x=-35,y=-55,ids=1},
  87. juvia={name="Juvia",right={"1622a164d2d"},left={"16229fb25ae"},x=-35,y=-55,ids=1},
  88. kagura={name="Kagura",right={"1622a169e06"},left={"16229fb7728"},x=-35,y=-55,ids=1},
  89. kain={name="Kain",right={"1622a16ef96"},left={"16229fbc819"},x=-35,y=-55,ids=1},
  90. kurohebi={name="Kurohebi",right={"1622a174111"},left={"16229fc1969"},x=-35,y=-55,ids=1},
  91. kyoka={name="Kyoka",right={"1622a1791f8"},left={"16229fc6afe"},x=-35,y=-55,ids=1},
  92. laxus={name="Laxus",right={"1622a17e2f1"},left={"16229fcbbf4"},x=-35,y=-55,ids=1},
  93. lector={name="Lector",right={"1622a1833f3"},left={"16229fd0cef"},x=-35,y=-55,ids=1},
  94. levy={name="Levy",right={"1622a188508"},left={"16229fd5e36"},x=-35,y=-55,ids=1},
  95. lily={name="Lily",right={"1622a18d6c2"},left={"16229fdaf16"},x=-35,y=-55,ids=1},
  96. lisana={name="Lisana",right={"1622a19282f"},left={"16229fe008b"},x=-35,y=-55,ids=1},
  97. loke={name="Loke",right={"1622a197912"},left={"16229fe5246"},x=-35,y=-55,ids=1},
  98. lucy={name="Lucy",right={"1622a19ca61"},left={"16229fea461"},x=-35,y=-55,ids=1},
  99. lyon={name="Lyon",right={"1622a1a1b2f"},left={"1622a690311"},x=-35,y=-55,ids=1},
  100. makarov={name="Makarov",right={"1622a1a6bf7"},left={"16229ff4644"},x=-35,y=-55,ids=1},
  101. mavis={name="Mavis",right={"1622a1abd10"},left={"16229ff96f3"},x=-35,y=-55,ids=1},
  102. meredy={name="Meredy",right={"1622a1b0e26"},left={"16229ffe7e6"},x=-35,y=-55,ids=1},
  103. minerva={name="Minerva",right={"1622a1b5ef6"},left={"1622a0038e2"},x=-35,y=-55,ids=1},
  104. mirajane={name="Mirajane",right={"1622a1baffe","1622a1c0100"},left={"1622a008a3e","1622a00dae6"},x=-35,y=-55,ids=2},
  105. mystogan={name="Mystogan",right={"1622a1c51fd"},left={"1622a01303b"},x=-35,y=-55,ids=1},
  106. natsu={name="Natsu",right={"1622a1ca323","1622a1cf43a","1622a1d44ea"},left={"1622a018108","1622a01d650","1622a022a20"},x=-35,y=-55,ids=3},
  107. rogue={name="Rogue",right={"1622a1f7efe","1622a1fd02e","1622a051650"},left={"1622a046ff7","1622a04c54d","1622a2020f9"},x=-35,y=-55,ids=3},
  108. nobarly={name="Nobarly",right={"1622a1d95ed"},left={"1622a0282a5"},x=-35,y=-55,ids=1},
  109. nullpudding={name="Nullpudding",right={"1622a1de726"},left={"1622a02db66"},x=-35,y=-55,ids=1},
  110. obra={name="Obra",right={"1622a1e3814"},left={"1622a032c18"},x=-35,y=-55,ids=1},
  111. orga={name="Orga",right={"1622a1e8900"},left={"1622a037ce0"},x=-35,y=-55,ids=1},
  112. risley={name="Risley",right={"1622a1eda57"},left={"1622a03ce21"},x=-35,y=-55,ids=1},
  113. rocker={name="Rocker",right={"1622a1f2d7d"},left={"1622a041f1e"},x=-35,y=-55,ids=1},
  114. romeo={name="Romeo",right={"1622a2071ee"},left={"1622a0566f0"},x=-35,y=-55,ids=1},
  115. rufus={name="Rufus",right={"1622a20c2e5"},left={"1622a05b7fc"},x=-35,y=-55,ids=1},
  116. racer={name="Racer",right={"1622a211a30"},left={"1622a060eb1"},x=-35,y=-55,ids=1},
  117. sawyer={name="Sawyer",right={"1622a211a30"},left={"1622a060eb1"},x=-35,y=-55,ids=1},
  118. seilah={name="Seilah",right={"1622a216b13"},left={"1622a065fe7"},x=-35,y=-55,ids=1},
  119. semmes={name="Semmes",right={"1622a21bf9a"},left={"1622a06b136"},x=-35,y=-55,ids=1},
  120. sherria={name="Sherria",right={"1622a2231ba"},left={"1622a0701f0"},x=-35,y=-55,ids=1},
  121. silver={name="Silver",right={"1622a228340"},left={"1622a0752f8"},x=-35,y=-55,ids=1},
  122. sting={name="Sting",right={"1622a22d3f6","1622a232502"},left={"1622a07a3f4","1622a07f526"},x=-35,y=-55,ids=2},
  123. wendy={name="Wendy",right={"1622a24c037","1622a2510ee"},left={"1622a0994ec","1622a09e9d3"},x=-35,y=-55,ids=2},
  124. toby={name="Toby",right={"1622a237625"},left={"1622a0845ed"},x=-35,y=-55,ids=1},
  125. totomaru={name="Totomaru",right={"1622a23c719"},left={"1622a089704"},x=-35,y=-55,ids=1},
  126. ultear={name="Ultear",right={"1622a241dc0"},left={"1622a08f330"},x=-35,y=-55,ids=1},
  127. warcry={name="Warcry",right={"1622a246f09"},left={"1622a09441e"},x=-35,y=-55,ids=1},
  128. yuka={name="Yuka",right={"1622a25623d"},left={"1622a0a3e2f"},x=-35,y=-55,ids=1},
  129. yukino={name="Yukino",right={"1622a25b626"},left={"1622a0a939a"},x=-35,y=-55,ids=1},
  130. zancrow={name="Zancrow",right={"1622a2606fd"},left={"1622a0ae50b"},x=-35,y=-55,ids=1},
  131. zeref={name="Zeref",right={"1622a2657e6"},left={"1622a0b3df2"},x=-35,y=-55,ids=1},
  132. }
  133.  
  134. names={}
  135. local c={"list","characters","guild","lang","map","","profile","random","mouse","help","shop"}
  136. for index,p in pairs(characters) do
  137. table.insert(names,index)
  138. table.insert(c,index)
  139. end
  140.  
  141. circles={"15e15473f69","15e15471bde","15e15470619","15e1546e1d7","15e1546c318","15e1546a427"}
  142. data={}
  143. p={}
  144. toDespawn={}
  145. id={list={},badge={},primage={},shop1={},shop2={},shop3={},logo={},logo1={},logo2={},logo3={},logo4={},character={},emt1={},emt2={},emt3={},character={},badge1={},badge2={},badge3={},badge4={},badge5={},help={}}
  146.  
  147. items={
  148. [49]={name="Cannon",id=17,x=15,y=0,max=20,xa=30,angle=90,max_x=24,max_x2=24,max_y=24},
  149. [50]={name="Plank",id=3,x=70,y=-3,max=15,xa=25,angle=0,max_x=69,max_x2=29,max_y=24},
  150. [51]={name="Anvil",id=10,x=15,y=0,max=5,xa=25,angle=0,max_x=24,max_x2=-1,max_y=24}
  151. }
  152.  
  153. maps={
  154. {code="@1667582",x={ft=680,st=124,ls=138,bp=670},y={ft=66,st=66,ls=194,bp=194}},
  155. {code="@1825269",x={ft=410,st=578,ls=410,bp=106},y={ft=185,st=65,ls=185,bp=265}},
  156. {code="@1749647",x={ft=400,st=650,ls=150,bp=400},y={ft=335,st=335,ls=335,bp=335}},
  157. {code="@2324513",x={ft=485,st=629,ls=629,bp=332},y={ft=256,st=215,ls=215,bp=206}},
  158. {code="@2218853",x={ft=601,st=202,ls=402,bp=404},y={ft=67,st=67,ls=45,bp=162}},
  159. {code="@3219038",x={ft=637,st=305,ls=325,bp=738},y={ft=245,st=245,ls=105,bp=105}},
  160. {code="@2020179",x={ft=730,st=398,ls=66,bp=398},y={ft=70,st=85,ls=70,bp=85}},
  161. {code="@1922239",x={ft=628,st=475,ls=326,bp=178},y={ft=65,st=65,ls=65,bp=65}},
  162. {code="@4411127",x={ft=401,st=552,ls=248,bp=401},y={ft=163,st=245,ls=245,bp=351}},
  163. {code="@4383258",x={ft=400,st=400,ls=82,bp=720},y={ft=200,st=200,ls=270,bp=120}},
  164. {code="@1985678",x={ft=720,st=81,ls=556,bp=244},y={ft=59,st=59,ls=170,bp=170}},
  165. {code="@589800",x={ft=700,st=550,ls=250,bp=100},y={ft=162,st=162,ls=162,bp=162}},
  166. {code="@1616785",x={ft=675,st=567,ls=235,bp=127},y={ft=108,st=210,ls=210,bp=108}},
  167. {code="@1688696",x={ft=738,st=59,ls=182,bp=620},y={ft=115,st=115,ls=215,bp=215}},
  168. {code="@2232342",x={ft=715,st=715,ls=94,bp=94},y={ft=90,st=190,ls=90,bp=190}},
  169. {code="@2222981",x={ft=667,st=131,ls=448,bp=354},y={ft=122,st=122,ls=66,bp=66}},
  170. {code="@7292599",x={ft=739,st=61,ls=402,bp=402},y={ft=44,st=44,ls=74,bp=74}},
  171. {code="@3015995",x={ft=555,st=255,ls=94,bp=705},y={ft=208,st=208,ls=334,bp=334}},
  172. {code="@7292145",x={ft=775,st=600,ls=202,bp=20},y={ft=251,st=181,ls=181,bp=251}},
  173. {code="@5017354",x={ft=400,st=400,ls=740,bp=65},y={ft=81,st=81,ls=141,bp=141}},
  174. {code="@7286179",x={ft=770,st=308,ls=32,bp=490},y={ft=319,st=336,ls=319,bp=336}},
  175. {code="@7286382",x={ft=599,st=400,ls=400,bp=204},y={ft=120,st=232,ls=232,bp=120}},
  176. {code="@7293452",x={ft=645,st=650,ls=155,bp=156},y={ft=266,st=95,ls=95,bp=266}},
  177. {code="@7297649",x={ft=450,st=684,ls=173,bp=368},y={ft=303,st=132,ls=211,bp=92}},
  178. {code="@7290901",x={ft=735,st=398,ls=60,bp=398},y={ft=184,st=157,ls=184,bp=157}},
  179. {code="@7093063",x={ft=740,st=408,ls=408,bp=60},y={ft=99,st=202,ls=202,bp=99}},
  180. {code="@2839265",x={ft=228,st=574,ls=228,bp=574},y={ft=201,st=201,ls=201,bp=201}},
  181. {code="@6694506",x={ft=80,st=715,ls=400,bp=400},y={ft=344,st=344,ls=344,bp=344}},
  182. {code="@7291632",x={ft=680,st=405,ls=406,bp=120},y={ft=332,st=307,ls=307,bp=332}}
  183. }
  184.  
  185. function setLang(n)
  186. text[n]=lang[tfm.get.room.playerList[n].community] or lang.en
  187. end
  188.  
  189. function nameTagFormat(name, size, color1, color2)
  190. local Name, Hash = name:match("([^#]+)(#%d+)")
  191. Name = Name or name
  192. Hash = Hash or ""
  193. local size = tonumber(size or 14)
  194. local color1 = color1 or 'r'
  195. local color2 = color2 or 'j'
  196. local colorN, colorH = (color1:match("#") and "<font color='"..color1.."' size='"..size.."'>%s</font>" ) or "<font size='"..size.."'><"..color1..">%s</"..color1.."></font>" , ( color2:match("#") and "<font color='"..color2.."' size='".. math.floor(size*2/3) .."'>%s</font>" ) or "<font size='".. math.floor(size*2/3) .."'><"..color2..">%s</"..color2.."></font>"
  197. return string.format(colorN, Name)..string.format(colorH, Hash)
  198. end
  199.  
  200. function Data(n)
  201. data[n]={score=0,wins=0,losses=0,rounds=0,badges={"1622a220aa8.png","1622a220aa8.png","1622a220aa8.png","1622a220aa8.png","1622a220aa8.png"},timer=0,character=names[math.random(#names)],id=1,skills={arrow={can=false,max=15},snowball={can=false,max=10},bombs={can=false,max=5}},inGuild=false,guild="",guild_table="",coins=1000,attack=49,maxx={[49]=20,[50]=15,[51]=5},alpha={[49]=false,[50]=false,[51]=false},x={[49]=15,[50]=70,[51]=15},y={[49]=0,[50]=-3,[51]=0}}
  202. data[n].max={[49]=data[n].maxx[49],[50]=data[n].maxx[50],[51]=data[n].maxx[51]}
  203. end
  204.  
  205. function newMap()
  206. map={}
  207. i=0
  208. for _,v in pairs(maps) do
  209. i=i+1
  210. map[i]=v.code
  211. end
  212. tfm.exec.newGame(map[math.random(#map)])
  213. end
  214.  
  215. function eventNewPlayer(n)
  216. mouse[n]=false
  217. open[n]=false
  218. setLang(n)
  219. p[n]={right=false,left=false,timestamp=os.time(),objectid=0,imageid=0,magic=0,x=tfm.get.room.playerList[n].x,y=tfm.get.room.playerList[n].y,id=1}
  220. if not data[n] then
  221. Data(n)
  222. end
  223. magic(n)
  224. ui.addTextArea(23, "<p align='center'><a href='event:help'><b>H", n, 8, 54, 15, 20, 0x8a583c, 0x000000, 1, true)
  225. ui.addTextArea(24, "<p align='center'><a href='event:guild'><b>G", n, 32, 54, 15, 20, 0x8a583c, 0x000000, 1, true)
  226. ui.addTextArea(25, "<p align='center'><a href='event:profile'><b>P", n, 56, 54, 15, 20, 0x8a583c, 0x000000, 1, true)
  227. ui.addTextArea(26, "<p align='center'><a href='event:shop'><b>S", n, 80, 54, 15, 20, 0x8a583c, 0x000000, 1, true)
  228. if data[n].inGuild then
  229. guilds[data[n].guild_table].inRoomMembers=guilds[data[n].guild_table].inRoomMembers+1
  230. end
  231. for k=0,100 do
  232. tfm.exec.bindKeyboard(n,k,true,true)
  233. end
  234. if data[n].inGuild then
  235. Guild(n)
  236. guilds[data[n].guild_table].notInRoom[n]=nil
  237. guilds[data[n].guild_table].inRoom[n]=true
  238. else
  239. Guilds(n)
  240. end
  241. end
  242.  
  243. function eventPlayerLeft(n)
  244. if data[n].inGuild then
  245. guilds[data[n].guild_table].inRoomMembers=guilds[data[n].guild_table].inRoomMembers-1
  246. guilds[data[n].guild_table].notInRoom[n]=true
  247. guilds[data[n].guild_table].inRoom[n]=nil
  248. end
  249. end
  250.  
  251. function Win(guild)
  252. for i in pairs(guilds[guild].members) do
  253. tfm.exec.giveCheese(i)
  254. tfm.exec.playerVictory(i)
  255. data[i].coins=data[i].coins+1
  256. data[i].wins=data[i].wins+1
  257. data[i].score=data[i].score+10
  258. if data[i].wins==1 and data[i].badges[2]=="1622a220aa8.png" then
  259. newBadge(i,"1622a2229e9.png",2)
  260. end
  261. end
  262. for i in pairs(guilds) do
  263. if guilds[i]~=guilds[guild] and guilds[i].inRoomMembers > 0 then
  264. guilds[i].losses=guilds[i].losses+1
  265. end
  266. end
  267. tfm.exec.setGameTime(5)
  268. guilds[guild].wins=guilds[guild].wins+1
  269. end
  270.  
  271. function eventNewGame()
  272. map=tfm.get.room.currentMap
  273. started=false
  274. for n in pairs(tfm.get.room.playerList) do
  275. closeAttackBoard(n)
  276. tfm.exec.setNameColor(n,0xC2C2DA)
  277. if not mouse[n] then
  278. Character(n,data[n].character)
  279. end
  280. tfm.exec.setPlayerScore(n,data[n].score)
  281. end
  282. if play then
  283. tfm.exec.setGameTime(123)
  284. for i in pairs(guilds) do
  285. if guilds[i].inRoomMembers > 0 then
  286. guilds[i].rounds=guilds[i].rounds+1
  287. calculateState=math.floor((guilds[i].wins/guilds[i].rounds)*100+0.5)/100
  288. guilds[i].stats=(calculateState==1 and 1 or (calculateState==0 and 0 or (#tostring(calculateState):sub(3)==1 and tonumber(tostring(calculateState):sub(3).."0") or tonumber(tostring(calculateState):sub(3)))))
  289. end
  290. end
  291. for n in pairs(tfm.get.room.playerList) do
  292. if data[n].inGuild then
  293. data[n].rounds=data[n].rounds+1
  294. closeGuilds(n)
  295. tfm.exec.setNameColor(n,guilds[data[n].guild_table].color)
  296. data[n].attack=49
  297. data[n].max={[49]=data[n].maxx[49],[50]=data[n].maxx[50],[51]=data[n].maxx[51]}
  298. for i in pairs(items) do
  299. if i==data[n].attack then
  300. data[n].alpha[i]=true
  301. else
  302. data[n].alpha[i]=false
  303. end
  304. end
  305. for i,v in pairs(maps) do
  306. if v.code==map then
  307. tfm.exec.movePlayer(n,v.x[data[n].guild_table],v.y[data[n].guild_table])
  308. end
  309. end
  310. data[n].skills["arrow"].max=15
  311. data[n].skills["snowball"].max=10
  312. data[n].skills["bombs"].max=5
  313. else
  314. tfm.exec.killPlayer(n)
  315. end
  316. end
  317. end
  318. end
  319.  
  320. function closeAttackBoard(n)
  321. for a=7,9 do
  322. ui.removeTextArea(a,n)
  323. end
  324. for k,v in pairs({"emt1","emt2","emt3"}) do
  325. if id[v][n] then tfm.exec.removeImage(id[v][n],n) id[v][n]=nil end
  326. end
  327. end
  328.  
  329. function attackBoard(n)
  330. closeAttackBoard(n)
  331. ui.addTextArea(7, "<p align='center'><b>Anvil\n\n"..data[n].max[51].." / "..data[n].maxx[51].."", n, 694, 28, 100, 78, 0x324650, 0x000000, data[n].alpha[51] and 0.5 or 0.2, true)
  332. ui.addTextArea(8, "<p align='center'><b>Plank\n\n"..data[n].max[50].." / "..data[n].maxx[50].."", n, 584, 28, 100, 78, 0x324650, 0x000000, data[n].alpha[50] and 0.5 or 0.2, true)
  333. ui.addTextArea(9, "<p align='center'><b>Cannon\n\n"..data[n].max[49].." / "..data[n].maxx[49].."", n, 474, 28, 100, 78, 0x324650, 0x000000, data[n].alpha[49] and 0.5 or 0.2, true)
  334. id["emt1"][n]=tfm.exec.addImage("15e15461b64.png", "&1", 508, 80, n)
  335. id["emt2"][n]=tfm.exec.addImage("15e1546302e.png", "&2", 617, 80, n)
  336. id["emt3"][n]=tfm.exec.addImage("15e1546449e.png", "&3", 729, 80, n)
  337. end
  338.  
  339. function Character(n,charc)
  340. mouse[n]=false
  341. if id["character"][n] then tfm.exec.removeImage(id["character"][n]) id["character"][n]=nil end
  342. data[n].character=charc
  343. data[n].timer=0
  344. if tfm.get.room.playerList[n].isFacingRight then
  345. id["character"][n]=tfm.exec.addImage(characters[data[n].character]["right"][data[n].id]..".png", "%"..n, characters[data[n].character]["x"], characters[data[n].character]["y"])
  346. else
  347. id["character"][n]=tfm.exec.addImage(characters[data[n].character]["left"][data[n].id]..".png", "%"..n, characters[data[n].character]["x"], characters[data[n].character]["y"])
  348. end
  349. end
  350.  
  351. function Mirrored(n,mirror)
  352. if id["character"][n] then tfm.exec.removeImage(id["character"][n]) id["character"][n]=nil end
  353. id["character"][n]=tfm.exec.addImage(characters[data[n].character][mirror][data[n].id]..".png", "%"..n, characters[data[n].character]["x"], characters[data[n].character]["y"])
  354. end
  355.  
  356. function magic(n)
  357. ui.addTextArea(20, "", n, 8, 27, 104, 18, 0x142b2e, 0x8a583c, 1, true)
  358. if p[n].magic > 0 then
  359. ui.addTextArea(21, "", n, 10, 29, p[n].magic, 14, 0x176eb0, 0x176eb0, 1, true)
  360. else
  361. ui.removeTextArea(21,n)
  362. end
  363. ui.addTextArea(22, "<p align='center'><b><J>"..p[n].magic.."%", n, 8, 27, 100, 18, 0x000000, 0x000000, 0, true)
  364. end
  365.  
  366. chances={1,1,1,1,1,1,1,1,1,1,2,2,2,2,3,3,3,4,4,5}
  367. function eventKeyboard(n,k,d,x,y)
  368. if k==2 then
  369. p[n].right=true
  370. p[n].left=true
  371. if not mouse[n] and started then
  372. Mirrored(n,"right")
  373. end
  374. elseif k==0 then
  375. p[n].right=false
  376. p[n].left=false
  377. if not mouse[n] and started then
  378. Mirrored(n,"left")
  379. end
  380. end
  381. if play and started then
  382. if (k==32 or k==3) and p[n].timestamp<os.time()-1000 and not tfm.get.room.playerList[n].isDead and data[n].max[data[n].attack]>0 then
  383. data[n].max[data[n].attack]=data[n].max[data[n].attack]-1
  384. p[n].objectid=tfm.exec.addShamanObject(items[data[n].attack].id,x+(p[n].right and data[n].x[data[n].attack] or -data[n].x[data[n].attack]),y+data[n].y[data[n].attack],p[n].right and items[data[n].attack].angle or -items[data[n].attack].angle,p[n].right and 30 or -30)
  385. p[n].timestamp=os.time()
  386. table.insert(toDespawn,{os.time(),p[n].objectid})
  387. if p[n].magic < 100 then
  388. if p[n].magic >= 96 then
  389. p[n].magic=p[n].magic+1
  390. else
  391. p[n].magic=p[n].magic+chances[math.random(#chances)]
  392. end
  393. end
  394. magic(n)
  395. elseif k==85 and p[n].timestamp<os.time()-1000 and not tfm.get.room.playerList[n].isDead and data[n].skills["arrow"].can==true and data[n].skills["arrow"].max>0 then
  396. data[n].skills["arrow"].max=data[n].skills["arrow"].max-1
  397. p[n].timestamp=os.time()
  398. p[n].objectid=tfm.exec.addShamanObject(35,x+(p[n].right and 15 or -15),y+0,p[n].right and 0 or 180,p[n].right and 25 or -25)
  399. table.insert(toDespawn,{os.time(),p[n].objectid})
  400. elseif k==72 and p[n].timestamp<os.time()-1000 and not tfm.get.room.playerList[n].isDead and data[n].skills["snowball"].can==true and data[n].skills["snowball"].max>0 then
  401. data[n].skills["snowball"].max=data[n].skills["snowball"].max-1
  402. p[n].timestamp=os.time()
  403. tfm.exec.addShamanObject(34,x+(p[n].right and 15 or -15),y,0,p[n].right and 20 or -20)
  404. tfm.exec.addShamanObject(34,x+(p[n].right and 15 or -15),y+30,0,p[n].right and 20 or -20)
  405. tfm.exec.addShamanObject(34,x+(p[n].right and 15 or -15),y-30,0,p[n].right and 20 or -20)
  406. elseif k==66 and p[n].timestamp<os.time()-1000 and not tfm.get.room.playerList[n].isDead and data[n].skills["bombs"].can==true and data[n].skills["bombs"].max>0 then
  407. data[n].skills["bombs"].max=data[n].skills["bombs"].max-1
  408. p[n].timestamp=os.time()
  409. ui.timerImage("161197ad4f2",x-20,y-30,nil,true,5)
  410. elseif k==17 and p[n].magic==100 and not tfm.get.room.playerList[n].isDead then
  411. p[n].magic=0
  412. for i=1,60 do
  413. tfm.exec.displayParticle(41,x,y-6*i)
  414. end
  415. for k in pairs(tfm.get.room.playerList) do
  416. if data[n].guild_table~=data[k].guild_table and not tfm.get.room.playerList[k].isDead then
  417. tfm.exec.explosion(p[k].x,p[k].y+30,80,40,false)
  418. tfm.exec.displayParticle(12,p[k].x,p[k].y+30)
  419. end
  420. end
  421. if data[n].badges[5]=="1622a220aa8.png" then
  422. newBadge(n,"1622a220aa8.png",5)
  423. end
  424. magic(n)
  425. ui.timerImage(circles[math.random(#circles)],235,45,n,5)
  426. elseif items[k] and data[n].inGuild and not tfm.get.room.playerList[n].isDead then
  427. data[n].attack=k
  428. for i in pairs(items) do
  429. if i==k then
  430. data[n].alpha[i]=true
  431. else
  432. data[n].alpha[i]=false
  433. end
  434. end
  435. end
  436. end
  437. end
  438.  
  439. function eventPlayerDied(n)
  440. if play then
  441. local t = {ft = 0, st = 0, ls = 0, bp = 0}
  442. if data[n].inGuild then
  443. closeAttackBoard(n)
  444. data[n].losses=data[n].losses+1
  445. for n,p in pairs(tfm.get.room.playerList) do
  446. if not p.isDead then
  447. t[data[n].guild_table] = t[data[n].guild_table] + 1
  448. end
  449. end
  450. local team = {}
  451. for k,v in pairs(t) do
  452. if v ~= 0 then
  453. team[#team+1] = k
  454. end
  455. if #team > 1 then
  456. break
  457. end
  458. end
  459. if #team == 1 then
  460. Win(team[1])
  461. end
  462. end
  463. end
  464. end
  465.  
  466. function close(n,guild,shop,profile,help,badge,list)
  467. open[n]=false
  468. if guild then
  469. closeGuilds(n)
  470. end
  471. if shop then
  472. closeShop(n)
  473. end
  474. if profile then
  475. closeProfile(n)
  476. end
  477. if help then
  478. closeHelp(n)
  479. end
  480. if badge then
  481. closeBadge(n)
  482. end
  483. if list then
  484. closeCharacters(n)
  485. end
  486. end
  487.  
  488. function Guilds(n)
  489. close(n,true,true,true,true,true,true)
  490. ui.addTextArea(1, "", n, 270, 91, 260, 217, 0x142b2e, 0x8a583c, 1, true)
  491. ui.addTextArea(2, "<a href='event:ft'><b><font color='#cc0000'><p align='center'>"..text[n].join, n, 278, 170, 74, 20, 0x2c555c, 0x936240, 1, true)
  492. ui.addTextArea(3, "<a href='event:ls'><b><font color='#6cff73'><p align='center'>"..text[n].join, n, 450, 275, 74, 20, 0x2c555c, 0x936240, 1, true)
  493. ui.addTextArea(4, "<a href='event:st'><b><font color='#f9c944'><p align='center'>"..text[n].join, n, 278, 275, 74, 20, 0x2c555c, 0x936240, 1, true)
  494. ui.addTextArea(5, "<a href='event:bp'><b><font color='#b6deff'><p align='center'>"..text[n].join, n, 450, 170, 74, 20, 0x2c555c, 0x936240, 1, true)
  495. ui.addTextArea(6, "<R><b><a href='event:guild_close'><p align='center'>"..text[n].closebutton, n, 347, 316, 100, 20, 0x142b2e, 0x8a583c, 1, true)
  496. id["logo1"][n]=tfm.exec.addImage(guilds["bp"].logo, "&1", 465, 105, n)
  497. id["logo2"][n]=tfm.exec.addImage(guilds["ft"].logo, "&1", 284, 105, n)
  498. id["logo3"][n]=tfm.exec.addImage(guilds["ls"].logo, "&1", 465, 214, n)
  499. id["logo4"][n]=tfm.exec.addImage(guilds["st"].logo, "&1", 284, 214, n)
  500. end
  501.  
  502. function Guild(n)
  503. close(n,true,true,true,true,true,true)
  504. open[n]=true
  505. ui.addTextArea(1, "", n, 294, 66, 212, 267, 0x142b2e, 0x8a583c, 1, true)
  506. ui.addTextArea(2, "", n, 294, 66, 75, 74, 0x2c555c, 0x8a583c, 1, true)
  507. ui.addTextArea(3, "<p align='center'><J>"..text[n].wins.." : <V>"..guilds[data[n].guild_table].wins.."\n<J>"..text[n].losses.." : <V>"..guilds[data[n].guild_table].losses.."\n<J>"..text[n].members.." : <V>"..guilds[data[n].guild_table].membersNumber.." ("..string.format(text[n].inRoom,guilds[data[n].guild_table].inRoomMembers)..")\n<J>"..text[n].rounds.." :<V> "..guilds[data[n].guild_table].rounds.."\n<J>"..text[n].stats.." : <V>"..guilds[data[n].guild_table].stats.."%\n\n", n, 305, 158, 188, 83, 0x142b2e, 0x8a583c, 1, true)
  508. ui.addTextArea(4, "<p align='center'><b><a href='event:members'><BV>"..text[n].members.."</a>\n\n<p align='center'><b><a href='event:leave'><R>"..text[n].leave.."</a>", n, 305, 258, 188, 67, 0x142b2e, 0x8a583c, 1, true)
  509. ui.addTextArea(5, "\n<b><font size='15'><p align='center'>"..guilds[data[n].guild_table].name, n, 379, 66, 126, 74, 0x2c555c, 0x8a583c, 1, true)
  510. ui.addTextArea(6, "<R><a href='event:guild_close'><b><p align='center'>"..text[n].closebutton, n, 351, 341, 100, 20, 0x142b2e, 0x8a583c, 1, true)
  511. id["logo"][n]=tfm.exec.addImage(guilds[data[n].guild_table].logo, "&1", 302, 77, n)
  512. end
  513.  
  514. function Characters(n)
  515. close(n,true,true,true,true,true,true)
  516. ui.addTextArea(63, "", n, 299, 114, 202, 172, 0x47707d, 0x000000, 1, true)
  517. ui.addTextArea(64, "<p align='center'><font size='22' face='Soopafresh'><a href='event:"..names[p[n].id].."'>"..characters[names[p[n].id]].name.."</a></font></p>", n, 300, 115, 200, 170, 0x193542, 0x47707d, 1, true)
  518. ui.addTextArea(65, "", n, 304, 250, 32, 27, 0x47707d, 0x000000, 1, true)
  519. ui.addTextArea(66, "<p align='center'><font size='2'><font size='12'><a href='event:pre'>←", n, 305, 250, 30, 25, 0x38516b, 0x47707d, 1, true)
  520. ui.addTextArea(67, "", n, 350, 250, 102, 27, 0x47707d, 0x000000, 1, true)
  521. ui.addTextArea(68, "<p align='center'><font size='2'><font size='12'><a href='event:close_list'>"..text[n].closebutton, n, 350, 250, 100, 25, 0x38516b, 0x47707d, 1, true)
  522. ui.addTextArea(69, "", n, 465, 250, 32, 27, 0x47707d, 0x000000, 1, true)
  523. ui.addTextArea(70, "<p align='center'><font size='2'><font size='12'><a href='event:next'>→", n, 466, 250, 30, 25, 0x38516b, 0x47707d, 1, true)
  524. if p[n].id==1 then
  525. ui.removeTextArea(66,n)
  526. ui.removeTextArea(65,n)
  527. elseif p[n].id==69 then
  528. ui.removeTextArea(70,n)
  529. ui.removeTextArea(69,n)
  530. end
  531. id["list"][n]=tfm.exec.addImage(characters[names[p[n].id]].left[1], "&1", 365, 165, n)
  532. end
  533.  
  534. function closeCharacters(n)
  535. for a=63,70 do
  536. ui.removeTextArea(a,n)
  537. end
  538. if id["list"][n] then tfm.exec.removeImage(id["list"][n],n) id["list"][n]=nil end
  539. end
  540.  
  541. function Shop(n)
  542. close(n,true,true,true,true,true,true)
  543. open[n]=true
  544. ui.addTextArea(27, "", n, 230, 74, 340, 251, 0x142b2e, 0x8a583c, 1, true)
  545. ui.addTextArea(28, "", n, 280, 140, 49, 50, 0x2c555c, 0x936240, 1, true)
  546. ui.addTextArea(29, "", n, 380, 140, 50, 50, 0x2c555c, 0x936240, 1, true)
  547. ui.addTextArea(30, "", n, 480, 140, 50, 50, 0x2c555c, 0x936240, 1, true)
  548. ui.addTextArea(31, "<b><p align='center'><a href='event:skills'>"..text[n].skills.."", n, 191, 112, 30, nil, 0x142b2e, 0x8a583c, 1, true)
  549. ui.addTextArea(32, "<p align='center'><b>"..data[n].coins.." $", n, 191, 37, 100, 27, 0x142b2e, 0x8a583c, 1, true)
  550. ui.addTextArea(33, "<p align='center'><b><r><a href='event:closeshop'>X", n, 192, 74, 30, 28, 0x142b2e, 0x8a583c, 1, true)
  551. if data[n].maxx[49]~=30 then
  552. ui.addTextArea(34, "<b><p align='center'><a href='event:+cannon'>+", n, 290, 285, 25, 25, 0x2c555c, 0x936240, 1, true)
  553. end
  554. if data[n].maxx[50]~=25 then
  555. ui.addTextArea(35, "<b><p align='center'><a href='event:+plank'>+", n, 390, 285, 25, 25, 0x2c555c, 0x936240, 1, true)
  556. end
  557. if data[n].maxx[51]~=10 then
  558. ui.addTextArea(36, "<b><p align='center'><a href='event:+anvil'>+", n, 490, 285, 25, 25, 0x2c555c, 0x936240, 1, true)
  559. end
  560. ui.addTextArea(37, "<b><p align='center'>3 $", n, 275, 230, 50, 25, 0x324650, 0x000000, 0, true)
  561. ui.addTextArea(38, "<b><p align='center'>4 $", n, 375, 230, 50, 25, 0x324650, 0x000000, 0, true)
  562. ui.addTextArea(39, "<b><p align='center'>5 $", n, 475, 230, 50, 25, 0x324650, 0x000000, 0, true)
  563. ui.addTextArea(40, "<b><p align='center'>"..data[n].maxx[49].."\n30", n, 282, 84, 50, 40, 0x324650, 0x000000, 0, true)
  564. ui.addTextArea(41, "<b><p align='center'>"..data[n].maxx[50].."\n25", n, 382, 84, 50, 40, 0x324650, 0x000000, 0, true)
  565. ui.addTextArea(42, "<b><p align='center'>"..data[n].maxx[51].."\n10", n, 482, 84, 50, 40, 0x324650, 0x000000, 0, true)
  566. id["shop1"][n]=tfm.exec.addImage("1611e2cb8a3.png", "&1", 480, 140, n)
  567. id["shop2"][n]=tfm.exec.addImage("1611e2ce0e0.png", "&1", 285, 148, n)
  568. id["shop3"][n]=tfm.exec.addImage("1611e2cf8f7.png", "&1", 380, 165, n)
  569. end
  570.  
  571. function ShopSkills(n)
  572. close(n,true,true,true,true,true,true)
  573. open[n]=true
  574. ui.addTextArea(27, "", n, 230, 74, 340, 251, 0x142b2e, 0x8a583c, 1, true)
  575. ui.addTextArea(28, "", n, 380, 128, 49, 84, 0x2c555c, 0x936240, 1, true)
  576. ui.addTextArea(29, "", n, 273, 151, 60, 27, 0x2c555c, 0x936240, 1, true)
  577. ui.addTextArea(30, "", n, 480, 140, 50, 50, 0x2c555c, 0x936240, 1, true)
  578. ui.addTextArea(31, "<b><p align='center'><a href='event:shop'>"..text[n].items.."", n, 191, 112, 30, nil, 0x142b2e, 0x8a583c, 1, true)
  579. ui.addTextArea(32, "<p align='center'><b>"..data[n].coins.." $", n, 191, 37, 100, 27, 0x142b2e, 0x8a583c, 1, true)
  580. ui.addTextArea(33, "<p align='center'><b><r><a href='event:closeshop'>X", n, 192, 74, 30, 28, 0x142b2e, 0x8a583c, 1, true)
  581. if not data[n].skills["arrow"].can then
  582. ui.addTextArea(34, "<b><p align='center'><a href='event:arrow'><BV>"..text[n].buy.."", n, 280, 285, nil, 25, 0x2c555c, 0x936240, 1, true)
  583. end
  584. if not data[n].skills["snowball"].can then
  585. ui.addTextArea(35, "<b><p align='center'><a href='event:snowball'><BV>"..text[n].buy.."", n, 380, 285, nil, 25, 0x2c555c, 0x936240, 1, true)
  586. end
  587. if not data[n].skills["bombs"].can then
  588. ui.addTextArea(36, "<b><p align='center'><a href='event:bombs'><BV>"..text[n].buy.."", n, 480, 285, nil, 25, 0x2c555c, 0x936240, 1, true)
  589. end
  590. ui.addTextArea(37, "<b><p align='center'>15 $", n, 275, 230, 50, 25, 0x324650, 0x000000, 0, true)
  591. ui.addTextArea(38, "<b><p align='center'>30 $", n, 375, 230, 50, 25, 0x324650, 0x000000, 0, true)
  592. ui.addTextArea(39, "<b><p align='center'>50 $", n, 475, 230, 50, 25, 0x324650, 0x000000, 0, true)
  593. id["shop1"][n]=tfm.exec.addImage("1611e2d13e8.png", "&3", 271, 157, n)
  594. id["shop2"][n]=tfm.exec.addImage("1611e2d2618.png", "&1", 392, 136, n)
  595. id["shop3"][n]=tfm.exec.addImage("161197ad4f2.png", "&2", 484, 145, n)
  596. end
  597.  
  598. function Profile(n,p)
  599. close(n,true,true,true,true,true,true)
  600. open[n]=true
  601. ui.addTextArea(44, "", n, 149, 54, 502, 292, 0x47707d, 0x000000, 1, true)
  602. if data[p].inGuild then
  603. ui.addTextArea(45, "<p align='center'><b><font size='22' face='Soopafresh'>"..nameTagFormat(p,22,"N","V").."</font></b>\n<font size='22' face='Soopafresh'>"..guilds[data[p].guild_table].name.."</font></b></p>\n\n", n, 150, 54, 500, 290, 0x193542, 0x47707d, 1, true)
  604. else
  605. ui.addTextArea(45, "<p align='center'><b><font size='22' face='Soopafresh'>"..nameTagFormat(p,22,"N","V").."</font></b>", n, 150, 54, 500, 290, 0x193542, 0x47707d, 1, true)
  606. end
  607. ui.addTextArea(46, "", n, 565, 130, 75, 75, 0x0b161c, 0x0b161c, 1, true)
  608. ui.addTextArea(47, "", n, 398, 316, 202, 22, 0x47707d, 0x000000, 1, true)
  609. ui.addTextArea(48, "<p align='center'><a href='event:close_profile'>"..text[n].closebutton, n, 400, 318, 200, 20, 0x38516b, 0x47707d, 1, true)
  610. ui.addTextArea(49, "", n, 341, 245, 301, 60, 0x0b161c, 0x0b161c, 1, true)
  611. ui.addTextArea(50, "<font size='15'>"..text[n].wins.." : "..data[p].wins.."\n\n"..text[n].losses.." : "..data[p].losses.."\n\n"..text[n].rounds.." : "..data[p].rounds.."", n, 343, 123, 205, 100, 0x193542, 0x193542, 1, true)
  612. if n==p then
  613. ui.addTextArea(51, "<p align='center'><b>Cannon</b></p>\n\n<font color='#193542'>000</color><V><b>Offset X: </b><N>"..data[p].x[49].." <CH>[<a href='event:49x+'>+</a>] [<a href='event:49x-'>-</a>] [<a href='event:49dx'>D</a>]\n<font color='#193542'>000</color><V><b>Offset Y: </b><N>"..data[p].y[49].." <CH>[<a href='event:49y+'>+</a>] [<a href='event:49y-'>-</a>] [<a href='event:49dy'>D</a>]\n<p align='center'><N><b>Plank</b></p>\n\n<font color='#193542'>000</color><V><b>Offset X: </b><N>"..data[p].x[50].." <CH>[<a href='event:50x+'>+</a>] [<a href='event:50x-'>-</a>] [<a href='event:50dx'>D</a>]\n<font color='#193542'>000</color><V><b>Offset Y: </b><N>"..data[p].y[50].." <CH>[<a href='event:50y+'>+</a>] [<a href='event:50y-'>-</a>] [<a href='event:50dy'>D</a>]\n<p align='center'><N><b>Anvil</b></p>\n\n<font color='#193542'>000</color><V><b>Offset X: </b><N>"..data[p].x[51].." <CH>[<a href='event:51x+'>+</a>] [<a href='event:51x-'>-</a>] [<a href='event:51dx'>D</a>]\n<font color='#193542'>000</color><V><b>Offset Y: </b><N>"..data[p].y[51].." <CH>[<a href='event:51y+'>+</a>] [<a href='event:51y-'>-</a>] [<a href='event:51dy'>D</a>]\n", n, 155, 82, 167, 256, 0x193542, 0x193542, 0, true)
  614. else
  615. ui.addTextArea(51, "<p align='center'><b>Cannon</b></p>\n<font color='#193542'>000</color><V><b>Offset X: </b><N>"..data[p].x[49].." \n<font color='#193542'>000</color><V><b>Offset Y: </b><N>"..data[p].y[49].."\n<p align='center'><b>Plank</b></p>\n<font color='#193542'>000</color><V><b>Offset X: </b><N>"..data[p].x[50].." \n<font color='#193542'>000</color><V><b>Offset Y: </b><N>"..data[p].y[50].." \n<p align='center'><b>Anvil</b></p>\n<font color='#193542'>000</color><V><b>Offset X: </b><N>"..data[p].x[51].." \n<font color='#193542'>000</color><V><b>Offset Y: </b><N>"..data[p].y[51].." \n", n, 155, 82, 167, 256, 0x193542, 0x193542, 0, true)
  616. end
  617. id["shop1"][n]=tfm.exec.addImage("1611e2cb8a3.png", "&1", 260, 207, n)
  618. id["shop2"][n]=tfm.exec.addImage("1611e2ce0e0.png", "&2", 270, 80, n)
  619. id["shop3"][n]=tfm.exec.addImage("1611e2cf8f7.png", "&3", 260, 158, n)
  620. id["badge5"][n]=tfm.exec.addImage(data[p].badges[5], "&4", 580, 250, n)
  621. id["badge4"][n]=tfm.exec.addImage(data[p].badges[4], "&5", 520, 250, n)
  622. id["badge3"][n]=tfm.exec.addImage(data[p].badges[3], "&6", 460, 250, n)
  623. id["badge2"][n]=tfm.exec.addImage(data[p].badges[2], "&7", 400, 250, n)
  624. id["badge1"][n]=tfm.exec.addImage(data[p].badges[1], "&8", 340, 250, n)
  625. id["primage"][n]=tfm.exec.addImage(characters[data[p].character]["left"][data[p].id]..".png", "&9", 565, 130, n)
  626. end
  627.  
  628. function newBadge(n,badge,bn)
  629. close(n,true,true,true,true,true,true)
  630. ui.addTextArea(59, "", n, 309, 119, 182, 162, 0x47707d, 0x000000, 1, true)
  631. ui.addTextArea(60, "<p align='center'><font face='Soopafresh' size='13'>"..text[n].newbadge, n, 310, 120, 180, 160, 0x193542, 0x47707d, 1, true)
  632. ui.addTextArea(61, "", n, 334, 248, 132, 22, 0x47707d, 0x000000, 1, true)
  633. ui.addTextArea(62, "<p align='center'><font size='2'><font size='12'><a href='event:close_badge'>"..text[n].closebutton, n, 335, 248, 130, 20, 0x38516b, 0x47707d, 1, true)
  634. data[n].badges[bn]=badge
  635. id["badge"][n]=tfm.exec.addImage(data[n].badges[bn], "&1", 375, 175, n)
  636. end
  637.  
  638. function closeBadge(n)
  639. for a=59,62 do
  640. ui.removeTextArea(a,n)
  641. end
  642. if id["badge"][n] then tfm.exec.removeImage(id["badge"][n],n) id["badge"][n]=nil end
  643. end
  644.  
  645. function Help(n,g,c,r)
  646. close(n,true,true,true,true,true,true)
  647. open[n]=true
  648. ui.addTextArea(54, "", n, 189, 39, 422, 350, 0x47707d, 0x000000, 1, true)
  649. if g then
  650. ui.addTextArea(52, "<p align='center'><a href='event:commands'>"..text[n].commandsbutton, n, 87, 120, 100, 23, 0x193542, 0x193542, 1, true)
  651. ui.addTextArea(58, "<p align='center'><a href='event:credits'>"..text[n].creditsbutton, n, 87, 170, 100, 23, 0x193542, 0x193542, 1, true)
  652. ui.addTextArea(53, "<p align='center'>"..text[n].gameplaybutton, n, 87, 70, 100, 23, 0x193542, 0x47707d, 1, true)
  653. ui.addTextArea(55, "", n, 190, 39, 420, 348, 0x193542, 0x47707d, 1, true)
  654. id["help"][n]=tfm.exec.addImage("1622c48a5a2.png", "&1", 202, 51, n)
  655. elseif c then
  656. ui.addTextArea(52, "<p align='center'>"..text[n].commandsbutton, n, 87, 120, 100, 23, 0x193542, 0x47707d, 1, true)
  657. ui.addTextArea(53, "<p align='center'><a href='event:gameplay'>"..text[n].gameplaybutton, n, 87, 70, 100, 23, 0x193542, 0x193542, 1, true)
  658. ui.addTextArea(58, "<p align='center'><a href='event:credits'>"..text[n].creditsbutton, n, 87, 170, 100, 23, 0x193542, 0x193542, 1, true)
  659. ui.addTextArea(55, text[n].commands, n, 190, 39, 420, 348, 0x193542, 0x47707d, 1, true)
  660. else
  661. ui.addTextArea(52, "<p align='center'><a href='event:commands'>"..text[n].commandsbutton, n, 87, 120, 100, 23, 0x193542, 0x193542, 1, true)
  662. ui.addTextArea(53, "<p align='center'><a href='event:gameplay'>"..text[n].gameplaybutton, n, 87, 70, 100, 23, 0x193542, 0x193542, 1, true)
  663. ui.addTextArea(58, "<p align='center'>"..text[n].creditsbutton, n, 87, 170, 100, 23, 0x193542, 0x47707d, 1, true)
  664. ui.addTextArea(55, text[n].credits, n, 190, 39, 420, 348, 0x193542, 0x47707d, 1, true)
  665. end
  666. ui.addTextArea(56, "", n, 199, 360, 222, 22, 0x47707d, 0x000000, 1, true)
  667. ui.addTextArea(57, "<p align='center'><font size='2'><font size='12'><a href='event:close_help'>"..text[n].closebutton, n, 200, 360, 220, 20, 0x38516b, 0x47707d, 1, true)
  668. end
  669.  
  670. function closeHelp(n)
  671. for a=52,58 do
  672. ui.removeTextArea(a,n)
  673. end
  674. if id["help"][n] then tfm.exec.removeImage(id["help"][n],n) id["help"][n]=nil end
  675. open[n]=false
  676. end
  677.  
  678. function closeProfile(n)
  679. for a=44,51 do
  680. ui.removeTextArea(a,n)
  681. end
  682. for k,v in pairs({"shop1","shop2","shop3","badge1","badge2","badge3","badge4","badge5","primage"}) do
  683. if id[v][n] then tfm.exec.removeImage(id[v][n],n) id[v][n]=nil end
  684. end
  685. open[n]=false
  686. end
  687.  
  688. function plus(n,id,cns)
  689. data[n].maxx[id]=data[n].maxx[id]+1
  690. data[n].max[id]=data[n].max[id]+1
  691. data[n].coins=data[n].coins-cns
  692. Shop(n)
  693. end
  694.  
  695. function buy(n,id,cns)
  696. data[n].skills[id].can=true
  697. data[n].coins=data[n].coins-cns
  698. ShopSkills(n)
  699. end
  700.  
  701. function xy(n,xy,id,thing)
  702. data[n][xy][id]=thing
  703. Profile(n,n)
  704. end
  705.  
  706. function closeGuilds(n)
  707. for a=1,6 do
  708. ui.removeTextArea(a,n)
  709. end
  710. for k,v in pairs({"logo","logo1","logo2","logo3","logo4"}) do
  711. if id[v][n] then tfm.exec.removeImage(id[v][n],n) id[v][n]=nil end
  712. end
  713. open[n]=false
  714. end
  715.  
  716. function closeShop(n)
  717. for a=27,42 do
  718. ui.removeTextArea(a,n)
  719. end
  720. for k,v in pairs({"shop1","shop2","shop3"}) do
  721. if id[v][n] then tfm.exec.removeImage(id[v][n],n) id[v][n]=nil end
  722. end
  723. open[n]=false
  724. end
  725.  
  726. function eventTextAreaCallback(ids,n,cb)
  727. if guilds[cb] then
  728. data[n].inGuild=true
  729. guilds[cb]["members"][n]=true
  730. data[n].guild=guilds[cb].name
  731. data[n].guild_table=cb
  732. guilds[cb].membersNumber=guilds[cb].membersNumber+1
  733. guilds[cb].inRoomMembers=guilds[cb].inRoomMembers+1
  734. guilds[cb].inRoom[n]=true
  735. Guild(n)
  736. if data[n].badges[1]=="1622a220aa8.png" then
  737. newBadge(n,"1622a220aa8.png",1)
  738. end
  739. elseif characters[cb] then
  740. Character(n,cb)
  741. elseif cb=="members" then
  742. if guilds[data[n].guild_table].membersNumber~=guilds[data[n].guild_table].inRoomMembers then
  743. tfm.exec.chatMessage("<N>"..text[n].gm.." :-\n<J>"..table.concat(guilds[data[n].guild_table].inRoom," <BL>-<J> ",tostring).."<BL> - "..table.concat(guilds[data[n].guild_table].notInRoom," - ",tostring),n)
  744. else
  745. tfm.exec.chatMessage("<N>"..text[n].gm.." :-\n<J>"..table.concat(guilds[data[n].guild_table].inRoom," <BL>-<J> ",tostring),n)
  746. end
  747. elseif cb=="guild_close" then
  748. closeGuilds(n)
  749. elseif cb=="leave" then
  750. data[n].inGuild=false
  751. guilds[data[n].guild_table].members[n]=nil
  752. guilds[data[n].guild_table].membersNumber=guilds[data[n].guild_table].membersNumber-1
  753. guilds[data[n].guild_table].inRoomMembers=guilds[data[n].guild_table].inRoomMembers-1
  754. guilds[data[n].guild_table].notInRoom[n]=nil
  755. guilds[data[n].guild_table].inRoom[n]=nil
  756. data[n].guild="No Guild Yet."
  757. closeGuilds(n)
  758. Guilds(n)
  759. if play then
  760. tfm.exec.killPlayer(n)
  761. end
  762. elseif cb=="49x+" and data[n].x[49] <= items[49].max_x then
  763. xy(n,"x",49,data[n].x[49]+1)
  764. elseif cb=="49x-" and -items[49].max_x2 <= data[n].x[49] then
  765. xy(n,"x",49,data[n].x[49]-1)
  766. elseif cb=="49dx" then
  767. xy(n,"x",49,15)
  768. elseif cb=="50x+" and data[n].x[50] <= items[50].max_x then
  769. xy(n,"x",50,data[n].x[50]+1)
  770. elseif cb=="50x-" and -items[50].max_x2 <= data[n].x[50] then
  771. xy(n,"x",50,data[n].x[50]-1)
  772. elseif cb=="50dx" then
  773. xy(n,"x",50,70)
  774. elseif cb=="51x+" and data[n].x[51] <= items[51].max_x then
  775. xy(n,"x",51,data[n].x[51]+1)
  776. elseif cb=="51x-" and -items[51].max_x2 <= data[n].x[51] then
  777. xy(n,"x",51,data[n].x[51]-1)
  778. elseif cb=="51dx" then
  779. xy(n,"x",51,15)
  780. elseif cb=="49y+" and data[n].y[49] <= items[49].max_y then
  781. xy(n,"y",49,data[n].y[49]+1)
  782. elseif cb=="49y-" and -items[49].max_y <= data[n].y[49] then
  783. xy(n,"y",49,data[n].y[49]-1)
  784. elseif cb=="49dy" then
  785. xy(n,"y",49,0)
  786. elseif cb=="50y+" and data[n].y[50] <= items[50].max_y then
  787. xy(n,"y",50,data[n].y[50]+1)
  788. elseif cb=="50y-" and -items[50].max_y <= data[n].y[50] then
  789. xy(n,"y",50,data[n].y[50]-1)
  790. elseif cb=="50dy" then
  791. xy(n,"y",50,-3)
  792. elseif cb=="51y+" and data[n].y[51] <= items[51].max_y then
  793. xy(n,"y",51,data[n].y[51]+1)
  794. elseif cb=="51y-" and -items[51].max_y <= data[n].y[51] then
  795. xy(n,"y",51,data[n].y[51]-1)
  796. elseif cb=="51dy" then
  797. xy(n,"y",51,0)
  798. elseif cb=="close_profile" then
  799. closeProfile(n)
  800. elseif cb=="close_badge" then
  801. closeBadge(n)
  802. elseif cb=="guild" then
  803. if data[n].inGuild then
  804. Guild(n)
  805. else
  806. Guilds(n)
  807. end
  808. elseif cb=="+cannon" and data[n].maxx[49]~=30 and data[n].coins>=3 then
  809. plus(n,49,3)
  810. elseif cb=="+plank" and data[n].maxx[50]~=25 and data[n].coins>=4 then
  811. plus(n,50,4)
  812. elseif cb=="+anvil" and data[n].maxx[51]~=10 and data[n].coins>=5 then
  813. plus(n,51,5)
  814. if data[n].maxx[51]==10 and data[n].badges[3]=="1622a220aa8.png" then
  815. newBadge(n,"1622a21c76a.png",3)
  816. end
  817. elseif cb=="closeshop" then
  818. closeShop(n)
  819. elseif cb=="shop" then
  820. Shop(n)
  821. elseif cb=="profile" then
  822. Profile(n,n)
  823. elseif cb=="skills" then
  824. ShopSkills(n)
  825. elseif cb=="arrow" and data[n].coins>=15 and data[n].skills["arrow"].can==false then
  826. buy(n,"arrow",15)
  827. elseif cb=="snowball" and data[n].coins>=30 and data[n].skills["snowball"].can==false then
  828. buy(n,"snowball",30)
  829. elseif cb=="bombs" and data[n].coins>=50 and data[n].skills["bombs"].can==false then
  830. buy(n,"bombs",50)
  831. if data[n].badges[4]=="1622a220aa8.png" then
  832. newBadge(n,"1622a220aa8.png",4)
  833. end
  834. elseif cb=="commands" then
  835. Help(n,false,true,false)
  836. elseif cb=="gameplay" then
  837. Help(n,true,false,false)
  838. elseif cb=="credits" then
  839. Help(n,false,false,true)
  840. elseif cb=="close_help" then
  841. closeHelp(n)
  842. elseif cb=="help" then
  843. Help(n,true,false,false)
  844. elseif cb=="characters" then
  845. Characters(n)
  846. elseif cb=="next" and p[n].id~=69 then
  847. p[n].id=p[n].id+1
  848. Characters(n)
  849. elseif cb=="pre" and p[n].id~=1 then
  850. p[n].id=p[n].id-1
  851. Characters(n)
  852. elseif cb=="close_list" then
  853. p[n].id=1
  854. closeCharacters(n)
  855. end
  856. end
  857.  
  858. function eventLoop(time,remaining)
  859. if (guilds["ft"].inRoomMembers > 0 and guilds["st"].inRoomMembers > 0) or (guilds["ft"].inRoomMembers > 0 and guilds["ls"].inRoomMembers > 0) or (guilds["st"].inRoomMembers > 0 and guilds["ls"].inRoomMembers > 0) or (guilds["ls"].inRoomMembers > 0 and guilds["bp"].inRoomMembers > 0) or (guilds["bp"].inRoomMembers > 0 and guilds["ft"].inRoomMembers > 0) or (guilds["bp"].inRoomMembers > 0 and guilds["st"].inRoomMembers > 0) then
  860. play=true
  861. else
  862. play=false
  863. end
  864. for i,v in pairs(maps) do
  865. if v.code==map and time >= 3000 and not started then
  866. started=true
  867. end
  868. end
  869. if remaining<=0 then
  870. if play then
  871. newMap()
  872. else
  873. tfm.exec.newGame("@6984945")
  874. end
  875. end
  876. for i,cannon in ipairs(toDespawn) do
  877. if cannon[1] <= os.time()-1500 then
  878. tfm.exec.removeObject(cannon[2])
  879. table.remove(toDespawn,i)
  880. end
  881. end
  882. for n in pairs(tfm.get.room.playerList) do
  883. if open[n] then
  884. for k,v in pairs({"emt1","emt2"}) do
  885. if id[v][n] then tfm.exec.removeImage(id[v][n],n) id[v][n]=nil end
  886. end
  887. else
  888. if data[n].inGuild and play and started and not tfm.get.room.playerList[n].isDead then
  889. attackBoard(n)
  890. end
  891. end
  892. data[n].timer=data[n].timer+0.5
  893. if not mouse[n] then
  894. if data[n].timer==60 then
  895. if data[n].id~=characters[data[n].character]["ids"] then
  896. data[n].id=data[n].id+1
  897. Character(n,data[n].character)
  898. else
  899. data[n].id=1
  900. Character(n,data[n].character)
  901. end
  902. data[n].timer=0
  903. end
  904. end
  905. end
  906. end
  907.  
  908. function loop(fnc, ticks)
  909. local s = 1000/ticks
  910. local timers = {}
  911. for t = 0, 1000 - s, s do
  912. system.newTimer(function () table.insert(timers, system.newTimer(fnc, 1000, true)) end, 1000 + t, false)
  913. end
  914. return timers
  915. end
  916.  
  917. loop(function()
  918. for n in next,tfm.get.room.playerList do
  919. p[n].x=tfm.get.room.playerList[n].x
  920. p[n].y=tfm.get.room.playerList[n].y
  921. end
  922. end, 5)
  923.  
  924.  
  925. function eventChatCommand(n,cmd)
  926. local c={}
  927. for i in cmd:gmatch('[^%s]+') do
  928. table.insert(c,i)
  929. end
  930. c[1]=c[1]:lower()
  931. local found,index=table.find(characters,cmd:lower(),"name",string.lower)
  932. if found then
  933. local character=characters[index]
  934. data[n].id=1
  935. Character(n,index)
  936. end
  937. if c[1]=="guild" then
  938. if data[n].inGuild then
  939. Guild(n)
  940. else
  941. Guilds(n)
  942. end
  943. elseif c[1]=="shop" then
  944. Shop(n)
  945. elseif c[1]=="lang" then
  946. text[n]=lang[c[2]] or text[n]
  947. elseif c[1]=="map" and n=="Bodykudo#0000" then
  948. newMap()
  949. elseif c[1]=="help" then
  950. Help(n,true,false,false)
  951. elseif c[1]=="random" then
  952. data[n].id=1
  953. Character(n,names[math.random(#names)])
  954. elseif c[1]=="mouse" then
  955. mouse[n]=true
  956. tfm.exec.chatMessage(text[n].mouse,n)
  957. elseif c[1]=="characters" or c[1]=="list" then
  958. Characters(n)
  959. elseif c[1]=="profile" then
  960. if c[2] then
  961. if data[c[2]] then
  962. Profile(n,c[2])
  963. end
  964. else
  965. Profile(n,n)
  966. end
  967. end
  968. end
  969.  
  970. for i=1,#c do
  971. system.disableChatCommandDisplay(c[i],true)
  972. end
  973.  
  974. if play then
  975. newMap()
  976. else
  977. tfm.exec.newGame("@6984945")
  978. end
  979. table.foreach(tfm.get.room.playerList,eventNewPlayer)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement