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

Bright Sword quest

Venn

Member
Joined
Aug 16, 2009
Messages
547
Reaction score
20
can some one fix it ? becous it doesn't work
it take ring but don't remove wall ;/

Code:
local t = {
	interval = 2,
	itemID = 2166,
	itempos = {x=32594, y=32214, z=9},
	wallpos = {x=32604, y=32216, z=9},
	wallnewID = 1103 -- why do you use a new id ? the quest won't be resettable
}
local event = 0
function onUse(cid, item, fromPosition, itemEx, toPosition)
	local getitem, wallchk = getTileItemById(t.itempos, 2166).uid, getTileItemById(t.wallpos, 1103).uid
	if item.itemid == 1945 then
		if getitem > 0 and wallchk > 0 then
			doSendMagicEffect(t.itempos, CONST_ME_TELEPORT)
			doSendMagicEffect(t.wallpos, CONST_ME_TELEPORT)
			doRemoveItem(getitem)
			doRemoveItem(wallchk)
			doTransformItem(item.uid, 1946)
			event = addEvent(doCreateItem, t.interval * 60 * 1000, t.wallnewID, 1, t.wallpos)
		else
			doPlayerSendCancel(cid, "There is something missing.")
		end
	elseif item.itemid == 1946 then
		stopEvent(event)
		doCreateItem(t.wallnewID, 1, t.wallpos)
		doTransformItem(item.uid, 1945)
	end
	return TRUE
end
 
i had traied to fix it but no result ... ;p
it don't remove wall and it add it. when i remove wall by god comand /r wall where more then one there ;p after trying quest.
 
I fix it...

Code:
local t = {
	interval = 2,
	itemID = 2166,
	itempos = {x=32594, y=32214, z=9},
	wallpos = {x=32604, y=32216, z=9},
	wallnewID = 1026
}
local event = 0
function onUse(cid, item, fromPosition, itemEx, toPosition)
	local getitem, wallchk = getTileItemById(t.itempos, 2166).uid, getTileItemById(t.wallpos, 1026).uid
	if item.itemid == 1945 and getitem > 0 and wallchk > 0 then

			doSendMagicEffect(t.itempos, CONST_ME_TELEPORT)
			doSendMagicEffect(t.wallpos, CONST_ME_TELEPORT)
			doRemoveItem(getitem)
			doRemoveItem(wallchk)
			doTransformItem(item.uid, 1946)
			doDecayItem(wallchk)
			event = addEvent(doCreateItem, t.interval * 60 * 1000, t.wallnewID, 1, t.wallpos)

	elseif item.itemid == 1946 and wallchk > 0 then
		doTransformItem(item.uid, 1945)
		stopEvent(event)
	elseif item.itemid == 1946 then
		doCreateItem(t.wallnewID, 1, t.wallpos)
		doTransformItem(item.uid, 1945)
		stopEvent(event)
	else
		doPlayerSendCancel(cid, "There is something missing.")
		stopEvent(event)
	end
	return TRUE
end
 
Back
Top Bottom