Ir para conteúdo
  • Cadastre-se

Posts Recomendados

Bom galera, to precisando MUITO e URGENTE de um sistema de Torneio PVP de Sobrevivencia tipo:

 

Explicação:

O torneio tem que acontecer 3 vezes por dia. Fica um NPC na CP, dai vc fala com ele e não precisa pagar nada, dai vai pra uma area de espera até começar o evento, dai fica aparecendo mensagens tipo "3 minutos para o Evento." dps "2 Minutos para  o Evento." dps "1 Minuto para o Evento.", "30 Segundos para o Evento" dai quando acaba-se o tempo aparecia "Evento fechado." dai ninguem mais poderia participar do evento. Só os que já estava lá dentro. Ai quando aparece-se "Evento Fechado." os player's que estava na area de espera eram Teleportados para a "Arena de Sobrevivencia." Dai ficava PLAYER vs PLAYER até que sobre um unico player na arena. quando restar apenas 1 player ele receberá o seu premio que irá aparecer dentro da bag.

 

Por favor me ajudem nisso, to precisando Muitoo :3  

Editado por principe sharingan (veja o histórico de edições)

eR3Xwgv.png?1
 

Link para o post
Compartilhar em outros sites

Resumindo você quer um zombie event sem os zombie

Mais vale a lagrima da derrota doque a Covardia de não ter lutado , Prefiro morrer de Pé do que sempre viver ajoelhado.

Kaio santos "soldier killed"

Link para o post
Compartilhar em outros sites

Foi oque disse é o mesmo sistema do zombie event mais sem os zombi

Mais vale a lagrima da derrota doque a Covardia de não ter lutado , Prefiro morrer de Pé do que sempre viver ajoelhado.

Kaio santos "soldier killed"

Link para o post
Compartilhar em outros sites

Foi oque disse é o mesmo sistema do zombie event mais sem os zombi

Então poderia me passar este sistema sem os Zombie ?

eR3Xwgv.png?1
 

Link para o post
Compartilhar em outros sites

Então poderia me passar este sistema sem os Zombie ?

Bom

http://tibiaking.com/forum/topic/11192-instalando-zombie-event/

 

Acho que é so você não adicionar essa parte

/data/globalevents/scripts/zombie/onthink.lua

 

E não adicionar a parte dos monstros !

 

E editar a Msg que vai aparecer para os players ao seu gosto !

Mais vale a lagrima da derrota doque a Covardia de não ter lutado , Prefiro morrer de Pé do que sempre viver ajoelhado.

Kaio santos "soldier killed"

Link para o post
Compartilhar em outros sites

Bom

http://tibiaking.com/forum/topic/11192-instalando-zombie-event/

 

Acho que é so você não adicionar essa parte

/data/globalevents/scripts/zombie/onthink.lua

 

E não adicionar a parte dos monstros !

 

E editar a Msg que vai aparecer para os players ao seu gosto !

 

Mano não é por comando, é tipo: quando der um certo horario se o player não comparecer no local de espera o evento se fecha e ninguem mais entra. tipo quando chega em um horario o NPC que teleporta o player para o local não teleporta, só começa a teleportar no outro evento que é no outro horario ou no outro dia.

eR3Xwgv.png?1
 

Link para o post
Compartilhar em outros sites

Fonte: Otland - Doggynub
Modificações e tradução de algumas falas do npc e do MOD: Hudsin
Testado em tfs 0.4

O que faz o script:
Sistema de guerra entre 2 times(vermelho e azul),para que a war se inicie é necessário 2 times de 20 players(pode ser mudado no script) além de todos que forem participar precisar falar com o npc Eventer.

Atualizações:
1- GM pode resetar o evento.
2- Players nao pode mudar a cor do outfit durante o evento.
3- Cada 40 segundos é enviado a mensagem avisando quantos players estão participando.


Crie um novo npc em npc/Eventer.xml:

 

 

<?xml version="1.0" encoding="UTF-8"?>

<npc name="Eventer" script="event.lua" walkinterval="2000" floorchange="0">
<health now="100" max="100"/>
<look type="129" head="79" body="113" legs="105" feet="86" addons="0"/>
        <parameters>
                <parameter key="message_greet" value="Ola |PLAYERNAME|. Para entrar na batalha diga {Battle} e para sair diga leave."/>
                <parameter key="message_farewell" value="Good bye."/>
                <parameter key="message_walkaway" value="Farewell then.." />
    </parameters>

</npc>

Agora em npc/script crie Event.lua e cole:

[spoiler]

local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)
local talkState = {}
 
function onCreatureAppear(cid)                npcHandler:onCreatureAppear(cid) end
function onCreatureDisappear(cid)            npcHandler:onCreatureDisappear(cid) end
function onCreatureSay(cid, type, msg)            npcHandler:onCreatureSay(cid, type, msg) end
function onThink()                    npcHandler:onThink() end
 
   
--[[Start edit]]--  
 
       
local mingroup = 4 --(updated) minimum group to reset the event
        local joined = 10000 ---must be like the storage in mod
       
local maxPlayerEachTeam = 20 ---must be like max number in mod
       
local team1Name = "Blue" ---must be like team number i mod
       
local team2Name = "Red"
        local minlevel = 130 --(added) min lvl for a player to join.
 
               
--[[Storage like in the mod file]]--
          local  running1 = 12000 --just add a non ussed storage
         
local running2 = 12001 --just add a non ussed storage
         
local sto = 12223 --just add a non ussed storage
         
--[[Storage end]]--
 
 
 
--[[End of edit]]--
local function getBlue()
        return getGlobalStorageValue(9888)
end
 local function removeBlue()
    return setGlobalStorageValue(9888, getGlobalStorageValue(9888) - 1)
end
local function addBlue()
   return setGlobalStorageValue(9888, getGlobalStorageValue(9888) + 1)
end
local function resetBlue()
      return setGlobalStorageValue(9888,0)
end
 
local function getRed()
        return getGlobalStorageValue(9887)
end
 local function removeRed()
    return setGlobalStorageValue(9887, getGlobalStorageValue(9887) - 1)
end
local function addRed()
   return setGlobalStorageValue(9887, getGlobalStorageValue(9887) + 1)
end
local function resetRed()
      return setGlobalStorageValue(9887,0)
end
--[[Script start]]--
 
function creatureSayCallback(cid, type, msg)
    if(not npcHandler:isFocused(cid)) then
        return false
    end
    local talkUser = NPCHANDLER_CONVBEHAVIOR == CONVERSATION_DEFAULT and 0 or cid
if getPlayerGroupId(cid) >= mingroup then
     npcHandler:say("Oh! Hail, sire. Do you want to reset my event?", cid)
         talkState[talkUser] = 1
      if msgcontains(msg, 'yes') and talkState[talkUser] == 1 then
                     resetBlue()
                 resetRed()
                         setGlobalStorageValue(running1,-1)
                 setGlobalStorageValue(running2,-1)
                 setGlobalStorageValue(sto,-1)
                         npcHandler:say("Event was reseted, sire.", cid)
                         doBroadcastMessage("Eventer: Meu evento foi resetado por ordens do "..getCreatureName(cid)..". Para participar fale comigo outra vez,estou na arena pvp.")
                 for _,cid in ipairs(getPlayersOnline()) do
                    if getPlayerStorageValue(cid, joined) > 0 then
                           setPlayerStorageValue(cid, joined,-1)
                             doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid)), FALSE)
                 doSendMagicEffect(getCreaturePosition(cid), 10)
                         end
                 end
          elseif msgcontains(msg, 'yes') and talkState[talkUser] == 1 then
            npcHandler:say("As You wish, sire.", cid)
             talkState[talkUser] = 0
         end
else
    if msgcontains(msg, 'battle') then
             if getGlobalStorageValue(running2) == 1 then  
             npcHandler
