Re: Ask a simple question, get a simple answer
Posted: Thu Dec 15, 2016 11:21 pm
Is there a way to avoid the burning condition animation on already dead monsters ?
I have a few spells that burn monsters to fix, for example:
I have a few spells that burn monsters to fix, for example:
Code: Select all
defineObject{
name = "volcanic_eruption",
baseObject = "base_spell",
components = {
{
class = "Particle",
particleSystem = "volcanic_eruption",
offset = vec(0, 1.3, 0),
destroyObject = true,
},
{
class = "Light",
color = vec(1, 1, 1),
brightness = 10,
range = 6,
offset = vec(0, 1.3, 0),
fadeOut = 0.75,
disableSelf = true,
fillLight = true,
},
{
class = "TileDamager",
attackPower = 10,
damageType = "fire",
onHitMonster = function(self, monster)
if monster:isAlive() then
monster:setCondition("burning", 5)
-- mark condition so that exp is awarded if monster is killed by the condition
local burning = monster.go.burning
local ordinal = self:getCastByChampion()
if burning and ordinal then burning:setCausedByChampion(ordinal) end
monster:setCondition("poisoned", 25)
-- mark condition so that exp is awarded if monster is killed by the condition
local poisonedCondition = monster.go.poisoned
if poisonedCondition and ordinal then poisonedCondition:setCausedByChampion(ordinal) end
end
end,
},
},
}