RevScript Remove Door / Item Acess

Alex

Miembro del equipo
Webdesigner
LV
58
 
Awards
38
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.

Código:
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:

Código:
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

Código:
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()
 
Última edición:

Ethaanks123

Miembro
LV
7
 
Awards
6
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 ?
 

Alex

Miembro del equipo
Webdesigner
LV
58
 
Awards
38
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.
 

Ethaanks123

Miembro
LV
7
 
Awards
6
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 '?
 

Alex

Miembro del equipo
Webdesigner
LV
58
 
Awards
38
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,

 

Ethaanks123

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

Alex

Miembro del equipo
Webdesigner
LV
58
 
Awards
38
Arriba