The World of Open Tibia
Hola bienvenido a word open-tibia si quieres pertenecer a esta comunidad solo registrate, es fácil y sencillo Gracias por tu preferencia.

Aqui encontraras cosas de calidad.
The World of Open Tibia
Hola bienvenido a word open-tibia si quieres pertenecer a esta comunidad solo registrate, es fácil y sencillo Gracias por tu preferencia.

Aqui encontraras cosas de calidad.
The World of Open Tibia
¿Quieres reaccionar a este mensaje? Regístrate en el foro con unos pocos clics o inicia sesión para continuar.


encontraras aquí todo sobre open-tibia
 
ÍndiceBuscarÚltimas imágenesRegistrarseConectarse
Afiliados
[Globalevent] Capture The Flag ! Two10 [Globalevent] Capture The Flag ! Two110
Conectarse
Nombre de Usuario:
Contraseña:
Entrar automáticamente en cada visita: 
:: Recuperar mi contraseña
Miembros que empiezan más temas
Belloz
[Globalevent] Capture The Flag ! I_vote_lcap[Globalevent] Capture The Flag ! I_voting_bar[Globalevent] Capture The Flag ! I_vote_rcap 
Darko0
[Globalevent] Capture The Flag ! I_vote_lcap[Globalevent] Capture The Flag ! I_voting_bar[Globalevent] Capture The Flag ! I_vote_rcap 
Kiba
[Globalevent] Capture The Flag ! I_vote_lcap[Globalevent] Capture The Flag ! I_voting_bar[Globalevent] Capture The Flag ! I_vote_rcap 
Cronox
[Globalevent] Capture The Flag ! I_vote_lcap[Globalevent] Capture The Flag ! I_voting_bar[Globalevent] Capture The Flag ! I_vote_rcap 
Falcón
[Globalevent] Capture The Flag ! I_vote_lcap[Globalevent] Capture The Flag ! I_voting_bar[Globalevent] Capture The Flag ! I_vote_rcap 
Darkens
[Globalevent] Capture The Flag ! I_vote_lcap[Globalevent] Capture The Flag ! I_voting_bar[Globalevent] Capture The Flag ! I_vote_rcap 
Hazardous
[Globalevent] Capture The Flag ! I_vote_lcap[Globalevent] Capture The Flag ! I_voting_bar[Globalevent] Capture The Flag ! I_vote_rcap 
angel.maclish
[Globalevent] Capture The Flag ! I_vote_lcap[Globalevent] Capture The Flag ! I_voting_bar[Globalevent] Capture The Flag ! I_vote_rcap 
Alush
[Globalevent] Capture The Flag ! I_vote_lcap[Globalevent] Capture The Flag ! I_voting_bar[Globalevent] Capture The Flag ! I_vote_rcap 
Kashort
[Globalevent] Capture The Flag ! I_vote_lcap[Globalevent] Capture The Flag ! I_voting_bar[Globalevent] Capture The Flag ! I_vote_rcap 
Mejores posteadores
Belloz
[Globalevent] Capture The Flag ! I_vote_lcap[Globalevent] Capture The Flag ! I_voting_bar[Globalevent] Capture The Flag ! I_vote_rcap 
Kiba
[Globalevent] Capture The Flag ! I_vote_lcap[Globalevent] Capture The Flag ! I_voting_bar[Globalevent] Capture The Flag ! I_vote_rcap 
Darko0
[Globalevent] Capture The Flag ! I_vote_lcap[Globalevent] Capture The Flag ! I_voting_bar[Globalevent] Capture The Flag ! I_vote_rcap 
Darkens
[Globalevent] Capture The Flag ! I_vote_lcap[Globalevent] Capture The Flag ! I_voting_bar[Globalevent] Capture The Flag ! I_vote_rcap 
Alush
[Globalevent] Capture The Flag ! I_vote_lcap[Globalevent] Capture The Flag ! I_voting_bar[Globalevent] Capture The Flag ! I_vote_rcap 
angel.maclish
[Globalevent] Capture The Flag ! I_vote_lcap[Globalevent] Capture The Flag ! I_voting_bar[Globalevent] Capture The Flag ! I_vote_rcap 
Hazardous
[Globalevent] Capture The Flag ! I_vote_lcap[Globalevent] Capture The Flag ! I_voting_bar[Globalevent] Capture The Flag ! I_vote_rcap 
Falcón
[Globalevent] Capture The Flag ! I_vote_lcap[Globalevent] Capture The Flag ! I_voting_bar[Globalevent] Capture The Flag ! I_vote_rcap 
Cronox
[Globalevent] Capture The Flag ! I_vote_lcap[Globalevent] Capture The Flag ! I_voting_bar[Globalevent] Capture The Flag ! I_vote_rcap 
Maniatiko™
[Globalevent] Capture The Flag ! I_vote_lcap[Globalevent] Capture The Flag ! I_voting_bar[Globalevent] Capture The Flag ! I_vote_rcap 
Últimos temas
» afililiacion Tibiaguys
[Globalevent] Capture The Flag ! EmptyMar Mayo 20, 2014 12:50 am por fernando1027

