This is a mana and health rune, but how do I add a level requirement to it and how do I make the runes clickable like potions so that it can be used on other players? Like lvl 20 for itemid 12596 and lvl 200 for itemid 12600.
Lua:
local exhaust = Condition(CONDITION_EXHAUST_HEAL)
exhaust:setParameter(CONDITION_PARAM_TICKS, 1200)
function onUse(player, item, fromPosition, target, toPosition, isHotkey)
if type(target) == "userdata" and not target:isPlayer() then
return false
end
if player:getCondition(CONDITION_EXHAUST_HEAL) then
player:sendTextMessage(MESSAGE_STATUS_SMALL, Game.getReturnMessage(RETURNVALUE_YOUAREEXHAUSTED))
return true
end
if item:getId() == 12596 then
doTargetCombatMana(0, player, (40), (60), CONST_ME_MAGIC_BLUE)
doTargetCombatHealth(0, player, (20), (50), CONST_ME_MAGIC_BLUE)
item:remove(1)
player:say("Aaaah...", TALKTYPE_MONSTER_SAY)
end
if item:getId() == 12600 then
doTargetCombatMana(0, player, (150), (240), CONST_ME_MAGIC_BLUE)
doTargetCombatHealth(0, player, (90), (120), CONST_ME_MAGIC_BLUE)
item:remove(1)
player:say("Aaaah...", TALKTYPE_MONSTER_SAY)
end
return true
end