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

Lua Exhaust on certain item?

I'm NOT expert of TFS, but weapon dont have any common things with this.

The exhaust is for male atack, not for item.

I think the one idea is a add atribute to items which it will change male exhausted time.
If changeExhausted LUA function exist then no problem otherwise you have to make your own.
And maybe you will have to add new status for players.h like exhatedTime, like in spells in new Tibia.
 
Lua:
local storage = 1000
local time = 100
function onUse(cid, item, fromPosition, itemEx, toPosition)
	if not exhaustion.check(cid, 100) then
		xxxx
		exhaustion.set(cid, 100, time
	else
		doPlayerSendCancel(cid, 'You are exhausted.')
	end
return TRUE
end
 
Last edited:
Yes it will, 100 = time in milliseconds if i'm right.

local time = 1000
would be a second and so on.
 
Code:
function onUse(cid, item, fromPosition, itemEx, toPosition)
	
local storage = 1000
local time = 120000
	if not exhaustion.get(cid, 100) then
		doRemoveCondition(cid, CONDITION_POISON)
	
		doCreatureSay(itemEx.uid, "Gulp.", TALKTYPE_ORANGE_1)
	
		doRemoveItem(item.uid, 1)

		doPlayerGiveItem(cid, 2548,1)
		exhaustion.set(cid, 100, time)
	else
		doPlayerSendCancel(cid, 'You cannot drink more antidote yet.')
	end
return TRUE
end

Still no cooldown :)
 
Lua:
function onUse(cid, item, fromPosition, itemEx, toPosition)
	
local storage = 1000
local time = 120 -- seconds
	if(exhaustion.check(cid, storage) == false) then
		doRemoveCondition(cid, CONDITION_POISON)
		doCreatureSay(itemEx.uid, "Gulp.", TALKTYPE_ORANGE_1)
		doRemoveItem(item.uid, 1)
		doPlayerGiveItem(cid, 2548,1)
		exhaustion.set(cid, storagae, time)
	else
		doPlayerSendCancel(cid, 'You cannot drink more antidote yet.')
	end
return TRUE
end
 
Back
Top