• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

Solved Manarune by vocations

bybbzan

mapper
Joined
Aug 4, 2012
Messages
809
Solutions
2
Reaction score
136
Location
Sweden
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.

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.
 
Yes its posble but use a table insted of 4-8 if statments.
But that script isent gonna work as it is, try reading some tutorials.
 
Back
Top