I'm releasing to the community the healing spells (with their scrolls) I'm using in my WIP mod. It's not a big deal (no stunning revelation) but I think it could be of use for some people here. I also added an Enchant Arrow spell in the middle

Copy/paste the following code into any lua file you want, and voilà ! It's done. These scripts could be upgraded / optimised by testing alive status and others things, but I think you get the idea

Resurrection
Code: Select all
defineSpell{
name = "resurrection",
uiName = "Resurrection",
skill = "earth_magic",
requirements = {"earth_magic", 5, "concentration", 5},
gesture = 789654,
manaCost = 150,
icon = 72,
spellIcon = 13,
description = "Resurrect a dead champion with full health.",
onCast =
function(champion, x, y, direction, elevation, skillLevel)
local difference = 0
local championToRaise = nil
local deadChampions = {}
local healthToGive
for i = 1, 4, 1 do
if party.party:getChampion(i):getConditionValue("dead") ~= 0 then
deadChampions[#deadChampions + 1] = party.party:getChampion(i)
end
end
if #deadChampions >= 1 then
championToRaise = deadChampions[1]
championToRaise:playHealingIndicator()
championToRaise:setHealth(championToRaise:getMaxHealth())
playSound("heal_party")
else
if #deadChampions == 0 then
hudPrint("Nobody is dead")
playSound("spell_fizzle")
return false
end
end
end
}
defineObject{
name = "scroll_resurrection",
baseObject = "scroll_light",
components = {
{
class = "Item",
uiName = "Scroll of Resurrection",
gfxAtlas = "assets/textures/gui/items.tga",
gfxIndex = 113,
weight = 0.3,
},
{
class = "SpellScrollItem",
spell = "resurrection",
}
},
}
Code: Select all
defineSpell{
name = "antidote",
uiName = "Antidote",
skill = "earth_magic",
requirements = {"earth_magic", 3},
gesture = 65874,
manaCost = 40,
icon = 72,
spellIcon = 13,
description = "Cure disease on the more wounded champion.",
onCast =
function(champion, x, y, direction, elevation, skillLevel)
local difference = 0
local championToHeal = nil
local sickChampions = {}
for i = 1, 4, 1 do
if party.party:getChampion(i):getConditionValue("diseased") ~= 0 then
sickChampions[#sickChampions + 1] = party.party:getChampion(i)
end
end
if #sickChampions >= 1 then
championToHeal = sickChampions[1]
if #sickChampions > 1 then
for i = 1, #sickChampions, 1 do
if (sickChampions[i]:getMaxHealth() - sickChampions[i]:getHealth()) > difference then
difference = sickChampions[i]:getMaxHealth() - sickChampions[i]:getHealth()
championToHeal = sickChampions[i]
end
end
end
championToHeal:playHealingIndicator()
championToHeal:setConditionValue("diseased", 0)
playSound("heal_party")
else
if #sickChampions == 0 then
hudPrint("Nobody is diseased")
playSound("spell_fizzle")
return false
end
end
end
}
defineObject{
name = "scroll_antidote",
baseObject = "scroll_light",
components = {
{
class = "Item",
uiName = "Scroll of Antidote",
gfxAtlas = "assets/textures/gui/items.tga",
gfxIndex = 113,
weight = 0.3,
},
{
class = "SpellScrollItem",
spell = "antidote",
}
},
}
Code: Select all
defineSpell{
name = "antivenom",
uiName = "Antivenom",
skill = "earth_magic",
requirements = {"earth_magic", 2},
gesture = 6587,
manaCost = 30,
icon = 72,
spellIcon = 13,
description = "Cure poison on the more wounded champion.",
onCast =
function(champion, x, y, direction, elevation, skillLevel)
local difference = 0
local championToHeal = nil
local poisonedChampions = {}
for i = 1, 4, 1 do
if party.party:getChampion(i):getConditionValue("poison") > 0 then
poisonedChampions[#poisonedChampions + 1] = party.party:getChampion(i)
end
end
if #poisonedChampions >= 1 then
championToHeal = poisonedChampions[1]
if #poisonedChampions > 1 then
for i = 1, #poisonedChampions, 1 do
if (poisonedChampions[i]:getMaxHealth() - poisonedChampions[i]:getHealth()) > difference then
difference = poisonedChampions[i]:getMaxHealth() - poisonedChampions[i]:getHealth()
championToHeal = poisonedChampions[i]
end
end
end
championToHeal:playHealingIndicator()
championToHeal:setConditionValue("poison", 0)
playSound("heal_party")
else
if #poisonedChampions == 0 then
hudPrint("Nobody is poisoned")
playSound("spell_fizzle")
return false
end
end
end,
}
defineObject{
name = "scroll_antivenom",
baseObject = "scroll_light",
components = {
{
class = "Item",
uiName = "Scroll of Antivenom",
gfxAtlas = "assets/textures/gui/items.tga",
gfxIndex = 113,
weight = 0.3,
},
{
class = "SpellScrollItem",
spell = "antivenom",
}
},
}
Code: Select all
defineSpell{
name = "enchant_arrow",
uiName = "Enchant Arrow",
skill = "water_magic",
requirements = {"water_magic", 4},
gesture = 123698745,
manaCost = 0,
icon = 72,
spellIcon = 13,
description = "Enchant arrows with a frost damage modifier.",
onCast =
function(champion, x, y, direction, elevation, skillLevel)
local size = 0
local itmSpawned = nil
local enchantBaseCost = 0
if getMouseItem() == nil or (getMouseItem() ~= nil and getMouseItem().go.name ~= "arrow") then
hudPrint("You must cast this spell while holding arrows")
else
size = getMouseItem():getStackSize()
enchantBaseCost = size * 20
if champion:getEnergy() >= enchantBaseCost then
champion:regainEnergy(-enchantBaseCost)
itmSpawned = spawn("cold_arrow")
itmSpawned.item:setStackSize(size)
setMouseItem(itmSpawned.item)
playSound("generic_spell")
else
hudPrint("Not enough energy")
playSound("spell_fizzle")
end
end
end,
}
defineObject{
name = "scroll_enchant_arrow",
baseObject = "scroll_light",
components = {
{
class = "Item",
uiName = "Scroll of Enchant Arrow",
gfxAtlas = "assets/textures/gui/items.tga",
gfxIndex = 113,
weight = 0.3,
},
{
class = "SpellScrollItem",
spell = "enchant_arrow",
}
},
}
Code: Select all
defineSpell{
name = "recovery",
uiName = "Recovery",
skill = "earth_magic",
requirements = {"earth_magic", 4, "concentration", 3},
gesture = 587,
manaCost = 0,
icon = 72,
spellIcon = 13,
description = "Heals a champion which has one or more limb wounds.",
onCast =
function(champion, x, y, direction, elevation, skillLevel)
local difference = 0
local championToHeal = nil
local nbrWounds = 0
local healBaseCost = 0
for i = 1, 4, 1 do
if party.party:getChampion(i):getConditionValue("left_hand_wound") ~= 0 then
nbrWounds = nbrWounds + 1
end
if party.party:getChampion(i):getConditionValue("right_hand_wound") ~= 0 then
nbrWounds = nbrWounds + 1
end
if party.party:getChampion(i):getConditionValue("leg_wound") ~= 0 then
nbrWounds = nbrWounds + 1
end
if party.party:getChampion(i):getConditionValue("feet_wound") ~= 0 then
nbrWounds = nbrWounds + 1
end
if party.party:getChampion(i):getConditionValue("head_wound") ~= 0 then
nbrWounds = nbrWounds + 1
end
if nbrWounds > 0 then
championToHeal = party.party:getChampion(i)
break
end
end
if championToHeal == nil then
hudPrint("Nobody has a limb wound")
playSound("spell_fizzle")
return false
end
healBaseCost = nbrWounds * 15
if champion:getEnergy() >= healBaseCost then
champion:regainEnergy(-healBaseCost)
championToHeal:playHealingIndicator()
championToHeal:setConditionValue("left_hand_wound", 0)
championToHeal:setConditionValue("right_hand_wound", 0)
championToHeal:setConditionValue("leg_wound", 0)
championToHeal:setConditionValue("feet_wound", 0)
championToHeal:setConditionValue("head_wound", 0)
playSound("heal_party")
else
hudPrint("Not enough energy")
playSound("spell_fizzle")
end
end
}
defineObject{
name = "scroll_recovery",
baseObject = "scroll_light",
components = {
{
class = "Item",
uiName = "Scroll of Recovery",
gfxAtlas = "assets/textures/gui/items.tga",
gfxIndex = 113,
weight = 0.3,
},
{
class = "SpellScrollItem",
spell = "recovery",
}
},
}
Code: Select all
defineSpell{
name = "heal",
uiName = "Healing",
skill = "earth_magic",
requirements = {"earth_magic", 2, "concentration", 1},
gesture = 7456,
manaCost = 0,
icon = 72,
spellIcon = 13,
description = "Heals the most wounded champion (this spell has no effect on limb wounds). If you don't have enough energy, the spell is cast but the healing is decreased proportionally. The healing depends on your skills :\n- Earth Magic 2 : Concentration x 5\n- Earth Magic 3 : Concentration x 10\n- Earth Magic 4 : Concentration x 20\n- Earth Magic 5 : Concentration x 30",
onCast =
function(champion, x, y, direction, elevation, skillLevel)
local difference = 0
local indexMostWounded = 0
local healValue = 0
local healCoefficient = 1
local healBaseCost = 0
local healPower = ""
for i = 1, 4, 1 do
if (party.party:getChampion(i):getMaxHealth() - party.party:getChampion(i):getHealth()) > difference then
difference = party.party:getChampion(i):getMaxHealth() - party.party:getChampion(i):getHealth()
indexMostWounded = i
end
end
if indexMostWounded > 0 then
healBaseCost = champion:getSkillLevel("concentration") * 10 + champion:getSkillLevel("earth_magic") * 5
if champion:getEnergy() >= healBaseCost then
champion:regainEnergy(-healBaseCost)
else
healCoefficient = champion:getEnergy() / healBaseCost
champion:regainEnergy(-champion:getEnergy())
end
if champion:getSkillLevel("earth_magic") == 2 then
healValue = champion:getSkillLevel("concentration") * 5 * healCoefficient --Soigne entre 5 et 25
healPower = "light"
end
if champion:getSkillLevel("earth_magic") == 3 then
healValue = champion:getSkillLevel("concentration") * 10 * healCoefficient --Soigne entre 10 et 50
healPower = "light"
end
if champion:getSkillLevel("earth_magic") == 4 then
healValue = champion:getSkillLevel("concentration") * 20 * healCoefficient --Soigne entre 20 et 100
healPower = "medium"
end
if champion:getSkillLevel("earth_magic") == 5 then
healValue = champion:getSkillLevel("concentration") * 30 * healCoefficient --Soigne entre 30 et 150
healPower = "strong"
end
party.party:getChampion(indexMostWounded):playHealingIndicator()
party.party:getChampion(indexMostWounded):regainHealth(healValue)
playSound("heal_party")
else
hudPrint("Nobody is wounded")
playSound("spell_fizzle")
end
end
}
defineObject{
name = "scroll_heal",
baseObject = "scroll_light",
components = {
{
class = "Item",
uiName = "Scroll of Healing",
gfxAtlas = "assets/textures/gui/items.tga",
gfxIndex = 113,
weight = 0.3,
},
{
class = "SpellScrollItem",
spell = "heal",
}
},
}
Code: Select all
defineSpell{
name = "mass_heal",
uiName = "Mass Healing",
skill = "earth_magic",
requirements = {"earth_magic", 3, "concentration", 2},
gesture = 74569,
manaCost = 0,
icon = 72,
spellIcon = 13,
description = "Heals yourself and your comrades (this spell has no effect on limb wounds). If you don't have enough energy, the spell is cast but the healing is decreased proportionally. The healing depends on your skills :\n- Earth Magic 3 : Concentration x 5\n- Earth Magic 4 : Concentration x 10\n- Earth Magic 5 : Concentration x 15",
onCast =
function(champion, x, y, direction, elevation, skillLevel)
local partyIsWounded = false
local indexMostWounded = 0
local healValue = 0
local healCoefficient = 1
local healBaseCost = 0
local healPower = ""
for i = 1, 4, 1 do
if (party.party:getChampion(i):getMaxHealth() - party.party:getChampion(i):getHealth()) > 0 then
partyIsWounded = true
end
end
if partyIsWounded then
healBaseCost = champion:getSkillLevel("concentration") * 15 + champion:getSkillLevel("earth_magic") * 5
if champion:getEnergy() >= healBaseCost then
champion:regainEnergy(-healBaseCost)
else
healCoefficient = champion:getEnergy() / healBaseCost
champion:regainEnergy(-champion:getEnergy())
end
if champion:getSkillLevel("earth_magic") == 3 then
healValue = champion:getSkillLevel("concentration") * 5 * healCoefficient --Soigne entre 10 et 25
healPower = "medium"
end
if champion:getSkillLevel("earth_magic") == 4 then
healValue = champion:getSkillLevel("concentration") * 10 * healCoefficient --Soigne entre 20 et 50
healPower = "medium"
end
if champion:getSkillLevel("earth_magic") == 5 then
healValue = champion:getSkillLevel("concentration") * 15 * healCoefficient --Soigne entre 30 et 75
healPower = "strong"
end
playSound("heal_party")
for i = 1, 4, 1 do
party.party:getChampion(i):playHealingIndicator()
party.party:getChampion(i):regainHealth(healValue)
end
else
hudPrint("Nobody is wounded")
playSound("spell_fizzle")
end
end
}
defineObject{
name = "scroll_mass_heal",
baseObject = "scroll_light",
components = {
{
class = "Item",
uiName = "Scroll of Mass Healing",
gfxAtlas = "assets/textures/gui/items.tga",
gfxIndex = 113,
weight = 0.3,
},
{
class = "SpellScrollItem",
spell = "mass_heal",
}
},
}