» Mi segundo spite :)
[Globalevent] Capture The Flag ! EmptySáb Dic 08, 2012 9:54 pm por icaros

» New Aggrox ot 8.60 Edited
[Globalevent] Capture The Flag ! EmptySáb Nov 03, 2012 4:42 pm por <Fercho>

» Afiliación a Stylez Records
[Globalevent] Capture The Flag ! EmptyMar Oct 30, 2012 5:23 pm por Darko0

» [Sugerencia]Colocar una radio online por el foro
[Globalevent] Capture The Flag ! EmptyJue Oct 25, 2012 6:56 am por Carlos Reguera DJ

» Server Map Rl 8.60
[Globalevent] Capture The Flag ! EmptyDom Oct 07, 2012 6:28 pm por Vizellzhs

» Instalar Contenido Pago en tu Web
[Globalevent] Capture The Flag ! EmptyJue Ago 30, 2012 8:34 pm por Darko0

» [Herramienta] Remere's Map Editor 3.0 [BETA]
[Globalevent] Capture The Flag ! EmptyLun Ago 27, 2012 11:02 am por Darko0

» War map 8.60
[Globalevent] Capture The Flag ! EmptyLun Ago 27, 2012 10:57 am por Darko0

Argumentos más vistos
Paquete de Nuevas Armas , Outfits , Granadas etc. [GOW] FREE!
New Aggrox ot 8.60 Edited
[BIBLIOTECA]Todas Las Versiones De Open Tibia
Concurso Mapping !
Mis sprites :Darko0
[8.60] AtomicsOT [CUSTOM]
Angel.Maclish Sprites
Como agregar Efectos a tu cliente!
Comandos Guild channel
Sprites Por Maniatiko

 

 [Globalevent] Capture The Flag !

Ir abajo 
3 participantes
AutorMensaje
Cronox
Aportadores
Aportadores
Cronox


Posts : 15
Points : 39
Reputation : 0
Join date : 14/07/2012

[Globalevent] Capture The Flag ! Empty
MensajeTema: [Globalevent] Capture The Flag !   [Globalevent] Capture The Flag ! EmptySáb Jul 14, 2012 7:55 pm

Buenas amigos este es un pedido de Infernal Warrior xD

- Descarguen el Mapa y los Scripts: [Tienes que estar registrado y conectado para ver este vínculo]

PD: El Mapa solo es un ejemplo de como deveria ir, mas no es el mapa original. (Ustedes deven hacer su propio mapa de CTF.)

1.- ... Ok!, Vamos a nuestro Server y nos dirigimos a Data/globalevents/scripts y creamos un documento nuevo llamado ctf.lua, ya hecho ponemos esto dentro:

Código:
local t = {
  redPos = {x = 982, y = 1022, z = 7},
  bluePos = {x = 993, y = 1033, z = 7},
  redStorage = 15000,
  blueStorage = 15001,
  fromPos = {x = 1004, y = 1023, z = 7},
  toPos = {x = 1015, y = 1032, z = 7}
}
local conditionBlue = createConditionObject(CONDITION_OUTFIT)
  setConditionParam(conditionBlue, CONDITION_PARAM_TICKS, 1800 * 1000)
  addOutfitCondition(conditionBlue, {lookType = 130, lookHead = 87, lookBody = 87, lookLegs = 87, lookFeet = 87})
