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

Little problem.

ruth

Veteran OT User
Joined
Aug 3, 2009
Messages
670
Solutions
2
Reaction score
380
How to combine these two functions.

pick.lua
Code:
local TUMB_ENTRANCE	=	7200
local MUD_HOLE		=	392
local ICE_FISHHOLE	=	7236

local duration = 5 * 60000 -- 5 minutes

function onUse(cid, item, frompos, item2, topos)
	if (isInArray(MUD, item2.itemid) == TRUE) then
		if (item2.actionid == TUMB_ENTRANCE) then
			doSendMagicEffect(topos, CONST_ME_POFF)
			doTransformItem(item2.uid, MUD_HOLE)
			addEvent(__doTransformHole__, duration, {oldType = item2.itemid, pos = topos})
			return TRUE
		end
	end
	return FALSE
end

function __doTransformHole__(parameters)
	local thing = getTileItemById(parameters.pos, MUD_HOLE)
	local newItem = doTransformItem(thing.uid, parameters.oldType)
end

With:

Code:
elseif (item2.itemid == 1304 and item2.aid == 4005) then
                doRemoveItem(item2.uid,1)
                doSendMagicEffect(topos,2)
                end
               return 1
               end
 
Code:
local TOMB_ENTRANCE	=	7200
local MUD_HOLE		=	392
local ICE_FISHHOLE	=	7236

local duration = 5 * 60 -- 5 minutes

local function __doTransformHole__(parameters)
	local thing = getTileItemById(parameters.pos, MUD_HOLE)
	local newItem = doTransformItem(thing.uid, parameters.oldType)
end

function onUse(cid, item, fromPosition, itemEx, toPosition)
	if isInArray({354, 355}, itemEx.itemid) then
		if itemEx.actionid == TOMB_ENTRANCE then
			doSendMagicEffect(toPosition, CONST_ME_POFF)
			doTransformItem(itemEx.uid, MUD_HOLE)
			addEvent(__doTransformHole__, duration, {oldType = itemEx.itemid, pos = toPosition})
			return TRUE
		end
	elseif isInArray({1304}, itemEx.itemid) then
		if itemEx.actionid == 4005 then
			doRemoveItem(itemEx.uid)
			doSendMagicEffect(toPosition, 2)
		end
	end
	
	return FALSE
end
 
Last edited:
Back
Top