Hello,
so as far as i know to make level door you have to set actionid to 1050 which means you can enter door with level 50 only and above, so i found this Itutorial doors on steroids
So my question is
local levelDoors = {
[1000] = {levelMin = 50, levelMax = nil}
}
is that 1000 is actionid? Just to make sure
so as far as i know to make level door you have to set actionid to 1050 which means you can enter door with level 50 only and above, so i found this Itutorial doors on steroids
LUA:
local questDoors = {
[1000] = {questValues = {5, 6}}
}
local vocationDoors = {
[1000] = {vocs = {1, 2, 3, 4}}
}
local levelDoors = {
[1000] = {levelMin = 50, levelMax = nil}
}
function onUse(player, item, fromPosition, target, toPosition, isHotkey)
local itemId = item:getId()
local voc = vocationDoors(item:getActionId())
local level = levelDoors(item:getActionId())
local questDoor = questDoors(item:getActionId())
-- VOCATION DOORS --
if voc and not isInArray(voc.vocs, player:getVocation():getId()) then
local text = "Only "
for i = 1, #voc.vocs do
local VOC = Vocation(voc.vocs[i])
if VOC then
text = text..""..VOC:getName()..", "
end
end
text = text.." can enter here."
return player:sendTextMessage(MESSAGE_INFO_DESCR, text)
end
-- LEVEL DOORS --
if level then
if level.levelMax ~= nil then
return player:sendTextMessage(MESSAGE_INFO_DESCR, "Only levels "..level.levelMin.." - "..level.levelMax.." can enter here.")
else
return player:sendTextMessage(MESSAGE_INFO_DESCR, "Only levels "..level.levelMin.." and higher can enter here.")
end
end
-- QUEST DOORS --
if isInArray(questDoors, itemId) then
local quest = questDoors[item:getActionId()]
if not quest then return player:sendTextMessage(MESSAGE_INFO_DESCR, "The door seems to be sealed against unwanted intruders.") end
if player:getStorageValue(item:getActionId()) ~= nil and isInArray(quest.questValues, player:getStorageValue(item:getActionId())) then
item:transform(itemId + 1)
player:teleportTo(toPosition, true)
else
return player:sendTextMessage(MESSAGE_INFO_DESCR, "The door seems to be sealed against unwanted intruders.")
end
end
if isInArray(keys, itemId) then
if target.actionid > 0 then
if item.actionid == target.actionid and doors[target.itemid] then
target:transform(doors[target.itemid])
return true
end
player:sendTextMessage(MESSAGE_STATUS_SMALL, "The key does not match.")
return true
end
return false
end
if isInArray(horizontalOpenDoors, itemId) or isInArray(verticalOpenDoors, itemId) then
local doorCreature = Tile(toPosition):getTopCreature()
if doorCreature ~= nil then
toPosition.x = toPosition.x + 1
local query = Tile(toPosition):queryAdd(doorCreature, bit.bor(FLAG_IGNOREBLOCKCREATURE, FLAG_PATHFINDING))
if query ~= RETURNVALUE_NOERROR then
toPosition.x = toPosition.x - 1
toPosition.y = toPosition.y + 1
query = Tile(toPosition):queryAdd(doorCreature, bit.bor(FLAG_IGNOREBLOCKCREATURE, FLAG_PATHFINDING))
end
if query ~= RETURNVALUE_NOERROR then
player:sendTextMessage(MESSAGE_STATUS_SMALL, query)
return true
end
doorCreature:teleportTo(toPosition, true)
end
if not isInArray(openSpecialDoors, itemId) then
item:transform(itemId - 1)
end
return true
end
if doors[itemId] then
if item.actionid == 0 or voc or level or questDoor then
item:transform(doors[itemId])
else
player:sendTextMessage(MESSAGE_INFO_DESCR, "It is locked.")
end
return true
end
return false
end
local levelDoors = {
[1000] = {levelMin = 50, levelMax = nil}
}
is that 1000 is actionid? Just to make sure


