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

Lua How to make a Quest in TFS 0.3b3gui

Zorenia

Hoster of Zorenia
Joined
Jan 21, 2009
Messages
598
Reaction score
64
Location
The Netherlands
How Can I make a Quest box?? in 8.4 TFS 0.3b3-gui!!!

If I go to map editor place a box and I fill in ITEM ID in Unique ID.. and action id on 0 It WONT WORK!!!

Can anyone explain how I can make Questes with this version??

I hope to hear something soon!!

Thanks in advance,

Rick.
 
/data/actions/scripts/quests/old_system.lua:
Code:
local annihilatorReward = {1990, 2400, 2431, 2494}
function onUse (cid, item, fromPosition, itemEx, toPosition)
	if item.uid > 1000 and item.uid < 10000 then
		local itemWeight = getItemWeightById(item.uid, 1, FALSE)
		local playerCap = getPlayerFreeCap(cid)
		if isInArray(annihilatorReward, item.uid) == TRUE then
			if getPlayerStorageValue(cid, 30015) == -1 then
				if playerCap >= itemWeight then
					if item.uid == 1990 then
						local container = doPlayerAddItem(cid, 1990, 1)
						doAddContainerItem(container, 2326, 1)
					else
						doPlayerAddItem(cid, item.uid, 1)
					end
					doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, 'You have found a ' .. getItemNameById(item.uid) .. '.')
					setPlayerStorageValue(cid, 30015, 1)
				else
					doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, 'You have found a ' .. getItemNameById(item.uid) .. ' weighing ' .. itemWeight .. ' oz it\'s too heavy.')
				end
			else
				doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "It is empty.")
			end
		elseif getPlayerStorageValue(cid, item.uid) == -1 then
			if playerCap >= itemWeight then
				doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, 'You have found a ' .. getItemNameById(item.uid) .. '.')
				doPlayerAddItem(cid, item.uid, 1)
				setPlayerStorageValue(cid, item.uid, 1)
			else
				doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, 'You have found a ' .. getItemNameById(item.uid) .. ' weighing ' .. itemWeight .. ' oz it\'s too heavy.')
			end
		else
			doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "It is empty.")
		end
	else
		return FALSE
	end
	return TRUE
end

/data/actions/actions.xml:
Code:
	<!-- Old quest system-->
	<action itemid="1740" script="quests/old_system.lua"/>
	<action fromid="1747" toid="1749" script="quests/old_system.lua"/>

Then your quests should work.
 
Aff.. Add mine script PROPERLY so everything should work (uniqueid as itemid of reward). I had SAME problem, and I had posted how I had solved it. Learn to read. Learn to copy'n'paste.
 
Back
Top