:say("Ja tem batalha em andamento,tente mais tarde.", cid)
         elseif getPlayerLevel(cid) < minlevel then
                 npcHandler:say("Apenas level 130+ pode participar.",cid)
                 else
         npcHandler:say("Voce esta preparado para a abatalha? Por enquanto temos " .. getBlue() .. "/" .. maxPlayerEachTeam .. " players no {" .. team1Name .. "} team e " .. getRed() .. "/" .. maxPlayerEachTeam .. " players no {" .. team2Name .. "} team,vc quer escolher algum?", cid)
         talkState[talkUser] = 1
             end
    elseif msgcontains(msg, 'yes') and talkState[talkUser] == 1 then
        if getPlayerStorageValue(cid, joined) ~= 1 and getPlayerStorageValue(cid, joined) ~= 2 then
            npcHandler:say("Vc quer ser do  {" .. team1Name .. "} team  ou {" .. team2Name .. "} team?", cid)
            talkState[talkUser] = 2
        else
            npcHandler:say("Vc esta cadastrado!", cid)
            talkState[talkUser] = 0
        end
    elseif msgcontains(msg, 'no') and talkState[talkUser] == 1 then
        npcHandler:say("Okay then.", cid)
        talkState[talkUser] = 0
    elseif msgcontains(msg, team1Name) and talkState[talkUser] == 2 then
        if getBlue() ~= maxPlayerEachTeam then --fixed
            setPlayerStorageValue(cid, joined, 1)
           addBlue()
            npcHandler:say("Vc entrou no " .. team1Name .. " team! Quando ambas equipes tiverem " .. maxPlayerEachTeam .. " os players serao teleportados para arena de batalha.", cid)
 
            talkState
[talkUser] = 0
        else
            npcHandler:say("{" .. team1Name .. "} team esta cheio, entre no {" .. team2Name .. "} team ou espere alguem sair do {" .. team1Name .. "} team.", cid) --fixed
            talkState[talkUser] = 1
        end
    elseif msgcontains(msg, team2Name) and talkState[talkUser] == 2 then
        if getRed() ~= maxPlayerEachTeam then --fixed
            setPlayerStorageValue(cid, joined, 2) --fixed
           addRed()
            npcHandler:say("Vc esta no " .. team2Name .. " team! Quando ambas equipes tiverem " .. maxPlayerEachTeam .. " os players serao teleportados para arena de batalha.", cid)
 
            talkState
[talkUser] = 0
        else
            npcHandler:say("{" .. team2Name .. "} team esta cheio, entre no {" .. team1Name .. "} team ou espere alguem sair do {" .. team2Name .. "} team.", cid)
            talkState[talkUser] = 1
        end
 elseif msgcontains(msg, 'leave') then
        npcHandler:say("Vc quer sair da lista de espera para batalha?", cid)
        talkState[talkUser] = 3
    elseif msgcontains(msg, 'yes') and talkState[talkUser] == 3 then
        if getPlayerStorageValue(cid,joined) == 1 then
            setPlayerStorageValue(cid, joined, -1) -- fixed
           removeBlue()
            npcHandler:say("Vc saiu da batalha.", cid)
            doBroadcastMessage("Event: " .. getPlayerName(cid) .. " saiu da batalha " .. team1Name .. " e " .. team2Name .. "!")
        elseif getPlayerStorageValue(cid,joined) == 2 then --fixed
                      setPlayerStorageValue(cid,joined,-1)
              removeRed()
              npcHandler:say("Vc saiu da batalha.", cid)
             doBroadcastMessage("Event: " .. getPlayerName(cid) .. " saiu da batalha " .. team1Name .. " e " .. team2Name .. "!")
                else
            npcHandler:say("Vc nao esta cadastrado!", cid)
        end
        talkState[talkUser] = 0 -- moved
   
end
end    
   
return true
end
npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())

Agora para instalar o MOD crie um novo arquivo Event.xml na pasta mods de seu ot e coloque o seguinte codigo:


<?

xml version="1.0" encoding="UTF-8"?>
<mod name="Team Event" version="1.0" author="Damadgerz" contact="[email protected]" enabled="yes">
 <description>
 
      This is a full auto Team BattleEvent(missing part for site) :
             1- Player will get the ability to talk to the npc event starter to start the event every x times(time between each event)
                 2- players will go to npc and say battle and then join their desired team(you adjust team names) , they also have ability to leave team
                 3- You have ability to set max players per each team, npc will not tp the players to arena except when both teams are full
                 4- Script automatically set the place of event to a pvp arena (players no lose items,levels,geet msg who killed them).Place cant be a non-pvp area.
                 5- if player logged out they will automatically be lifted out from event.
                 6- players in same team cant attack each others even with spells
                 7- each team will have a uniform :)
                 8-you choose where the first team be tped and where the second team be tped
                 9-when event start, you set a max time for event.So if ppl couldnt kill each other( if players in first team = players in second team when event times finish) They will automatically be sent to temple and no one will take reward and broadcast :)
                 10 -during event if max time didnt finish and player of team 1 killed all of those of team2 then players of team1 will be tped to temple broadcasting they won by killing all other members and will recieve a random reward taht you set
                 11 -Then the event will be on hold untill time between each event pass(you set that) , and when it pass a auto broadcast is made every minute to tell player that event is open.
   
</description>
 
<config name="tutorial_m"><![CDATA[
 
    running1 = 12000 --just add a non ussed storage
        running2 = 12001 --just add a non ussed storage
        joined = 10000 --just add a non ussed storage
        sto = 12223 --just add a non ussed storage
        check = 5454 -- empty storage
        redpotision = {x=19068, y=18978, z=7} --place where the red team player be teleported to
    blueposition = {x=19060, y=19052, z=7} --place where the blue team player be teleported to
        stoptime = 2 --in minutes
        team1name = "Blue" --just put the name without
<team>
        team2name = "Red"
        timebetween = 5 -- time between each event
        arena = { frompos = {x=19068,y=18978,z=7}, topos = {x=19060,y=19052,z=7} } ----Put you event area here
        conf = {
                                rewards_id = {2472}, -- Rewards ID
                                maxplayers = 20 ---maxplayers per team
                        }
 ]]>
</config>
 <lib name="football-lib"><![CDATA[
 
function getBlue()
        return getGlobalStorageValue(9888)
end
 function removeBlue()
    return setGlobalStorageValue(9888, getGlobalStorageValue(9888) - 1)
end
function addBlue()
   return setGlobalStorageValue(9888, getGlobalStorageValue(9888) + 1)
end
function resetBlue()
      return setGlobalStorageValue(9888,0)
end
 
function getRed()
        return getGlobalStorageValue(9887)
end
 function removeRed()
    return setGlobalStorageValue(9887, getGlobalStorageValue(9887) - 1)
end
function addRed()
   return setGlobalStorageValue(9887, getGlobalStorageValue(9887) + 1)
end
function resetRed()
      return setGlobalStorageValue(9887,0)
end
function onStop()
        if getGlobalStorageValue(running1) == 1 then
                setGlobalStorageValue(running1, -1)
                setGlobalStorageValue(sto,1)
        end
        return true
end
function onStopp()
        if getGlobalStorageValue(running2) > 0 then
                setGlobalStorageValue(running2,-1)
                doBroadcastMessage("Event : event is started again , go talk to the Evnet's Npc.")
        end
end
 
]]>
</lib>
 
<event type="login" name="Tutorial Login" event="script"><![CDATA[
domodlib('football-lib')
domodlib('tutorial_m')
function onLogin(cid)
        if getPlayerStorageValue(cid,check) > 0 then
                if isInRange(getCreaturePosition(cid), arena.frompos, arena.topos) then
                        doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid)), FALSE)
                        doSendMagicEffect(getCreaturePosition(cid), 10)
                    setPlayerStorageValue(cid,check,-1)
                else
                        setPlayerStorageValue(cid,check,-1)  
                end
        end
        registerCreatureEvent(cid, "Log")
        registerCreatureEvent(cid, "Arena")
        registerCreatureEvent(cid, "Attk")
        return true
