• 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!

Some door script.

Hermes

dziwki kola gramy w lola
Joined
Nov 17, 2007
Messages
1,867
Reaction score
14
Location
Poland
Hi there!

I'm making 100% Global Pits of Inferno Quest, and now there is a final script that is checking have player stepped on thrones, and then script allows player to go through the reward room. I need exactly that script.

I don't know how it is in real tibia, but I think it's the door.

There are my storage id's for all thrones.

Code:
            setPlayerStorageValue(cid,10274,1)
            setPlayerStorageValue(cid,10275,1)
            setPlayerStorageValue(cid,10276,1)
            setPlayerStorageValue(cid,10277,1)
            setPlayerStorageValue(cid,10278,1)
            setPlayerStorageValue(cid,10279,1)
            setPlayerStorageValue(cid,10280,1)

I'm also using uniqueID (for this script) 10281, and position of the door (if needed):
Code:
{x=794, y= 1313, z=12}

Thanks!

Reg~,
Hermes
 
try this script.u need only to edit storages and ID of door:

Code:
function onUse(cid, item, frompos, item2, topos)
	
if item.uid == 10281 then	
	if item.itemid == 1223 then
  			queststatus = getPlayerStorageValue(cid,1234561)
 			queststatus2 = getPlayerStorageValue(cid,1234562)
 			queststatus3 = getPlayerStorageValue(cid,1234563)
 			queststatus4 = getPlayerStorageValue(cid,1234564)
 			queststatus5 = getPlayerStorageValue(cid,1234565)
 			queststatus6 = getPlayerStorageValue(cid,1234566)
 			queststatus7 = getPlayerStorageValue(cid,1234567)
  
  		if queststatus == -1 or queststatus2 == -1 or queststatus3 == -1 or queststatus4 == -1 or queststatus5 == -1 or queststatus6 == -1 or queststatus7 == -1 then
  			doPlayerSendTextMessage(cid,22,"The door seems to be sealed against unwanted intruders.")
	

		
else
pos = getPlayerPosition(cid)	
			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,'Stand in front of the door.')
				return 1
			end

			doTeleportThing(cid,pos)
			doSendMagicEffect(topos,12)
                        doCreatureSay(cid,'You absorbed enough energy! You may pass.',TALKTYPE_ORANGE_1)
			end
end
		return 1
	else
		return 0
	end
end
 
Hm, I've tested this one more time, and this script causes tibia client crash when I'm using door. But when I log in I am at the other side of door. Maybe make the tile under door in movements? I think that this bug is because of the door. Door on opening/using changes it's id+1, but script makes only using a door. Not opening. Some ideas?
Code:
function onUse(cid, item, frompos, item2, topos)
	
if item.uid == 10281 then	
	if item.itemid == 1210 then
  			queststatus = getPlayerStorageValue(cid,10274)
 			queststatus2 = getPlayerStorageValue(cid,10275)
 			queststatus3 = getPlayerStorageValue(cid,10276)
 			queststatus4 = getPlayerStorageValue(cid,10277)
 			queststatus5 = getPlayerStorageValue(cid,10278)
 			queststatus6 = getPlayerStorageValue(cid,10279)
 			queststatus7 = getPlayerStorageValue(cid,10280)
  
  		if queststatus == -1 or queststatus2 == -1 or queststatus3 == -1 or queststatus4 == -1 or queststatus5 == -1 or queststatus6 == -1 or queststatus7 == -1 then
  			doPlayerSendTextMessage(cid,22,"The door seems to be sealed against unwanted intruders.")
else
pos = getPlayerPosition(cid)	
			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,'Stand in front of the door.')
				return 1
			end

			doTeleportThing(cid,pos)
			doSendMagicEffect(topos,12)
                        doCreatureSay(cid,'You absorbed enough energy! You may pass.',MESSAGE_EVENT_ADVANCE)
			end
end
		return 1
	else
		return 0
	end
end
 
Last edited:
Hm, I've tested this one more time, and this script causes tibia client crash when I'm using door. But when I log in I am at the other side of door. Maybe make the tile under door in movements? I think that this bug is because of the door. Door on opening/using changes it's id+1, but script makes only using a door. Not opening. Some ideas?
Code:
function onUse(cid, item, frompos, item2, topos)
	
if item.uid == 10281 then	
	if item.itemid == 1210 then
  			queststatus = getPlayerStorageValue(cid,10274)
 			queststatus2 = getPlayerStorageValue(cid,10275)
 			queststatus3 = getPlayerStorageValue(cid,10276)
 			queststatus4 = getPlayerStorageValue(cid,10277)
 			queststatus5 = getPlayerStorageValue(cid,10278)
 			queststatus6 = getPlayerStorageValue(cid,10279)
 			queststatus7 = getPlayerStorageValue(cid,10280)
  
  		if queststatus == -1 or queststatus2 == -1 or queststatus3 == -1 or queststatus4 == -1 or queststatus5 == -1 or queststatus6 == -1 or queststatus7 == -1 then
  			doPlayerSendTextMessage(cid,22,"The door seems to be sealed against unwanted intruders.")
else
pos = getPlayerPosition(cid)	
			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,'Stand in front of the door.')
				return 1
			end

			doTeleportThing(cid,pos)
			doSendMagicEffect(topos,12)
                        doCreatureSay(cid,'You absorbed enough energy! You may pass.',MESSAGE_EVENT_ADVANCE)
			end
end
		return 1
	else
		return 0
	end
end

Enough? :thumbup:
Code:
function onUse(cid, item, fromPosition, itemEx, toPosition)
	if item.uid == 10281 then
		if(isInArray({getPlayerStorageValue(cid,10274), getPlayerStorageValue(cid,10275), getPlayerStorageValue(cid,10276), getPlayerStorageValue(cid,10277), getPlayerStorageValue(cid,10278), getPlayerStorageValue(cid,10279), getPlayerStorageValue(cid,10280)}, -1) == TRUE) then
  			doPlayerSendTextMessage(cid, 22, "The door seems to be sealed against unwanted intruders.")
		else
			doPlayerSendTextMessage(cid, 22, "You've absorbed enough energy! You may pass.")
			doTransformItem(item.uid, item.itemid + 1)
			doTeleportThing(cid, toPosition, TRUE)
		end
		return TRUE
	end
	return FALSE
end
 
So I will test it right now again.

@edit
No way. The door remains open. When I use it again, it's ID changes + 1, until reaches 1215 ID.
 
OMFG now I realised that closingdoor.lua already exists in movements LOL! >.>

Thanks all for solution!

Reg~,
Hermes
 
Back
Top