local conditionRed = createConditionObject(CONDITION_OUTFIT)
  setConditionParam(conditionRed, CONDITION_PARAM_TICKS, 1800 * 1000)
  addOutfitCondition(conditionRed, {lookType = 130, lookHead = 94, lookBody = 94, lookLegs = 94, lookFeet = 94})
local function teleportThing(minutes)
  local event = 0
  if minutes <= 0 then
      for _, cid in ipairs(getPlayersOnline()) do
        if isInRange(getThingPos(cid), t.fromPos, t.toPos) then
            if math.random(1, 3) < 3 then
              setPlayerStorageValue(cid, t.redStorage, 1)
              doAddCondition(cid, conditionRed)
              doTeleportThing(cid, t.redPos, true)
            else
              setPlayerStorageValue(cid, t.blueStorage, 1)
              doAddCondition(cid, conditionBlue)
              doTeleportThing(cid, t.bluePos, true)
            end
        end
      end
      return true
  end
  if minutes == 1 then
      doBroadcastMessage("Capture The Flag will begin in " .. minutes .. " minute!")
  elseif minutes <= 3 then
      doBroadcastMessage("Capture The Flag will begin in " .. minutes .. " minutes!")
  else
      doBroadcastMessage("Capture The Flag will begin in " .. minutes .. " minutes!")
  end
  event = addEvent(teleportThing, 60, minutes - 1)
  return true
end
function onThink(interval, lastExecution)
  return teleportThing(math.abs(math.ceil(1)))
end

1.2.- ... En la carpeta GlobalEvents abrimos el archivo globalevents.xml, y pegamos esto:

Código:
<globalevent name="ctf_event" interval="60" event="script" value="ctf.lua"/>

2.- ... Ahora vamos a nuestra carpeta de Creaturescripts/scripts/ y creamos otro nuevo archivo con el nombre de: ctf_target.lua, y dentro pegamos esto:

Código:
local t = {
  redStorage = 15000,
  blueStorage = 15001
}
function onCombat(cid, target)
  if isPlayer(cid) and isPlayer(target) then
      if getPlayerStorageValue(cid, t.redStorage) == 1 and getPlayerStorageValue(target, t.redStorage) == 1 then
        return doPlayerSendCancel(cid, "You may not attack your team mates.") and false
      elseif getPlayerStorageValue(cid, t.blueStorage) == 1 and getPlayerStorageValue(target, t.blueStorage) == 1 then
        return doPlayerSendCancel(cid, "You may not attack your team mates.") and false
      end
  end
  return true
end

2.2.- ... Creamos otro archivo en la misma carpeta de creaturescripts/scripts/ y de nombre le pondremos: stats_ctf.lua, y dentro lo siguiente...

Código:
local t = {
  redPos = {x = 983, y = 1028, z = 7},
  bluePos = {x = 992, y = 1028, z = 7},
  redStorage = 15000,
  blueStorage = 15001,
  redFlag = 18000,
  blueFlag = 18001
}
function onStatsChange(cid, attacker, type, combat, value)
  if type == 1 then
      if getCreatureHealth(cid) <= value then
        if isPlayer(cid) and isCreature(attacker) then
            if getPlayerStorageValue(cid, t.redStorage) == 1 then
              if getPlayerStorageValue(cid, t.blueFlag) == 1 and getGlobalStorageValue(t.blueFlag) == 1 then
                  setPlayerStorageValue(cid, t.blueFlag, -1)
                  setGlobalStorageValue(t.blueFlag, -1)
                  doBroadcastMessage(getCreatureName(cid) .. " has lost the Blue Flag!")
                  doTeleportThing(cid, t.redPos, true)
              else
                  doTeleportThing(cid, t.redPos, true)
              end
              doCreatureAddHealth(cid, getCreatureMaxHealth(cid), true)
              doCreatureAddMana(cid, getCreatureMaxMana(cid), true)
            elseif getPlayerStorageValue(cid, t.blueStorage) == 1 then
              if getPlayerStorageValue(cid, t.redFlag) == 1 and getGlobalStorageValue(t.redFlag) == 1 then
                  setPlayerStorageValue(cid, t.redFlag, -1)
                  setGlobalStorageValue(t.redFlag, -1)
                  doTeleportThing(cid, t.bluePos, true)
                  doBroadcastMessage(getCreatureName(cid) .. " has lost the Red Flag!")
              else
                  doTeleportThing(cid, t.bluePos, true)
              end
              doCreatureAddHealth(cid, getCreatureMaxHealth(cid), true)
              doCreatureAddMana(cid, getCreatureMaxMana(cid), true)
            end
        end
        return false
      end
  end
  return true