end
]]>
</event>
<event type="combat" name="Attk" event="script"><![CDATA[
        domodlib('tutorial_m')
                domodlib('football-lib')
        function onCombat(cid, target)
        if getPlayerStorageValue(cid, joined) == 1 and getPlayerStorageValue(target, joined) == 1 then
 
                return false
        end
                if getPlayerStorageValue(cid, joined) == 2 and getPlayerStorageValue(target, joined) == 2 then
 
                return false
        end
        return true
end
]]>
</event>
 <event type="logout" name="Log" event="script"><![CDATA[
 domodlib('football-lib')
 domodlib('tutorial_m')
 function onLogout(cid)
  if getPlayerStorageValue(cid,joined) == 1 then
    doBroadcastMessage(""..getPlayerName(cid).." have left the War-Event")
    setPlayerStorageValue(cid,joined,-1)
        setPlayerStorageValue(cid,check,1)
        removeBlue()
   return true
   end
   if getPlayerStorageValue(cid,joined) == 2 then
    doBroadcastMessage(""..getPlayerName(cid).." have left the War-Event")
   setPlayerStorageValue(cid,check,1)
        removeRed()
   return true
   end
   return true
  end
 
]]>
</event>
<event type="statschange" name="Arena" event="script"><![CDATA[
domodlib('football-lib')
domodlib('tutorial_m')
local corpse_ids = {
        [0] = 3065, -- female
        [1] = 3058 -- male
}
function onStatsChange(cid, attacker, type, combat, value)
        if combat == COMBAT_HEALING then
                        return true
        end
        if getCreatureHealth(cid) > value then
                        return true
        end
        if isInRange(getCreaturePosition(cid), arena.frompos, arena.topos) then
                doItemSetAttribute(doCreateItem(corpse_ids[getPlayerSex(cid)], 1, getThingPos(cid)), "description", "You recognize "..getCreatureName(cid)..". He was killed by "..(isMonster(attacker) and "a "..string.lower(getCreatureName(attacker)) or isCreature(attacker) and getCreatureName(attacker) or "a field item")..".\n[War-Event kill]")
                doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid)), FALSE)
                doSendMagicEffect(getCreaturePosition(cid), 10)
                doRemoveConditions(cid, FALSE)
                doCreatureAddHealth(cid, getCreatureMaxHealth(cid) - getCreatureHealth(cid))
                doCreatureAddMana(cid, getCreatureMaxMana(cid) - getCreatureMana(cid))
                doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You got killed by "..(isMonster(attacker) and "a "..string.lower(getCreatureName(attacker)) or isCreature(attacker) and getCreatureName(attacker) or "a field item").." in the war event.")
                        if isPlayer(attacker) then
                                        doPlayerSendTextMessage(attacker, MESSAGE_STATUS_CONSOLE_BLUE, "You killed "..getCreatureName(cid).." in the war event.")
                        end
                        if getPlayerStorageValue(cid,joined) == 1 then
                                removeBlue()
                                setPlayerStorageValue(cid,10000,-1)
                        elseif getPlayerStorageValue(cid,joined) == 2 then
                                removeRed()
                                setPlayerStorageValue(cid,10000,-1)
                        end
        end
        return true
end
 
]]>
</event>
 <globalevent name="reset" type="start" event="script"><![CDATA[
 domodlib('football-lib')
 domodlib('tutorial_m')
     function onStartup()
             resetBlue()
          resetRed()
                    setGlobalStorageValue(running1,-1)
  setGlobalStorageValue(running2,-1)
   setGlobalStorageValue(sto,-1)
 
        return true
end
 ]]>
</globalevent>
  <globalevent name="TeamBattle" interval="7" event="script"><![CDATA[
                domodlib('football-lib')
        domodlib('tutorial_m')
 
 
 
local bmale = createConditionObject(CONDITION_OUTFIT)
setConditionParam(bmale, CONDITION_PARAM_TICKS, -1)
addOutfitCondition(bmale, {lookType = math.random(128,134), lookHead = 88, lookBody = 88, lookLegs = 88, lookFeet = 88, lookTypeEx = 0, lookAddons = 3})
 
local bfemale = createConditionObject(CONDITION_OUTFIT)
setConditionParam(bfemale, CONDITION_PARAM_TICKS, -1)
addOutfitCondition(bfemale, {lookType = math.random(136,142), lookHead = 88, lookBody = 88, lookLegs = 88, lookFeet = 88, lookTypeEx = 0, lookAddons = 3})
 
local rmale = createConditionObject(CONDITION_OUTFIT)
setConditionParam(rmale, CONDITION_PARAM_TICKS, -1)
addOutfitCondition(rmale, {lookType = math.random(128,134), lookHead = 94, lookBody = 94, lookLegs = 94, lookFeet = 94, lookTypeEx = 0, lookAddons = 3})
 
local rfemale = createConditionObject(CONDITION_OUTFIT)
setConditionParam(rfemale, CONDITION_PARAM_TICKS, -1)
addOutfitCondition(rfemale, {lookType = math.random(136,142),lookHead = 94, lookBody = 94, lookLegs = 94, lookFeet = 94, lookTypeEx = 0, lookAddons = 3})
 
function onThink(interval, lastExecution)
        local random_item = conf.rewards_id[math.random(1, #conf.rewards_id)]
        if (getBlue() == conf.maxplayers and getRed() == conf.maxplayers) then
                if (getGlobalStorageValue(running1) == -1 and getGlobalStorageValue(sto) == -1) then
                        setGlobalStorageValue(running1,1)
                        doBroadcastMessage("The Team Battle Event have started.And will end in "..stoptime.." minutes, unless one of the teams has killed all the oponents")
                        addEvent(onStop, stoptime * 60 * 1000)
                                for _, cid in ipairs(getPlayersOnline()) do
 
             if getPlayerStorageValue(cid, joined) == 1 then  
                     if getPlayerSex(cid) == 1 then
                        doAddCondition(cid, bmale)
                elseif getPlayerSex(cid) ~= 1 then
                        doAddCondition(cid, bfemale)
                end
                   doTeleportThing(cid, blueposition, FALSE)
            doSendMagicEffect(blueposition, 10)
                 elseif getPlayerStorageValue(cid, joined) == 2 then
                       if getPlayerSex(cid) == 1 then
                 doAddCondition(cid, rmale)
               elseif getPlayerSex(cid) ~= 1 then
                  doAddCondition(cid, rfemale)
               end
                   doTeleportThing(cid, redpotision, FALSE)
            doSendMagicEffect(redpotision, 10)
                 end
                end
      end
        end
        if getGlobalStorageValue(running1) == 1 then
                setGlobalStorageValue(running2,1)
                if (getBlue() >= 1 and getRed() < 1) then
                        addEvent(onStopp, timebetween * 60 * 1000)
                        doBroadcastMessage("The War-Event has finished as the " ..team1name.. " team has killed all players in oponnent team ,they will recieve their rewards.Event will be reopened in ".. timebetween .." minutes")
                elseif (getBlue() < 1 and getRed() >= 1) then
                        doBroadcastMessage("The War-Event has finished as the " ..team2name.. "  team has killed all players in oponnent team,they will recieve their rewards.Event will be reopened in ".. timebetween .." minutes")
                        addEvent(onStopp, timebetween * 60 * 1000)
                end
        for _, cid in ipairs(getPlayersOnline()) do
                        if (getBlue() >= 1 and getRed() < 1) then
                                if getPlayerStorageValue(cid,joined) == 1 then
                                        doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid)), FALSE)
                                        doSendMagicEffect(getCreaturePosition(cid), 10)
                                        doRemoveConditions(cid, FALSE)
                                        doPlayerAddItem(cid, random_item, 1)
                                        doRemoveConditions(cid, FALSE)
                                        doCreatureSay(cid, "You have won a "..getItemNameById(random_item).." as a reward from war event", TALKTYPE_ORANGE_1)
                                        setPlayerStorageValue(cid, joined,-1)
                                        setGlobalStorageValue(running1,-1)
                                        resetBlue()
                                end
                        end
                        if (getBlue() < 1 and getRed() >= 1) then
                                if getPlayerStorageValue(cid,joined) == 2 then
                                        doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid)), FALSE)
                                        doRemoveConditions(cid, FALSE)
                                        doSendMagicEffect(getCreaturePosition(cid), 10)
                                        doRemoveConditions(cid, FALSE)
                                        doPlayerAddItem(cid, random_item, 1)
                                        doCreatureSay(cid, "You have won a "..getItemNameById(random_item).." as a reward from war event", TALKTYPE_ORANGE_1)
                                        setGlobalStorageValue(running1,-1)
                                        setPlayerStorageValue(cid, joined,-1)
                                        resetRed()
                                end
                        end
                end
        end
 
        return true
