Hello!
Im struggeling a bit with a script, im a rly terrible of scripting
But is it possible to make something like this for a manarune?
It will heal different based on what vocation you are, so a formula for each vocation.
thanks in advance.
Im struggeling a bit with a script, im a rly terrible of scripting
But is it possible to make something like this for a manarune?
It will heal different based on what vocation you are, so a formula for each vocation.
Code:
local exhaust = createConditionObject(CONDITION_EXHAUST)
setConditionParam(exhaust, CONDITION_PARAM_TICKS, (getConfigInfo('timeBetweenExActions') - 100))
function onUse(cid, item, fromPosition, itemEx, toPosition)
if playerVoc == 1 then then
local level = getPlayerLevel(cid)
local mlevel = getPlayerMagLevel(cid)
local mana_minimum = (level * 1.0) + (mlevel * 1) - 50
local mana_maximum = (level * 3.0) + (mlevel * 1)
local mana_add = math.random(mana_minimum, mana_maximum)
doPlayerAddMana(cid, mana_add)
doSendMagicEffect(getThingPos(itemEx.uid), CONST_ME_MAGIC_BLUE)
doCreatureSay(itemEx.uid, "Ahh... Manarune rocks!", TALKTYPE_ORANGE_1)
--> doRemoveitem(item.uid) <---
else
doPlayerSendCancel(cid,22, "your level is too low , only level 50+ can use it", TALKTYPE_ORANGE_1)
elseif playerVoc == 2 then
local level = getPlayerLevel(cid)
local mlevel = getPlayerMagLevel(cid)
local mana_minimum = (level * 2.0) + (mlevel * 1) - 50
local mana_maximum = (level * 4.0) + (mlevel * 1)
local mana_add = math.random(mana_minimum, mana_maximum)
doPlayerAddMana(cid, mana_add)
doSendMagicEffect(getThingPos(itemEx.uid), CONST_ME_MAGIC_BLUE)
doCreatureSay(itemEx.uid, "Ahh... Manarune rocks!", TALKTYPE_ORANGE_1)
--> doRemoveitem(item.uid) <---
else
doPlayerSendCancel(cid,22, "your level is too low , only level 50+ can use it", TALKTYPE_ORANGE_1)
elseif playerVoc == 3 then
local level = getPlayerLevel(cid)
local mlevel = getPlayerMagLevel(cid)
local mana_minimum = (level * 3.0) + (mlevel * 1) - 50
local mana_maximum = (level * 5.0) + (mlevel * 1)
local mana_add = math.random(mana_minimum, mana_maximum)
doPlayerAddMana(cid, mana_add)
doSendMagicEffect(getThingPos(itemEx.uid), CONST_ME_MAGIC_BLUE)
doCreatureSay(itemEx.uid, "Ahh... Manarune rocks!", TALKTYPE_ORANGE_1)
--> doRemoveitem(item.uid) <---
else
doPlayerSendCancel(cid,22, "your level is too low , only level 50+ can use it", TALKTYPE_ORANGE_1)
elseif playerVoc == 4 then
local level = getPlayerLevel(cid)
local mlevel = getPlayerMagLevel(cid)
local mana_minimum = (level * 4.0) + (mlevel * 1) - 50
local mana_maximum = (level * 6.0) + (mlevel * 1)
local mana_add = math.random(mana_minimum, mana_maximum)
doPlayerAddMana(cid, mana_add)
doSendMagicEffect(getThingPos(itemEx.uid), CONST_ME_MAGIC_BLUE)
doCreatureSay(itemEx.uid, "Ahh... Manarune rocks!", TALKTYPE_ORANGE_1)
--> doRemoveitem(item.uid) <---
else
doPlayerSendCancel(cid,22, "your level is too low , only level 50+ can use it", TALKTYPE_ORANGE_1)
end
return TRUE
end
thanks in advance.