end

2.3.- ... Ahora nos dirigimos a creaturescripts.xml y dentro pegamos esto:

Código:
<event type="statschange" name="stats_ctf" event="script" value="stats_ctf.lua"/>
    <event type="combat" name="ctf_target" event="script" value="ctf_target.lua"/>

3.- ... Ahora al documento llamado login.lua, que se ubica, también, en nuestra carpeta de creaturescripts/scripts/login.lua, y dentro agregamos lo siguiente:

Código:
registerCreatureEvent(cid, "stats_ctf")
  registerCreatureEvent(cid, "ctf_target")

4.- ... Luego, nos vamos a data/movements/scripts/ creamos uno llamado test.lua y dentro ponemos esto:

Código:
local t = {
  redStorage = 15000,
  blueStorage = 15001,
  redFlag = 18000,
  blueFlag = 18001,
  redGoal = 19000,
  blueGoal = 19001,
  fromPos = {x = 982, y = 1022, z = 7},
  toPos = {x = 993, y = 1033, z = 7}
}
local function getPlayers()
  local thisTable = {}
  for x = t.fromPos.x, t.toPos.x do
      for y = t.fromPos.y, t.toPos.y do
        for z = t.fromPos.z, t.toPos.z do
            local myPos = {x = x, y = y, z = z}
            local player = getTopCreature(myPos).uid
            if player > 0 then table.insert(thisTable, player) else table.remove(thisTable, player) end
        end
      end
  end
  return {thisTable = thisTable}
end
local function repeatFlagOnPlayer(cid)
  local k = getThingPos(cid)
  local r = {
      {pos = {x = k.x + 2, y = k.y - 2, z = k.z}, delay = 300},
      {pos = {x = k.x + 2, y = k.y + 2, z = k.z}, delay = 300},
      {pos = {x = k.x - 2, y = k.y + 2, z = k.z}, delay = 300},
      {pos = {x = k.x - 2, y = k.y, z = k.z}, delay = 300},
      {pos = {x = k.x - 2, y = k.y - 2, z = k.z}, delay = 300},
      {pos = {x = k.x, y = k.y - 2, z = k.z}, delay = 300}
  }
  local effects = {27, 28, 29, 30}
  if isPlayer(cid) then
      if getPlayerStorageValue(cid, t.blueStorage) == 1 and getPlayerStorageValue(cid, t.redFlag) == 1 and getGlobalStorageValue(t.redFlag) == 1 then
        for i = 1, 6 do
            addEvent(doSendDistanceShoot, r[i].delay, r[i].pos, k, CONST_ME_FIREWORK_YELLOW)
        end
        for i = 1, 4 do
            addEvent(doSendMagicEffect, 1000, getThingPos(cid), effects[i])
        end
        return addEvent(repeatFlagOnPlayer, 1000, cid)
      elseif getPlayerStorageValue(cid, t.redStorage) == 1 and getPlayerStorageValue(cid, t.blueFlag) == 1 and getGlobalStorageValue(t.blueFlag) == 1 then
        for i = 1, 6 do
            addEvent(doSendDistanceShoot, r[i].delay, r[i].pos, k, CONST_ME_FIREWORK_YELLOW)
        end
        for i = 1, 4 do
            addEvent(doSendMagicEffect, 1000, getThingPos(cid), effects[i])
        end
        return addEvent(repeatFlagOnPlayer, 1000, cid)
      else
        return false
      end
  else
      return false
  end
