• 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!
  • New resources must be posted under Resources tab. A discussion thread will be created automatically, you can't open threads manually anymore.

MoveEvent Dreamer's Challenge Quest (Some movements) 100%

LucasFerraz

Systems Analyst
Joined
Jun 10, 2010
Messages
2,858
Reaction score
96
Location
Brazil
Some movements of Dreamer's Challenge Quest, enjoy!

Most part of these scripts are Self-explanatory so use your brain.
From: Dreamer's Challenge Quest/Spoiler - TibiaWiki - Quests, Items, Spells, and more


Pillows --I didn't made this
Lua:
-- Pilow order to complete:
-- BLUE, GREEN
-- RED, YELLOW
 
-- >>CONFIG<< --
local verticalTiles = 5400 -- Action id of the vertical tiles.
local horizontalTiles = 5401 -- Action id of the horizontal tiles.
local ground = {normal = 426, used = 425} -- Itemid of the ground tile when it is normal or used (when you stand on it)
local teleport = {itemid = 1387, actionid = 5408} -- Enter the itemid and the actionid of the teleport.
local teleportPosition = {x = 32826, y = 32347, z = 9} -- Where should the teleport be spawned when you finnish the puzzle?
local newPosition = {x = 32766, y = 32275, z = 14} -- Where should you get teleported when you enter the teleport?
local position = {x = 32818, y = 32334, z = 9} -- Position of the north west (top left) side of the puzzle area.
local magicEffect = 12 -- What effect will appear when you finnish the puzzle? Leave blank or write "nil" if you don't want any.
-- >>CONFIG<< --
 
function onStepIn(cid, item, pos)
	teleportPosition.stackpos = 1
	local getTeleport = getThingfromPos(teleportPosition)
	if getTeleport.itemid == teleport.itemid and getTeleport.actionid == teleport.actionid then
		doRemoveItem(getTeleport.uid, 1)
	end
	local getPillow = {}
	if item.actionid == verticalTiles then
		for i = 0, 5 do
			getPillow[i + 1] = getThingfromPos({x = position.x + i, y = getPlayerPosition(cid).y, z = position.z, stackpos = 1})
		end
	elseif item.actionid == horizontalTiles then
		for i = 0, 5 do
			getPillow[i + 1] = getThingfromPos({x = getPlayerPosition(cid).x, y = position.y + i, z = position.z, stackpos = 1})
		end
	end
	doTransformItem(getPillow[1].uid, getPillow[6].itemid)
	for i = 1, 5 do
		doTransformItem(getPillow[i + 1].uid, getPillow[i].itemid)
	end
	if checkPillows(position.x, position.y, 1686) == 1 and checkPillows(position.x + 3, position.y, 1688) == 1 and checkPillows(position.x, position.y + 3, 1687) == 1 and checkPillows(position.x + 3, position.y + 3, 1689) == 1 then
		local newTeleport = doCreateTeleport(teleport.itemid, newPosition, teleportPosition)
		doSetItemActionId(newTeleport, teleport.actionid)
		if magicEffect ~= nil then
			doSendMagicEffect(pos, magicEffect)
		end
	end
	doTransformItem(item.uid, ground.used)
	return 1
end
 
function onStepOut(cid, item, pos)
	pos.stackpos = 1
	local getPos = getThingfromPos(pos)
	teleportPosition.stackpos = 1
	local getTeleport = getThingfromPos(teleportPosition)
	if comparePos(pos, teleportPosition) and getPos.itemid == getTeleport.itemid and getPos.actionid == getTeleport.actionid then
		teleportPosition.stackpos = 1
		doRemoveItem(getTeleport.uid, 1)
		resetPuzzle()
		return 1
	else
		doTransformItem(item.uid, ground.normal)
		return 1
	end
end
 
function checkPillows(posx, posy, item)
	local returnValue = 1
	for gx = posx, posx + 2 do
		for gy = posy, posy + 2 do
			if getThingfromPos({x = gx, y = gy, z = position.z, stackpos = 1}).itemid ~= item then
				returnValue = 0
				break
			end
		end
	end
	return returnValue
end
 
