• 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!
  • New resources must be posted under Resources tab. A discussion thread will be created automatically, you can't open threads manually anymore.

MoveEvent Hota - Helmet of the Ancients

andypsylon

be be
Joined
Jan 13, 2009
Messages
772
Reaction score
65
Location
de/pl
last room ;)

you need add in yourots/movements/movements.xml

XML:
	<movevent type="AddItem"	actionid="11111" tileitem="1"  event="script" value="hota.lua"/>
add file yourots/movements/hota.lua

Lua:
-- ver. 1 2011-11-24
-- author tfs, otland.net/members/andypsylon
local c = {
	{2335, 2336, 2337, 2338, 2339, 2340, 2341},
	{2342, 2147}
}
local rew = {2342, 2343}

function onAddItem(moveItem, tileItem, position, cid)

	for r, v in ipairs(c) do
		if isInArray(v, moveItem.itemid) then
			local itemy = {}
			for i = 1, #v do
				local tmp = getTileItemById(position, v[i])
				if tmp.itemid == v[i] then
					table.insert(itemy, tmp)
				end
			end
			if table.maxn(itemy) == #v then
				for _, q in ipairs(itemy) do
					doRemoveItem(q.uid, 1)
				end
				doCreateItem(rew[r], 1, position)
				doSendMagicEffect(position, CONST_ME_FIREAREA)
			end
			return true
		end
	end
	return false
end

Insert on the map tile with aid 11111 and move your hota items on it

Any error? Suggestions?
 
Last edited:
Works great bro, thanks! I used this for TFS 9.31 (mystic spirit 0.2)
I edited it for my own uses, but its a great script!
 
Back
Top