Abbeh
New Member
Good evening,
This is how the manarune looks like at the moment...
- in actions.xml
This is the manarune.lua...
And it doesn't work. Anyone that has a solution?
This is how the manarune looks like at the moment...
Code:
<action itemid="2270" event="script" value="other/manarune.lua"/>
This is the manarune.lua...
Code:
local exhaust = createConditionObject(CONDITION_EXHAUST)
setConditionParam(exhaust, CONDITION_PARAM_TICKS, 1000) -- time in seconds x1000
function onUse(cid, item, fromPosition, itemEx, toPosition)
local manamax = getPlayerMaxMana(cid)
local min = 20 -- this means 3% minimum healing
local max = 30 -- this means 5% maximum healing
local mana_add = math.random((manamax * (min/100)), (manamax * (max/100)))
if(hasCondition(cid, CONDITION_EXHAUST)) then
doSendMagicEffect(getThingPos(cid), CONST_ME_POFF)
return doPlayerSendCancel(cid, "You are exhausted")
end
doPlayerAddMana(cid, mana_add)
doSendMagicEffect(getThingPos(cid), CONST_ME_MAGIC_BLUE)
doSendAnimatedText(getPlayerPosition(cid),""..mana_add.."", TEXTCOLOR_LIGHTBLUE)
doAddCondition(cid, exhaust)
return true
end
And it doesn't work. Anyone that has a solution?