Hello,
I'm looking for some help for this script.
This script is staged by level but i want add too vocation and show how much mana added with each use on console.
Like if level x and vocation x then... add mana
Something like this
++REP
I'm looking for some help for this script.
This script is staged by level but i want add too vocation and show how much mana added with each use on console.
Like if level x and vocation x then... add mana
Something like this
Lua:
{1} < Vocation {1,10} < Level {35,80} < Mana
Lua:
local t = {
[{1,35}] = {150,150},
[{51,100}] = {150,250},
[{101,250}] = {250,400},
[{251,350}] = {400,600},
[{450,550}] = {600,750},
[{551,650}] = {750,1000},
[{650,math.huge}] = {1000,1300}
}
local exhaust = createConditionObject(CONDITION_EXHAUST)
setConditionParam(exhaust, CONDITION_PARAM_TICKS, 1000)
setConditionParam(exhaust, CONDITION_PARAM_SUBID, EXHAUST_HEAL)
function onUse(cid, item, fromPosition, itemEx, toPosition)
if hasCondition(cid, CONDITION_EXHAUST, EXHAUST_HEAL) then
return doPlayerSendDefaultCancel(cid, RETURNVALUE_YOUAREEXHAUSTED)
elseif not isPlayer(itemEx.uid) then
return doPlayerSendDefaultCancel(cid, RETURNVALUE_NOTPOSSIBLE)
end
local lvl = getPlayerLevel(cid)
for k, v in pairs(t) do
if lvl >= k[1] and lvl <= k[2] then
doPlayerAddMana(itemEx.uid,math.random(v[1], v[2]))
doSendMagicEffect(toPosition, CONST_ME_MAGIC_BLUE)
doAddCondition(cid, exhaust)
doSendAnimatedText(toPosition, 'Manarune!', math.random(255))
return true
end
end
end
++REP
Last edited: