Lua:
local cooldownID = 199029
local cooldownTime = 900
local combat = Combat()
combat:setParameter(COMBAT_PARAM_TYPE, COMBAT_HEALING)
combat:setParameter(COMBAT_PARAM_EFFECT, CONST_ME_MAGIC_BLUE)
combat:setParameter(COMBAT_PARAM_AGGRESSIVE, 0)
combat:setParameter(COMBAT_PARAM_TARGETCASTERORTOPMOST, 1)
combat:setParameter(COMBAT_PARAM_DISPEL, CONDITION_PARALYZE)
function onGetFormulaValues(player, level, maglevel)
local min = (level / 5) + (maglevel * 3.2) + 20
local max = (level / 5) + (maglevel * 5.4) + 40
return min, max
end
combat:setCallback(CALLBACK_PARAM_LEVELMAGICVALUE, "onGetFormulaValues")
local exhaust = Condition(CONDITION_EXHAUST_HEAL)
exhaust:setParameter(CONDITION_PARAM_TICKS, cooldownTime)
function onCastSpell(creature, var, isHotkey)
local player = creature:getPlayer()
local item = player:getItemById(31093, true, -1)
if creature:getCondition(CONDITION_EXHAUST_HEAL) then
creature:sendTextMessage(MESSAGE_STATUS_SMALL, Game.getReturnMessage(RETURNVALUE_YOUAREEXHAUSTED))
return false
end
creature:addCondition(exhaust)
addEvent(function() item:transform(31173) print('item removed') end,0)
addEvent(function() item:transform(31093) print('item removed') end, cooldownTime)
return combat:execute(creature, var)
end
What I'm doing is adding a cooldown and transforming the rune to another to display that it's on cooldown. The problem is it only works while in a backpack. How would I go about making it work outside of a backpack? Also is there a way to force use or far use on an item without changing the .dat?