I'm wanting to make it so one of my boss's is able to release a fire aura around him that will burn the party if they are to close to it. Below is the spell's coding
Code: Select all
defineSpell{
name = "fire_aura",
uiName = "Fire Aura",
skill = "fire_magic",
requirements = {"fire_magic", 5},
gesture = 1458,
manaCost = 70,
icon = 5,
iconAtlas = "mod_assets/textures/gui/icons.tga",
spellIcon = 5,
spellIconAtlas = "mod_assets/textures/gui/spellIcons.tga",
description = "Burns ennemies in melee range. Lasts 3 seconds per willpower point.",
onCast = function(champion, x, y, direction, elevation, skillLevel)
local time = 3 * champion:getCurrentStat("willpower")
spells_functions.script.soundStart("fire_elemental_burn", 10)
delayedCall("spells_functions", time-10, "soundStop", "fire_elemental_burn", 10)
spells_functions.script.lightStart("fire_aura", 1, 0.5, 0.25, 10, 10, 10)
delayedCall("spells_functions", time-10, "lightStop", "fire_aura", 10)
for i = 0, time do delayedCall("spells_functions", i, "fireAuraPulse", champion:getOrdinal()) end
end
}Code: Select all
function fireAuraPulse(champion)
fireAuraTile(-1, -1, champion)
fireAuraTile(-1, 0, champion)
fireAuraTile(-1, 1, champion)
fireAuraTile( 0, 1, champion)
fireAuraTile( 1, 1, champion)
fireAuraTile( 1, 0, champion)
fireAuraTile( 1, -1, champion)
fireAuraTile( 0, -1, champion)
end
function fireAuraTile(dx, dy, champion)
local w = party.map:getWidth()
local h = party.map:getHeight()
local x = party.x+dx
local y = party.y+dy
if (-1<x and x<w and -1<y and y<h) then
local a = spawn("fire_aura_blast", party.level, x, y, party.facing, party.elevation)
a.tiledamager:setCastByChampion(champion)
end
end