Vocation doors

S

Skaredz

Invited
Hi all,

I was trying 6h or more hours to find information about how to do vocation doors... I did everything what I can, and nothing.

Was trying with AID - 1001 or 2001 etc. still does not work, I think I am doing something wrong.

Can someone explain please, what I have to do?
 
Hi all,

I was trying 6h or more hours to find information about how to do vocation doors... I did everything what I can, and nothing.

Was trying with AID - 1001 or 2001 etc. still does not work, I think I am doing something wrong.

Can someone explain please, what I have to do?
Hello

I am not at house right now, but you can try starting a new script as action ( copy another action and create new script ), remove code inside ( all after function and before the end of the function ).

Inside you need try to check the vocation for example to use a door is an Action() with function onUse, so, it will be adding and AID to the door and at final of the script door:aid(AID).

This is an example, not sure it will work properly but it's a good start, you can also add much more things, like if player has been done a quest ( Storage.Storage.Quest... line == 1 >= 1 < 1... )
JavaScript:
local door = Action()

 
function door.onUse(player, fromPosition, toPosition)

if player:getVocation():getBaseId() == VOCATION.BASE_ID.SORCERER then
player:teleportTo(33333, 32111, 7)
else
player:teleportTo(POSITION_BEFORE_DOOR)
player:sendMagicEffect(CONST_ME_POFF)
end
if player:getVocation():getBaseId() == VOCATION.BASE_ID.DRUID then

same...
end
if player:getVocation():getBaseId() == VOCATION.BASE_ID.PALADIN then

same...
end
if player:getVocation():getBaseId() == VOCATION.BASE_ID.KNIGHT then

same...
end

end

door:aid(11111)
door:register
 
Hello

I am not at house right now, but you can try starting a new script as action ( copy another action and create new script ), remove code inside ( all after function and before the end of the function ).

Inside you need try to check the vocation for example to use a door is an Action() with function onUse, so, it will be adding and AID to the door and at final of the script door:aid(AID).

This is an example, not sure it will work properly but it's a good start, you can also add much more things, like if player has been done a quest ( Storage.Storage.Quest... line == 1 >= 1 < 1... )
JavaScript:
local door = Action()

 
function door.onUse(player, fromPosition, toPosition)

if player:getVocation():getBaseId() == VOCATION.BASE_ID.SORCERER then
player:teleportTo(33333, 32111, 7)
else
player:teleportTo(POSITION_BEFORE_DOOR)
player:sendMagicEffect(CONST_ME_POFF)
end
if player:getVocation():getBaseId() == VOCATION.BASE_ID.DRUID then

same...
end
if player:getVocation():getBaseId() == VOCATION.BASE_ID.PALADIN then

same...
end
if player:getVocation():getBaseId() == VOCATION.BASE_ID.KNIGHT then

same...
end

end

door:aid(11111)
door:register
Really thanks for help, but I have a really brainwash today...

And to be honest I do not really know what to do right now...

I created some new script in actions folder, but on canary there is showing some errors
 
Ok I did some stupid change and it works XD, but I did on existing .lua file

I put - if player:getVocation():getBaseId() == door.vocation then

and this is skipping talking with npc and someone can go straight to doors.
 
Ok I did some stupid change and it works XD, but I did on existing .lua file

I put - if player:getVocation():getBaseId() == door.vocation then

and this is skipping talking with npc and someone can go straight to doors.
Of course, using a local variable is possible,

door.vocation:

Code:
local vocationDoors = {
    -- Sorcerer
    [22001] = {
        vocation = VOCATION.ID.SORCERER,
        destination = {x = 32054, y = 31883, z = 6}
    },
    -- Druid
    [22002] = {
        vocation = VOCATION.ID.DRUID,
        destination = {x = 32073, y = 31883, z = 6}
    },
    -- Paladin
    [22003] = {
        vocation = VOCATION.ID.PALADIN,
        destination = {x = 32059, y = 31883, z = 6}
    },
    -- Knight
    [22004] = {
        vocation = VOCATION.ID.KNIGHT,
        destination = {x = 32068, y = 31883, z = 6}
    },
}

