RevScript Remove Door / Item Acess

Alex

Administrator
Dev
Messages
2,368
Points
707
Hola a todos,

Aquí les comparto el script de remover una pared / item o lo que sea, para acceder a una sala de tesoros, por ejemplo
Si tienen imaginación, pueden añadirle un TP en la sala para ir en otra sala e asi convertir esto por ejemplo en un dungeon.

Para esto, se trata de una ' estrategia ', crear por ejemplo un nuevo boss en su servidor , le hacen la promoción en la pagina web, etc.
Diciendo que matando el boss en un sitio determinado desbloqueara la room , así los players deberan encontrar la táctica y esto puede hacerlo mas rpg.

Aquí un vídeo de como funciona

Video Password: lepiigortv

Video link:


El script basta en añadir 2 posiciones en donde habrá que matar el Monstruo,
Abra que añadirle el ItemID que removerá y 15, son 15 Segundos.

Code:
local config = {
    positionCheck = {north_west = Position(32368, 32172, 7), south_east = Position(32371, 32172, 7)},
    item = {Position(32368, 32169, 7), 22766}, -- {item_position, itemid}
    timer = 15, -- timer is how long until the 'stone' aka: item, is replaced.
    discoveryText = "A passageway has opened nearby!\nQuickly, get inside!"
}

local toggle = 0
local function changePassageway()
    local item = Tile(config.item[1]):getItemById(config.item[2])
    if item then
        item:remove()
        return true
    end
    config.item[1]:sendMagicEffect(CONST_ME_BIGPLANTS)
    Game.createItem(config.item[2], 1, config.item[1])
    toggle = 0
end

local creatureevent = CreatureEvent("onDeath_open_passageway")

function creatureevent.onDeath(creature, corpse, killer, mostDamageKiller, lastHitUnjustified, mostDamageUnjustified)
    if toggle == 1 then
        return true
    end
    local deathPosition = creature:getPosition()
    if not deathPosition:isInRange(config.positionCheck.north_west, config.positionCheck.south_east) then
        return true
    end
    toggle = 1
    config.item[1]:sendMagicEffect(CONST_ME_POFF)
    changePassageway()
    addEvent(changePassageway, config.timer * 1000)
    creature:say(config.discoveryText, TALKTYPE_MONSTER_SAY, false, nil, deathPosition)  
    return true
end

creatureevent:register()

Para que funcione con el boss, debereis ir en el script de vuestro boss.lua , el que habreis creado, y debajo de monsters.flags, antes de monster.light
Ejemplo en rat.lua = Linea 67 se anadira el script entre los dos y pondreis este script:

Code:
monster.events = {
    "onDeath_open_passageway"
}

Si desean hacer este script para una Hunt especial, para que por ejemplo estais cazando demons y tenga un 5% matando un demon en una Tile determinada y tenga un % de abrir una puerta secreta hacia un teleport , usen este script:

Ps: No olviden cambiar las positiones

Code:
local config = {
    positionCheck = {north_west = Position(99, 99, 7), south_east = Position(101, 101, 7)},
    item = {Position(103, 100, 7), 1285}, -- {item_position, itemid}
    timer = 20, -- timer is how long until the 'stone' aka: item, is replaced.
    chance = 5, -- percentage out of 100. 5/100
    discoveryText = "A passageway has opened nearby!\nQuickly, get inside!"
}

local toggle = 0
local function changePassageway()
    local item = Tile(config.item[1]):getItemById(config.item[2])
    if item then
        item:remove()
        return true
    end
    config.item[1]:sendMagicEffect(CONST_ME_BIGPLANTS)
    Game.createItem(config.item[2], 1, config.item[1])
    toggle = 0
end

local creatureevent = CreatureEvent("onDeath_open_passageway")

function creatureevent.onDeath(creature, corpse, killer, mostDamageKiller, lastHitUnjustified, mostDamageUnjustified)
    if toggle == 1 then
        return true
    end
    local deathPosition = creature:getPosition()
    if not deathPosition:isInRange(config.positionCheck.north_west, config.positionCheck.south_east) then
        return true
    end
    if math.random(100) <= config.chance then
        toggle = 1
        config.item[1]:sendMagicEffect(CONST_ME_POFF)
        changePassageway()
        addEvent(changePassageway, config.timer * 1000)
        creature:say(config.discoveryText, TALKTYPE_MONSTER_SAY, false, nil, deathPosition)
    end
    return true
