local runeTest = Spell(SPELL_RUNE)
function runeTest.onCastSpell(creature, variant)
local target = Tile(variant:getPosition()):getTopVisibleCreature(creature)
if not target or not target:isPlayer() then
creature:getPosition():sendMagicEffect(CONST_ME_POFF)
return false
end
local maxMana = creature:getMaxMana() / 100
target:addMana(math.random(maxMana * 10, maxMana * 15))
target:getPosition():sendMagicEffect(CONST_ME_MAGIC_BLUE)
target:say("MR Aaahh!")
return true
end
runeTest:name("ManaRune#1")
runeTest:isAggressive(false)
runeTest:runeId(2307)
runeTest:blockWalls(true)
runeTest:magicLevel(1)
runeTest:level(8)
runeTest:group("support")...
local runeTest = Spell(SPELL_RUNE)
function runeTest.onCastSpell(creature, variant)
local target = Tile(variant:getPosition()):getTopVisibleCreature(creature)
if not target or not target:isPlayer() then
creature:getPosition():sendMagicEffect(CONST_ME_POFF)
return false
end
local maxMana = creature:getMaxMana() / 100
target:addMana(math.random(maxMana * 10, maxMana * 15))
target:getPosition():sendMagicEffect(CONST_ME_MAGIC_BLUE)
target:say("MR Aaahh!")
return true
end
runeTest:name("ManaRune#1")
runeTest:isAggressive(false)
runeTest:runeId(2307)
runeTest:blockWalls(true)
runeTest:magicLevel(1)
runeTest:level(8)
runeTest:group("support")
runeTest:id(24)
runeTest:cooldown(1 * 1000)
runeTest:groupCooldown(1 * 1000)
runeTest:isPremium(true)
runeTest:register()
target:addMana(math.random(maxMana * 10, maxMana * 15))it works perfectly, Thanksdata/scripts/manarune.lua
LUA:local runeTest = Spell(SPELL_RUNE) function runeTest.onCastSpell(creature, variant) local target = Tile(variant:getPosition()):getTopVisibleCreature(creature) if not target or not target:isPlayer() then creature:getPosition():sendMagicEffect(CONST_ME_POFF) return false end local maxMana = creature:getMaxMana() / 100 target:addMana(math.random(maxMana * 10, maxMana * 15)) target:getPosition():sendMagicEffect(CONST_ME_MAGIC_BLUE) target:say("MR Aaahh!") return true end runeTest:name("ManaRune#1") runeTest:isAggressive(false) runeTest:runeId(2307) runeTest:blockWalls(true) runeTest:magicLevel(1) runeTest:level(8) runeTest:group("support") runeTest:id(24) runeTest:cooldown(1 * 1000) runeTest:groupCooldown(1 * 1000) runeTest:isPremium(true) runeTest:register()
In this line:
target:addMana(math.random(maxMana * 10, maxMana * 15))
control the amount of percentage that you recover with each use, in this case, from 10 to 15 percent