local door = vocationDoors[item.uid]

Similar as Dawnport.
 

Tibia Server Lists

#1 FEATURED US Ultron OT 1,504 / 5,000 EXPStages PROTO8.6 ENGINEUltron OT RANK PTS6.6 -9% VOTES0 #2 FEATURED US Nefera 190 / 0 EXPx1 PROTO15.20 ENGINECrystal Server RANK PTS5.9 +25% VOTES0 #3 FEATURED CL ZHYRAVEX 15 / 500 EXPx5 PROTO10.98 ENGINETFS 1.4.2 RANK PTS4.7 +100% VOTES0 #4 FEATURED ES Deixis 0 / 0 EXPStages PROTO1098 ENGINETFS RANK PTS4.0 -61% VOTES1 #5 DE DBU Online 213 / 400 EXP11 PROTO8.6 ENGINETFS 1.0 RANK PTS6.1 +1,000% VOTES0 #6 BR Exordion Legacy 80 / 2,000 EXPx2 PROTO7.72 ENGINEExordion RANK PTS5.7 +2% VOTES0 #7 MX Marlboro War 31 / 300 EXP999 PROTO8.6 ENGINETFS 0.3.7 RANK PTS5.5 -28% VOTES0 #8 BR Tibinha YurOts 22 / 150 EXPStages PROTO7.4 ENGINEYurOTS 1.5 RANK PTS5.5 +3% VOTES0 #9 ES JustRL FreeTC 1530 20 / 250 EXPx2 PROTO15.30 ENGINECrystal Server RANK PTS5.0 +18% VOTES0 #10 US Wiki Ots 53 / 1,000 EXPx9999 PROTOcustom client ENGINETFS 1.4.2 RANK PTS5.0 +100% VOTES0 #11 PL Lubelski 11 / 1,000 EXP200 PROTO7.6 ENGINELubelskiOTS 2.56.0 RANK PTS4.9 -17% VOTES0 #12 BR Turion Server 1 / 2,000 EXPx1 PROTO7.4 ENGINETurion 7.7 Project RANK PTS4.6 +244% VOTES0 #13 PL ReWar 0 / 2,000 EXPcustom PROTO8.6 ENGINEOther RANK PTS4.6 +100% VOTES0 #14 US Halera 0 / 0 EXPStages PROTO10.98 ENGINETFS 1.4.2 RANK PTS4.4 -81% VOTES0 #15 PL Velesta 0 / 1,000 EXP20 PROTO8.0 ENGINETFS 1.4.2 RANK PTS4.4 -100% VOTES0 #16 US BerethaOnline 0 / 2,000 EXPStages PROTO15.0 ENGINETFS RANK PTS4.3 -77% VOTES0 #17 ES Farlia Global 2026 0 / 333 EXPx5 PROTO15.25 ENGINEFarliaServ 1.525 RANK PTS4.0 -100% VOTES0 #18 SE MortalisOT Custom 0 / 500 EXP100x -1.2x PROTO10.98 ENGINEMortalisOT V1 RANK PTS4.0 -100% VOTES0 #19 RU Oldavia | 8.60 0 / 0 EXPx9999 PROTO8.6 ENGINETFS 1.3 RANK PTS3.9 +100% VOTES0 #20 US Rommania 0 / 3,000 EXPstages, x10 PROTO7.4 ENGINETFS 0.4 RANK PTS3.6 -89% VOTES0 #21 MX Maeli 0 / 150 EXPx10 PROTO10.98 ENGINETFS 1.4.2 RANK PTS3.5 -33% VOTES0 #22 ES DarkDragon EXPx10 PROTO8.6 ENGINECanary RANK PTS0.0 0% VOTES0
Top