shockBlast spell
Posted: Sun Nov 01, 2015 7:27 am
I have tried to create some BLAST spells like Lex did in his Gothmog mod. I decided to create the BLAST spells for each element, (air, earth, fire and ice). I had already created a frostburst spell to fire with ruin I. I have had great success with all but shock.
All of the blast spells work just fine when I try them in my mod. But the shockBlast spell does not. In fact, it crashes the editor and I end up at the desktop. Can anyone tell me why this is so?
The script I used in my spells.lua file is the same for all the blast spells except for the spell names and attributes, skill, level, mana cost etc. The script I used is as follows...
defineSpell{
name = "shockBlast",
uiName = "Shock Blast",
skill = "air_magic",
level = 10,
runes = "CDF",
manaCost = 33,
onCast = function(champ,x,y,dir,sk)
local xlr, ylr = 0, 0
local xt, yt = getForward(dir) -- get the x & y offset to move 1 tile ahead
if xt == 0 then xlr = 1 else ylr = 1 end
xt = x+xt yt = y+yt --xt & yt = x & y party is headed to
if isWall(party.level,xt,yt) then
spawn("shock",party.level,x,y,0)
else
spawn("shock",party.level,xt,yt,0)
spawn("shock",party.level,xt - xlr,yt - ylr,0)
spawn("shock",party.level,xt + xlr,yt + ylr,0)
end
end,
}
Like I said it works fine for all the spells except shock.
All of the blast spells work just fine when I try them in my mod. But the shockBlast spell does not. In fact, it crashes the editor and I end up at the desktop. Can anyone tell me why this is so?
The script I used in my spells.lua file is the same for all the blast spells except for the spell names and attributes, skill, level, mana cost etc. The script I used is as follows...
defineSpell{
name = "shockBlast",
uiName = "Shock Blast",
skill = "air_magic",
level = 10,
runes = "CDF",
manaCost = 33,
onCast = function(champ,x,y,dir,sk)
local xlr, ylr = 0, 0
local xt, yt = getForward(dir) -- get the x & y offset to move 1 tile ahead
if xt == 0 then xlr = 1 else ylr = 1 end
xt = x+xt yt = y+yt --xt & yt = x & y party is headed to
if isWall(party.level,xt,yt) then
spawn("shock",party.level,x,y,0)
else
spawn("shock",party.level,xt,yt,0)
spawn("shock",party.level,xt - xlr,yt - ylr,0)
spawn("shock",party.level,xt + xlr,yt + ylr,0)
end
end,
}
Like I said it works fine for all the spells except shock.