Progenosis
Member
- Joined
- Sep 6, 2011
- Messages
- 131
- Reaction score
- 18
I have an script for a Mana Rune that works fine for: Druid, Sorcer, Paladin, Knight, Elder Druid, Master Sorcerer, Elite Knight and Royal Paladin.
But when a player gets second promotion the rune doesn't work on them :/
How can I make it work properly for all players?
This is the script:
But when a player gets second promotion the rune doesn't work on them :/
How can I make it work properly for all players?
This is the script:
Code:
local exhausted = createConditionObject(CONDITION_EXHAUST)
setConditionParam(exhausted, CONDITION_PARAM_TICKS, (getConfigInfo('timeBetweenExActions') - 100))
function onUse(cid, item, fromPosition, itemEx, toPosition)
local min, max
local lvl, mag = getPlayerLevel(cid), getPlayerMagLevel(cid)
if isSorcerer(cid) or isDruid(cid) then
min = lvl * 1.0 + mag * 1.0
max = lvl * 2.0 + mag * 2.0
elseif isPaladin(cid) then
min = lvl * 2.0 + mag * 2.0
max = lvl * 2.0 + mag * 2.0
elseif isKnight(cid) then
min = lvl * 2.0 + mag * 2.0
max = lvl * 3.0 + mag * 3.0
end
local rand = math.random(min, max)
if hasCondition(cid, CONDITION_EXHAUST_HEAL) then
return doPlayerSendDefaultCancel(cid, RETURNVALUE_YOUAREEXHAUSTED)
end
if not isPlayer(itemEx.uid) then
return doPlayerSendDefaultCancel(cid, RETURNVALUE_NOTPOSSIBLE)
end
if(getCreatureHealth(cid) >= getCreatureMaxHealth(cid)) then
return doPlayerSendCancel(cid, "Your health is currently full.")
end
return doSendMagicEffect(toPosition, CONST_ME_MAGIC_BLUE) and doCreatureAddHealth(itemEx.uid, rand) and doAddCondition(cid, exhausted) and doCreatureSay(itemEx.uid, "Aaaah super UH...", TALKTYPE_ORANGE_1)
end