sexta-feira, 13 de dezembro de 2013

[LUA] Shaman attack

[ é recomendado jogar o script em tribos cheias ]
[ Mude o nome "Ilhaqjo" pelo seu nome ]
Mate os outros shamans! todos terão 3 vidas. tente ser o único sobrevivente.
Clique em "Mais informações" para ter acesso ao script!

admins={"Ilhaqjo"};
data={};
vivos=0;
-- Dar data
for player in pairs(tfm.get.room.playerList) do
newData={
 ["vidas"]=3;
 };
 data[player] = newData;
 end
 -- Mapas
mapas={[[0]],[[1]],[[2]],[[3]],[[4]],[[5]],[[6]],[[11]],[[12]],[[13]],[[14]],[[15]],[[16]],[[17]],[[18]],[[19]],[[20]],[[21]],[[22]],[[24]],[[25]],[[26]],[[28]],[[29]],[[30]],[[31]],[[32]],[[33]],[[34]],[[35]],[[36]],[[37]],[[38]],[[39]],[[40]],[[41]],[[42]],[[43]],[[44]],[[45]],[[46]],[[47]],[[48]],[[49]],[[50]],[[51]],[[52]],[[53]],[[54]],[[55]],[[56]],[[57]],[[58]],[[59]],[[60]],[[61]],[[62]],[[63]],[[64]],[[65]],[[66]],[[67]],[[68]],[[69]],[[70]],[[71]],[[72]],[[73]],[[74]],[[75]],[[76]],[[77]],[[78]],[[79]],[[80]],[[81]],[[82]],[[83]],[[84]],[[85]],[[86]],[[87]],[[88]],[[89]],[[90]],[[91]],[[92]],[[93]],[[95]],[[96]],[[97]],[[98]],[[99]],[[100]],[[110]],[[114]],[[115]],[[116]],[[117]],[[118]],[[119]],[[120]],[[121]],[[122]],[[123]],[[124]],[[125]],[[126]],[[127]],[[128]],[[129]],[[130]],[[131]],[[132]],[[133]],[[134]],[[136]],[[137]],[[138]],[[139]],[[140]],[[141]],[[142]],[[143]],[[200]],[[201]],[[202]],[[203]],[[204]],[[205]],[[206]],[[207]],[[208]],[[209]],[[210]]};
 -- Inicio do script

function eventPlayerWon(player)
nextRound() 
tfm.exec.setPlayerScore(player,10,true)
end

tfm.exec.disableAutoNewGame(true)
tfm.exec.newGame(mapas[math.random(#mapas)])
tfm.exec.disableAutoShaman(true)
tfm.exec.disableAutoScore(true)

 -- Novo round

function nextRound()
    tfm.exec.newGame(mapas[math.random(#mapas)]);
end

-- Novo jogo se inicia

function eventNewGame()
vivo=0
for player in pairs(tfm.get.room.playerList) do
data[player].vidas = 3;
vivo=vivo+1
tfm.exec.setShaman(player)
end
tfm.exec.setUIShamanName("Todos são shaman!")
tfm.exec.setUIMapName("Shaman Attack");
end
 -- Jogador morre
function eventPlayerDied(player)
data[player].vidas=data[player].vidas-1;
if data[player].vidas >= 1 then
tfm.exec.respawnPlayer(player)
end
if data[player].vidas <= 0 then
vivo=vivo-1;
end
end
 -- Loop
function eventLoop(tempoFaltando, tempoPassado)
    if vivo == 0 or tempoFaltando < 1000 then
        nextRound();
    end
     for player in pairs(tfm.get.room.playerList) do
                if data[player].vidas == 3 then
                tfm.exec.displayParticle(5,30,35,0,0, 0, 0, player)
                tfm.exec.displayParticle(5,60,35,0,0, 0, 0, player)
                tfm.exec.displayParticle(5,90,35,0,0, 0, 0, player)
                end
                if data[player].vidas == 2 then
                tfm.exec.displayParticle(5,30,35,0,0, 0, 0, player)
                tfm.exec.displayParticle(5,60,35,0,0, 0, 0, player)
                end
                if data[player].vidas == 1 then
                tfm.exec.displayParticle(5,30,35,0,0, 0, 0, player)
                end
        end
end
-- Novo jogador entra na partida
function eventNewPlayer(player)
newData={
 ["vidas"]=0;
 };
 data[player] = newData;
 end
 -- Um item é invocado
function eventSummoningEnd(player,id,x,y,ang,xs,ys,other)
        if id == 4 then
   tfm.exec.removeObject(other.id)
   end
           if id == 3 then
   tfm.exec.removeObject(other.id)
end
end
 -- Comandos
function eventChatCommand(nome, cmd)
  if cmd=="comandos" then
  ui.addTextArea(2,0,"Comandos serão desenvolvidos em breve. Caso encontre algum bug ou queira fazer um melhoramento cochiche comigo ou então comente no Tópico oficial na seção Modules",nome,200,70,360);
  end
end
-- Popup inicial
ui.addPopup(0, 0,[[Bem vindo ao minigame Shaman Race! Terá de matar todos os shamans e em seguida completar o mapa! Atenção todos os shamans tem 3 vidas!
Digite !Comandos para a lista completa de comandos. Minigame criado por Ilhaqjo. Sem o Brenower a realização deste minigame seria imposivel.]], NIL, 140, 60, 430)








3 comentários: