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

Dester quest for tfs 0.3.5

barker

HHHHH
Joined
Nov 23, 2007
Messages
1,298
Reaction score
25
I have so far seen no working desert quest for tfs 0.3.5
Ive tried everything that is avaiable and none is working at all.. :P and I did the settings right xP
 

no lies!!

I have the use status thing at true(unlimited) but still when I try to use it.. it says
A player in your team has already done this quest.

meaning.. something must be wrong ;OOO and no errors at the console :P

When I put the status = false then I got a error in the console

Code:
[04/12/2009 17:35:50] Lua Script Error: [Action Interface] 
[04/12/2009 17:35:50] data/actions/scripts/lever.lua:onUse

[04/12/2009 17:35:50] data/actions/scripts/lever.lua:54: attempt to compare table with number
[04/12/2009 17:35:50] stack traceback:
[04/12/2009 17:35:50] 	data/actions/scripts/lever.lua:54: in function <data/actions/scripts/lever.lua:41>
 
Try

Code:
local config = {
	-- level needed to make the quest
	level = 20,
	-- if players should be able to do the quest unlimited amount of times (not conflicting quest rewards)
	redo = {
		status = true, -- true = unlimited, false = once
		storageValue = 4535 -- only if status is false this will be used
	},
	-- vocation requirement, positions and item configuration
	{
		vocations = {1, 5},
		itemId = 2175,
		playerPos = {x=32677, y=32089, z=8},
		newPos = {x=32671, y=32069, z=8},
		itemPos = {x=32679, y=32089, z=8}
	},
	{
		vocations = {2, 6},
		itemId = 2674,
		playerPos = {x=32669, y=32089, z=8},
		newPos = {x=32672, y=32069, z=8},
		itemPos = {x=32667, y=32089, z=8}
	},
	{
		vocations = {3, 7},
		itemId = 2455,
		playerPos = {x=32673, y=32085, z=8},
		newPos = {x=32671, y=32070, z=8},
		itemPos = {x=32673, y=32083, z=8}
	},
	{
		vocations = {4, 8},
		itemId = 2376,
		playerPos = {x=32673, y=32093, z=8},
		newPos = {x=32672, y=32070, z=8},
		itemPos = {x=32673, y=32094, z=8}
	}
}
function onUse(cid)
	local players = {}
	for _, v in ipairs(config) do
		local player = getTopCreature(v.playerPos).uid
		if isPlayer(player) == FALSE then
			return doPlayerSendCancel(cid, "There are not enough players.")
		elseif getPlayerLevel(player) < config.level then
			players.level = true
		elseif isInArray(v.vocations, getPlayerVocation(player)) == FALSE then
			players.vocation = true
		elseif config.redo.status and getPlayerStorageValue(cid, config.redo.storageValue) ~= TRUE then
			players.done = false
		else
			if getTileItemById(v.itemPos, v.itemId) < 1 then
				players.item = true
			else
				table.insert(players, player)
			end
		end
	end
	if players.level then
		doPlayerSendCancel(cid, "All players need to be level " .. config.level .. " or above.")
	elseif players.vocation then
		doPlayerSendCancel(cid, "All players must stand on the correct tiles.")
	elseif players.done then
		doPlayerSendCancel(cid, "A player in your team has already done this quest.")
	elseif players.item then
		doPlayerSendCancel(cid, "All items must be on the correct positions.")
	else
		for k, player in ipairs(players) do
			doSendMagicEffect(getCreaturePosition(player), CONST_ME_POFF)
			doTeleportThing(player, config[k].newPos)
			doSendMagicEffect(getCreaturePosition(player), CONST_ME_TELEPORT)
		end
	end
	return TRUE
end
 
Code:
local config = {
	-- level needed to make the quest
	level = 20,
	-- if players should be able to do the quest unlimited amount of times (not conflicting quest rewards)
	redo = {
		status = true, -- true = unlimited, false = once
		storageValue = 4535 -- only if status is false this will be used
	},
	-- vocation requirement, positions and item configuration
	{
		vocations = {1, 5},
		itemId = 2175,
		playerPos = {x=32677, y=32089, z=8},
		newPos = {x=32671, y=32069, z=8},
		itemPos = {x=32679, y=32089, z=8}
	},
	{
		vocations = {2, 6},
		itemId = 2674,
		playerPos = {x=32669, y=32089, z=8},
		newPos = {x=32672, y=32069, z=8},
		itemPos = {x=32667, y=32089, z=8}
	},
	{
		vocations = {3, 7},
		itemId = 2455,
		playerPos = {x=32673, y=32085, z=8},
		newPos = {x=32671, y=32070, z=8},
		itemPos = {x=32673, y=32083, z=8}
	},
	{
		vocations = {4, 8},
		itemId = 2376,
		playerPos = {x=32673, y=32093, z=8},
		newPos = {x=32672, y=32070, z=8},
		itemPos = {x=32673, y=32094, z=8}
	}
}
function onUse(cid)
	local players = {}
	for _, v in ipairs(config) do
		local player = getTopCreature(v.playerPos).uid
		if isPlayer(player) == FALSE then
			return doPlayerSendCancel(cid, "There are not enough players.")
		elseif getPlayerLevel(player) < config.level then
			players.level = true
		elseif isInArray(v.vocations, getPlayerVocation(player)) == FALSE then
			players.vocation = true
		elseif config.redo.status and getPlayerStorageValue(cid, config.redo.storageValue) ~= TRUE then
			players.done = false
		else
			if getTileItemById(v.itemPos, v.itemId) < 1 then
				players.item = true
			else
				table.insert(players, player)
			end
		end
	end
	if players.level then
		doPlayerSendCancel(cid, "All players need to be level " .. config.level .. " or above.")
	elseif players.vocation then
		doPlayerSendCancel(cid, "All players must stand on the correct tiles.")
	elseif players.done then
		doPlayerSendCancel(cid, "A player in your team has already done this quest.")
	elseif players.item then
		doPlayerSendCancel(cid, "All items must be on the correct positions.")
	else
		for k, player in ipairs(players) do
			doSendMagicEffect(getCreaturePosition(player), CONST_ME_POFF)
			doTeleportThing(player, config[k].newPos)
			doSendMagicEffect(getCreaturePosition(player), CONST_ME_TELEPORT)
		end
	end
	return TRUE
end

The lever didnt want to move at all :(
 
Replace

Code:
function onUse(cid)
	local players = {}
	for _, v in ipairs(config) do
		local player = getTopCreature(v.playerPos).uid
		if isPlayer(player) == FALSE then
			return doPlayerSendCancel(cid, "There are not enough players.")
		elseif getPlayerLevel(player) < config.level then
			players.level = true
		elseif isInArray(v.vocations, getPlayerVocation(player)) == FALSE then
			players.vocation = true
		elseif config.redo.status and getPlayerStorageValue(cid, config.redo.storageValue) == FALSE then
			players.done = true
		else
			if getTileItemById(v.itemPos, v.itemId) < 1 then
				players.item = true
			else
				table.insert(players, player)
			end
		end
	end
	if players.level then
		doPlayerSendCancel(cid, "All players need to be level " .. config.level .. " or above.")
	elseif players.vocation then
		doPlayerSendCancel(cid, "All players must stand on the correct tiles.")
	elseif players.done then
		doPlayerSendCancel(cid, "A player in your team has already done this quest.")
	elseif players.item then
		doPlayerSendCancel(cid, "All items must be on the correct positions.")
	else
		for k, player in ipairs(players) do
			doSendMagicEffect(getCreaturePosition(player), CONST_ME_POFF)
			doTeleportThing(player, config[k].newPos)
			doSendMagicEffect(getCreaturePosition(player), CONST_ME_TELEPORT)
		end
	end
	return TRUE
end
 
Code:
[05/12/2009 17:38:26] Lua Script Error: [Action Interface] 
[05/12/2009 17:38:26] data/actions/scripts/lever.lua:onUse

[05/12/2009 17:38:27] data/actions/scripts/lever.lua:52: attempt to compare table with number
[05/12/2009 17:38:27] stack traceback:
[05/12/2009 17:38:27] 	data/actions/scripts/lever.lua:52: in function <data/actions/scripts/lever.lua:39>
 
Change local switchUID to the correct unique id your lever uses.
 
Last edited:
Change local switchUID to the correct unique id your lever uses.

Code:
function onUse(cid, item, fromPosition, itemEx, toPosition)
local switchUID = 6000 -- Unique ID of the Switch
	local positions = {
		players = {
			{x = 100, y = 100, z = 7, stackpos = 253}, -- Sorc
			{x = 100, y = 100, z = 7, stackpos = 253}, -- Druid
			{x = 100, y = 100, z = 7, stackpos = 253}, -- Paladin
			{x = 100, y = 100, z = 7, stackpos = 253} -- Knight
		}
		items = {
			{x = 100, y = 100, z = 7, stackpos = 2}, -- Spellbook
			{x = 100, y = 100, z = 7, stackpos = 2}, -- Apple
			{x = 100, y = 100, z = 7, stackpos = 2}, -- Crossbow
			{x = 100, y = 100, z = 7, stackpos = 2} -- Sword
		}
		new = {
			{x = 100, y = 100, z = 7}, -- New Sorc Spot
			{x = 100, y = 100, z = 7}, -- New Druid Spot
			{x = 100, y = 100, z = 7}, -- New Paladin Spot
			{x = 100, y = 100, z = 7} -- New Knight Spot
		}
	}
	
	local vocations = { 1, 2, 3, 4 }
	local questItems = { {2175},{2674},{2455},{2376} }

	if (item.itemid == 1945) and (item.uid == switchUID) then
		if (isPlayer(getThingfromPos(positions.players[i]))) then
			if (getPlayerVocation(getThingfromPos(positions.players[i])) == vocations[i]) then
				if (getThingFromPos(positions.items[i]).itemid == questItems[i]) then
					for i = 1, 4 do
						doTeleportThing(getThingfromPos(positions.players[i]), positions.new[i])
						doRemoveItem(getThingfromPos(positions.items[i]), questItems[i].uid)
						doSendMagicEffect(positions.players[i], CONST_ME_POFF)
						doSendMagicEffect(positions.items[i], CONST_ME_POFF)
						doSendMagicEffect(positions.new[i], CONST_ME_TELEPORT)
					end
				else
					doPlayerSendCancel(cid, "The items are not on the correct spots.")
				end
			else
				doPlayerSendCancel(cid, "All players must be on the correct spots.")
			end
		else
			doPlayerSendCancel(cid, "You need four players to do this quest.")
		end
	elseif (item.itemid == 1946) then
		doTransformItem(item.uid, item.itemid - 1)
	end
	return TRUE
end
plz place config-related things before the function and use getTileItemById instead of getThingfromPos (you can drop stackpos)
 
[07/12/2009 13:47:29] [Warning - Event::loadScript] Cannot load script (data/actions/scripts/lever.lua)
[07/12/2009 13:47:29] data/actions/scripts/lever.lua:10: '}' expected (to close '{' at line 3) near 'items'
 
Last edited:
LUA:
function onUse(cid, item, fromPosition, itemEx, toPosition)
local switchUID = 6000 -- Unique ID of the Switch
        local positions = {
                players = {
                        {x = 100, y = 100, z = 7, stackpos = 253}, -- Sorc
                        {x = 100, y = 100, z = 7, stackpos = 253}, -- Druid
                        {x = 100, y = 100, z = 7, stackpos = 253}, -- Paladin
                        {x = 100, y = 100, z = 7, stackpos = 253} -- Knight
                },
                items = {
                        {x = 100, y = 100, z = 7, stackpos = 2}, -- Spellbook
                        {x = 100, y = 100, z = 7, stackpos = 2}, -- Apple
                        {x = 100, y = 100, z = 7, stackpos = 2}, -- Crossbow
                        {x = 100, y = 100, z = 7, stackpos = 2} -- Sword
                },
                new = {
                        {x = 100, y = 100, z = 7}, -- New Sorc Spot
                        {x = 100, y = 100, z = 7}, -- New Druid Spot
                        {x = 100, y = 100, z = 7}, -- New Paladin Spot
                        {x = 100, y = 100, z = 7} -- New Knight Spot
                }
        }
        
        local vocations = { 1, 2, 3, 4 }
        local questItems = { {2175},{2674},{2455},{2376} }

        if (item.itemid == 1945) and (item.uid == switchUID) then
                if (isPlayer(getThingfromPos(positions.players[i]))) == true then
                        if (getPlayerVocation(getThingfromPos(positions.players[i])) == vocations[i]) then
                                if (getThingfromPos(positions.items[i]).itemid == questItems[i]) then
                                        for i = 1, 4 do
                                                doTeleportThing(getThingfromPos(positions.players[i]), positions.new[i])
                                                doRemoveItem(getThingfromPos(positions.items[i]), questItems[i].uid)
                                                doSendMagicEffect(positions.players[i], CONST_ME_POFF)
                                                doSendMagicEffect(positions.items[i], CONST_ME_POFF)
                                                doSendMagicEffect(positions.new[i], CONST_ME_TELEPORT)
                                        end
                                else
                                        doPlayerSendCancel(cid, "The items are not on the correct spots.")
                                end
                        else
                                doPlayerSendCancel(cid, "All players must be on the correct spots.")
                        end
                else
                        doPlayerSendCancel(cid, "You need four players to do this quest.")
                end
        elseif (item.itemid == 1946) then
                doTransformItem(item.uid, item.itemid - 1)
        end
        return TRUE
end
 
Last edited:
[07/12/2009 17:45:01] Lua Script Error: [Action Interface]
[07/12/2009 17:45:01] data/actions/scripts/lever.lua:onUse

[07/12/2009 17:45:01] attempt to index a nil value
[07/12/2009 17:45:02] stack traceback:
[07/12/2009 17:45:02] [C]: in function 'getThingfromPos'
[07/12/2009 17:45:02] data/actions/scripts/lever.lua:28: in function <data/actions/scripts/lever.lua:1>
 
Updated my post.

Edited again, sorry.
Try it now, I think it will work.

plz place config-related things before the function and use getTileItemById instead of getThingfromPos (you can drop stackpos)

You can use getTileItemById for players?
I don't see why it matters, either way it works. :p
 
Last edited:
didnt work :(

Code:
[08/12/2009 16:12:36] Lua Script Error: [Action Interface] 
[08/12/2009 16:12:37] data/actions/scripts/lever.lua:onUse

[08/12/2009 16:12:37] attempt to index a nil value
[08/12/2009 16:12:37] stack traceback:
[08/12/2009 16:12:37] 	[C]: in function 'getThingfromPos'
[08/12/2009 16:12:37] 	data/actions/scripts/lever.lua:28: in function <data/actions/scripts/lever.lua:1


I think as the other guy said.. Cykotitan I think xP <to lazy to scroll> that the getThingfromPos something? xD
 
LUA:
function onUse(cid, item, fromPosition, itemEx, toPosition)
local switchUID = 6000 -- Unique ID of the Switch
        local positions = {
                players = {
                        {x = 100, y = 100, z = 7, stackpos = 253}, -- Sorc
                        {x = 100, y = 100, z = 7, stackpos = 253}, -- Druid
                        {x = 100, y = 100, z = 7, stackpos = 253}, -- Paladin
                        {x = 100, y = 100, z = 7, stackpos = 253} -- Knight
                },
                items = {
                        {x = 100, y = 100, z = 7, stackpos = 2}, -- Spellbook
                        {x = 100, y = 100, z = 7, stackpos = 2}, -- Apple
                        {x = 100, y = 100, z = 7, stackpos = 2}, -- Crossbow
                        {x = 100, y = 100, z = 7, stackpos = 2} -- Sword
                },
                new = {
                        {x = 100, y = 100, z = 7}, -- New Sorc Spot
                        {x = 100, y = 100, z = 7}, -- New Druid Spot
                        {x = 100, y = 100, z = 7}, -- New Paladin Spot
                        {x = 100, y = 100, z = 7} -- New Knight Spot
                }
        }
        
        local vocations = { 1, 2, 3, 4 }
        local questItems = { {2175},{2674},{2455},{2376} }

        if (item.itemid == 1945) and (item.uid == switchUID) then
	    for i = 1,4 do
                if (isPlayer(getThingfromPos(positions.players[i]))) == TRUE then
                        if (getPlayerVocation(getThingfromPos(positions.players[i])) == vocations[i]) then
                                if (getThingfromPos(positions.items[i]).itemid == questItems[i]) then
                                    doTeleportThing(getThingfromPos(positions.players[i]), positions.new[i])
                                    doRemoveItem(getThingfromPos(positions.items[i]), questItems[i].uid)
				    doSendMagicEffect(positions.players[i], CONST_ME_POFF)
				    doSendMagicEffect(positions.items[i], CONST_ME_POFF)
				    doSendMagicEffect(positions.new[i], CONST_ME_TELEPORT)
                                else
                                        doPlayerSendCancel(cid, "The items are not on the correct spots.")
                                end
                        else
                                doPlayerSendCancel(cid, "All players must be on the correct spots.")
                        end
                else
                        doPlayerSendCancel(cid, "You need four players to do this quest.")
                end
	    end
        elseif (item.itemid == 1946) then
                doTransformItem(item.uid, item.itemid - 1)
        end
	return TRUE
end
 
Back
Top