function resetPuzzle()
	local availablePillows = {}
	for i = 0, 3 do
		local pillowId = 1686 + i
		for i = 1, 9 do
			table.insert(availablePillows, pillowId)
		end
	end
	availablePillows = shuffleTable(availablePillows)
	for gx = position.x, position.x + 5 do
		for gy = position.y, position.y + 5 do
			local pillow = math.random(1, #availablePillows)
			getItem = getThingfromPos({x = gx, y = gy, z = position.z, stackpos = 1})
			doTransformItem(getItem.uid, availablePillows[pillow])
			table.remove(availablePillows, pillow)
		end
	end
end 
 
function shuffleTable(t)
	local newTable = {}
	for i = 1, #t do
		randomId = math.random(1, #t)
		table.insert(newTable, t[randomId])
		table.remove(t, randomId)
	end
	return newTable
end

Carrot
Lua:
function onStepIn(cid, item, pos, fromPos)
	if isPlayer(cid) then
		if doPlayerRemoveItem(cid, 2684, 1) then
			doTeleportThing(cid, {x=32861, y=32235, z=9})
			doSendMagicEffect({x=32861, y=32239, z=9}, 2)
			doSendMagicEffect({x=32860, y=32238, z=9}, 2)
			doSendMagicEffect({x=32860, y=32237, z=9}, 2)
			doSendMagicEffect({x=32861, y=32236, z=9}, 2)
			doSendMagicEffect({x=32861, y=32235, z=9}, 2)
			doCreatureSay(cid, 'Mjam!', TALKTYPE_ORANGE_1, false, 0, {x=32855, y=32238, z=9})
		else
			doTeleportThing(cid, {x=32861, y=32239, z=9})
			doPlayerSendCancel(cid, 'You need a carrot.')
		end
	end
end

On put water in floor
Lua:
function onAddItem(moveitem, tileitem, pos)
 
	food1 = {x=32881, y=32267, z=14, stackpos=1}
	getfood1 = getThingfromPos(food1)
	food2 = {x=32881, y=32273, z=14, stackpos=1}
	getfood2 = getThingfromPos(food2)
	food3 = {x=32881, y=32270, z=14, stackpos=1}
	getfood3 = getThingfromPos(food3)
	food4 = {x=32884, y=32270, z=14, stackpos=1}
	getfood4 = getThingfromPos(food4)

	if moveitem.itemid == 2016 and getfood1.itemid == 2168 and getfood2.itemid == 6300 and getfood3.itemid == 1355 and getfood4.itemid == 1492 then

		doRemoveItem(getfood3.uid,1)
		local panienka = doCreateItem(1387,1,food3)
		doItemSetAttribute(panienka, "aid", 2223)
end
return 1
end

On put death ring in floor
Lua:
local function createTree(p)
 
doCreateItem(2722,1,{x=32857, y=32231, z=11})
doCreateItem(2722,1,{x=32857, y=32232, z=11})
doCreateItem(2722,1,{x=32857, y=32233, z=11})

 end

function onAddItem(moveitem, tileitem, pos)
 
tree1pos = {x=32857, y=32231, z=11, stackpos=1}
tree2pos = {x=32857, y=32232, z=11, stackpos=1}
tree3pos = {x=32857, y=32233, z=11, stackpos=1}
tree1 = getThingfromPos(tree1pos)
tree2 = getThingfromPos(tree2pos)
tree3 = getThingfromPos(tree3pos)
 
if (moveitem.itemid == 6300 or moveitem.itemid == 6301) then
	doRemoveItem(moveitem.uid,1)
	doSendMagicEffect(pos,2)
 
	doRemoveItem(tree1.uid,1)
	doRemoveItem(tree2.uid,1)
	doRemoveItem(tree3.uid,1)
 
	doSendMagicEffect(tree1pos,7)
	doSendMagicEffect(tree2pos,7)
	doSendMagicEffect(tree3pos,7)
	p = {treeid = tree1.itemid}
	addEvent(createTree, 10*1000, p)

 
else
end
return 1
end

If you don't know how to use, ask here.
Report bugs in this Thread!
 
Last edited:
Hah u paste script from Iriana's data, add author, i'm not sure but probably it was made by Sasir
 
Back
Top