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

Chests don't give me what I put in...

Neubbed

New Member
Joined
Jan 15, 2013
Messages
24
Reaction score
0
Hey, my chests won't give me what I put the reward to be, for example... one of my chests has a spoon in it... and when you (use) the chest, it gives a small amethyst.

The action ID is 2000 like the guides I have read said, and the unique ID is random number

Why is this?
It also happens to me other chest, where it gives the player an Anvil :/
 
Ah thanks dude, it works!

Will this work for all players now? because when it did sort of work, it was like... 5 cc in a chest, but if 1 person took then it wouldnt be there for me.

- - - Updated - - -

Oh, I just tried in my other character and there's nothing in the chest now :S
 
Uniqueid in chest means storage id, if you put uniqueid 0 then only 1 player can get the reward.
Most of people put in uniqueid the id of item in chest.
 
Ah thanks godiskungen, I will use that it seems much easier for me.

Limos, how do I find out which unique ID's have already been used?
 
You can look in your xml files, like movements or actions. To check in the map for used unique ids you can go to Edit, Find, Find Unique.
But your server should give an error about duplicated unique ids if it was used 2x. But to be sure the unique id isn't the problem, you can just try it with a different one.
 
If you look in the map with Find Unique, then you see all used unique ids used in the map. But in the xml files only the lines with uniqueid are for unique ids.
 
I checked movements/actions.xml for unique ids, there is only one and its for annihilator quest.

Made sure the unique ids were not the same, now when I opened the chest, I received a letter to Markwin... :/

- - - Updated - - -

Post before said about unique id being the item you want to give out, but what about if I want to give more than 1 items... it doesnt make sense
 
The unique id in the chest is for storage (so a player can't take the reward again), if the unique id was used for an other script it could give problems. But if the unique id you used is not inuse, then that isn't the problem.
 
Hm... it doesn't work for me though :(

I tried this - changed the unique id, since I only have 1 unique ID for annihilator quest well.. yeh.. its not the same.

Anyway, I got the items on my first character,
I then logged out and changed characters and went to the same chest.

The chest was empty.

:/ whyyyyy?
 
You can try an other system.lua (could be the same tho), but just to be sure incase there is a problem with the script.
LUA:
local specialQuests = {
	[2001] = 30015 --Annihilator
}

local questsExperience = {
	[30015] = 10000
}

function onUse(cid, item, fromPosition, itemEx, toPosition)
	if(getPlayerCustomFlagValue(cid, PLAYERCUSTOMFLAG_GAMEMASTERPRIVILEGES)) then
		doSendMagicEffect(getCreaturePosition(cid), CONST_ME_POFF, cid)
		return true
	end

	local storage = specialQuests[item.actionid]
	if(not storage) then
		storage = item.uid
		if(storage > 65535) then
			return false
		end
	end

	if(getPlayerStorageValue(cid, storage) > 0) then
		doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "It is empty.")
		return true
	end

	local items = {}
	local reward = 0

	local size = isContainer(item.uid) and getContainerSize(item.uid) or 0
	if(size == 0) then
		reward = doCopyItem(item, false)
	else
		for i = 0, size do
			local tmp = getContainerItem(item.uid, i)
			if(tmp.itemid > 0) then
				table.insert(items, tmp)
			end
		end
	end

	size = table.maxn(items)
	if(size == 1) then
		reward = doCopyItem(items[1], true)
	end

	local result = ""
	if(reward ~= 0) then
		local ret = getItemDescriptions(reward.uid)
		if(reward.type > 0 and isItemRune(reward.itemid)) then
			result = reward.type .. " charges " .. ret.name
		elseif(reward.type > 0 and isItemStackable(reward.itemid)) then
			result = reward.type .. " " .. ret.plural
		else
			result = ret.article .. " " .. ret.name
		end
	else
		if(size > 20) then
			reward = doCopyItem(item, false)
		elseif(size > 8) then
			reward = getThing(doCreateItemEx(1988, 1))
		else
			reward = getThing(doCreateItemEx(1987, 1))
		end

		for i = 1, size do
			local tmp = doCopyItem(items[i], true)
			if(doAddContainerItemEx(reward.uid, tmp.uid) ~= RETURNVALUE_NOERROR) then
				print("[Warning] QuestSystem:", "Could not add quest reward")
			else
				local ret = ", "
				if(i == 2) then
					ret = " and "
				elseif(i == 1) then
					ret = ""
				end

				result = result .. ret
				ret = getItemDescriptions(tmp.uid)
				if(tmp.type > 0 and isItemRune(tmp.itemid)) then
					result = result .. tmp.type .. " charges " .. ret.name
				elseif(tmp.type > 0 and isItemStackable(tmp.itemid)) then
					result = result .. tmp.type .. " " .. ret.plural
				else
					result = result .. ret.article .. " " .. ret.name
				end
			end
		end
	end

	if(doPlayerAddItemEx(cid, reward.uid, false) ~= RETURNVALUE_NOERROR) then
		result = "You have found a reward weighing " .. getItemWeight(reward.uid) .. " oz. It is too heavy or you have not enough space."
	else
		result = "You have found " .. result .. "."
		setPlayerStorageValue(cid, storage, 1)
		if(questsExperience[storage] ~= nil) then
			doPlayerAddExp(cid, questsExperience[storage])
			doSendAnimatedText(getCreaturePosition(cid), questsExperience[storage], TEXTCOLOR_WHITE)
		end
	end

	doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, result)
	return true
end
 
None! D:

Code:
<?xml version="1.0" encoding="UTF-8"?>
<actions>
	<!-- Quests -->
	<action itemid="1740" script="quests/quests.lua"/>
	<action fromid="1747" toid="1749" script="quests/quests.lua"/>
	<action uniqueid="30015" script="quests/annihilator.lua"/>

	<!-- Tools -->
	<action itemid="2420" script="tools/machete.lua"/>
	<action itemid="2550" script="tools/scythe.lua"/>
	<action itemid="2580" script="tools/fishing.lua" allowfaruse="1"/>
	<action itemid="2554" script="tools/shovel.lua"/>
	<action itemid="2120" script="tools/rope.lua"/>
	<action itemid="2553" script="tools/pick.lua"/>

	<!-- Increase/Decrease ItemId -->
	<action itemid="1873" function="increaseItemId"/>
	<action itemid="1874" function="decreaseItemId"/>
	<action itemid="1875" function="increaseItemId"/>
	<action itemid="1876" function="decreaseItemId"/>
	<action itemid="2162" function="increaseItemId"/>
	<action itemid="2163" function="decreaseItemId"/>
	<action itemid="3743" function="increaseItemId"/>
	<action itemid="3744" function="decreaseItemId"/>
	<action itemid="3947" function="increaseItemId"/>
	<action itemid="3948" function="decreaseItemId"/>
	<action itemid="1479" function="increaseItemId"/>
	<action itemid="1480" function="decreaseItemId"/>
	<action itemid="1945" function="increaseItemId"/>
	<action itemid="1946" function="decreaseItemId"/>
	<action itemid="2037" function="increaseItemId"/>
	<action itemid="2038" function="decreaseItemId"/>
	<action itemid="2039" function="increaseItemId"/>
	<action itemid="2040" function="decreaseItemId"/>
	<action itemid="2058" function="increaseItemId"/>
	<action itemid="2059" function="decreaseItemId"/>
	<action itemid="2060" function="increaseItemId"/>
	<action itemid="2061" function="decreaseItemId"/>
	<action itemid="2066" function="increaseItemId"/>
	<action itemid="2067" function="decreaseItemId"/>
	<action itemid="2068" function="increaseItemId"/>
	<action itemid="2069" function="decreaseItemId"/>
	<action itemid="2064" function="increaseItemId"/>
	<action itemid="2065" function="decreaseItemId"/>
	<action itemid="2578" function="increaseItemId"/>
	<action itemid="2096" function="increaseItemId"/>
	<action itemid="2097" function="decreaseItemId"/>
	<action itemid="1786" function="increaseItemId"/>
	<action itemid="1787" function="decreaseItemId"/>
	<action itemid="1788" function="increaseItemId"/>
	<action itemid="1789" function="decreaseItemId"/>
	<action itemid="1790" function="increaseItemId"/>
	<action itemid="1791" function="decreaseItemId"/>
	<action itemid="1792" function="increaseItemId"/>
	<action itemid="1793" function="decreaseItemId"/>
	<action itemid="1634" function="increaseItemId"/>
	<action itemid="1635" function="decreaseItemId"/>
	<action itemid="1636" function="increaseItemId"/>
	<action itemid="1637" function="decreaseItemId"/>
	<action itemid="1638" function="increaseItemId"/>
	<action itemid="1639" function="decreaseItemId"/>
	<action itemid="1640" function="increaseItemId"/>
	<action itemid="1641" function="decreaseItemId"/>
	<action itemid="5812" function="increaseItemId"/>
	<action itemid="5813" function="decreaseItemId"/>
	<action itemid="6489" function="increaseItemId"/>
	<action itemid="6490" function="decreaseItemId"/>
	<action itemid="7058" function="increaseItemId"/>
	<action itemid="7059" function="decreaseItemId"/>
	<action itemid="8684" function="increaseItemId"/>
	<action itemid="8685" function="decreaseItemId"/>
	<action itemid="8686" function="increaseItemId"/>
	<action itemid="8687" function="decreaseItemId"/>
	<action itemid="8688" function="increaseItemId"/>
	<action itemid="8689" function="decreaseItemId"/>
	<action itemid="8690" function="increaseItemId"/>
	<action itemid="8691" function="decreaseItemId"/>
	<action itemid="9575" function="increaseItemId"/>
	<action itemid="9576" function="decreaseItemId"/>
	<action itemid="9577" function="increaseItemId"/>
	<action itemid="9578" function="decreaseItemId"/>
	<action itemid="9579" function="increaseItemId"/>
	<action itemid="9580" function="decreaseItemId"/>
	<action itemid="9581" function="increaseItemId"/>
	<action itemid="9582" function="decreaseItemId"/>
	<action itemid="9747" function="increaseItemId"/>
	<action itemid="9748" function="decreaseItemId"/>
	<action itemid="9749" function="increaseItemId"/>
	<action itemid="9750" function="decreaseItemId"/>

	<!-- Food -->
	<action fromid="2362" toid="2363" script="other/food.lua"/>
	<action fromid="2666" toid="2691" script="other/food.lua"/>
	<action fromid="2695" toid="2696" script="other/food.lua"/>
	<action fromid="2787" toid="2796" script="other/food.lua"/>
	<action itemid="5097" script="other/food.lua"/>
	<action itemid="6125" script="other/food.lua"/>
	<action itemid="6278" script="other/food.lua"/>
	<action itemid="6279" script="other/food.lua"/>
	<action itemid="6394" script="other/food.lua"/>
	<action itemid="6501" script="other/food.lua"/>
	<action fromid="6541" toid="6545" script="other/food.lua"/>
	<action itemid="6569" script="other/food.lua"/>
	<action itemid="6574" script="other/food.lua"/>
	<action itemid="7158" script="other/food.lua"/>
	<action itemid="7159" script="other/food.lua"/>
	<action fromid="7372" toid="7377" script="other/food.lua"/>

	<!-- Spellbooks -->
	<action itemid="2175" script="other/spellbook.lua"/>
	<action itemid="6120" script="other/spellbook.lua"/>
	<action fromid="8900" toid="8904" script="other/spellbook.lua"/>
	<action itemid="8918" script="other/spellbook.lua"/>

	<!-- Other -->
	<action itemid="6578" script="other/partyhat.lua"/>
	<action itemid="2114" script="other/piggybank.lua"/>
	<action fromid="6570" toid="6571" script="other/surprisebag.lua"/>
	<action itemid="6576" script="other/fireworksrocket.lua"/>
	<action itemid="2036" script="other/watch.lua"/>
	<action fromid="1728" toid="1731" script="other/watch.lua"/>
	<action itemid="6572" script="other/partytrumpet.lua"/>
	<action itemid="2785" script="other/blueberrybush.lua"/>
	<action itemid="2579" script="other/trap.lua"/>
	<action itemid="2148" script="other/changegold.lua"/>
	<action itemid="2152" script="other/changegold.lua"/>
	<action itemid="2160" script="other/changegold.lua"/>
	<action fromid="3901" toid="3938" script="other/constructionkits.lua"/>
	<action fromid="2070" toid="2078" script="other/music.lua"/>
	<action fromid="2080" toid="2085" script="other/music.lua"/>
	<action itemid="2332" script="other/music.lua"/>
	<action itemid="2364" script="other/music.lua"/>
	<action fromid="2367" toid="2368" script="other/music.lua"/>
	<action fromid="2370" toid="2373" script="other/music.lua"/>
	<action fromid="2041" toid="2042" script="other/decayto.lua"/>
	<action fromid="2044" toid="2045" script="other/decayto.lua"/>
	<action fromid="2047" toid="2048" script="other/decayto.lua"/>
	<action fromid="2050" toid="2055" script="other/decayto.lua"/>
	<action itemid="430" script="other/teleport.lua"/>
	<action itemid="1369" script="other/teleport.lua"/>
	<action itemid="1386" script="other/teleport.lua"/>
	<action itemid="3678" script="other/teleport.lua"/>
	<action itemid="5543" script="other/teleport.lua"/>
	<action fromid="2376" toid="2404" script="other/destroy.lua"/>
	<action fromid="2406" toid="2419" script="other/destroy.lua"/>
	<action fromid="2421" toid="2453" script="other/destroy.lua"/>
	<action fromid="2005" toid="2009" script="other/fluids.lua"/>
	<action fromid="2011" toid="2015" script="other/fluids.lua"/>
	<action itemid="2023" script="other/fluids.lua"/>
	<action itemid="1775" script="other/fluids.lua"/>
	<action fromid="2031" toid="2034" script="other/fluids.lua"/>
	<action fromid="2574" toid="2577" script="other/fluids.lua"/>
	<action fromid="5792" toid="5797" script="other/dice.lua"/>
	<action itemid="7588" script="other/potions.lua"/>
	<action itemid="7589" script="other/potions.lua"/>
	<action itemid="7590" script="other/potions.lua"/>
	<action itemid="7591" script="other/potions.lua"/>
	<action itemid="7618" script="other/potions.lua"/>
	<action itemid="7620" script="other/potions.lua"/>
	<action itemid="8472" script="other/potions.lua"/>
	<action itemid="8473" script="other/potions.lua"/>
	<action itemid="8474" script="other/potions.lua"/>
	<action itemid="8704" script="other/potions.lua"/>
	<action itemid="2692" script="other/createbread.lua"/>
	<action itemid="2694" script="other/createbread.lua"/>
	<action fromid="6436" toid="6447" script="other/windows.lua"/>
	<action fromid="6450" toid="6473" script="other/windows.lua"/>
	<action fromid="6788" toid="6791" script="other/windows.lua"/>
	<action fromid="7025" toid="7032" script="other/windows.lua"/>
	<action fromid="10264" toid="10267" script="other/windows.lua" />
	<action fromid="10488" toid="10491" script="other/windows.lua" />
	<action fromid="1209" toid="1214" script="other/doors.lua"/>
	<action fromid="1219" toid="1262" script="other/doors.lua"/>
	<action fromid="1539" toid="1542" script="other/doors.lua"/>
	<action fromid="2086" toid="2092" script="other/doors.lua"/>
	<action fromid="3535" toid="3552" script="other/doors.lua"/>
	<action fromid="4913" toid="4918" script="other/doors.lua"/>
	<action fromid="5082" toid="5085" script="other/doors.lua"/>
	<action fromid="5098" toid="5145" script="other/doors.lua"/>
	<action fromid="5278" toid="5295" script="other/doors.lua"/>
	<action fromid="5515" toid="5518" script="other/doors.lua"/>
	<action fromid="5732" toid="5737" script="other/doors.lua"/>
	<action fromid="5745" toid="5749" script="other/doors.lua"/>
	<action fromid="6192" toid="6209" script="other/doors.lua"/>
	<action fromid="6249" toid="6266" script="other/doors.lua"/>
	<action fromid="6795" toid="6802" script="other/doors.lua"/>
	<action fromid="6891" toid="6908" script="other/doors.lua"/>
	<action fromid="7033" toid="7050" script="other/doors.lua"/>
	<action fromid="7054" toid="7057" script="other/doors.lua"/>
	<action fromid="8541" toid="8558" script="other/doors.lua"/>
	<action fromid="9165" toid="9184" script="other/doors.lua"/>
	<action fromid="9267" toid="9284" script="other/doors.lua"/>
	<action itemid="10032" script="other/doors.lua" />
	<action fromid="10268" toid="10285" script="other/doors.lua" />
	<action fromid="10468" toid="10486" script="other/doors.lua" />
	<action itemid="1981" function="highscoreBook"/>
	<action itemid="8306" script="upgrade.lua"/>  
	<action itemid="14405" function="market"/>
</actions>
 
Okay, added to actions.xml and made a new system.lua, I will check tomorrow if it works.

Is this right for the actions.xml?
Code:
<action uniqueid="2000" script="quests/system.lua"/>
 
Back
Top