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

Quest Help!

Majeski20

New Member
Joined
Apr 21, 2008
Messages
602
Reaction score
4
Location
Sweden
Hello!

If i want 2 quests with the same item, how to do, cuz it just says "This unique id is already in use!"

Any ideas?

I use SimOnes map editor.

Thanks :peace:
 
Edit your data/actions/scripts/quests/quests.lua:
Code:
local charges = {[2161] = 200, [2164] = 20, [2170] = 200, [2172] = 200, [2197] = 5, [2198] = 50, [2199] = 150, [2200] = 250, [2201] = 200, [7887] = 200, [7888] = 200, [7889] = 200, [7890] = 200, [10218] = 5, [10219] = 5, [10220] = 5, [10221] = 5}
function onUse(cid, item, fromPosition, itemEx, toPosition)
	if item.uid > 0 and item.uid <= 65535 then
		if getPlayerStorageValue(cid, item.uid) <= 0 then
			local getArticle = getItemDescriptions(item.actionid).article
			local article = getArticle ~= "" and getArticle
			if getPlayerFreeCap(cid) >= getItemWeight(item.actionid, 1) then
				local itemToAdd = doCreateItemEx(item.actionid, charges[item.actionid] or 1)
				if doPlayerAddItemEx(cid, itemToAdd, 0) == RETURNVALUE_NOERROR then
					doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You have found " .. (article and article .. " " or "") .. getItemName(item.actionid) .. ".")
					setPlayerStorageValue(cid, item.uid, 1)
				else
					doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You have found " .. (article and article .. " " or "") .. getItemName(item.actionid) .. ", but you have no room to take it.")
				end
			else
				doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You have found " .. (article and article .. " " or "") .. getItemName(item.actionid) .. ". Weighing " .. getItemWeight(item.actionid, 1) .. " oz it is too heavy.")
			end
		else
			doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "The " .. getItemName(item.itemid) .. " is empty.")
		end
		return TRUE
	end
	return FALSE
end
Usage: ActionID as itemid, UniqueID as storage value.
 
I dont understand, i use a 8.1 ot so i do not have the map script > quest > quests.

But should i take the same action id as unique id?
if i do that it say the same thing "unique id is already in use"
or like this, You have found 2160 crystal coin.
 
Back
Top