fly = false chamane = false vampire = false bootcamp = false survivor = false quizz = false -- Liste des commandes commands = {"stop", "time", "color", "kill", "ch", "respawn", "meep", "help", "bc", "next"} -- Liste des cartes bootcamp pouvant être jouées (en attendant de pouvoir jouer une carte aléatoire d'une rotation) bootcampMaps = {"@1427980", "@161434", "@216173", "@172621", "@500000", "@3908151", "@512887","@374995", "@306365", "@155606", "@333002", "@172547", "@3734998", "@1737914", "@2989803", "@3136410", "@438449", "@976944", "@1595965", "@1636814", "@2009003", "@3804078", "@3768117", "@3799357", "@3278138", "@3311534", "@3779861", "@3576303", "@3780618", "@2789121", "@2811229", "@3659983", "@3759157", "@597804", "@2998268", "@2132250", "@3745158", "@3338283", "@3062939", "@3137929", "@3560999", "@3182487", "@3725142", "@3012311", "@3493456", "@343456", "@208056", "@881158", "@492399", "@268915", "@505619", "@397469", "@729863", "@184648", "@156720", "@541693"} -- Liste des cartes survivor pouvant être jouées (en attendant de pouvoir jouer une carte aléatoire d'une rotation) survivorMaps = {"@3540608","@492283","@1026249","@1545834","@1659906","@1659906","@3295213","@3699989","@741041","@489470","@395246","@292672","@306106","@3584123","@1522692","@3107377","@2387888","@3685564","@787131","@2408376","@3670885","@3620709","@3584826","@3587860","@3549404","@481676","@3550350","@3480467"} -- Durée d'un bootcamp (défaut: 6min soit 360 secondes) bootcampDuration = 360 tfm.exec.disableAfkDeath(true) tfm.exec.newGame() function eventNewPlayer(playerName) displayCredits(playerName) tfm.exec.bindKeyboard(playerName, 79, true) tfm.exec.bindKeyboard(playerName, 80, true) tfm.exec.respawnPlayer(playerName) if fly==true then tfm.exec.bindKeyboard(playerName,32,true) end if chamane==true then tfm.exec.setShaman(playerName) end end function eventPlayerDied(playerName) if bootcamp==true then tfm.exec.respawnPlayer(playerName) end if chamane==true then tfm.exec.setShaman(playerName) tfm.exec.respawnPlayer(playerName) end if survivor==true then tfm.exec.setPlayerScore(playerName, 1, true) if tfm.get.room.playerList[playerName].isShaman==true then tfm.exec.setPlayerScore(p, 0, false) tfm.exec.newGame(survivorMaps[math.random(#survivorMaps)]) for p,_ in pairs(tfm.get.room.playerList) do if tfm.get.room.playerList[p].isShaman==false then if tfm.get.room.playerList[p].isDead==false then tfm.exec.setPlayerScore(p, math.random(3) + 15, true) end end end else survivorShaman = "" nbSurv = 0 for p,_ in pairs(tfm.get.room.playerList) do if tfm.get.room.playerList[p].isShaman==false then if tfm.get.room.playerList[p].isDead==false then nbSurv = nbSurv + 1 end else survivorShaman = p end end if nbSurv <= 1 then tfm.exec.setPlayerScore(survivorShaman, 0, false) tfm.exec.newGame(survivorMaps[math.random(#survivorMaps)]) for p,_ in pairs(tfm.get.room.playerList) do if tfm.get.room.playerList[p].isShaman==false then if tfm.get.room.playerList[p].isDead==false then tfm.exec.setPlayerScore(p, math.random(3) + 15, true) end end end end end end end function eventPlayerWon(playerWon) if bootcamp==true then tfm.exec.respawnPlayer(playerWon) tfm.exec.setPlayerScore(playerWon, 20, true) end end function eventNewGame() displayCredits(nil) for p,_ in pairs(tfm.get.room.playerList) do tfm.exec.bindKeyboard(p,79,true) tfm.exec.bindKeyboard(p,80,true) if fly==true then tfm.exec.bindKeyboard(p,32,true) end if chamane==true then tfm.exec.setShaman(p) end end if vampire==true then hasVampired = false tfm.exec.setUIMapName("Mini-jeu : Vampire") end if fly==true then tfm.exec.setUIMapName("Mini-jeu : Fly") end if chamane==true then tfm.exec.setUIShamanName("Tout le monde !") tfm.exec.setUIMapName("Mini-jeu : Chamane") end if bootcamp==true then tfm.exec.setUIMapName("Mini-jeu : Bootcamp") end if survivor==true then tfm.exec.setUIMapName("Mini-jeu : Survivor") end end function eventKeyboard(playerName, keyCode, True, x, y) if keyCode==79 then displayGestionnaire(false, playerName) end if keyCode==80 then ui.addPopup(1, 2, "Entrez le code de la map que vous voulez jouer :", playerName, 300, 150, 200) end if fly==true then if keyCode==32 then tfm.exec.movePlayer(playerName, playerName.x, playerName.y, false, 0, -50, off) end end end function eventPopupAnswer(popupId, playerName, answer) if popupId==1 then if answer~="" then activate() tfm.exec.newGame(answer) end end end hasVampired = false function eventLoop(currentTime, timeRemaining) if vampire==true then if hasVampired==false then if timeRemaining<=105000 then tfm.exec.setVampirePlayer(randomPlayer()) hasVampired = true end end end if bootcamp==true then if timeRemaining<=0 then tfm.exec.newGame(bootcampMaps[math.random(#bootcampMaps)]) tfm.exec.setGameTime(bootcampDuration) end end if survivor==true then if timeRemaining<=0 then for p,_ in pairs(tfm.get.room.playerList) do if tfm.get.room.playerList[p].isShaman==false then tfm.exec.setPlayerScore(p, math.random(3) + 15, true) else tfm.exec.setPlayerScore(p, 0, false) end end tfm.exec.newGame(survivorMaps[math.random(#survivorMaps)]) end end end function eventChatCommand(playerName, message) if message=="stop" then activate() tfm.exec.newGame() end if message=="next" then if bootcamp==true then tfm.exec.disableAutoScore(true) tfm.exec.disableAutoShaman(true) tfm.exec.disableAfkDeath(true) tfm.exec.disableAutoTimeLeft(true) tfm.exec.disableAutoNewGame(true) tfm.exec.newGame(bootcampMaps[math.random(#bootcampMaps)]) tfm.exec.setGameTime(bootcampDuration) end end if message:sub(0, 2)=="bc" then if bootcamp==true then tfm.exec.disableAutoScore(true) tfm.exec.disableAutoShaman(true) tfm.exec.disableAfkDeath(true) tfm.exec.disableAutoTimeLeft(true) tfm.exec.disableAutoNewGame(true) tfm.exec.newGame(message:sub(4)) tfm.exec.setGameTime(bootcampDuration) end end if message:sub(0,4)=="time" then tfm.exec.setGameTime(message:sub(6)) end if message:sub(0,5)=="color" then if string.len(message) > 6 then tfm.exec.setNameColor(playerName, "0x"..message:sub(7).."") end end if message=="kill" then tfm.exec.killPlayer(playerName) end if message=="ch" then tfm.exec.setPlayerScore(playerName, 9001, add) end if message=="respawn" then if chamane==true then tfm.exec.setShaman(playerName) end if survivor==false then tfm.exec.respawnPlayer(playerName) end end if message=="meep" then tfm.exec.giveMeep(playerName) end if message=="help" then displayHelp(false, playerName) end end function eventTextAreaCallback(textAreaId, playerName, callback) if callback=="callbackClose" then displayHelp(true, playerName) elseif callback=="callbackCommands" then displayHelp(true, playerName) displayCommands(false, playerName) elseif callback=="callbackCloseCommands" then displayCommands(true, playerName) elseif callback=="callbackAccueilCommands" then displayCommands(true, playerName) displayHelp(false, playerName) elseif callback=="callbackMinijeux" then displayHelp(true, playerName) displayMinijeux(false, playerName) elseif callback=="callbackCloseMinijeux" then displayMinijeux(true, playerName) elseif callback=="callbackAccueilMinijeux" then displayMinijeux(true, playerName) displayHelp(false, playerName) elseif callback=="callbackCloseGestionnaire" then displayGestionnaire(true, playerName) elseif callback=="callbackBootcamp" then displayGestionnaire(true, playerName) activate("bootcamp") elseif callback=="callbackChamane" then displayGestionnaire(true, playerName) activate("chamane") elseif callback=="callbackFly" then displayGestionnaire(true, playerName) activate("fly") elseif callback=="callbackVampire" then displayGestionnaire(true, playerName) activate("vampire") elseif callback=="callbackSurvivor" then displayGestionnaire(true, playerName) activate("survivor") elseif callback=="callbackStop" then displayGestionnaire(true, playerName) activate(nil) end end function displayHelp(doClose, playerName) if doClose==true then ui.removeTextArea(3, playerName) ui.removeTextArea(4, playerName) ui.removeTextArea(5, playerName) ui.removeTextArea(6, playerName) else ui.addTextArea(3, "
Aide
Commandes
Mini-jeux
Gestionnaire de mini-jeux
Veuillez selectionner le mini-jeu désiré :", playerName, 200, 100, 400, 235, 0x324650, 0x6A8FA2, 1f)
else
ui.addTextArea(13, "
Gestionnaire de mini-jeux
Veuillez selectionner le mini-jeu désiré :", playerName, 200, 100, 400, 200, 0x324650, 0x6A8FA2, 1f)
end
ui.addTextArea(14, "x", playerName, 205, 105, 20, 30, 0x324650, 0x324650, 1f)
ui.addTextArea(15, "