• 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 how to make individual cooldowns

Haaan

New Member
Joined
Oct 24, 2009
Messages
56
Reaction score
0
how to make individual cooldown for spells i mean

i mean if SPELL A got exhaust 60 minut(just example) i can use in this time other spells with their own exhaustions

is hard to explain but i hope you get this
 
I think it can be done, but I'm wondering as well.
If what I think is possible, you could make a many groups you want.

As far as cooldown icons go, this is the only reason why I am still doubting this possibility.
If anybody knows the answer, I'd appreciate it.

I'm going to test it in a bit.

- - - Updated - - -

Nope, I've tested, it debugs you

I'm out of ideas
 
For example:

ultimate energy strike.lua (exori max vis)


Lua:
local storage = 4000 -- storage for cooldown
local sec = 30  -- 30 secconds cooldown

local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_ENERGYDAMAGE)
setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_ENERGYAREA)
setCombatParam(combat, COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_ENERGY)

function onGetFormulaValues(cid, level, maglevel)
	local min = -(((level/5)+(maglevel)+(maglevel*10)/0.954))/2
	local max = -(((level/5)+(maglevel)+(maglevel*10)/0.954))
	return min, max
end

setCombatCallback(combat, CALLBACK_PARAM_LEVELMAGICVALUE, "onGetFormulaValues")


function onCastSpell(cid, var)
if getExhausted(cid, storage) then
 setExhausted(cid, storage, sec)
 return doCombat(cid, combat, var) and true
end
return doPlayerSendCancel(cid, 'You are exhausted Ultimate Energy Strike for: ' .. exhaustion.get(cid, storage) + 1 ..' seconds.') and false
end

And add this to your 050-function.lua lib:

Lua:
function getExhausted(cid, storage)
return os.time() > getCreatureStorage(cid, storage) and true
end

function setExhausted(cid, storage, cooldown)
return doCreatureSetStorage(cid, storage, os.time() + cooldown - 1)
end
 
Back
Top