end

creatureevent:register()
 
Last edited:
hola amigo buen dia me pregunto si podrias ayudarme me gustaria crear una sala roms pero quiero que por un tiempo de 2 minutos luego de estar en la roms sea expulsado a de terminada posición podria ayudarme con eso ?
 
hola amigo buen dia me pregunto si podrias ayudarme me gustaria crear una sala roms pero quiero que por un tiempo de 2 minutos luego de estar en la roms sea expulsado a de terminada posición podria ayudarme con eso ?

Este script debería de funcionarte,
Es para usar una palanca entrar en una sala, mirate bien las posiciones, si en el tiempo determinado no lo matas, debe de quitarte el boss y en el local exit kickear los players,

En caso que no funciona, no hay otro en el foro, habria que dar la vuelta en otland y ver.
 
vale vale muchas gracias una ultima consulta alex es de gran ayuda como podria hacer que al matar al boss me envie a determinado lugar '?
 
vale vale muchas gracias una ultima consulta alex es de gran ayuda como podria hacer que al matar al boss me envie a determinado lugar '?

Aqui tienes uno, al registrar el evento en un Boss, creara el Teleport en donde indicaras las coordenadas,

 
muchas gracias me funciono perfectamente mi pregunta es si en ves de crear un teleport me envie directamente se puede hacer eso ?
 

Tibia Server Lists

#1 FEATURED US Ultron OT 1,617 / 5,000Online EXPStages PROTO8.6 ENGINEUltron OT RANK PTS5.9 +100% VOTES0 #2 FEATURED US Nefera 0 / 0Offline EXPx1 PROTO15.20 ENGINECrystal Server RANK PTS5.1 +100% VOTES0 #3 FEATURED ES Deixis 0 / 0Offline EXPStages PROTO1098 ENGINETFS RANK PTS3.7 +100% VOTES1 #4 FEATURED ES Maeli 8 / 150Online EXPx10 PROTO10.98 ENGINETFS 1.4.2 RANK PTS3.7 +100% VOTES0 #5 MX Marlboro War 43 / 300Online EXP999 PROTO8.6 ENGINETFS 0.3.7 RANK PTS5.5 -33% VOTES0 #6 BR Tibinha YurOts 18 / 150Online EXPStages PROTO7.4 ENGINEYurOTS 1.5 RANK PTS5.2 -14% VOTES0 #7 US Halera 2 / 0Online EXPStages PROTO10.98 ENGINETFS 1.4.2 RANK PTS4.9 -83% VOTES0 #8 BR Exordion Legacy 54 / 2,000Online EXPx2 PROTO7.72 ENGINEExordion RANK PTS4.9 +100% VOTES0 #9 PL Lubelski 3 / 1,000Online EXP200 PROTO7.6 ENGINELubelskiOTS 2.56.0 RANK PTS4.6 -15% VOTES0 #10 DE DBU Online 0 / 400Online EXP11 PROTO8.6 ENGINETFS 1.0 RANK PTS4.3 +100% VOTES0 #11 PL ReWar 0 / 2,000Online EXPcustom PROTO8.6 ENGINEOther RANK PTS4.3 0% VOTES0 #12 PL Velesta 0 / 1,000Offline EXP20 PROTO8.0 ENGINETFS 1.4.2 RANK PTS4.3 -98% VOTES0 #13 ES JustRL FreeTC 1530 11 / 250Online EXPx2 PROTO15.30 ENGINECrystal Server RANK PTS4.3 +100% VOTES0 #14 ES Farlia Global 2026 0 / 333Offline EXPx5 PROTO15.25 ENGINEFarliaServ 1.525 RANK PTS3.9 -22% VOTES0 #15 SE MortalisOT Custom 0 / 500Offline EXP100x -1.2x PROTO10.98 ENGINEMortalisOT V1 RANK PTS3.8 +100% VOTES0 #16 US Rommania 0 / 500Online EXPstages, x10 PROTO7.4 ENGINETFS 0.4 RANK PTS3.6 +100% VOTES0 #17 US BerethaOnline 2 / 2,000Online EXPStages PROTO10.98 ENGINETFS RANK PTS3.5 +100% VOTES0
Top