• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

Sealed Door Problem

apockalyptik

New Member
Joined
Jun 17, 2007
Messages
47
Reaction score
0
I want people to pass through this door:
Code:
01:33 You see a closed door.
The door seems to be sealed against unwanted intruders.
ItemID: [1223].
UniqueID: [22222].
Position: [X: 295] [Y: 480] [Z: 11].

only after they did all the seals. The problem is, everyone can pass as a normal door, so people wouldnt need to go on all the thrones on the POI quest to get the reward.

Thrones.lua
Code:
function onStepIn(cid, item, pos)
    if item.uid == 10001 then
        if getPlayerStorageValue(cid,1234561) == -1 then
            setPlayerStorageValue(cid,1234561,1)
            doPlayerSendTextMessage(cid,MESSAGE_EVENT_ADVANCE,'You have touched Verminor´s throne and absorbed some of his spirit.')
        else
            doPlayerSendTextMessage(cid,MESSAGE_EVENT_ADVANCE,'You have already absorbed some of Veminor´s spirit.')
        end
    elseif item.uid == 10002 then
        if getPlayerStorageValue(cid,1234562) == -1 then
            setPlayerStorageValue(cid,1234562,1)
            doPlayerSendTextMessage(cid,MESSAGE_EVENT_ADVANCE,'You have touched Infernatil´s throne and absorbed some of his spirit.')
        else
            doPlayerSendTextMessage(cid,MESSAGE_EVENT_ADVANCE,'You have already absorbed some of Infernatil´s spirit.')
        end
    elseif item.uid == 10003 then
        if getPlayerStorageValue(cid,1234563) == -1 then
            setPlayerStorageValue(cid,1234563,1)
            doPlayerSendTextMessage(cid,MESSAGE_EVENT_ADVANCE,'You have touched Tafariel´s throne and absorbed some of his spirit.')
        else
            doPlayerSendTextMessage(cid,MESSAGE_EVENT_ADVANCE,'You have already absorbed some of Tafariel´s spirit.')
        end
    elseif item.uid == 10004 then
        if getPlayerStorageValue(cid,1234564) == -1 then
            setPlayerStorageValue(cid,1234564,1)
            doPlayerSendTextMessage(cid,MESSAGE_EVENT_ADVANCE,'You have touched Apocalypse´s throne and absorbed some of his spirit.')
        else
            doPlayerSendTextMessage(cid,MESSAGE_EVENT_ADVANCE,'You have already absorbed some of Apocalypse´s spirit.')
        end
    elseif item.uid == 10005 then
        if getPlayerStorageValue(cid,1234565) == -1 then
            setPlayerStorageValue(cid,1234565,1)
            doPlayerSendTextMessage(cid,MESSAGE_EVENT_ADVANCE,'You have touched Pumin´s throne and absorbed some of his spirit.')
        else
            doPlayerSendTextMessage(cid,MESSAGE_EVENT_ADVANCE,'You have already absorbed some of Pumin´s spirit.')
        end
    elseif item.uid == 10006 then
        if getPlayerStorageValue(cid,1234566) == -1 then
            setPlayerStorageValue(cid,1234566,1)
            doPlayerSendTextMessage(cid,MESSAGE_EVENT_ADVANCE,'You have touched Bazir´s throne and absorbed some of his spirit.')
        else
            doPlayerSendTextMessage(cid,MESSAGE_EVENT_ADVANCE,'You have already absorbed some of Bazir´s spirit.')
        end
    elseif item.uid == 10007 then
        if getPlayerStorageValue(cid,1234567) == -1 then
            setPlayerStorageValue(cid,1234567,1)
            doPlayerSendTextMessage(cid,MESSAGE_EVENT_ADVANCE,'You have touched Ashfalor´s throne and absorbed some of his spirit.')
        else
            doPlayerSendTextMessage(cid,MESSAGE_EVENT_ADVANCE,'You have already absorbed some of Ashfalor´s spirit.')
        end
    elseif item.uid == 22222 and item.itemid == 1223 and pos == {x=295, y=480, z=11} then
        if getPlayerStorageValue(cid,1234561) == -1 or getPlayerStorageValue(cid,1234562) == -1 or getPlayerStorageValue(cid,1234563) == -1 or getPlayerStorageValue(cid,1234564) == -1 or getPlayerStorageValue(cid,1234565) == -1 then
            doTransformItem(item.uid,item.itemid+1)
            doPlayerSendTextMessage(cid,MESSAGE_EVENT_ADVANCE,'Sorry, but you did not absorb enough energy!')
        else
            doPlayerSendTextMessage(cid,MESSAGE_EVENT_ADVANCE,'You absorbed enough energy! You may pass.')
        end
    end
    return 1
