Hello, i have run in to a problem where i cant get this script:
To show how much mana you get every time.
Have tryd to add these lines in diffrent places and ways but can only get it to show the first heal over and over.
So in the end i only get it to work partly.
Lua:
local runes = {
[2298] = {
voc = {1, 2, 3, 4, 5, 6, 7, 8},
min = {level = 1, maglv = 6},
max = {level = 1, maglv = 8},
}
}
local likePotions = true
function onUse(cid, item, fromPosition, target, toPosition, isHotkey)
local i = runes[item.itemid]
if not i then return false end
local player = Player(cid)
if target:isPlayer() then
if isInArray(i.voc, player:getVocation():getId()) then
level, maglv = target:getLevel(), target:getMagicLevel()
if isInArray({4,8}, player:getVocation():getId()) then
target:addMana(math.random(125, 175))
target:getPosition():sendMagicEffect(CONST_ME_MAGIC_BLUE)
target:say("First Manarune", TALKTYPE_MONSTER_SAY)
else
rand = target:addMana(math.random((i.min.level * level) + (i.min.maglv * maglv), (i.max.level * level) + (i.max.maglv * maglv)))
target:getPosition():sendMagicEffect(CONST_ME_MAGIC_BLUE)
target:say("First Manarune", TALKTYPE_MONSTER_SAY)
end
else
player:sendCancelMessage('Your vocation cannot use this rune.')
end
else
player:sendCancelMessage(RETURNVALUE_CANONLYUSETHISRUNEONCREATURES)
end
return true
end
To show how much mana you get every time.
Have tryd to add these lines in diffrent places and ways but can only get it to show the first heal over and over.
Lua:
local heal = math.floor(math.random(min, max))
player:say("+ "..heal.." mana", TALKTYPE_ORANGE_1)
player:addHealth(heal)
So in the end i only get it to work partly.