function onUse(cid, item, frompos, item2, topos)
local playervoc = getPlayerVocation(cid)
local pos = getPlayerPosition(cid)
if item.actionid == (4531) then
if getPlayerVocation(cid) == 1 or playervoc == 5 then
if pos.x == topos.x then
if pos.y < topos.y then
pos.y = topos.y + 1
else
pos.y = topos.y - 1
end
elseif pos.y == topos.y then
if pos.x < topos.x then
pos.x = topos.x + 1
else
pos.x = topos.x - 1
end
else
doPlayerSendTextMessage(cid,22,'You need to be in front of the door.')
return 1
end
doTeleportThing(cid, topos)
doTransformItem(item.uid, 1226)
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "in this room, open all chest and equip yourself with what you find there. afterwars, you can hunt in the dungeon below.")
else
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "The door seems to be sealed against unwanted intruders.")
end
elseif item.actionid == (4532) then
if getPlayerVocation(cid) == 2 or playervoc == 6 then
if pos.x == topos.x then
if pos.y < topos.y then
pos.y = topos.y + 1
else
pos.y = topos.y - 1
end
elseif pos.y == topos.y then
if pos.x < topos.x then
pos.x = topos.x + 1
else
pos.x = topos.x - 1
end
else
doPlayerSendTextMessage(cid,22,'You need to be in front of the door.')
return 1
end
doTeleportThing(cid, topos)
doTransformItem(item.uid, 1226)
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "in this room, open all chest and equip yourself with what you find there. afterwars, you can hunt in the dungeon below.")
else
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "The door seems to be sealed against unwanted intruders.")
end
elseif item.actionid == (4533) then
if getPlayerVocation(cid) == 3 or playervoc == 7 then
if pos.x == topos.x then
if pos.y < topos.y then
pos.y = topos.y + 1
else
pos.y = topos.y - 1
end
elseif pos.y == topos.y then
if pos.x < topos.x then
pos.x = topos.x + 1
else
pos.x = topos.x - 1
end
else
doPlayerSendTextMessage(cid,22,'You need to be in front of the door.')
return 1
end
doTeleportThing(cid, topos)
doTransformItem(item.uid, 1226)
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "in this room, open all chest and equip yourself with what you find there. afterwars, you can hunt in the dungeon below.")
else
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "The door seems to be sealed against unwanted intruders.")
end
elseif item.actionid == (4534) then
if getPlayerVocation(cid) == 4 or playervoc == 8 then
if pos.x == topos.x then
if pos.y < topos.y then
pos.y = topos.y + 1
else
pos.y = topos.y - 1
end
elseif pos.y == topos.y then
if pos.x < topos.x then
pos.x = topos.x + 1
else
pos.x = topos.x - 1
end
else
doPlayerSendTextMessage(cid,22,'You need to be in front of the door.')
return 1
end
doTeleportThing(cid, topos)
doTransformItem(item.uid, 1226)
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "in this room, open all chest and equip yourself with what you find there. afterwars, you can hunt in the dungeon below.")
else
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "The door seems to be sealed against unwanted intruders.")
end
return 1
else
return 0
end
end