end
function onStepIn(cid, item, position, fromPosition, toPosition, lastPosition, actor)
  if isPlayer(cid) then
      if item.actionid == 6000 then
        if getPlayerStorageValue(cid, t.redStorage) == 1 then
            if getPlayerStorageValue(cid, t.blueFlag) == -1 and getGlobalStorageValue(t.blueFlag) == -1 then
              setPlayerStorageValue(cid, t.blueFlag, 1)
              setGlobalStorageValue(t.blueFlag, 1)
              repeatFlagOnPlayer(cid)
              doBroadcastMessage(getCreatureName(cid) .. " has stolen the Blue Flag!")
            else
              doCreatureSay(cid, "The flag is not at home.", 19)
              doTeleportThing(cid, fromPosition, false)
            end
        else
            doCreatureSay(cid, "You may only pick up the opposite team flag.", 19)
            doTeleportThing(cid, fromPosition, false)
        end
      elseif item.actionid == 6001 then
        if getPlayerStorageValue(cid, t.blueStorage) == 1 then
            if getPlayerStorageValue(cid, t.redFlag) == -1 and getGlobalStorageValue(t.redFlag) == -1 then
              setPlayerStorageValue(cid, t.redFlag, 1)
              setGlobalStorageValue(t.redFlag, 1)
              repeatFlagOnPlayer(cid)
              doBroadcastMessage(getCreatureName(cid) .. " has stolen the Red flag!")
            else
              doCreatureSay(cid, "The flag is not at home.", 19)
              doTeleportThing(cid, fromPosition, false)
            end
        else
            doCreatureSay(cid, "The flag is not at home.", 19)
            doTeleportThing(cid, fromPosition, false)
        end
      end
      if item.actionid == 6002 then
        if getPlayerStorageValue(cid, t.redStorage) == 1 then
            if getPlayerStorageValue(cid, t.blueFlag) == 1 and getGlobalStorageValue(t.blueFlag) == 1 then
              setGlobalStorageValue(t.blueFlag, -1)
              setPlayerStorageValue(cid, t.blueFlag, -1)
              setGlobalStorageValue(t.redGoal, getGlobalStorageValue(t.redGoal)+1)
              doBroadcastMessage("Current CTF Game Score:\nRed Team: " .. getGlobalStorageValue(t.redGoal) .. "\nBlue Team: " .. getGlobalStorageValue(t.blueGoal) .. "\nTen Scores to win!", 20)
              doBroadcastMessage(getCreatureName(cid) .. " has scored 1 point for the Red Team!")
            else
              doCreatureSay(cid, "You dont have the flag.", 19)
              doTeleportThing(cid, fromPosition, false)
            end
        elseif getPlayerStorageValue(cid, t.blueStorage) == 1 then
            if getPlayerStorageValue(cid, t.redFlag) == 1 and getGlobalStorageValue(t.redFlag) == 1 then
              setGlobalStorageValue(t.redFlag, -1)
              setPlayerStorageValue(cid, t.redFlag, -1)
              setGlobalStorageValue(t.blueGoal, getGlobalStorageValue(t.blueGoal)+1)
              doBroadcastMessage("Current CTF Game Score:\nRed Team: " .. getGlobalStorageValue(t.redGoal) .. "\nBlue Team: " .. getGlobalStorageValue(t.blueGoal) .. "\nTen Scores to win!", 20)
              doBroadcastMessage(getCreatureName(cid) .. " has scored 1 point for the Blue Team!")
            else
              doCreatureSay(cid, "You dont have the flag.", 19)
              doTeleportThing(cid, fromPosition, false)
            end
        end
        if getGlobalStorageValue(t.blueGoal) == 10 and getGlobalStorageValue(t.redGoal) < 10 then
            for _, cid in ipairs(getPlayersOnline()) do
              if getPlayerStorageValue(cid, t.blueStorage) == 1 then
                  setPlayerStorageValue(cid, t.blueStorage, -1)
                  doPlayerAddItem(cid, 9020, math.random(1, 6))
              elseif getPlayerStorageValue(cid, t.redStorage) == 1 then
                  setPlayerStorageValue(cid, t.redStorage, -1)
              end
              doRemoveCondition(cid, CONDITION_OUTFIT)
              setGlobalStorageValue(t.redGoal, 0)
              setGlobalStorageValue(t.blueGoal, 0)
            end
            local FF = getPlayers().thisTable
            if #FF > 1 then
              for _, hh in ipairs(FF) do
                  doTeleportThing(hh, getTownTemplePosition(getPlayerTown(hh)), true)
              end
            end
        elseif getGlobalStorageValue(t.redGoal) == 10 and getGlobalStorageValue(t.blueGoal) < 10 then
            for _, cid in ipairs(getPlayersOnline()) do
              if getPlayerStorageValue(cid, t.redStorage) == 1 then
                  setPlayerStorageValue(cid, t.redStorage, -1)
                  doPlayerAddItem(cid, 9020, math.random(1, 6))
              elseif getPlayerStorageValue(cid, t.blueStorage) == 1 then
                  setPlayerStorageValue(cid, t.blueStorage, -1)
              end
              doRemoveCondition(cid, CONDITION_OUTFIT)
              setGlobalStorageValue(t.redGoal, 0)
              setGlobalStorageValue(t.blueGoal, 0)
            end
            local F = getPlayers().thisTable
            if #F > 1 then
              for _, h in ipairs(F) do
                  doTeleportThing(h, getTownTemplePosition(getPlayerTown(h)), true)
              end
            end
        end
      end
  else
      doRemoveCreature(cid)
  end
  return true
