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

Dreamer's Challenge Quest Part {Script} (Solved)

LucasFerraz

Systems Analyst
Joined
Jun 10, 2010
Messages
2,857
Reaction score
96
Location
Brazil
Thanks to cyko,
this is the last script
LUA:
local pillars = {
	{x=100, y=100, z=7},
	{x=100, y=100, z=7},
	{x=100, y=100, z=7},
	{x=100, y=100, z=7},
}
local levers = {10001, 10002} -- unique IDs of the 2 levers
local teleportCreate = {x=32836, y=32288, z=14}
local teleportDestination = {x=100, y=100, z=7}
 
function onUse(cid, item, fromPosition, itemEx, toPosition)
	if item.itemid == 1945 then
		local t, t1 = {}, {{{x=32840, y=32268, z=14}, 6556},{{x=32840, y=32269, z=14}, 6557},{{x=32841, y=32269, z=14}, 6556},{{x=32842, y=32267, z=14}, 6556},{{x=32843, y=32268, z=14}, 6557},{{x=32843, y=32266, z=14}, 6557},{{x=32844, y=32267, z=14}, 6557},{{x=32845, y=32264, z=14}, 6557},{{x=32845, y=32268, z=14}, 6557}}
		for _, v in ipairs(t1) do
			local k = getTileItemById(v[1], v[2]).uid
			if k == 0 then
				return doPlayerSendCancel(cid, 'Sorry, not possible.')
			end
			table.insert(t, k)
		end
 
		for i = 1, #t do
			doRemoveItem(t[i])
			doSendMagicEffect(t1[i][1], CONST_ME_MAGIC_BLUE)
		end
 
		for i = 1, #pillars do
			doRemoveItem(getTileItemById(pillars[i], 1515).uid)
		end
 
		for i = 1, #levers do
			doTransformItem(levers[i], 1946)
		end
 
		doRemoveItem(getTileItemById(teleportCreate, 6299).uid)
		doCreateTeleport(1387, teleportDestination, teleportCreate)
		doSendMagicEffect(teleportCreate, CONST_ME_TELEPORT)
	else
		doRemoveItem(getTileItemById(teleportCreate, 1387).uid)
		doCreateItem(6299, 1, teleportCreate)
 
		for i = 1, #pillars do
			doRelocate(pillars[i], {x=pillars[i].x, y=pillars[i].y+1, z=pillars[i].z})
			doCreateItem(1515, 1, pillars[i])
		end
 
		for i = 1, #levers do
			doTransformItem(levers[i], 1945)
		end
 
	end
	return true
end
 
Last edited:
First script:
LUA:
function onUse(cid, item, fromPosition, itemEx, toPosition)
	if item.itemid == 1945 then
		doCreateItem(6556, 1, {x=32838, y=32264, z=14})
		doCreateItem(6557, 1, {x=32838, y=32264, z=14})
		doSendMagicEffect({x=32838, y=32264, z=14}, CONST_ME_MAGIC_BLUE)
		doTransformItem(item.uid, 1946)
	else
		doTransformItem(item.uid, 1945)
	end
	return true
end
 
LUA:
function onUse(cid, item, fromPosition, itemEx, toPosition)
	if getCreatureStorage(cid, 34498) == -1 then
		doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, 'You have found a book.')
		doItemSetAttribute(doPlayerAddItem(cid, 1955, 1), 'text', 'Book of the Lost Heroes:\nAskuro,\nMantar,\nIldoni,\nMaxmof,\nXemodo,\nOxanti')
		doCreatureSetStorage(cid, 34498,1)
	else
		doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, 'The chest is empty.')
	end
	return true
end
 
Try this as third script:
LUA:
local pillars = {
	{x=100, y=100, z=7},
	{x=100, y=100, z=7},
	{x=100, y=100, z=7},
	{x=100, y=100, z=7},
}
local levers = {10001, 10002} -- unique IDs of the 2 levers
local teleportCreate = {x=32836, y=32288, z=14}
local teleportDestination = {x=100, y=100, z=7}

function onUse(cid, item, fromPosition, itemEx, toPosition)
	if item.itemid == 1945 then
		local t, t1 = {}, {{{x=32840, y=32268, z=14}, 6556},{{x=32840, y=32269, z=14}, 6557},{{x=32841, y=32269, z=14}, 6556},{{x=32842, y=32267, z=14}, 6556},{{x=32843, y=32268, z=14}, 6557},{{x=32843, y=32266, z=14}, 6557},{{x=32844, y=32267, z=14}, 6557},{{x=32845, y=32264, z=14}, 6557},{{x=32845, y=32268, z=14}, 6557}}
		for _, v in ipairs(t1) do
			local k = getTileItemById(v[1], v[2]).uid
			if k == 0 then
				return doPlayerSendCancel(cid, 'Sorry, not possible.')
			end
			table.insert(t, k)
		end

		for i = 1, #t do
			doRemoveItem(t[i])
			doSendMagicEffect(t1[i][1], CONST_ME_MAGIC_BLUE)
		end

		for i = 1, #pillars do
			doRemoveItem(getTileItemById(pillars[i], 1515).uid)
		end
	
		for i = 1, #levers do
			doTransformItem(levers[i], 1946)
		end

		doRemoveItem(getTileItemById(teleportCreate, 6299).uid)
		doCreateTeleport(1387, teleportDestination, teleportCreate)
		doSendMagicEffect(teleportCreate, CONST_ME_TELEPORT)
	else
		doRemoveItem(getTileItemById(teleportCreate, 1387).uid)
		doCreateItem(6299, 1, teleportCreate)

		for i = 1, #pillars do
			doRelocate(pillars[i], {x=pillars[i].x, y=pillars[i].y+1, z=pillars[i].z})
			doCreateItem(1515, 1, pillars[i])
		end

		for i = 1, #levers do
			doTransformItem(levers[i], 1945)
		end

	end
	return true
end
 
Back
Top