end

I'm using the latest TFS.
 
You got leveldoors? Post the script here and I can add so you may only pass if you've done all seals :p

Something like this:
PHP:
if (item.uid == 22222) then
    for i=1, 5 do
        if (getPlayerStorageValue(cid, 1234560+i) == -1) then
            doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE, 'Sorry, but you did not absorb enough energy!')
			return 0
        end
    end 
    doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE, 'You absorbed enough energy! You may pass.')
    --// Push him like leveldoors? :O
    return 1
end

Or...? xD
 
Last edited:
The leveldoor script you mean?
PHP:
function onUse(cid, item, frompos, item2, topos)

			if getPlayerLevel(cid) >= item.actionid - 1000 then

				doTransformItem(item.uid, item.itemid + 1)

				playerpos = getPlayerPosition(cid)

				doorpos = {x = frompos.x, y = frompos.y, z = frompos.z, stackpos = 253}

				if playerpos.y == doorpos.y + 1 and playerpos.x == doorpos.x then

					doMoveCreature(cid, 0)

				elseif playerpos.x == doorpos.x - 1 and playerpos.y == doorpos.y then

					doMoveCreature(cid, 1)

				elseif playerpos.y == doorpos.y - 1 and playerpos.x == doorpos.x then

					doMoveCreature(cid, 2)

				elseif playerpos.y == doorpos.y and playerpos.x == doorpos.x + 1 then

					doMoveCreature(cid, 3)

				elseif playerpos.x == doorpos.x + 1 and playerpos.y == doorpos.y - 1 then

					doMoveCreature(cid, 4)

				elseif playerpos.x == doorpos.x - 1 and playerpos.y == doorpos.y - 1 then

					doMoveCreature(cid, 5)

				elseif playerpos.x == doorpos.x + 1 and playerpos.y == doorpos.y + 1 then

					doMoveCreature(cid, 6)

				elseif playerpos.x == doorpos.x - 1 and playerpos.y == doorpos.y + 1 then

					doMoveCreature(cid, 7)

				end

			else
					doPlayerSendTextMessage(cid, 22, "You need "..(item.actionid - 1000).." level to pass this door.")

			end

    return 1

end
 
He said about doMoveCreature(cid, dir) and onStepOut event to close the door when he goes from them, so basically, only the player who absorbed energy can pass :thumbup:
 
Not sure lol, but try this:
PHP:
function onUse(cid, item, frompos, item2, topos)
	if (item.uid == 22222 and item.itemid == 1223) then
		for i=1, 5 do 
			if (getPlayerStorageValue(cid, 1234560+i) == -1) then 
				doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE, 'Sorry, but you did not absorb enough energy!') 
				return 0 
			end 
		end  
		doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE, 'You absorbed enough energy! You may pass.')
	elseif not(getPlayerLevel(cid) >= item.actionid - 1000) then 
		doPlayerSendTextMessage(cid, 22, "You need "..(item.actionid - 1000).." level to pass this door.") 
		return 0
	end
	doTransformItem(item.uid, item.itemid + 1) 
	playerpos = getPlayerPosition(cid) 
	doorpos = {x = frompos.x, y = frompos.y, z = frompos.z, stackpos = 253} 
	if playerpos.y == doorpos.y + 1 and playerpos.x == doorpos.x then 
		doMoveCreature(cid, 0) 
	elseif playerpos.x == doorpos.x - 1 and playerpos.y == doorpos.y then 
		doMoveCreature(cid, 1) 
	elseif playerpos.y == doorpos.y - 1 and playerpos.x == doorpos.x then 
		doMoveCreature(cid, 2) 
	elseif playerpos.y == doorpos.y and playerpos.x == doorpos.x + 1 then 
		doMoveCreature(cid, 3) 
	elseif playerpos.x == doorpos.x + 1 and playerpos.y == doorpos.y - 1 then 
		doMoveCreature(cid, 4) 
	elseif playerpos.x == doorpos.x - 1 and playerpos.y == doorpos.y - 1 then 
		doMoveCreature(cid, 5) 
	elseif playerpos.x == doorpos.x + 1 and playerpos.y == doorpos.y + 1 then 
		doMoveCreature(cid, 6) 
	elseif playerpos.x == doorpos.x - 1 and playerpos.y == doorpos.y + 1 then 
		doMoveCreature(cid, 7) 
	end 
	return 1 
end

Also, add the 1223 in actions.xml!

Maybe you need to add something in movements leveldoor.lua too, you could post it too if this doesn't work!
 
I think it worked

06:59 You absorbed enough energy! You may pass. [with a char with the seals done]
07:00 Sorry, but you did not absorb enough energy! [without seals done]

Thank you!
 
Back
Top