(now with different Runes)
requires spellcraft level 16, costs 20 mana and heals a single character with the lowest percentage health by 2 to 4 times the level of the caster.
Code: Select all
-- Character Healing Spell
defineSpell{
name = "healing",
uiName = "Healing",
skill = "spellcraft",
level = 16,
runes = "BF",
manaCost = 20,
onCast = function(caster, x, y, direction, skill)
local heal_amount = math.random(2,4)*skill
local character_to_heal = 5
local least_health = 10000
local max_health = 10000
local percentage_health = 100
local champName = "No-one"
for j=1,4 do
if party:getChampion(j):getEnabled() and party:getChampion(j):isAlive()
then
if party:getChampion(j):getStat("health") / party:getChampion(j):getStatMax("health") * 100 < percentage_health
then
least_health = party:getChampion(j):getStat("health")
max_health = party:getChampion(j):getStatMax("health")
percentage_health = least_health / max_health * 100
character_to_heal = j
end
end
end
if (character_to_heal < 5)
then
champName = party:getChampion(character_to_heal):getName()
party:getChampion(character_to_heal):modifyStat("health", heal_amount)
end
-- hudPrint(champName .. " has " .. tostring(least_health) .. " of " .. tostring(max_health))
hudPrint(champName .. " was healed.")
playSound("heal_party")
party:playScreenEffect("frostburst")
end,
}