end
]]>
</globalevent>
<globalevent name="Team" interval="3" event="script"><![CDATA[
domodlib('football-lib')
domodlib('tutorial_m')
 
function onThink(interval, lastExecution)
 
local random_item = conf.rewards_id[math.random(1, #conf.rewards_id)]
        if getGlobalStorageValue(sto) == 1 then
                if (getRed() > getBlue()) then
                        doBroadcastMessage("The War-Event has finished as the " ..team2name.. "  team has killed all players in oponnent team,they will recieve their rewards.Event will be reopened in ".. timebetween .." minutes")
                                for _, cid in ipairs(getPlayersOnline()) do
                                        if getPlayerStorageValue(cid,joined) == 2 then
                                                doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid)), FALSE)
                                                doSendMagicEffect(getCreaturePosition(cid), 10)
                                                doRemoveConditions(cid, FALSE)
                                                doPlayerAddItem(cid, random_item, 1)
                                                doRemoveConditions(cid, FALSE)
                                                doCreatureSay(cid, "You have won a "..getItemNameById(random_item).." as a reward from war event", TALKTYPE_ORANGE_1)
                                                setPlayerStorageValue(cid, joined,-1)
                                        end    
                                        if getPlayerStorageValue(cid,joined) == 1 then
                                                doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid)), FALSE)
                                                doSendMagicEffect(getCreaturePosition(cid), 10)
                                                doPlayerSendTextMessage(cid,24, "Your team has lost in the war event war event")
                                                setPlayerStorageValue(cid, joined,-1)
                                                doRemoveConditions(cid, FALSE)
                                        end                                      
                                end
                                addEvent(onStopp, timebetween * 60 * 1000)
                end
                if (getRed() < getBlue()) then
                        doBroadcastMessage("The War-Event has finished as the " ..team1name.. "  team has killed all players in oponnent team,they will recieve their rewards.Event will be reopened in ".. timebetween .." minutes")
                                for _, cid in ipairs(getPlayersOnline()) do
                                        if getPlayerStorageValue(cid,joined) == 1 then
                                                doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid)), FALSE)
                                                doSendMagicEffect(getCreaturePosition(cid), 10)
                                                doPlayerAddItem(cid, random_item, 1)
                                                doRemoveConditions(cid, FALSE)
                                                doRemoveConditions(cid, FALSE)
                                                doCreatureSay(cid, "You have won a "..getItemNameById(random_item).." as a reward from war event", TALKTYPE_ORANGE_1)
                                                setPlayerStorageValue(cid, joined,-1)
                                        end    
                                        if getPlayerStorageValue(cid,joined) == 2 then
                                                doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid)), FALSE)
                                                doRemoveConditions(cid, FALSE)
                                                doSendMagicEffect(getCreaturePosition(cid), 10)
                                                doPlayerSendTextMessage(cid,24, "Your team has lost in the war event war event")
                                                setPlayerStorageValue(cid, joined,-1)
                                        end                                      
                                end
                                addEvent(onStopp, timebetween * 60 * 1000)
                end
                if (getRed() == getBlue()) then
                        for _, cid in ipairs(getPlayersOnline()) do
                                if getPlayerStorageValue(cid,joined) == 2 or getPlayerStorageValue(cid,joined) == 1 then
                                        doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid)), FALSE)
                                        doRemoveConditions(cid, FALSE)
                                        doSendMagicEffect(getCreaturePosition(cid), 10)
                                        doRemoveConditions(cid, FALSE)
                    setPlayerStorageValue(cid, joined,-1)
                                        doBroadcastMessage("Event max time ended.And niether of the teams won the event.Event will be reopened in ".. timebetween .." minutes")
                                end                      
                        end
                        addEvent(onStopp, timebetween * 60 * 1000)
                end
                resetBlue()
                resetRed()
                setGlobalStorageValue(sto, -1)
        end
        return true
end
]]>
</globalevent>
        <globalevent name="Broad" interval="90" event="script"><![CDATA[
                domodlib('football-lib')
                domodlib('tutorial_m')
 
function onThink(interval, lastExecution)
  if getGlobalStorageValue(running2) == -1 then
    doBroadcastMessage("O evento de batalha está aberto.O npc Eventer precisa de 2 times de 20 pessoas para iniciar a batalhe,ele esta na Arena Pvp que vai por teleport de Carlin. Ja tem "..getBlue().." players no blue team vs "..getRed().." players no Red team,o time vencedor sera premiado.")
        return true
        end
return true
end
 ]]>
</globalevent>
        <globalevent name="Karim" interval="40000" event="script"><![CDATA[
                domodlib('football-lib')
                domodlib('tutorial_m')
 
function onThink(interval, lastExecution)
        if getGlobalStorageValue(running1) > 0 then
                local blue = {}
                local green = {}
                for _, pid in ipairs(getPlayersOnline()) do
                        if isInRange(getCreaturePosition(pid),arena.frompos, arena.topos) then
                                if getPlayerStorageValue(pid, joined) == 1 then  
                                        table.insert(blue,getCreatureName(pid))
                                elseif getPlayerStorageValue(pid, joined) == 2 then  
                                        table.insert(green,getCreatureName(pid))
                                end
                        end
                end
                local greenn = table.concat(green,', ')
                local bluee = table.concat(blue,', ')
                for _, tid in ipairs(getPlayersOnline()) do
                        if getPlayerStorageValue(tid, joined) > 0 then
                                doPlayerSendTextMessage(tid,19,'<
<!-- Players left --!>>\n '..team1name..' team ('..#blue..') : '..bluee..'.\n '..team2name..' team ('..#green..') : '..greenn..'.')
                        end
                end
        end
        return true
end
 ]]></globalevent>
</mod>

Editado por kaio Santos (veja o histórico de edições)

Mais vale a lagrima da derrota doque a Covardia de não ter lutado , Prefiro morrer de Pé do que sempre viver ajoelhado.

Kaio santos "soldier killed"

Link para o post
Compartilhar em outros sites

Fonte: Otland - Doggynub
Modificações e tradução de algumas falas do npc e do MOD: Hudsin
Testado em tfs 0.4

O que faz o script:
Sistema de guerra entre 2 times(vermelho e azul),para que a war se inicie é necessário 2 times de 20 players(pode ser mudado no script) além de todos que forem participar precisar falar com o npc Eventer.

Atualizações:
1- GM pode resetar o evento.
2- Players nao pode mudar a cor do outfit durante o evento.
3- Cada 40 segundos é enviado a mensagem avisando quantos players estão participando.


Crie um novo npc em npc/Eventer.xml:

 

 

<?xml version="1.0" encoding="UTF-8"?>

<npc name="Eventer" script="event.lua" walkinterval="2000" floorchange="0">
<health now="100" max="100"/>
<look type="129" head="79" body="113" legs="105" feet="86" addons="0"/>
        <parameters>
                <parameter key="message_greet" value="Ola |PLAYERNAME|. Para entrar na batalha diga {Battle} e para sair diga leave."/>
                <parameter key="message_farewell" value="Good bye."/>
                <parameter key="message_walkaway" value="Farewell then.." />
    </parameters>

</npc>

Agora em npc/script crie Event.lua e cole:

[spoiler]

local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)
local talkState = {}
 
function onCreatureAppear(cid)                npcHandler:onCreatureAppear(cid) end
function onCreatureDisappear(cid)            npcHandler:onCreatureDisappear(cid) end
function onCreatureSay(cid, type, msg)            npcHandler:onCreatureSay(cid, type, msg) end
function onThink()                    npcHandler:onThink() end
 
   
--[[Start edit]]--  
 
       
local mingroup = 4 --(updated) minimum group to reset the event
        local joined = 10000 ---must be like the storage in mod
       
local maxPlayerEachTeam = 20 ---must be like max number in mod
       
local team1Name = "Blue" ---must be like team number i mod
       
local team2Name = "Red"
        local minlevel = 130 --(added) min lvl for a player to join.
 
               
--[[Storage like in the mod file]]--
          local  running1 = 12000 --just add a non ussed storage
         
local running2 = 12001 --just add a non ussed storage
         
local sto = 12223 --just add a non ussed storage
         
--[[Storage end]]--
 
 
 
--[[End of edit]]--
local function getBlue()
        return getGlobalStorageValue(9888)
end
 local function removeBlue()
    return setGlobalStorageValue(9888, getGlobalStorageValue(9888) - 1)
