This mana rune by action is usefull if you wanna customize effects, MIN, MAX, use it or no in protection zone, give pz or no or throw it to another players :thumbup:
Lua:
local MIN = 100
local MAX = 120
local exhaust = createConditionObject(CONDITION_EXHAUST)
setConditionParam(exhaust, CONDITION_PARAM_TICKS, (getConfigInfo('timeBetweenExActions') - 100))
function onUse(cid, item, fromPosition, itemEx, toPosition)
if(hasCondition(cid, CONDITION_EXHAUST)) then
doPlayerSendDefaultCancel(cid, RETURNVALUE_YOUAREEXHAUSTED)
return true
end
if isPlayer(itemEx.uid) == FALSE then
return false
end
if (getTileInfo(getCreaturePosition(cid)).protection) then
doPlayerSendCancel(cid, "You cannot use mana runes in protection zones.")
return TRUE
end
if doPlayerAddMana(itemEx.uid, math.random(MIN, MAX)) == LUA_ERROR then
return FALSE
end
doAddCondition(cid, exhaust)
doSendMagicEffect(getThingPos(itemEx.uid), 29)
doChangeTypeItem(item.uid,item.type-1)
return TRUE
end