I want to create a T3 Mobile bomb that creates a napalm explosion doing damage overtime.
I got the Fx good but for whatever reason can't get the napalm to work when the unit explodes.
Help and advice welcomed.
I tried this :
- Code: Select all
CMobileKamikazeBombWeapon1 = Class(KamikazeWeapon){
FxDeath = CybranmodedweaponsEffectTemplates.CMobileKamikazeBombExplosion1,
CreateProjectileForWeapon = function(self, bone)
local projectile = self:CreateProjectile(bone)
local damageTable = self:GetDamageTable()
local blueprint = self:GetBlueprint()
local data = {
Instigator = self.unit,
Damage = blueprint.DoTDamage,
Duration = blueprint.DoTDuration,
Frequency = blueprint.DoTFrequency,
Radius = blueprint.DamageRadius,
Type = 'Normal',
DamageFriendly = blueprint.DamageFriendly,
}
if projectile and not projectile:BeenDestroyed() then
projectile:PassData(data)
projectile:PassDamageData(damageTable)
end
return projectile
end,
OnFire = function(self)
local army = self.unit:GetArmy()
for k, v in self.FxDeath do
CreateEmitterAtBone(self.unit,-2,army,v)
end
KamikazeWeapon.OnFire(self)
end,
}