end
local function addBlue()
   return setGlobalStorageValue(9888, getGlobalStorageValue(9888) + 1)
end
local function resetBlue()
      return setGlobalStorageValue(9888,0)
end
 
local function getRed()
        return getGlobalStorageValue(9887)
end
 local function removeRed()
    return setGlobalStorageValue(9887, getGlobalStorageValue(9887) - 1)
end
local function addRed()
   return setGlobalStorageValue(9887, getGlobalStorageValue(9887) + 1)
end
local function resetRed()
      return setGlobalStorageValue(9887,0)
end
--[[Script start]]--
 
function creatureSayCallback(cid, type, msg)
    if(not npcHandler:isFocused(cid)) then
        return false
    end
    local talkUser = NPCHANDLER_CONVBEHAVIOR == CONVERSATION_DEFAULT and 0 or cid
if getPlayerGroupId(cid) >= mingroup then
     npcHandler:say("Oh! Hail, sire. Do you want to reset my event?", cid)
         talkState[talkUser] = 1
      if msgcontains(msg, 'yes') and talkState[talkUser] == 1 then
                     resetBlue()
                 resetRed()
                         setGlobalStorageValue(running1,-1)
                 setGlobalStorageValue(running2,-1)
                 setGlobalStorageValue(sto,-1)
                         npcHandler:say("Event was reseted, sire.", cid)
                         doBroadcastMessage("Eventer: Meu evento foi resetado por ordens do "..getCreatureName(cid)..". Para participar fale comigo outra vez,estou na arena pvp.")
                 for _,cid in ipairs(getPlayersOnline()) do
                    if getPlayerStorageValue(cid, joined) > 0 then
                           setPlayerStorageValue(cid, joined,-1)
                             doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid)), FALSE)
                 doSendMagicEffect(getCreaturePosition(cid), 10)
                         end
                 end
          elseif msgcontains(msg, 'yes') and talkState[talkUser] == 1 then
            npcHandler:say("As You wish, sire.", cid)
             talkState[talkUser] = 0
         end
else
    if msgcontains(msg, 'battle') then
             if getGlobalStorageValue(running2) == 1 then  
             npcHandler
:say("Ja tem batalha em andamento,tente mais tarde.", cid)
         elseif getPlayerLevel(cid) < minlevel then
                 npcHandler:say("Apenas level 130+ pode participar.",cid)
                 else
         npcHandler:say("Voce esta preparado para a abatalha? Por enquanto temos " .. getBlue() .. "/" .. maxPlayerEachTeam .. " players no {" .. team1Name .. "} team e " .. getRed() .. "/" .. maxPlayerEachTeam .. " players no {" .. team2Name .. "} team,vc quer escolher algum?", cid)
         talkState[talkUser] = 1
             end
    elseif msgcontains(msg, 'yes') and talkState[talkUser] == 1 then
        if getPlayerStorageValue(cid, joined) ~= 1 and getPlayerStorageValue(cid, joined) ~= 2 then
            npcHandler:say("Vc quer ser do  {" .. team1Name .. "} team  ou {" .. team2Name .. "} team?", cid)
            talkState[talkUser] = 2
        else
            npcHandler:say("Vc esta cadastrado!", cid)
            talkState[talkUser] = 0
        end
    elseif msgcontains(msg, 'no') and talkState[talkUser] == 1 then
        npcHandler:say("Okay then.", cid)
        talkState[talkUser] = 0
    elseif msgcontains(msg, team1Name) and talkState[talkUser] == 2 then
        if getBlue() ~= maxPlayerEachTeam then --fixed
            setPlayerStorageValue(cid, joined, 1)
           addBlue()
            npcHandler:say("Vc entrou no " .. team1Name .. " team! Quando ambas equipes tiverem " .. maxPlayerEachTeam .. " os players serao teleportados para arena de batalha.", cid)
 
            talkState
[talkUser] = 0
        else
            npcHandler:say("{" .. team1Name .. "} team esta cheio, entre no {" .. team2Name .. "} team ou espere alguem sair do {" .. team1Name .. "} team.", cid) --fixed
            talkState[talkUser] = 1
        end
    elseif msgcontains(msg, team2Name) and talkState[talkUser] == 2 then
        if getRed() ~= maxPlayerEachTeam then --fixed
            setPlayerStorageValue(cid, joined, 2) --fixed
           addRed()
            npcHandler:say("Vc esta no " .. team2Name .. " team! Quando ambas equipes tiverem " .. maxPlayerEachTeam .. " os players serao teleportados para arena de batalha.", cid)
 
            talkState
[talkUser] = 0
        else
            npcHandler:say("{" .. team2Name .. "} team esta cheio, entre no {" .. team1Name .. "} team ou espere alguem sair do {" .. team2Name .. "} team.", cid)
            talkState[talkUser] = 1
        end
 elseif msgcontains(msg, 'leave') then
        npcHandler:say("Vc quer sair da lista de espera para batalha?", cid)
        talkState[talkUser] = 3
    elseif msgcontains(msg, 'yes') and talkState[talkUser] == 3 then
        if getPlayerStorageValue(cid,joined) == 1 then
            setPlayerStorageValue(cid, joined, -1) -- fixed
           removeBlue()
            npcHandler:say("Vc saiu da batalha.", cid)
            doBroadcastMessage("Event: " .. getPlayerName(cid) .. " saiu da batalha " .. team1Name .. " e " .. team2Name .. "!")
        elseif getPlayerStorageValue(cid,joined) == 2 then --fixed
                      setPlayerStorageValue(cid,joined,-1)
              removeRed()
              npcHandler:say("Vc saiu da batalha.", cid)
             doBroadcastMessage("Event: " .. getPlayerName(cid) .. " saiu da batalha " .. team1Name .. " e " .. team2Name .. "!")
                else
            npcHandler:say("Vc nao esta cadastrado!", cid)
        end
        talkState[talkUser] = 0 -- moved
   
end
end    
   
return true
end
npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())

Agora para instalar o MOD crie um novo arquivo Event.xml na pasta mods de seu ot e coloque o seguinte codigo:


xml version="1.0" encoding="UTF-8"?>
<mod name="Team Event" version="1.0" author="Damadgerz" contact="[email protected]" enabled="yes">
 <description>
 
      This is a full auto Team BattleEvent(missing part for site) :
             1- Player will get the ability to talk to the npc event starter to start the event every x times(time between each event)
                 2- players will go to npc and say battle and then join their desired team(you adjust team names) , they also have ability to leave team
                 3- You have ability to set max players per each team, npc will not tp the players to arena except when both teams are full
                 4- Script automatically set the place of event to a pvp arena (players no lose items,levels,geet msg who killed them).Place cant be a non-pvp area.
                 5- if player logged out they will automatically be lifted out from event.
                 6- players in same team cant attack each others even with spells
                 7- each team will have a uniform :)
                 8-you choose where the first team be tped and where the second team be tped
                 9-when event start, you set a max time for event.So if ppl couldnt kill each other( if players in first team = players in second team when event times finish) They will automatically be sent to temple and no one will take reward and broadcast :)
                 10 -during event if max time didnt finish and player of team 1 killed all of those of team2 then players of team1 will be tped to temple broadcasting they won by killing all other members and will recieve a random reward taht you set
                 11 -Then the event will be on hold untill time between each event pass(you set that) , and when it pass a auto broadcast is made every minute to tell player that event is open.
   
</description>
 
<config name="tutorial_m"><![CDATA[
 
    running1 = 12000 --just add a non ussed storage
        running2 = 12001 --just add a non ussed storage
        joined = 10000 --just add a non ussed storage
        sto = 12223 --just add a non ussed storage
        check = 5454 -- empty storage
        redpotision = {x=19068, y=18978, z=7} --place where the red team player be teleported to
    blueposition = {x=19060, y=19052, z=7} --place where the blue team player be teleported to
        stoptime = 2 --in minutes
        team1name = "Blue" --just put the name without
<team>
        team2name = "Red"
        timebetween = 5 -- time between each event
        arena = { frompos = {x=19068,y=18978,z=7}, topos = {x=19060,y=19052,z=7} } ----Put you event area here
        conf = {
                                rewards_id = {2472}, -- Rewards ID
                                maxplayers = 20 ---maxplayers per team
                        }
 ]]>
</config>
 <lib name="football-lib"><![CDATA[
 
function getBlue()
        return getGlobalStorageValue(9888)
end
 function removeBlue()
    return setGlobalStorageValue(9888, getGlobalStorageValue(9888) - 1)
end
function addBlue()
   return setGlobalStorageValue(9888, getGlobalStorageValue(9888) + 1)
end
function resetBlue()
      return setGlobalStorageValue(9888,0)
end
 
function getRed()
        return getGlobalStorageValue(9887)
end
 function removeRed()
    return setGlobalStorageValue(9887, getGlobalStorageValue(9887) - 1)
end
function addRed()
   return setGlobalStorageValue(9887, getGlobalStorageValue(9887) + 1)
end
function resetRed()
      return setGlobalStorageValue(9887,0)
end
function onStop()
        if getGlobalStorageValue(running1) == 1 then
                setGlobalStorageValue(running1, -1)
                setGlobalStorageValue(sto,1)
        end
        return true
end
function onStopp()
        if getGlobalStorageValue(running2) > 0 then
                setGlobalStorageValue(running2,-1)
                doBroadcastMessage("Event : event is started again , go talk to the Evnet's Npc.")
        end
end
 
]]>
</lib>
 
<event type="login" name="Tutorial Login" event="script"><![CDATA[
domodlib('football-lib')
domodlib('tutorial_m')
function onLogin(cid)
        if getPlayerStorageValue(cid,check) > 0 then
                if isInRange(getCreaturePosition(cid), arena.frompos, arena.topos) then
                        doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid)), FALSE)
                        doSendMagicEffect(getCreaturePosition(cid), 10)
                    setPlayerStorageValue(cid,check,-1)
                else
                        setPlayerStorageValue(cid,check,-1)  
                end
        end
        registerCreatureEvent(cid, "Log")
        registerCreatureEvent(cid, "Arena")
        registerCreatureEvent(cid, "Attk")
        return true
end
]]>
</event>
<event type="combat" name="Attk" event="script"><![CDATA[
        domodlib('tutorial_m')
                domodlib('football-lib')
        function onCombat(cid, target)
        if getPlayerStorageValue(cid, joined) == 1 and getPlayerStorageValue(target, joined) == 1 then
 
                return false
        end
                if getPlayerStorageValue(cid, joined) == 2 and getPlayerStorageValue(target, joined) == 2 then
 
                return false
        end
        return true
end
]]>
</event>
 <event type="logout" name="Log" event="script"><![CDATA[
 domodlib('football-lib')
 domodlib('tutorial_m')
 function onLogout(cid)
  if getPlayerStorageValue(cid,joined) == 1 then
    doBroadcastMessage(""..getPlayerName(cid).." have left the War-Event")
    setPlayerStorageValue(cid,joined,-1)
        setPlayerStorageValue(cid,check,1)
        removeBlue()
   return true
   end
   if getPlayerStorageValue(cid,joined) == 2 then
    doBroadcastMessage(""..getPlayerName(cid).." have left the War-Event")
   setPlayerStorageValue(cid,check,1)
        removeRed()
   return true
   end
   return true
  end
 
]]>
</event>
<event type="statschange" name="Arena" event="script"><![CDATA[
domodlib('football-lib')
domodlib('tutorial_m')
local corpse_ids = {
        [0] = 3065, -- female
        [1] = 3058 -- male
}
function onStatsChange(cid, attacker, type, combat, value)
        if combat == COMBAT_HEALING then
                        return true
        end
        if getCreatureHealth(cid) > value then
                        return true
        end
        if isInRange(getCreaturePosition(cid), arena.frompos, arena.topos) then
                doItemSetAttribute(doCreateItem(corpse_ids[getPlayerSex(cid)], 1, getThingPos(cid)), "description", "You recognize "..getCreatureName(cid)..". He was killed by "..(isMonster(attacker) and "a "..string.lower(getCreatureName(attacker)) or isCreature(attacker) and getCreatureName(attacker) or "a field item")..".\n[War-Event kill]")
                doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid)), FALSE)
                doSendMagicEffect(getCreaturePosition(cid), 10)
                doRemoveConditions(cid, FALSE)
                doCreatureAddHealth(cid, getCreatureMaxHealth(cid) - getCreatureHealth(cid))
                doCreatureAddMana(cid, getCreatureMaxMana(cid) - getCreatureMana(cid))
                doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You got killed by "..(isMonster(attacker) and "a "..string.lower(getCreatureName(attacker)) or isCreature(attacker) and getCreatureName(attacker) or "a field item").." in the war event.")
                        if isPlayer(attacker) then
                                        doPlayerSendTextMessage(attacker, MESSAGE_STATUS_CONSOLE_BLUE, "You killed "..getCreatureName(cid).." in the war event.")
                        end
                        if getPlayerStorageValue(cid,joined) == 1 then
                                removeBlue()
                                setPlayerStorageValue(cid,10000,-1)
                        elseif getPlayerStorageValue(cid,joined) == 2 then
                                removeRed()
                                setPlayerStorageValue(cid,10000,-1)
                        end
        end
        return true
end
 
]]>
</event>
 <globalevent name="reset" type="start" event="script"><![CDATA[
 domodlib('football-lib')
 domodlib('tutorial_m')
     function onStartup()
             resetBlue()
          resetRed()
                    setGlobalStorageValue(running1,-1)
  setGlobalStorageValue(running2,-1)
   setGlobalStorageValue(sto,-1)
 
        return true
end
 ]]>
</globalevent>
  <globalevent name="TeamBattle" interval="7" event="script"><![CDATA[
                domodlib('football-lib')
        domodlib('tutorial_m')
 
 
 
local bmale = createConditionObject(CONDITION_OUTFIT)
setConditionParam(bmale, CONDITION_PARAM_TICKS, -1)
addOutfitCondition(bmale, {lookType = math.random(128,134), lookHead = 88, lookBody = 88, lookLegs = 88, lookFeet = 88, lookTypeEx = 0, lookAddons = 3})
 
local bfemale = createConditionObject(CONDITION_OUTFIT)
setConditionParam(bfemale, CONDITION_PARAM_TICKS, -1)
addOutfitCondition(bfemale, {lookType = math.random(136,142), lookHead = 88, lookBody = 88, lookLegs = 88, lookFeet = 88, lookTypeEx = 0, lookAddons = 3})
 
local rmale = createConditionObject(CONDITION_OUTFIT)
setConditionParam(rmale, CONDITION_PARAM_TICKS, -1)
addOutfitCondition(rmale, {lookType = math.random(128,134), lookHead = 94, lookBody = 94, lookLegs = 94, lookFeet = 94, lookTypeEx = 0, lookAddons = 3})
 
local rfemale = createConditionObject(CONDITION_OUTFIT)
setConditionParam(rfemale, CONDITION_PARAM_TICKS, -1)
addOutfitCondition(rfemale, {lookType = math.random(136,142),lookHead = 94, lookBody = 94, lookLegs = 94, lookFeet = 94, lookTypeEx = 0, lookAddons = 3})
 
function onThink(interval, lastExecution)
        local random_item = conf.rewards_id[math.random(1, #conf.rewards_id)]
        if (getBlue() == conf.maxplayers and getRed() == conf.maxplayers) then
                if (getGlobalStorageValue(running1) == -1 and getGlobalStorageValue(sto) == -1) then
                        setGlobalStorageValue(running1,1)
                        doBroadcastMessage("The Team Battle Event have started.And will end in "..stoptime.." minutes, unless one of the teams has killed all the oponents")
                        addEvent(onStop, stoptime * 60 * 1000)
                                for _, cid in ipairs(getPlayersOnline()) do
 
             if getPlayerStorageValue(cid, joined) == 1 then  
                     if getPlayerSex(cid) == 1 then
                        doAddCondition(cid, bmale)
                elseif getPlayerSex(cid) ~= 1 then
                        doAddCondition(cid, bfemale)
                end
                   doTeleportThing(cid, blueposition, FALSE)
            doSendMagicEffect(blueposition, 10)
                 elseif getPlayerStorageValue(cid, joined) == 2 then
                       if getPlayerSex(cid) == 1 then
                 doAddCondition(cid, rmale)
               elseif getPlayerSex(cid) ~= 1 then
                  doAddCondition(cid, rfemale)
               end
                   doTeleportThing(cid, redpotision, FALSE)
            doSendMagicEffect(redpotision, 10)
                 end
                end
      end
        end
        if getGlobalStorageValue(running1) == 1 then
                setGlobalStorageValue(running2,1)
                if (getBlue() >= 1 and getRed() < 1) then
                        addEvent(onStopp, timebetween * 60 * 1000)
                        doBroadcastMessage("The War-Event has finished as the " ..team1name.. " team has killed all players in oponnent team ,they will recieve their rewards.Event will be reopened in ".. timebetween .." minutes")
                elseif (getBlue() < 1 and getRed() >= 1) then
                        doBroadcastMessage("The War-Event has finished as the " ..team2name.. "  team has killed all players in oponnent team,they will recieve their rewards.Event will be reopened in ".. timebetween .." minutes")
                        addEvent(onStopp, timebetween * 60 * 1000)
                end
        for _, cid in ipairs(getPlayersOnline()) do
                        if (getBlue() >= 1 and getRed() < 1) then
                                if getPlayerStorageValue(cid,joined) == 1 then
                                        doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid)), FALSE)
                                        doSendMagicEffect(getCreaturePosition(cid), 10)
                                        doRemoveConditions(cid, FALSE)
                                        doPlayerAddItem(cid, random_item, 1)
                                        doRemoveConditions(cid, FALSE)
                                        doCreatureSay(cid, "You have won a "..getItemNameById(random_item).." as a reward from war event", TALKTYPE_ORANGE_1)
                                        setPlayerStorageValue(cid, joined,-1)
                                        setGlobalStorageValue(running1,-1)
                                        resetBlue()
                                end
                        end
                        if (getBlue() < 1 and getRed() >= 1) then
                                if getPlayerStorageValue(cid,joined) == 2 then
                                        doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid)), FALSE)
                                        doRemoveConditions(cid, FALSE)
                                        doSendMagicEffect(getCreaturePosition(cid), 10)
                                        doRemoveConditions(cid, FALSE)
                                        doPlayerAddItem(cid, random_item, 1)
                                        doCreatureSay(cid, "You have won a "..getItemNameById(random_item).." as a reward from war event", TALKTYPE_ORANGE_1)
                                        setGlobalStorageValue(running1,-1)
                                        setPlayerStorageValue(cid, joined,-1)
                                        resetRed()
                                end
                        end
                end
        end
 
        return true