end

4.2.- ... En movements.xml :

Código:
<movevent type="StepIn" actionid="6000-6002" event="script" value="test.lua"/>

5.- ... Ahora a data/globalevents/scripts/start.lua y dentro agregamos esto:

Código:
setGlobalStorageValue(19000, 0)
setGlobalStorageValue(19001, 0)

6.- ... Y Finalmente las posiciones.

Código:
mple position = {x = 1025, y = 1028, z = 7}
waiting room pos = {x = 1009, y = 1027, z = 7},
red team = {x = 982, y = 1022, z = 7},
blue team = {x = 993, y = 1033, z = 7},
score position = {x = 987, y = 1027, z = 7},
red team flag position = {x = 987, y = 1032, z = 7},
blue team flag position = {x = 987, y = 1023, z = 7}

Ejecutar esta consulta después de seleccionar la base de datos:

Código:
UPDATE `players` SET posx = 1025, posy = 1028, posz = 7



Creditos :
99% desconosido
1%yo por traerlo



PD: Porfavor no me pregunten sobre este script porque no se nada solo lo traje :)
Volver arriba Ir abajo
Guest
Invitado
avatar



[Globalevent] Capture The Flag ! Empty
MensajeTema: Re: [Globalevent] Capture The Flag !   [Globalevent] Capture The Flag ! EmptySáb Jul 14, 2012 7:57 pm

Amigo esta chido pero recuerda donde postear REPORTADO
Volver arriba Ir abajo
Hazardous
Administrador
Administrador
Hazardous


Posts : 38
Points : 151
Reputation : -1
Join date : 09/07/2012

[Globalevent] Capture The Flag ! Empty
MensajeTema: Re: [Globalevent] Capture The Flag !   [Globalevent] Capture The Flag ! EmptySáb Jul 14, 2012 7:58 pm

Movido
Volver arriba Ir abajo
https://world-ots.forumotion.com
zinzin1

zinzin1


Posts : 4
Points : 4
Reputation : 0
Join date : 23/07/2012

[Globalevent] Capture The Flag ! Empty
MensajeTema: Re: [Globalevent] Capture The Flag !   [Globalevent] Capture The Flag ! EmptyLun Jul 23, 2012 10:17 pm

i donde va esto?
mple position = {x = 1025, y = 1028, z = 7}
waiting room pos = {x = 1009, y = 1027, z = 7},
red team = {x = 982, y = 1022, z = 7},
blue team = {x = 993, y = 1033, z = 7},
score position = {x = 987, y = 1027, z = 7},
red team flag position = {x = 987, y = 1032, z = 7},
blue team flag position = {x = 987, y = 1023, z = 7}
Volver arriba Ir abajo
Contenido patrocinado





[Globalevent] Capture The Flag ! Empty
MensajeTema: Re: [Globalevent] Capture The Flag !   [Globalevent] Capture The Flag ! Empty

Volver arriba Ir abajo
 
[Globalevent] Capture The Flag !
Volver arriba 
Página 1 de 1.

Permisos de este foro:No puedes responder a temas en este foro.
The World of Open Tibia :: OT'S En General :: Scripts-
Cambiar a: