• 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!
  • 2026 staff recruitment is open! Check it out and consider applying!

Quest system 0.3.4pl2

legolas23

New Member
Joined
Jan 8, 2009
Messages
537
Reaction score
3
Witam
Mam pytanie ,czy w tfs 0.3.4pl2 jest możliwość zastosowania starego quest systemu? (tzn. po kliknięciu na skzynke o unique id np.2345 dostaje się item o tym samym id.)
 
Wrzuciłem z tfs 0.3.3 i mi nie działa . Testuje charem zwykłym nie gm ;p
 
Actions.xml
Code:
	-- Simple quests
<action itemid="1740" script="quest.lua" />
<action itemid="1747" script="quest.lua" />
<action itemid="1748" script="quest.lua" />
<action itemid="1749" script="quest.lua" />
<action itemid="1770" script="quest.lua" />
quest.lua
Code:
-- simple quests based on uniqueId
-- to make quest create chest on map and set its uniqueId to id of quest item

function onUse(cid, item, frompos, item2, topos)
	prize = item.uid
	count = item.actionid

	if prize > 0 and prize < 7000 then
		queststatus = getPlayerStorageValue(cid,prize)

		if queststatus == -1 then
			if count > 1 then
				doPlayerSendTextMessage(cid,22,'Orzymales nagrode!')
				doPlayerAddItem(cid,prize,count)
				setPlayerStorageValue(cid,prize,1)
			else
				doPlayerSendTextMessage(cid,22,'Orzymales nagrode!')
				doPlayerAddItem(cid,prize,1)
				setPlayerStorageValue(cid,prize,1)
			end
		else
			doPlayerSendTextMessage(cid,22,"Dostales juz nagrode z tej skrzynki!")
		end

		return 1
	else
		return 0
	end
end
 
Code:
	<!-- Quests -->
	<action itemid="1740" script="quests/quests.lua"/>
	<action fromid="1747" toid="1749" script="quests/quests.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)
		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[1], 2326, 1)
					else
						doPlayerAddItem(cid, item.uid, 1)
					end
					doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR,  'Zdobyles ' .. getItemNameById(item.uid) .. '.')
					setPlayerStorageValue(cid, 30015, 1)
				else
					doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, ' Zdobyles ' .. getItemNameById(item.uid) .. ' weighing ' .. itemWeight .. ' oz it\'s too heavy.')
				end
			else
				doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Pusto")
			end
		elseif getPlayerStorageValue(cid, item.uid) == -1 then
			if playerCap >= itemWeight then
				doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, ' Zdobyles ' .. 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, "Pusto")
		end
	else
		return FALSE
	end
	return TRUE
end
to na 100% będzie Działać
 
Odpowiedz na twoje pytanie. Pierdolic to Ty se mozesz, wiesz kogo. Siemano, wiecej pomocy nie masz ode mnie.
 
Back
Top