-- Project Name: Siltbreaker Hard Mode
-- Author: BroFrank
-- SteamAccountID: 144490770
axe_culling_blade_sb2019 = class({})
--------------------------------------------------------------------------------
--function axe_culling_blade_sb2019:GetCastAnimation()
-- return ACT_DOTA_CAST_ABILITY_1
--end
--------------------------------------------------------------------------------
function axe_culling_blade_sb2019:OnSpellStart()
if IsServer() then
local target = self:GetCursorTarget()
if target == nil then
return 0
end
EmitSoundOn( "Hero_Axe.Battle_Hunger", self:GetCaster() )
self.kill_threshold = self:GetSpecialValueFor( "kill_threshold" )
self.damage = self:GetSpecialValueFor( "damage" )
self.aoe = self:GetSpecialValueFor( "aoe" )
ParticleManager:CreateParticle( "particles/units/heroes/hero_axe/axe_battle_hunger_cast.vpcf", PATTACH_ABSORIGIN_FOLLOW, self:GetCaster() )
--ParticleManager:CreateParticle( "particles/econ/items/axe/axe_cinder/axe_cinder_battle_hunger.vpcf", PATTACH_OVERHEAD_FOLLOW, target )
local targetHealth = target:GetHealth()
ParticleManager:CreateParticle( "particles/units/heroes/hero_axe/axe_culling_blade.vpcf", PATTACH_POINT, target )
if targetHealth <= self.kill_threshold and target:GetUnitName() ~= "npc_dota_creature_living_treasure" then
target:ForceKill(false)
local FX = ParticleManager:CreateParticle( "particles/units/heroes/hero_axe/axe_culling_blade_kill.vpcf", PATTACH_POINT, self:GetCaster() )
ParticleManager:SetParticleControlEnt(FX, 0, target, PATTACH_POINT_FOLLOW, "attach_hitloc", target:GetAbsOrigin(), true)
ParticleManager:SetParticleControlEnt(FX, 1, target, PATTACH_POINT_FOLLOW, "attach_hitloc", target:GetAbsOrigin(), true)
ParticleManager:SetParticleControlEnt(FX, 2, target, PATTACH_POINT_FOLLOW, "attach_hitloc", target:GetAbsOrigin(), true)
ParticleManager:SetParticleControlEnt(FX, 4, target, PATTACH_POINT_FOLLOW, "attach_hitloc", target:GetAbsOrigin(), true)
ParticleManager:SetParticleControlEnt(FX, 8, target, PATTACH_POINT_FOLLOW, "attach_hitloc", target:GetAbsOrigin(), true)
ParticleManager:ReleaseParticleIndex(FX)
EmitSoundOn( "Hero_Axe.Culling_Blade_Success", self:GetCaster() )
self:EndCooldown()
else
local damageInfo =
{
victim = target,
attacker = self:GetCaster(),
damage_type = self:GetAbilityDamageType(),
ability = self,
damage = self.damage,
}
ApplyDamage( damageInfo )
EmitSoundOn( "Hero_Axe.Culling_Blade_Fail", self:GetCaster() )
end
local BattleHunger = self:GetCaster():FindAbilityByName("axe_battle_hunger_sb2019")
if BattleHunger ~= nil and BattleHunger:GetLevel() > 0 then
local units = FindUnitsInRadius( DOTA_TEAM_GOODGUYS, self:GetCaster():GetOrigin(), nil, self.aoe, DOTA_UNIT_TARGET_TEAM_FRIENDLY, DOTA_UNIT_TARGET_HERO, DOTA_UNIT_TARGET_FLAG_NONE, FIND_CLOSEST, false )
-- local oldCastPoint = BattleHunger:GetCastPoint()
if units ~= nil and #units > 0 then
for _, unit in pairs ( units ) do
if unit ~= nil and unit:IsInvulnerable() == false then
unit:AddNewModifier(self:GetCaster(), BattleHunger, "axe_battle_hunger_sb2019_modifier", {duration = BattleHunger:GetSpecialValueFor( "duration" )})
--print("casted on : "..unit:GetUnitName())
end
end
end
end
--target:AddNewModifier(self:GetCaster(),self,"axe_battle_hunger_sb2019_modifier", {duration = self.duration})
--table.insert( self.hHitEntities, target )
end
end |