• TibiaFace

    Tibiaface | Una comunidad Open Tibia donde encontras : mapas, scripts, Otserver, npc y amigos etc ...

    .
    demo menumenu

    Afiliados



    Votar:

    [Mods] Jaulas hunting (Evento Spot Monster)

    Compartir:

    Ver el tema anterior Ver el tema siguiente Ir abajo  Mensaje (Página 1 de 1.)

    [Admin] God Maya

    [Admin] God Maya
    Administrador
    Administrador
    Hola Usuarios de tibiaface


    Bueno aqui le traigo este mods muy interesante, este evento consiste en entrar a una jaula donde seran sumoneados moustros para up level los moustros seran sumoneados por usted mismo al pisar un sqm como tambien podra salir si usted lo desea pisando otro sqm. al ingresar al evento el evento te pedira un item llamado gold nuggets. el cual necesitas 1 bueno vamos a la instalacion:

    Nos vamos nuestra carpeta mods y copiamos cualquier archivo y renombramos por: m-huntingRoom.lua y pegamos este contenido dentro:


    Código:
    <?xml version="1.0" encoding="UTF-8"?>
    <mod name="Hunting_rooms" version='2.0' author='VirrageS' contact='otland.net' enabled='yes'>
       <config name="huntingConfig">
          <![CDATA[
             huntingConfig = {
                [1] = {
                   fromPos = {x=985, y=990, z=8}, -- left top corner of event room
                   toPos = {x=991, y=996, z=8},
                   teleportPos = {x=988, y=993, z=8},  --------> cuando pisas la entrada de la jaula te leporta a esta cordenada

                   expireTime = 900, -- w sekundach
                   enteryAid = 7001,  -------> es la entra a la jaula
                   monsters = {'Poison Spider', 6}  -----> lo que sumoneara y cantidad
                },

                [2] = {
                   fromPos = {x=2080, y=857, z=7},
                   toPos = {x=2090, y=867, z=7},
                   teleportPos = {x=2085, y=862, z=7},

                   expireTime = 900, -- w sekundach
                   enteryAid = 7002,
                   monsters = {'Grim Reaper', 6}
                },
                [3] = {
                   fromPos = {x=2098, y=857, z=7},
                   toPos = {x=2108, y=867, z=7},
                   teleportPos = {x=2103, y=862, z=7},

                   expireTime = 900, -- w sekundach
                   enteryAid = 7003,
                   monsters = {'Grim Reaper', 6}
                }
             }

             configHunting = {
                storage = 25050, -- jakies wolne storage
                
                timeStorage = 45648, -- jakies wolne storage
                
                storageExh = 25051, -- jakies wolne storage
                exhaust = 1, -- seckundy

                exhaustStorage = 4546,
                exhaustTime = 10, -- sekundy

                itemId = 2157
             }
          ]]>
       </config>
    <!-- avisa el tiempo restante dentro de la jaula -->
       <talkaction words="!timeleft" event="script">
          <![CDATA[
             domodlib("huntingConfig")

             function onSay(cid, words, param)
                if getCreatureStorage(cid, configHunting.storage) <= 0 then
                   return doPlayerSendCancel(cid, 'You can\'t do it if you aren\'t in hunting room.')
                end
                
                doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, 'You have '..getCreatureStorage(cid, configHunting.timeStorage)-os.time()..' seconds until you are teleporting out.')
                return true
             end
          ]]>
       </talkaction>

       <!-- al pisar este remueve la criaturas salida esquina inferior derecha-->
       <movement type="StepIn" actionid="2900" event="script">
          <![CDATA[
             domodlib("huntingConfig")

             function onStepIn(cid, item, position, lastPosition, fromPosition, toPosition, actor)
                if isPlayer(cid) then
                   for k, v in pairs(huntingConfig) do
                      if isInRange(getThingPos(cid), v.fromPos, v.toPos) then
                         for x = v.fromPos.x, v.toPos.x do
                            for y = v.fromPos.y, v.toPos.y do
                               doCleanTile({x=x, y=y, z=v.toPos.z})
                               local t = getTopCreature({x=x, y=y, z=v.toPos.z}).uid
                               if t ~= 0 then
                                  if isMonster(t) then
                                     doRemoveCreature(t)
                                  end
                               end
                            end
                         end
                         stopEvent(getCreatureStorage(cid, configHunting.storage))
                         doCreatureSetStorage(cid, configHunting.storage, -1)
                         doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid)), true)
                         doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, 'Your leaved from the room.')
                         break
                      end
                   end
                end
                return true
             end
          ]]>
       </movement>


       <!-- al pisar este sqm crea los moustros esqui superio izquierda -->
       <movement type="StepIn" actionid="2860" event="script">
          <![CDATA[
             domodlib("huntingConfig")

             function onStepIn(cid, item, position, lastPosition, fromPosition, toPosition, actor)
                local monsters, player = false, false
                if isPlayer(cid) then
                   for k, v in pairs(huntingConfig) do
                      if isInRange(getThingPos(cid), v.fromPos, v.toPos) then
                         for x = v.fromPos.x, v.toPos.x do
                            for y = v.fromPos.y, v.toPos.y do
                               doCleanTile({x=x, y=y, z=v.toPos.z})
                               local t = getTopCreature({x=x, y=y, z=v.toPos.z}).uid
                               if t ~= 0 then
                                  if isMonster(t) then
                                     monsters = true
                                  end
                               end
                            end
                         end
                         
                         if monsters then
                            doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, 'You haven\'t killed all monsters.')
                            doTeleportThing(cid, fromPosition)
                         else
                            if exhaustion.check(cid, configHunting.storageExh) then
                               doPlayerSendCancel(cid, 'You have to wait: '..exhaustion.get(cid, configHunting.storageExh)..' sec to respawn monsters again.')
                               doTeleportThing(cid, fromPosition)
                            else
                               exhaustion.set(cid, configHunting.storageExh, configHunting.exhaust)
                               doTeleportThing(cid, fromPosition, true)
                               doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, 'Monsters has been spawned.')
                               for i = 1, v.monsters[2] do
                                  doCreateMonster(v.monsters[1], v.teleportPos, false, false, false)
                               end
                            end
                         end
                         break
                      end
                   end
                end
                return true
             end
          ]]>
       </movement>

       <!-- to jest do wchodzenia do roomow -->
       <movement type="StepIn" actionid="7001-7003" event="script">
          <![CDATA[
             domodlib("huntingConfig")

             function onStepIn(cid, item, position, lastPosition, fromPosition, toPosition, actor)
                if isPlayer(cid) then
                   if getPlayerItemCount(cid, configHunting.itemId) < 1 then
                      return doPlayerSendTextMessage(cid, MESSAGE_STATUS_SMALL, 'You don\'t have required item. [' ..  getItemInfo(configHunting.itemId).name .. ']'), doTeleportThing(cid, fromPosition)
                   end

                   if exhaustion.check(cid, configHunting.exhaustStorage) ~= false then
                      return doPlayerSendTextMessage(cid, MESSAGE_STATUS_SMALL, 'You must to wait a ' .. exhaustion.get(cid, configHunting.exhaustStorage) .. ' sec.'), doTeleportThing(cid, fromPosition)
                   end

                   local monsters, player = {}, false
                   for k, v in pairs(huntingConfig) do
                      if v.enteryAid == item.actionid then
                         for x = v.fromPos.x, v.toPos.x do
                            for y = v.fromPos.y, v.toPos.y do
                               doCleanTile({x=x, y=y, z=v.toPos.z})
                               local t = getTopCreature({x=x, y=y, z=v.toPos.z}).uid
                               if t ~= 0 then
                                  if isMonster(t) then
                                     table.insert(monsters, t)
                                  else
                                     if isPlayer(t) then
                                        player = true
                                     end
                                  end
                               end
                            end
                         end
                         
                         if not player then
                            doTeleportThing(cid, v.teleportPos, true)
                            doPlayerRemoveItem(cid, configHunting.itemId, 1)
                            doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, 'You entered into room.')

                            local x = addEvent(removePlayerFromRoom, v.expireTime * 1000, cid, configHunting, huntingConfig)
                            doCreatureSetStorage(cid, configHunting.storage, x)
                            doCreatureSetStorage(cid, configHunting.timeStorage, os.time()+v.expireTime)
                            
                            for _, v in ipairs(monsters) do
                               if isCreature(v) then
                                  doRemoveCreature(v)
                               end
                            end
                         else
                            doTeleportThing(cid, fromPosition, true)
                            doPlayerSendCancel(cid, 'This room is full. Come later.')
                         end
                         break
                      end
                   end

                   exhaustion.set(cid, configHunting.exhaustStorage, configHunting.exhaustTime)
                end
                return true
             end

             function removePlayerFromRoom(pid, configHunting, huntingConfig)
                if isPlayer(pid) then
                   doTeleportThing(pid, getTownTemplePosition(getPlayerTown(pid)), true)
                   doPlayerSendTextMessage(pid, MESSAGE_STATUS_WARNING, 'Your time expired.')
                   doCreatureSetStorage(pid, configHunting.storage, -1)
                end
             end
          ]]>
       </movement>

       <event type="login" name="huntingRoom_login" event="script">
          <![CDATA[
             domodlib("huntingConfig")

             function onLogin(cid)
                registerCreatureEvent(cid, "huntingRoom_death")
                return true
             end
          ]]>
       </event>

       <event type="death" name="huntingRoom_death" event="script">
          <![CDATA[
             domodlib("huntingConfig")

             function onDeath(cid, target, damage, flags)
                if isPlayer(cid) then
                   if getCreatureStorage(cid, configHunting.storage) > 0 then
                      stopEvent(getCreatureStorage(cid, configHunting.storage))
                      doCreatureSetStorage(cid, configHunting.storage, -1)

                      for k, v in pairs(huntingConfig) do
                         if isInRange(getThingPos(cid), v.fromPos, v.toPos) then
                            for x = v.fromPos.x, v.toPos.x do
                               for y = v.fromPos.y, v.toPos.y do
                                  doCleanTile({x=x, y=y, z=v.toPos.z})
                                  local t = getTopCreature({x=x, y=y, z=v.toPos.z}).uid
                                  if t ~= 0 then
                                     if isMonster(t) then
                                        doRemoveCreature(t)
                                     end
                                  end
                               end
                            end
                            break
                         end
                      end
                   end
                end
                return true
             end
          ]]>
       </event>
    </mod>


    [Mods] Jaulas hunting (Evento Spot Monster) Captur16

    la configuracion es la misma para todas las jaulas el mod tiene 2 jaulas mas que puede habilitar si usted lo desea puede habilitar una la demas si no la confugura no le afecta, pero ahora vamos con la primera

    config:

    [1] = {
    fromPos = {x=985, y=990, z=8}, -- fromPos esquina superior izquierda como muestra la imagen
    toPos = {x=991, y=996, z=8}, -- toPos esquina inferiorior derecha como muestra la imagen
    teleportPos = {x=988, y=993, z=8},  ----> teleportPos cuando pisas la entrada de la jaula te leporta dentro de la jaula y la que tambien te pedira el gold nuggets.

    expireTime = 900, -- tiempo limite dentro de la jaula segundos


    enteryAid = 7001,  -------> actions id de la entrada de la jaula como muestra la imagen


    monsters = {'Poison Spider', 6}  -----> monster  que sumoneara y cantidad
    },



    otra configuracion:

    itemId = 2157 ------> este es el item que te pedira al entrar


    ahora nos fijamos en la imagen estos action id seran fijos en todas las jaulas

    rojo: aqui llevara el actionid en el sqm 2860 como muestra la imagen

    amarillo aqui llevara el actionid en el sqm 2900 como muestra la imagen


    ahora estos id varian dependiendo la cantidad de jaula se ira extendiendo


    Verde: aquillevara el actionid 7001 pero no es permanente para todas las jaula si no que ira en aumento ejmplo si tenemos dos jaulas mas entonces tendremos otra jaula con la entra actionid:

    7002
    7003

    y a asi sucesivamente.


    El comando !timeleft le indica el tiempo restante en la jaula



    bueno eso esto.


    creditos: por trae el evento y comprenderlo para poderselo explicar.



    [Mods] Jaulas hunting (Evento Spot Monster) YNU5B25
    5 participantes
    http://www.tibiaface.com

    Fremy

    Fremy
    Miembro
    Miembro
    Funciona para un tfs 1.2?

    5 participantes
    https://speeddrawn.wixsite.com/dosbarth/home/categories/monstruo

    [Admin] God Maya

    [Admin] God Maya
    Administrador
    Administrador
    Fremy escribió:Funciona para un tfs 1.2?

    no lo lamento soloe s compatible con tfs menores



    [Mods] Jaulas hunting (Evento Spot Monster) YNU5B25
    5 participantes
    http://www.tibiaface.com

    4[Mods] Jaulas hunting (Evento Spot Monster) Empty No Spawnea los monster. Jue Oct 22, 2020 9:27 pm

    ale_dro3

    ale_dro3
    Miembro
    Miembro
    Al pisar el SQM Que Spawnea los monsters da un pequeño Lag y en la consola ocurre esto:
    [Mods] Jaulas hunting (Evento Spot Monster) Error_10


    Los demas sqm funcionan bien, solo da error al pisar el sqm para spawnear, Los monsters no aparecen, aunque en el chat sale que si.. saludos

    5 participantes

    [Admin] God Maya

    [Admin] God Maya
    Administrador
    Administrador
    ale_dro3 escribió:Al pisar el SQM Que Spawnea los monsters da un pequeño Lag y en la consola ocurre esto:
    [Mods] Jaulas hunting (Evento Spot Monster) Error_10


    Los demas sqm funcionan bien, solo da error al pisar el sqm para spawnear, Los monsters no aparecen, aunque en el chat sale que si.. saludos

    prueba asi

    Código:


    <?xml version="1.0" encoding="UTF-8"?>
    <mod name="Hunting_rooms" version='2.0' author='VirrageS' contact='otland.net' enabled='yes'>
      <config name="huntingConfig">
          <![CDATA[
            huntingConfig = {
                [1] = {
                  fromPos = {x=985, y=990, z=8}, -- left top corner of event room
                  toPos = {x=991, y=996, z=8},
                  teleportPos = {x=988, y=993, z=8},  --------> cuando pisas la entrada de la jaula te leporta a esta cordenada

                  expireTime = 900, -- w sekundach
                  enteryAid = 7001,  -------> es la entra a la jaula
                  monsters = {'Poison Spider', 6}  -----> lo que sumoneara y cantidad
                },

                [2] = {
                  fromPos = {x=2080, y=857, z=7},
                  toPos = {x=2090, y=867, z=7},
                  teleportPos = {x=2085, y=862, z=7},

                  expireTime = 900, -- w sekundach
                  enteryAid = 7002,
                  monsters = {'Grim Reaper', 6}
                },
                [3] = {
                  fromPos = {x=2098, y=857, z=7},
                  toPos = {x=2108, y=867, z=7},
                  teleportPos = {x=2103, y=862, z=7},

                  expireTime = 900, -- w sekundach
                  enteryAid = 7003,
                  monsters = {'Grim Reaper', 6}
                }
            }

            configHunting = {
                storage = 25050, -- jakies wolne storage
               
                timeStorage = 45648, -- jakies wolne storage
               
                storageExh = 25051, -- jakies wolne storage
                exhaust = 1, -- seckundy

                exhaustStorage = 4546,
                exhaustTime = 10, -- sekundy

                itemId = 2157
            }
          ]]>
      </config>
    <!-- avisa el tiempo restante dentro de la jaula -->
      <talkaction words="!timeleft" event="script">
          <![CDATA[
            domodlib("huntingConfig")

            function onSay(cid, words, param)
                if getCreatureStorage(cid, configHunting.storage) <= 0 then
                  return doPlayerSendCancel(cid, 'You can\'t do it if you aren\'t in hunting room.')
                end
               
                doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, 'You have '..getCreatureStorage(cid, configHunting.timeStorage)-os.time()..' seconds until you are teleporting out.')
                return true
            end
          ]]>
      </talkaction>

      <!-- al pisar este remueve la criaturas salida esquina inferior derecha-->
      <movement type="StepIn" actionid="2900" event="script">
          <![CDATA[
            domodlib("huntingConfig")

            function onStepIn(cid, item, position, lastPosition, fromPosition, toPosition, actor)
                if isPlayer(cid) then
                  for k, v in pairs(huntingConfig) do
                      if isInRange(getThingPos(cid), v.fromPos, v.toPos) then
                        for x = v.fromPos.x, v.toPos.x do
                            for y = v.fromPos.y, v.toPos.y do
                              doCleanTile({x=x, y=y, z=v.toPos.z})
                              local t = getTopCreature({x=x, y=y, z=v.toPos.z}).uid
                              if t ~= 0 then
                                  if isMonster(t) then
                                    doRemoveCreature(t)
                                  end
                              end
                            end
                        end
                        stopEvent(getCreatureStorage(cid, configHunting.storage))
                        doCreatureSetStorage(cid, configHunting.storage, -1)
                        doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid)), true)
                        doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, 'Your leaved from the room.')
                        break
                      end
                  end
                end
                return true
            end
          ]]>
      </movement>


      <!-- al pisar este sqm crea los moustros esqui superio izquierda -->
      <movement type="StepIn" actionid="2860" event="script">
          <![CDATA[
            domodlib("huntingConfig")

            function onStepIn(cid, item, position, lastPosition, fromPosition, toPosition, actor)
                local monsters, player = false, false
                if isPlayer(cid) then
                  for k, v in pairs(huntingConfig) do
                      if isInRange(getThingPos(cid), v.fromPos, v.toPos) then
                        for x = v.fromPos.x, v.toPos.x do
                            for y = v.fromPos.y, v.toPos.y do
                              doCleanTile({x=x, y=y, z=v.toPos.z})
                              local t = getTopCreature({x=x, y=y, z=v.toPos.z}).uid
                              if t ~= 0 then
                                  if isMonster(t) then
                                    monsters = true
                                  end
                              end
                            end
                        end
                       
                        if monsters then
                            doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, 'You haven\'t killed all monsters.')
                            doTeleportThing(cid, fromPosition)
                        else
                            if exhaustion.check(cid, configHunting.storageExh) then
                              doPlayerSendCancel(cid, 'You have to wait: '..exhaustion.get(cid, configHunting.storageExh)..' sec to respawn monsters again.')
                              doTeleportThing(cid, fromPosition)
                            else
                              exhaustion.set(cid, configHunting.storageExh, configHunting.exhaust)
                              doTeleportThing(cid, fromPosition, true)
                              doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, 'Monsters has been spawned.')
                              for i = 1, v.monsters[2] do
                                doForceSummonCreature(v.monsters[1], v.teleportPos, false, false, false)
                              end
                            end
                        end
                        break
                      end
                  end
                end
                return true
            end
          ]]>
      </movement>

      <!-- to jest do wchodzenia do roomow -->
      <movement type="StepIn" actionid="7001-7003" event="script">
          <![CDATA[
            domodlib("huntingConfig")

            function onStepIn(cid, item, position, lastPosition, fromPosition, toPosition, actor)
                if isPlayer(cid) then
                  if getPlayerItemCount(cid, configHunting.itemId) < 1 then
                      return doPlayerSendTextMessage(cid, MESSAGE_STATUS_SMALL, 'You don\'t have required item. [' ..  getItemInfo(configHunting.itemId).name .. ']'), doTeleportThing(cid, fromPosition)
                  end

                  if exhaustion.check(cid, configHunting.exhaustStorage) ~= false then
                      return doPlayerSendTextMessage(cid, MESSAGE_STATUS_SMALL, 'You must to wait a ' .. exhaustion.get(cid, configHunting.exhaustStorage) .. ' sec.'), doTeleportThing(cid, fromPosition)
                  end

                  local monsters, player = {}, false
                  for k, v in pairs(huntingConfig) do
                      if v.enteryAid == item.actionid then
                        for x = v.fromPos.x, v.toPos.x do
                            for y = v.fromPos.y, v.toPos.y do
                              doCleanTile({x=x, y=y, z=v.toPos.z})
                              local t = getTopCreature({x=x, y=y, z=v.toPos.z}).uid
                              if t ~= 0 then
                                  if isMonster(t) then
                                    table.insert(monsters, t)
                                  else
                                    if isPlayer(t) then
                                        player = true
                                    end
                                  end
                              end
                            end
                        end
                       
                        if not player then
                            doTeleportThing(cid, v.teleportPos, true)
                            doPlayerRemoveItem(cid, configHunting.itemId, 1)
                            doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, 'You entered into room.')

                            local x = addEvent(removePlayerFromRoom, v.expireTime * 1000, cid, configHunting, huntingConfig)
                            doCreatureSetStorage(cid, configHunting.storage, x)
                            doCreatureSetStorage(cid, configHunting.timeStorage, os.time()+v.expireTime)
                           
                            for _, v in ipairs(monsters) do
                              if isCreature(v) then
                                  doRemoveCreature(v)
                              end
                            end
                        else
                            doTeleportThing(cid, fromPosition, true)
                            doPlayerSendCancel(cid, 'This room is full. Come later.')
                        end
                        break
                      end
                  end

                  exhaustion.set(cid, configHunting.exhaustStorage, configHunting.exhaustTime)
                end
                return true
            end

            function removePlayerFromRoom(pid, configHunting, huntingConfig)
                if isPlayer(pid) then
                  doTeleportThing(pid, getTownTemplePosition(getPlayerTown(pid)), true)
                  doPlayerSendTextMessage(pid, MESSAGE_STATUS_WARNING, 'Your time expired.')
                  doCreatureSetStorage(pid, configHunting.storage, -1)
                end
            end
          ]]>
      </movement>

      <event type="login" name="huntingRoom_login" event="script">
          <![CDATA[
            domodlib("huntingConfig")

            function onLogin(cid)
                registerCreatureEvent(cid, "huntingRoom_death")
                return true
            end
          ]]>
      </event>

      <event type="death" name="huntingRoom_death" event="script">
          <![CDATA[
            domodlib("huntingConfig")

            function onDeath(cid, target, damage, flags)
                if isPlayer(cid) then
                  if getCreatureStorage(cid, configHunting.storage) > 0 then
                      stopEvent(getCreatureStorage(cid, configHunting.storage))
                      doCreatureSetStorage(cid, configHunting.storage, -1)

                      for k, v in pairs(huntingConfig) do
                        if isInRange(getThingPos(cid), v.fromPos, v.toPos) then
                            for x = v.fromPos.x, v.toPos.x do
                              for y = v.fromPos.y, v.toPos.y do
                                  doCleanTile({x=x, y=y, z=v.toPos.z})
                                  local t = getTopCreature({x=x, y=y, z=v.toPos.z}).uid
                                  if t ~= 0 then
                                    if isMonster(t) then
                                        doRemoveCreature(t)
                                    end
                                  end
                              end
                            end
                            break
                        end
                      end
                  end
                end
                return true
            end
          ]]>
      </event>
    </mod>



    [Mods] Jaulas hunting (Evento Spot Monster) YNU5B25
    5 participantes
    http://www.tibiaface.com

    ale_dro3

    ale_dro3
    Miembro
    Miembro
    [Admin] God Maya escribió:
    ale_dro3 escribió:Al pisar el SQM Que Spawnea los monsters da un pequeño Lag y en la consola ocurre esto:
    [Mods] Jaulas hunting (Evento Spot Monster) Error_10


    Los demas sqm funcionan bien, solo da error al pisar el sqm para spawnear, Los monsters no aparecen, aunque en el chat sale que si.. saludos

    prueba asi

    Código:


    <?xml version="1.0" encoding="UTF-8"?>
    <mod name="Hunting_rooms" version='2.0' author='VirrageS' contact='otland.net' enabled='yes'>
       <config name="huntingConfig">
          <![CDATA[
             huntingConfig = {
                [1] = {
                   fromPos = {x=985, y=990, z=8}, -- left top corner of event room
                   toPos = {x=991, y=996, z=8},
                   teleportPos = {x=988, y=993, z=8},  --------> cuando pisas la entrada de la jaula te leporta a esta cordenada

                   expireTime = 900, -- w sekundach
                   enteryAid = 7001,  -------> es la entra a la jaula
                   monsters = {'Poison Spider', 6}  -----> lo que sumoneara y cantidad
                },

                [2] = {
                   fromPos = {x=2080, y=857, z=7},
                   toPos = {x=2090, y=867, z=7},
                   teleportPos = {x=2085, y=862, z=7},

                   expireTime = 900, -- w sekundach
                   enteryAid = 7002,
                   monsters = {'Grim Reaper', 6}
                },
                [3] = {
                   fromPos = {x=2098, y=857, z=7},
                   toPos = {x=2108, y=867, z=7},
                   teleportPos = {x=2103, y=862, z=7},

                   expireTime = 900, -- w sekundach
                   enteryAid = 7003,
                   monsters = {'Grim Reaper', 6}
                }
             }

             configHunting = {
                storage = 25050, -- jakies wolne storage
                
                timeStorage = 45648, -- jakies wolne storage
                
                storageExh = 25051, -- jakies wolne storage
                exhaust = 1, -- seckundy

                exhaustStorage = 4546,
                exhaustTime = 10, -- sekundy

                itemId = 2157
             }
          ]]>
       </config>
    <!-- avisa el tiempo restante dentro de la jaula -->
       <talkaction words="!timeleft" event="script">
          <![CDATA[
             domodlib("huntingConfig")

             function onSay(cid, words, param)
                if getCreatureStorage(cid, configHunting.storage) <= 0 then
                   return doPlayerSendCancel(cid, 'You can\'t do it if you aren\'t in hunting room.')
                end
                
                doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, 'You have '..getCreatureStorage(cid, configHunting.timeStorage)-os.time()..' seconds until you are teleporting out.')
                return true
             end
          ]]>
       </talkaction>

       <!-- al pisar este remueve la criaturas salida esquina inferior derecha-->
       <movement type="StepIn" actionid="2900" event="script">
          <![CDATA[
             domodlib("huntingConfig")

             function onStepIn(cid, item, position, lastPosition, fromPosition, toPosition, actor)
                if isPlayer(cid) then
                   for k, v in pairs(huntingConfig) do
                      if isInRange(getThingPos(cid), v.fromPos, v.toPos) then
                         for x = v.fromPos.x, v.toPos.x do
                            for y = v.fromPos.y, v.toPos.y do
                               doCleanTile({x=x, y=y, z=v.toPos.z})
                               local t = getTopCreature({x=x, y=y, z=v.toPos.z}).uid
                               if t ~= 0 then
                                  if isMonster(t) then
                                     doRemoveCreature(t)
                                  end
                               end
                            end
                         end
                         stopEvent(getCreatureStorage(cid, configHunting.storage))
                         doCreatureSetStorage(cid, configHunting.storage, -1)
                         doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid)), true)
                         doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, 'Your leaved from the room.')
                         break
                      end
                   end
                end
                return true
             end
          ]]>
       </movement>


       <!-- al pisar este sqm crea los moustros esqui superio izquierda -->
       <movement type="StepIn" actionid="2860" event="script">
          <![CDATA[
             domodlib("huntingConfig")

             function onStepIn(cid, item, position, lastPosition, fromPosition, toPosition, actor)
                local monsters, player = false, false
                if isPlayer(cid) then
                   for k, v in pairs(huntingConfig) do
                      if isInRange(getThingPos(cid), v.fromPos, v.toPos) then
                         for x = v.fromPos.x, v.toPos.x do
                            for y = v.fromPos.y, v.toPos.y do
                               doCleanTile({x=x, y=y, z=v.toPos.z})
                               local t = getTopCreature({x=x, y=y, z=v.toPos.z}).uid
                               if t ~= 0 then
                                  if isMonster(t) then
                                     monsters = true
                                  end
                               end
                            end
                         end
                        
                         if monsters then
                            doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, 'You haven\'t killed all monsters.')
                            doTeleportThing(cid, fromPosition)
                         else
                            if exhaustion.check(cid, configHunting.storageExh) then
                               doPlayerSendCancel(cid, 'You have to wait: '..exhaustion.get(cid, configHunting.storageExh)..' sec to respawn monsters again.')
                               doTeleportThing(cid, fromPosition)
                            else
                               exhaustion.set(cid, configHunting.storageExh, configHunting.exhaust)
                               doTeleportThing(cid, fromPosition, true)
                               doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, 'Monsters has been spawned.')
                               for i = 1, v.monsters[2] do
                                 doForceSummonCreature(v.monsters[1], v.teleportPos, false, false, false)
                               end
                            end
                         end
                         break
                      end
                   end
                end
                return true
             end
          ]]>
       </movement>

       <!-- to jest do wchodzenia do roomow -->
       <movement type="StepIn" actionid="7001-7003" event="script">
          <![CDATA[
             domodlib("huntingConfig")

             function onStepIn(cid, item, position, lastPosition, fromPosition, toPosition, actor)
                if isPlayer(cid) then
                   if getPlayerItemCount(cid, configHunting.itemId) < 1 then
                      return doPlayerSendTextMessage(cid, MESSAGE_STATUS_SMALL, 'You don\'t have required item. [' ..  getItemInfo(configHunting.itemId).name .. ']'), doTeleportThing(cid, fromPosition)
                   end

                   if exhaustion.check(cid, configHunting.exhaustStorage) ~= false then
                      return doPlayerSendTextMessage(cid, MESSAGE_STATUS_SMALL, 'You must to wait a ' .. exhaustion.get(cid, configHunting.exhaustStorage) .. ' sec.'), doTeleportThing(cid, fromPosition)
                   end

                   local monsters, player = {}, false
                   for k, v in pairs(huntingConfig) do
                      if v.enteryAid == item.actionid then
                         for x = v.fromPos.x, v.toPos.x do
                            for y = v.fromPos.y, v.toPos.y do
                               doCleanTile({x=x, y=y, z=v.toPos.z})
                               local t = getTopCreature({x=x, y=y, z=v.toPos.z}).uid
                               if t ~= 0 then
                                  if isMonster(t) then
                                     table.insert(monsters, t)
                                  else
                                     if isPlayer(t) then
                                        player = true
                                     end
                                  end
                               end
                            end
                         end
                        
                         if not player then
                            doTeleportThing(cid, v.teleportPos, true)
                            doPlayerRemoveItem(cid, configHunting.itemId, 1)
                            doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, 'You entered into room.')

                            local x = addEvent(removePlayerFromRoom, v.expireTime * 1000, cid, configHunting, huntingConfig)
                            doCreatureSetStorage(cid, configHunting.storage, x)
                            doCreatureSetStorage(cid, configHunting.timeStorage, os.time()+v.expireTime)
                            
                            for _, v in ipairs(monsters) do
                               if isCreature(v) then
                                  doRemoveCreature(v)
                               end
                            end
                         else
                            doTeleportThing(cid, fromPosition, true)
                            doPlayerSendCancel(cid, 'This room is full. Come later.')
                         end
                         break
                      end
                   end

                   exhaustion.set(cid, configHunting.exhaustStorage, configHunting.exhaustTime)
                end
                return true
             end

             function removePlayerFromRoom(pid, configHunting, huntingConfig)
                if isPlayer(pid) then
                   doTeleportThing(pid, getTownTemplePosition(getPlayerTown(pid)), true)
                   doPlayerSendTextMessage(pid, MESSAGE_STATUS_WARNING, 'Your time expired.')
                   doCreatureSetStorage(pid, configHunting.storage, -1)
                end
             end
          ]]>
       </movement>

       <event type="login" name="huntingRoom_login" event="script">
          <![CDATA[
             domodlib("huntingConfig")

             function onLogin(cid)
                registerCreatureEvent(cid, "huntingRoom_death")
                return true
             end
          ]]>
       </event>

       <event type="death" name="huntingRoom_death" event="script">
          <![CDATA[
             domodlib("huntingConfig")

             function onDeath(cid, target, damage, flags)
                if isPlayer(cid) then
                   if getCreatureStorage(cid, configHunting.storage) > 0 then
                      stopEvent(getCreatureStorage(cid, configHunting.storage))
                      doCreatureSetStorage(cid, configHunting.storage, -1)

                      for k, v in pairs(huntingConfig) do
                         if isInRange(getThingPos(cid), v.fromPos, v.toPos) then
                            for x = v.fromPos.x, v.toPos.x do
                               for y = v.fromPos.y, v.toPos.y do
                                  doCleanTile({x=x, y=y, z=v.toPos.z})
                                  local t = getTopCreature({x=x, y=y, z=v.toPos.z}).uid
                                  if t ~= 0 then
                                     if isMonster(t) then
                                        doRemoveCreature(t)
                                     end
                                  end
                               end
                            end
                            break
                         end
                      end
                   end
                end
                return true
             end
          ]]>
       </event>
    </mod>

    Ahora sale esto, y no aparecen los mosnters.
    [Tienes que estar registrado y conectado para ver este vínculo]
    [Mods] Jaulas hunting (Evento Spot Monster) Error210

    5 participantes

    [Admin] God Maya

    [Admin] God Maya
    Administrador
    Administrador
    ale_dro3 escribió:
    [Admin] God Maya escribió:
    ale_dro3 escribió:Al pisar el SQM Que Spawnea los monsters da un pequeño Lag y en la consola ocurre esto:
    [Mods] Jaulas hunting (Evento Spot Monster) Error_10


    Los demas sqm funcionan bien, solo da error al pisar el sqm para spawnear, Los monsters no aparecen, aunque en el chat sale que si.. saludos

    prueba asi


    Ahora sale esto, y no aparecen los mosnters.
    [Tienes que estar registrado y conectado para ver este vínculo]
    [Mods] Jaulas hunting (Evento Spot Monster) Error210

    prueba asi de nuevo

    Código:

    <?xml version="1.0" encoding="UTF-8"?>
    <mod name="Hunting_rooms" version='2.0' author='VirrageS' contact='otland.net' enabled='yes'>
      <config name="huntingConfig">
          <![CDATA[
            huntingConfig = {
                [1] = {
                  fromPos = {x=985, y=990, z=8}, -- left top corner of event room
                  toPos = {x=991, y=996, z=8},
                  teleportPos = {x=988, y=993, z=8},  --------> cuando pisas la entrada de la jaula te leporta a esta cordenada

                  expireTime = 900, -- w sekundach
                  enteryAid = 7001,  -------> es la entra a la jaula
                  monsters = {"Poison Spider", 6}  -----> lo que sumoneara y cantidad
                },

                [2] = {
                  fromPos = {x=2080, y=857, z=7},
                  toPos = {x=2090, y=867, z=7},
                  teleportPos = {x=2085, y=862, z=7},

                  expireTime = 900, -- w sekundach
                  enteryAid = 7002,
                  monsters = {"Grim Reaper", 6}
                },
                [3] = {
                  fromPos = {x=2098, y=857, z=7},
                  toPos = {x=2108, y=867, z=7},
                  teleportPos = {x=2103, y=862, z=7},

                  expireTime = 900, -- w sekundach
                  enteryAid = 7003,
                  monsters = {"Grim Reaper", 6}
                }
            }

            configHunting = {
                storage = 25050, -- jakies wolne storage
               
                timeStorage = 45648, -- jakies wolne storage
               
                storageExh = 25051, -- jakies wolne storage
                exhaust = 1, -- seckundy

                exhaustStorage = 4546,
                exhaustTime = 10, -- sekundy

                itemId = 2157
            }
          ]]>
      </config>
    <!-- avisa el tiempo restante dentro de la jaula -->
      <talkaction words="!timeleft" event="script">
          <![CDATA[
            domodlib("huntingConfig")

            function onSay(cid, words, param)
                if getCreatureStorage(cid, configHunting.storage) <= 0 then
                  return doPlayerSendCancel(cid, 'You can\'t do it if you aren\'t in hunting room.')
                end
               
                doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, 'You have '..getCreatureStorage(cid, configHunting.timeStorage)-os.time()..' seconds until you are teleporting out.')
                return true
            end
          ]]>
      </talkaction>

      <!-- al pisar este remueve la criaturas salida esquina inferior derecha-->
      <movement type="StepIn" actionid="2900" event="script">
          <![CDATA[
            domodlib("huntingConfig")

            function onStepIn(cid, item, position, lastPosition, fromPosition, toPosition, actor)
                if isPlayer(cid) then
                  for k, v in pairs(huntingConfig) do
                      if isInRange(getThingPos(cid), v.fromPos, v.toPos) then
                        for x = v.fromPos.x, v.toPos.x do
                            for y = v.fromPos.y, v.toPos.y do
                              doCleanTile({x=x, y=y, z=v.toPos.z})
                              local t = getTopCreature({x=x, y=y, z=v.toPos.z}).uid
                              if t ~= 0 then
                                  if isMonster(t) then
                                    doRemoveCreature(t)
                                  end
                              end
                            end
                        end
                        stopEvent(getCreatureStorage(cid, configHunting.storage))
                        doCreatureSetStorage(cid, configHunting.storage, -1)
                        doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid)), true)
                        doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, 'Your leaved from the room.')
                        break
                      end
                  end
                end
                return true
            end
          ]]>
      </movement>


      <!-- al pisar este sqm crea los moustros esqui superio izquierda -->
      <movement type="StepIn" actionid="2860" event="script">
          <![CDATA[
            domodlib("huntingConfig")

            function onStepIn(cid, item, position, lastPosition, fromPosition, toPosition, actor)
                local monsters, player = false, false
                if isPlayer(cid) then
                  for k, v in pairs(huntingConfig) do
                      if isInRange(getThingPos(cid), v.fromPos, v.toPos) then
                        for x = v.fromPos.x, v.toPos.x do
                            for y = v.fromPos.y, v.toPos.y do
                              doCleanTile({x=x, y=y, z=v.toPos.z})
                              local t = getTopCreature({x=x, y=y, z=v.toPos.z}).uid
                              if t ~= 0 then
                                  if isMonster(t) then
                                    monsters = true
                                  end
                              end
                            end
                        end
                       
                        if monsters then
                            doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, 'You haven\'t killed all monsters.')
                            doTeleportThing(cid, fromPosition)
                        else
                            if exhaustion.check(cid, configHunting.storageExh) then
                              doPlayerSendCancel(cid, 'You have to wait: '..exhaustion.get(cid, configHunting.storageExh)..' sec to respawn monsters again.')
                              doTeleportThing(cid, fromPosition)
                            else
                              exhaustion.set(cid, configHunting.storageExh, configHunting.exhaust)
                              doTeleportThing(cid, fromPosition, true)
                              doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, 'Monsters has been spawned.')
                              for i = 1, v.monsters[2] do
                                  doCreateMonster(v.monsters[1], v.teleportPos, false, false, false)
                              end
                            end
                        end
                        break
                      end
                  end
                end
                return true
            end
          ]]>
      </movement>

      <!-- to jest do wchodzenia do roomow -->
      <movement type="StepIn" actionid="7001-7003" event="script">
          <![CDATA[
            domodlib("huntingConfig")

            function onStepIn(cid, item, position, lastPosition, fromPosition, toPosition, actor)
                if isPlayer(cid) then
                  if getPlayerItemCount(cid, configHunting.itemId) < 1 then
                      return doPlayerSendTextMessage(cid, MESSAGE_STATUS_SMALL, 'You don\'t have required item. [' ..  getItemInfo(configHunting.itemId).name .. ']'), doTeleportThing(cid, fromPosition)
                  end

                  if exhaustion.check(cid, configHunting.exhaustStorage) ~= false then
                      return doPlayerSendTextMessage(cid, MESSAGE_STATUS_SMALL, 'You must to wait a ' .. exhaustion.get(cid, configHunting.exhaustStorage) .. ' sec.'), doTeleportThing(cid, fromPosition)
                  end

                  local monsters, player = {}, false
                  for k, v in pairs(huntingConfig) do
                      if v.enteryAid == item.actionid then
                        for x = v.fromPos.x, v.toPos.x do
                            for y = v.fromPos.y, v.toPos.y do
                              doCleanTile({x=x, y=y, z=v.toPos.z})
                              local t = getTopCreature({x=x, y=y, z=v.toPos.z}).uid
                              if t ~= 0 then
                                  if isMonster(t) then
                                    table.insert(monsters, t)
                                  else
                                    if isPlayer(t) then
                                        player = true
                                    end
                                  end
                              end
                            end
                        end
                       
                        if not player then
                            doTeleportThing(cid, v.teleportPos, true)
                            doPlayerRemoveItem(cid, configHunting.itemId, 1)
                            doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, 'You entered into room.')

                            local x = addEvent(removePlayerFromRoom, v.expireTime * 1000, cid, configHunting, huntingConfig)
                            doCreatureSetStorage(cid, configHunting.storage, x)
                            doCreatureSetStorage(cid, configHunting.timeStorage, os.time()+v.expireTime)
                           
                            for _, v in ipairs(monsters) do
                              if isCreature(v) then
                                  doRemoveCreature(v)
                              end
                            end
                        else
                            doTeleportThing(cid, fromPosition, true)
                            doPlayerSendCancel(cid, 'This room is full. Come later.')
                        end
                        break
                      end
                  end

                  exhaustion.set(cid, configHunting.exhaustStorage, configHunting.exhaustTime)
                end
                return true
            end

            function removePlayerFromRoom(pid, configHunting, huntingConfig)
                if isPlayer(pid) then
                  doTeleportThing(pid, getTownTemplePosition(getPlayerTown(pid)), true)
                  doPlayerSendTextMessage(pid, MESSAGE_STATUS_WARNING, 'Your time expired.')
                  doCreatureSetStorage(pid, configHunting.storage, -1)
                end
            end
          ]]>
      </movement>

      <event type="login" name="huntingRoom_login" event="script">
          <![CDATA[
            domodlib("huntingConfig")

            function onLogin(cid)
                registerCreatureEvent(cid, "huntingRoom_death")
                return true
            end
          ]]>
      </event>

      <event type="death" name="huntingRoom_death" event="script">
          <![CDATA[
            domodlib("huntingConfig")

            function onDeath(cid, target, damage, flags)
                if isPlayer(cid) then
                  if getCreatureStorage(cid, configHunting.storage) > 0 then
                      stopEvent(getCreatureStorage(cid, configHunting.storage))
                      doCreatureSetStorage(cid, configHunting.storage, -1)

                      for k, v in pairs(huntingConfig) do
                        if isInRange(getThingPos(cid), v.fromPos, v.toPos) then
                            for x = v.fromPos.x, v.toPos.x do
                              for y = v.fromPos.y, v.toPos.y do
                                  doCleanTile({x=x, y=y, z=v.toPos.z})
                                  local t = getTopCreature({x=x, y=y, z=v.toPos.z}).uid
                                  if t ~= 0 then
                                    if isMonster(t) then
                                        doRemoveCreature(t)
                                    end
                                  end
                              end
                            end
                            break
                        end
                      end
                  end
                end
                return true
            end
          ]]>
      </event>
    </mod>



    [Mods] Jaulas hunting (Evento Spot Monster) YNU5B25
    5 participantes
    http://www.tibiaface.com

    ale_dro3

    ale_dro3
    Miembro
    Miembro
    HOLA, COMO SE HABRAN DADO CUENTA LOS MONSTERS NO SPAWNEABAN PERO MAYA SE PORTO MUY AMABLE, LA VERSION DE MI CONSOLA ES "The OTX Server Version: (2.51 - SE - 1549) - Codename: (Necron)"
    No se si sea esa la versión pero asi dice cuando arranca xD, les dejo el codigo que probaablemente les funcione:

    Código:
    <?xml version="1.0" encoding="UTF-8"?>
    <mod name="Hunting_rooms" version='2.0' author='VirrageS' contact='otland.net' enabled='yes'>
      <config name="huntingConfig">
          <![CDATA[
            huntingConfig = {
                [1] = {
                  fromPos = {x=532, y=1408, z=7}, -- left top corner of event room
                  toPos = {x=535, y=1413, z=7},
                  teleportPos = {x=535, y=1410, z=7},  --------> cuando pisas la entrada de la jaula te leporta a esta cordenada

                  expireTime = 900, -- w sekundach
                  enteryAid = 7001,  -------> es la entra a la jaula
                  monsters = {"Barrera", 6}  -----> lo que sumoneara y cantidad
                },

                [2] = {
                  fromPos = {x=2080, y=857, z=7},
                  toPos = {x=2090, y=867, z=7},
                  teleportPos = {x=2085, y=862, z=7},

                  expireTime = 900, -- w sekundach
                  enteryAid = 7002,
                  monsters = {"Grim Reaper", 6}
                },
                [3] = {
                  fromPos = {x=2098, y=857, z=7},
                  toPos = {x=2108, y=867, z=7},
                  teleportPos = {x=2103, y=862, z=7},

                  expireTime = 900, -- w sekundach
                  enteryAid = 7003,
                  monsters = {"Grim Reaper", 6}
                }
            }

            configHunting = {
                storage = 25050, -- jakies wolne storage
               
                timeStorage = 45648, -- jakies wolne storage
               
                storageExh = 25051, -- jakies wolne storage
                exhaust = 1, -- seckundy

                exhaustStorage = 4546,
                exhaustTime = 10, -- sekundy

                itemId = 2157
            }
          ]]>
      </config>
    <!-- avisa el tiempo restante dentro de la jaula -->
      <talkaction words="!timeleft" event="script">
          <![CDATA[
            domodlib("huntingConfig")

            function onSay(cid, words, param)
                if getCreatureStorage(cid, configHunting.storage) <= 0 then
                  return doPlayerSendCancel(cid, 'You can\'t do it if you aren\'t in hunting room.')
                end
               
                doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, 'You have '..getCreatureStorage(cid, configHunting.timeStorage)-os.time()..' seconds until you are teleporting out.')
                return true
            end
          ]]>
      </talkaction>

      <!-- al pisar este remueve la criaturas salida esquina inferior derecha-->
      <movement type="StepIn" actionid="2900" event="script">
          <![CDATA[
            domodlib("huntingConfig")

            function onStepIn(cid, item, position, lastPosition, fromPosition, toPosition, actor)
                if isPlayer(cid) then
                  for k, v in pairs(huntingConfig) do
                      if isInRange(getThingPos(cid), v.fromPos, v.toPos) then
                        for x = v.fromPos.x, v.toPos.x do
                            for y = v.fromPos.y, v.toPos.y do
                              doCleanTile({x=x, y=y, z=v.toPos.z})
                              local t = getTopCreature({x=x, y=y, z=v.toPos.z}).uid
                              if t ~= 0 then
                                  if isMonster(t) then
                                    doRemoveCreature(t)
                                  end
                              end
                            end
                        end
                        stopEvent(getCreatureStorage(cid, configHunting.storage))
                        doCreatureSetStorage(cid, configHunting.storage, -1)
                        doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid)), true)
                        doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, 'Your leaved from the room.')
                        break
                      end
                  end
                end
                return true
            end
          ]]>
      </movement>


      <!-- al pisar este sqm crea los moustros esqui superio izquierda -->
      <movement type="StepIn" actionid="2860" event="script">
          <![CDATA[
            domodlib("huntingConfig")

            function onStepIn(cid, item, position, lastPosition, fromPosition, toPosition, actor)
                local monsters, player = false, false
                if isPlayer(cid) then
                  for k, v in pairs(huntingConfig) do
                      if isInRange(getThingPos(cid), v.fromPos, v.toPos) then
                        for x = v.fromPos.x, v.toPos.x do
                            for y = v.fromPos.y, v.toPos.y do
                              doCleanTile({x=x, y=y, z=v.toPos.z})
                              local t = getTopCreature({x=x, y=y, z=v.toPos.z}).uid
                              if t ~= 0 then
                                  if isMonster(t) then
                                    monsters = true
                                  end
                              end
                            end
                        end
                       
                        if monsters then
                            doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, 'You haven\'t killed all monsters.')
                            doTeleportThing(cid, fromPosition)
                        else
                            if exhaustion.check(cid, configHunting.storageExh) then
                              doPlayerSendCancel(cid, 'You have to wait: '..exhaustion.get(cid, configHunting.storageExh)..' sec to respawn monsters again.')
                              doTeleportThing(cid, fromPosition)
                            else
                              exhaustion.set(cid, configHunting.storageExh, configHunting.exhaust)
                              doTeleportThing(cid, fromPosition, true)
                              doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, 'Monsters has been spawned.')
                              for i = 1, v.monsters[2] do
                                  doCreateMonster(v.monsters[1], v.teleportPos)
                              end
                            end
                        end
                        break
                      end
                  end
                end
                return true
            end
          ]]>
      </movement>

      <!-- to jest do wchodzenia do roomow -->
      <movement type="StepIn" actionid="7001-7003" event="script">
          <![CDATA[
            domodlib("huntingConfig")

            function onStepIn(cid, item, position, lastPosition, fromPosition, toPosition, actor)
                if isPlayer(cid) then
                  if getPlayerItemCount(cid, configHunting.itemId) < 1 then
                      return doPlayerSendTextMessage(cid, MESSAGE_STATUS_SMALL, 'You don\'t have required item. [' ..  getItemInfo(configHunting.itemId).name .. ']'), doTeleportThing(cid, fromPosition)
                  end

                  if exhaustion.check(cid, configHunting.exhaustStorage) ~= false then
                      return doPlayerSendTextMessage(cid, MESSAGE_STATUS_SMALL, 'You must to wait a ' .. exhaustion.get(cid, configHunting.exhaustStorage) .. ' sec.'), doTeleportThing(cid, fromPosition)
                  end

                  local monsters, player = {}, false
                  for k, v in pairs(huntingConfig) do
                      if v.enteryAid == item.actionid then
                        for x = v.fromPos.x, v.toPos.x do
                            for y = v.fromPos.y, v.toPos.y do
                              doCleanTile({x=x, y=y, z=v.toPos.z})
                              local t = getTopCreature({x=x, y=y, z=v.toPos.z}).uid
                              if t ~= 0 then
                                  if isMonster(t) then
                                    table.insert(monsters, t)
                                  else
                                    if isPlayer(t) then
                                        player = true
                                    end
                                  end
                              end
                            end
                        end
                       
                        if not player then
                            doTeleportThing(cid, v.teleportPos, true)
                            doPlayerRemoveItem(cid, configHunting.itemId, 1)
                            doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, 'You entered into room.')

                            local x = addEvent(removePlayerFromRoom, v.expireTime * 1000, cid, configHunting, huntingConfig)
                            doCreatureSetStorage(cid, configHunting.storage, x)
                            doCreatureSetStorage(cid, configHunting.timeStorage, os.time()+v.expireTime)
                           
                            for _, v in ipairs(monsters) do
                              if isCreature(v) then
                                  doRemoveCreature(v)
                              end
                            end
                        else
                            doTeleportThing(cid, fromPosition, true)
                            doPlayerSendCancel(cid, 'This room is full. Come later.')
                        end
                        break
                      end
                  end

                  exhaustion.set(cid, configHunting.exhaustStorage, configHunting.exhaustTime)
                end
                return true
            end

            function removePlayerFromRoom(pid, configHunting, huntingConfig)
                if isPlayer(pid) then
                  doTeleportThing(pid, getTownTemplePosition(getPlayerTown(pid)), true)
                  doPlayerSendTextMessage(pid, MESSAGE_STATUS_WARNING, 'Your time expired.')
                  doCreatureSetStorage(pid, configHunting.storage, -1)
                end
            end
          ]]>
      </movement>

      <event type="login" name="huntingRoom_login" event="script">
          <![CDATA[
            domodlib("huntingConfig")

            function onLogin(cid)
                registerCreatureEvent(cid, "huntingRoom_death")
                return true
            end
          ]]>
      </event>

      <event type="death" name="huntingRoom_death" event="script">
          <![CDATA[
            domodlib("huntingConfig")

            function onDeath(cid, target, damage, flags)
                if isPlayer(cid) then
                  if getCreatureStorage(cid, configHunting.storage) > 0 then
                      stopEvent(getCreatureStorage(cid, configHunting.storage))
                      doCreatureSetStorage(cid, configHunting.storage, -1)

                      for k, v in pairs(huntingConfig) do
                        if isInRange(getThingPos(cid), v.fromPos, v.toPos) then
                            for x = v.fromPos.x, v.toPos.x do
                              for y = v.fromPos.y, v.toPos.y do
                                  doCleanTile({x=x, y=y, z=v.toPos.z})
                                  local t = getTopCreature({x=x, y=y, z=v.toPos.z}).uid
                                  if t ~= 0 then
                                    if isMonster(t) then
                                        doRemoveCreature(t)
                                    end
                                  end
                              end
                            end
                            break
                        end
                      end
                  end
                end
                return true
            end
          ]]>
      </event>
    </mod>

    5 participantes

    Dfsuno

    Dfsuno
    Miembro
    Miembro
    funcion en otx tibiaface v4?

    5 participantes

    [Admin] God Maya

    [Admin] God Maya
    Administrador
    Administrador
    Dfsuno escribió:funcion en otx tibiaface v4?


    si funciona



    [Mods] Jaulas hunting (Evento Spot Monster) YNU5B25
    5 participantes
    http://www.tibiaface.com

    akane

    akane
    Miembro
    Miembro
    el comando timeleft no me funciona, no hace nada pero tampoco me da error en la consola

    5 participantes

    [Admin] God Maya

    [Admin] God Maya
    Administrador
    Administrador
    poncex escribió:el comando timeleft no me funciona, no hace nada pero tampoco me da error en la consola

    esto fue testeado en la consola otx 2 con un excelente funcionamiento



    [Mods] Jaulas hunting (Evento Spot Monster) YNU5B25
    5 participantes
    http://www.tibiaface.com

    Contenido patrocinado


    5 participantes

    Ver el tema anterior Ver el tema siguiente Volver arriba  Mensaje (Página 1 de 1.)

    Permisos de este foro:
    No puedes responder a temas en este foro.

     

    BienvenidosTibiaFace es una comunidad de Open Tibia. Para participar debes estar registrado (click para Regístrate).