✅Como poner puerta por vocacion

D

danigym

Invitado
Hola, Necesito un script para ponerle a una puerta y que solo la abran los de cierta vocacion ejemplo:

Puerta 1 = Sorcerer
Puerta 2 = Druid
Puerta 3 = Paladin
Puerta 4 = Knight

Uso el globalbr tfs 1.3 con cliente 12.72
Gracias.
 
Solución
Hola, creo que este te puede servir;

data/scripts/actions

Código:
local vocationDoors = {
    -- Sorcerer
    [22001] = {
        vocation = VOCATION.ID.SORCERER,
        destination = {x = 1000, y = 1000, z = 7}
    },
    -- Druid
    [22002] = {
        vocation = VOCATION.ID.DRUID,
        destination = {x = 1000, y = 1000, z = 7}
    },
    -- Paladin
    [22003] = {
        vocation = VOCATION.ID.PALADIN,
        destination = {x = 1000, y = 1000, z = 7}
    },
    -- Knight
    [22004] = {
        vocation = VOCATION.ID.KNIGHT,
        destination = {x = 1000, y = 1000, z = 7}
    },
}

local vocationDoor = Action()

function vocationDoor.onUse(player, item, target, position, fromPosition)
    local door = vocationDoors[item.uid]...

Alex

Miembro del equipo
Webdesigner
LV
58
 
Awards
38
Hola, Necesito un script para ponerle a una puerta y que solo la abran los de cierta vocacion ejemplo:

Puerta 1 = Sorcerer
Puerta 2 = Druid
Puerta 3 = Paladin
Puerta 4 = Knight

Uso el globalbr tfs 1.3 con cliente 12.72
Gracias.
Hola

Utilizando el TFS ya genera las actions y estan registradas en el sistema.

Para utilizar el sistema de puertas con vocations, si recuerdo bien:
Crear una puerta e indicar en ActionID:

101 - Puertas para Vocaciones con ID 1 ( sorcerers y master )
102 - ....
103 - ...
104 - Puertas para Knights & Elite Knights

Para niveles, pero sin registrar la vocations, empieza a 1001.
1001 = nivel 1.
1100 = nivel 100.

Para unicamente Skulls, no recuerdo los numeros bien pero existe también
Para personas sin skull era 180 en AID.
 

Gamuza

Miembro
LV
7
 
Awards
4
Hola, creo que este te puede servir;

data/scripts/actions

Código:
local vocationDoors = {
    -- Sorcerer
    [22001] = {
        vocation = VOCATION.ID.SORCERER,
        destination = {x = 1000, y = 1000, z = 7}
    },
    -- Druid
    [22002] = {
        vocation = VOCATION.ID.DRUID,
        destination = {x = 1000, y = 1000, z = 7}
    },
    -- Paladin
    [22003] = {
        vocation = VOCATION.ID.PALADIN,
        destination = {x = 1000, y = 1000, z = 7}
    },
    -- Knight
    [22004] = {
        vocation = VOCATION.ID.KNIGHT,
        destination = {x = 1000, y = 1000, z = 7}
    },
}

local vocationDoor = Action()

function vocationDoor.onUse(player, item, target, position, fromPosition)
    local door = vocationDoors[item.uid]
    --Check Oressa storage before choose vocation
    if player:getStorageValue(Storage.Dawnport.DoorVocation) == door.vocation then
        player:teleportTo(door.destination)
        player:getPosition():sendMagicEffect(CONST_ME_TELEPORT)
        player:sendTextMessage(
            MESSAGE_EVENT_ADVANCE,
            "Open the chest and take your gear, young " .. player:getVocation():getName():lower() .. "!"
        )
    elseif player:getStorageValue(Storage.Dawnport.DoorVocation) ~= door.vocation then
        player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "The door seems to be sealed against unwanted intruders.")
    end
    return true
end

for index, value in pairs(vocationDoors) do
    vocationDoor:uid(index)
end

vocationDoor:register()
 
Arriba