end
]]>
</globalevent>
<globalevent name="Team" interval="3" event="script"><![CDATA[
domodlib('football-lib')
domodlib('tutorial_m')
 
function onThink(interval, lastExecution)
 
local random_item = conf.rewards_id[math.random(1, #conf.rewards_id)]
        if getGlobalStorageValue(sto) == 1 then
                if (getRed() > getBlue()) then
                        doBroadcastMessage("The War-Event has finished as the " ..team2name.. "  team has killed all players in oponnent team,they will recieve their rewards.Event will be reopened in ".. timebetween .." minutes")
                                for _, cid in ipairs(getPlayersOnline()) do
                                        if getPlayerStorageValue(cid,joined) == 2 then
                                                doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid)), FALSE)
                                                doSendMagicEffect(getCreaturePosition(cid), 10)
                                                doRemoveConditions(cid, FALSE)
                                                doPlayerAddItem(cid, random_item, 1)
                                                doRemoveConditions(cid, FALSE)
                                                doCreatureSay(cid, "You have won a "..getItemNameById(random_item).." as a reward from war event", TALKTYPE_ORANGE_1)
                                                setPlayerStorageValue(cid, joined,-1)
                                        end    
                                        if getPlayerStorageValue(cid,joined) == 1 then
                                                doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid)), FALSE)
                                                doSendMagicEffect(getCreaturePosition(cid), 10)
                                                doPlayerSendTextMessage(cid,24, "Your team has lost in the war event war event")
                                                setPlayerStorageValue(cid, joined,-1)
                                                doRemoveConditions(cid, FALSE)
                                        end                                      
                                end
                                addEvent(onStopp, timebetween * 60 * 1000)
                end
                if (getRed() < getBlue()) then
                        doBroadcastMessage("The War-Event has finished as the " ..team1name.. "  team has killed all players in oponnent team,they will recieve their rewards.Event will be reopened in ".. timebetween .." minutes")
                                for _, cid in ipairs(getPlayersOnline()) do
                                        if getPlayerStorageValue(cid,joined) == 1 then
                                                doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid)), FALSE)
                                                doSendMagicEffect(getCreaturePosition(cid), 10)
                                                doPlayerAddItem(cid, random_item, 1)
                                                doRemoveConditions(cid, FALSE)
                                                doRemoveConditions(cid, FALSE)
                                                doCreatureSay(cid, "You have won a "..getItemNameById(random_item).." as a reward from war event", TALKTYPE_ORANGE_1)
                                                setPlayerStorageValue(cid, joined,-1)
                                        end    
                                        if getPlayerStorageValue(cid,joined) == 2 then
                                                doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid)), FALSE)
                                                doRemoveConditions(cid, FALSE)
                                                doSendMagicEffect(getCreaturePosition(cid), 10)
                                                doPlayerSendTextMessage(cid,24, "Your team has lost in the war event war event")
                                                setPlayerStorageValue(cid, joined,-1)
                                        end                                      
                                end
                                addEvent(onStopp, timebetween * 60 * 1000)
                end
                if (getRed() == getBlue()) then
                        for _, cid in ipairs(getPlayersOnline()) do
                                if getPlayerStorageValue(cid,joined) == 2 or getPlayerStorageValue(cid,joined) == 1 then
                                        doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid)), FALSE)
                                        doRemoveConditions(cid, FALSE)
                                        doSendMagicEffect(getCreaturePosition(cid), 10)
                                        doRemoveConditions(cid, FALSE)
                    setPlayerStorageValue(cid, joined,-1)
                                        doBroadcastMessage("Event max time ended.And niether of the teams won the event.Event will be reopened in ".. timebetween .." minutes")
                                end                      
                        end
                        addEvent(onStopp, timebetween * 60 * 1000)
                end
                resetBlue()
                resetRed()
                setGlobalStorageValue(sto, -1)
        end
        return true
end
]]>
</globalevent>
        <globalevent name="Broad" interval="90" event="script"><![CDATA[
                domodlib('football-lib')
                domodlib('tutorial_m')
 
function onThink(interval, lastExecution)
  if getGlobalStorageValue(running2) == -1 then
    doBroadcastMessage("O evento de batalha está aberto.O npc Eventer precisa de 2 times de 20 pessoas para iniciar a batalhe,ele esta na Arena Pvp que vai por teleport de Carlin. Ja tem "..getBlue().." players no blue team vs "..getRed().." players no Red team,o time vencedor sera premiado.")
        return true
        end
return true
end
 ]]>
</globalevent>
        <globalevent name="Karim" interval="40000" event="script"><![CDATA[
                domodlib('football-lib')
                domodlib('tutorial_m')
 
function onThink(interval, lastExecution)
        if getGlobalStorageValue(running1) > 0 then
                local blue = {}
                local green = {}
                for _, pid in ipairs(getPlayersOnline()) do
                        if isInRange(getCreaturePosition(pid),arena.frompos, arena.topos) then
                                if getPlayerStorageValue(pid, joined) == 1 then  
                                        table.insert(blue,getCreatureName(pid))
                                elseif getPlayerStorageValue(pid, joined) == 2 then  
                                        table.insert(green,getCreatureName(pid))
                                end
                        end
                end
                local greenn = table.concat(green,', ')
                local bluee = table.concat(blue,', ')
                for _, tid in ipairs(getPlayersOnline()) do
                        if getPlayerStorageValue(tid, joined) > 0 then
                                doPlayerSendTextMessage(tid,19,'<
<!-- Players left --!>>\n '..team1name..' team ('..#blue..') : '..bluee..'.\n '..team2name..' team ('..#green..') : '..greenn..'.')
                        end
                end
        end
        return true
end
 ]]></globalevent>
</mod>

<?

 

Vlw por estar tentando me ajudar, esta script eu já vi. Mas eu quero ela sem Time, eu queria que esse evento fosse Todos os player's contra.

eR3Xwgv.png?1
 

Link para o post
Compartilhar em outros sites

 

Vlw por estar tentando me ajudar, esta script eu já vi. Mas eu quero ela sem Time, eu queria que esse evento fosse Todos os player's contra.

 Deleta essa linha !

 

local team1Name = "Blue" ---must be like team number i mod

        local team2Name = "Red"

 

Dexando assim !

 

local team1Name = "NOMEDOEVENTO" ---must be like team number i mod

Mais vale a lagrima da derrota doque a Covardia de não ter lutado , Prefiro morrer de Pé do que sempre viver ajoelhado.

Kaio santos "soldier killed"

Link para o post
Compartilhar em outros sites
  • 3 years later...

Participe da conversa

Você pode postar agora e se cadastrar mais tarde. Se você tem uma conta, faça o login para postar com sua conta.

Visitante
Responder

×   Você colou conteúdo com formatação.   Remover formatação

  Apenas 75 emojis são permitidos.

×   Seu link foi automaticamente incorporado.   Mostrar como link

×   Seu conteúdo anterior foi restaurado.   Limpar o editor

×   Não é possível colar imagens diretamente. Carregar ou inserir imagens do URL.

  • Quem Está Navegando   0 membros estão online

    Nenhum usuário registrado visualizando esta página.

  • Conteúdo Similar

    • Por Kiman174
      GRIMHAVEN SEASON 4
      LAUNCHING APRIL 18TH 19:00 CEST
       
      Join our community and stay up to date:
      Official Discord Server
       
       
       
       
       
      Step into a world where passion meets innovation—welcome to Grimhaven MMORPG! Born from a heartfelt passion project, Grimhaven has evolved into an extraordinary realm where every pixel on our meticulously crafted Real Map tells a story. Leveraging the classic legacy of version 8.6 and elevated by inventive custom content, our server transcends traditional gameplay, inviting you into a living, breathing adventure at every turn.
       
       
      Explore sprawling landscapes, battle formidable foes, and uncover hidden lore as you journey through environments that blend classic mechanics with innovative systems. Every corner of Grimhaven pulses with life and mystery, inviting you to forge alliances, challenge epic quests, and redefine what you thought possible in an open Tibia server. With each update, our dedicated team pushes the envelope, ensuring that every raid, dungeon, and social encounter feels fresh and electrifying.
       
       
      Whether you're a seasoned adventurer or new to the realm, Grimhaven offers a thrilling escape into a world where the spirit of discovery and the thrill of combat come together in perfect harmony. Embrace the extraordinary—your adventure begins now in Grimhaven MMORPG!
       
       
      What Makes Grimhaven Stand Out?
       
      With over thousands of hours of development and 4000+ commits, Grimhaven stands out with its unique blend of classic and innovative MMORPG features. Built on an authentic Real Map with 8.6 mechanics and expanded with carefully designed custom content, the experience is unmatched. The server offers rates starting from 12x, stunning HD visuals, and intricately scripted quests that immerse you in a dynamic narrative. From challenging custom raid bosses to a refined item system inspired by classic action RPGs, every element is thoughtfully crafted to deliver an engaging and ever-evolving adventure, all backed by a dedicated team ensuring a top-tier gaming experience.
       
       
       
      Custom Zones :
      Explore meticulously designed zones that promise unique challenges and unparalleled rewards.
       

       
       
       
      Unique Randomly Generated Dungeons :
      As if that's not enough, brace yourselves for our unique dungeons. Each one is randomly generated, ensuring that no adventure is ever the same. The thrill of exploring the unknown awaits you in every twist and turn.
       


       

       
       


       
       
       
      Scripted and Mechanically Challenging Quests:
      Immerse yourself in intricately designed quests that push your strategic prowess and combat skills, all brought to life by the remarkable creativity of our quest designer and mapper.
       

       

       


       
       
      Mighty Bosses:
      Confront colossal adversaries, each boasting unique abilities and intricate mechanics that challenge your tactics and teamwork, turning every encounter into an unforgettable battle.
       


       
       
       
      Ancient and Mythic Monsters:
      Encounter legendary beasts, ancient guardians, and mythical creatures that not only test your skills and courage but also offer tougher challenges, richer loot drops, and enhanced experience rewards.
       

       
       
       
      Magical Attributes & Crafting:
      Discover a world of enchantment where magical items not only have a chance to drop in the wild, but can also be expertly crafted to bestow unique and powerful attributes on your gear.
       
       

       

       
       
       
      Custom Events :
      We keep the excitement rolling with unique, server-wide events that'll keep you on the edge of your seat. Expect the unexpected!
       
       



       
       
       
      This glimpse barely scratches the surface—there's a TON more content that would overwhelm this thread! To dive even deeper, visit our official wiki at Grimhaven Wiki (https://wiki.grimhaven.net) and create your account today at Latestnews - Grimhaven (https://www.grimhaven.net/) .   
       
      Gear up for an unforgettable adventure starting April 18th 19:00 CEST.
      Dive into a realm of epic rewards, heart-pounding quests, and intense PVP battles where you'll test your skills against others.
      Join a vibrant community of adventurers, embrace the thrill of discovery, and answer the call to glory on the battlefield!
    • Por zandoria
      Olá, aventureiro!

      É com grande entusiasmo que anunciamos o lançamento do servidor Zandoria! Prepare-se para uma experiência única em um mundo totalmente novo, repleto de desafios, mistérios e diversão!

      Link de acesso: https://zandoria.com.br
      Host BR - Ping: 20ms

      FREE PREMIUM

      Server Info

      IP: zandoria.com.br
      Client: 13.40
      World type: PVP
      Protection level: 7
      Loot: x800
      Spawn: x80
      House rent: monthly
      Level to create guild: 100
      Level to buy house: 100

      Rates
      Exp Rate: x800
      Magic Level: x800
      Skills: x800

      Frags & Skull system

      PZ Lock: 1 min
      Frag Duration: 7 hours
      RedSkull Duration: 1 days
      BlackSkull Duration: 3 days
      Red skull: 3 daily / 5 weekly / 10 monthly
      Black skull: 6 daily / 10 frags weekly / 20 frags monthly 
    • Por yezzin
      FALA RAPAZIADA CANSADOS DE JOGAR EM SERVIDORES QUE FECHAM TODA HORA E ADM'S QUE NÃO LIGAM PARA O GAME?
      APRESENTO NTO STORM.

      ⚡NTO STORM⚡
       
       💖Versão 8.60 com OLD e OTC
       💖Task system;
       💖Saga system;
      💖 Outfit/skin system;
       💖Raridade system;
       💖Elo/Kage system;
       💖buff/Aura system;
      💖 Market system;
      💖 Autoloot system;
      💖 Mapa 100% proprio e novinho;
       💖Diversas quest de todos os niveis;
      💖 Vocaçao do dia;
       💖Cast System;
       💖Shop no Game
       💖Mercado Negro;
      💖Upgrade Set;
      💖Refinamento de Armas e Shields;
       💖Evento(castle,Guild castle, eventos, task, bonus, sorteios!
       
      https://discord.gg/un9uewM3Ds
      VOA !!
    • Por Nogard
      Não deixe seu evento de Natal para última hora, faltam apenas 4 dias. 

      Aproveite as sprites com desconto no site: https://otsprites.com
       
       
       

       

       
       
       
    • Por Heyron
      Elysia OT (Global Full 8.60)   IP: elysiaot-global.servegame.com   ✔︎ Login pelo Account Manager 1/1, não temos site. ✔︎ Login zerado é Cast System.   XP (Rates): Stages = Sim Experience = 50.0 Skill = 15.0 Magic = 5.0 Loot = 1.0 Spawn = 1.0 Protection Level: 30   ✔︎ Sem itens VIP. ✔︎ Premiação ao upar nível 20, 50 e 80. ✔︎ Itens iniciais por vocação. ✔︎ Free Bless até o level 50. ✔︎ Danos de spells balanceados. ✔︎ Sem fast attack ou ataque rápido (padrão 2seg). ✔︎ Sem itens infinitos, exceto munição de Paladin.           Jogue agora!   IP: elysiaot-global.servegame.com Versão: 8.60      
  • Estatísticas dos Fóruns

    96823
    Tópicos
    519565
    Posts
×
×
  • Criar Novo...

Informação Importante

Confirmação de Termo