script_lycan_howl = class({})
LinkLuaModifier( "modifier_script_lycan_howl", "abilities/script_lycan_howl", LUA_MODIFIER_MOTION_NONE )
function script_lycan_howl:OnSpellStart()
local allies = FindUnitsInRadius( self:GetCaster():GetTeamNumber(), self:GetCaster():GetOrigin(), self:GetCaster(), FIND_UNITS_EVERYWHERE, DOTA_UNIT_TARGET_TEAM_FRIENDLY, DOTA_UNIT_TARGET_HERO + DOTA_UNIT_TARGET_BASIC, DOTA_UNIT_TARGET_FLAG_PLAYER_CONTROLLED, 0, false )
if #allies > 0 then
for _,ally in pairs(allies) do
ally:AddNewModifier( self:GetCaster(), self, "modifier_script_lycan_howl", { duration = self:GetSpecialValueFor( "howl_duration" ) } )
end
end
EmitSoundOnLocationForAllies( self:GetCaster():GetOrigin(), "Hero_Lycan.Howl.Team", self:GetCaster() )
EmitSoundOn( "Hero_Lycan.Howl", self:GetCaster() )
local fx = ParticleManager:CreateParticle( "particles/units/heroes/hero_lycan/lycan_howl_cast.vpcf", PATTACH_ABSORIGIN, self:GetCaster() )
ParticleManager:SetParticleControl( fx, 0 , self:GetCaster():GetAbsOrigin() )
ParticleManager:SetParticleControl( fx, 1 , self:GetCaster():GetAbsOrigin() )
ParticleManager:SetParticleControl( fx, 2 , self:GetCaster():GetAbsOrigin() )
end
modifier_script_lycan_howl = class({})
function modifier_script_lycan_howl:IsHidden()
return false
end
function modifier_script_lycan_howl:IsPurgable()
return true
end
function modifier_script_lycan_howl:GetEffectName()
return "particles/units/heroes/hero_lycan/lycan_howl_buff.vpcf"
end
function modifier_script_lycan_howl:GetEffectAttachType()
return PATTACH_ABSORIGIN_FOLLOW
end
function modifier_script_lycan_howl:OnCreated( kv )
if self:GetParent():IsRealHero() then
self.hp = self:GetAbility():GetSpecialValueFor( "hero_bonus_hp" )
self.dmg = self:GetAbility():GetSpecialValueFor( "hero_bonus_damage" )
elseif self:GetParent():IsControllableByAnyPlayer() then
self.hp = self:GetAbility():GetSpecialValueFor( "unit_bonus_hp" )
self.dmg = self:GetAbility():GetSpecialValueFor( "unit_bonus_damage" )
end
if IsServer() then
if GameRules:IsDaytime() == false then
self.hp = self.hp * 2
self.dmg = self.dmg * 2
end
end
end
function modifier_script_lycan_howl:OnRefresh( kv )
if self:GetParent():IsRealHero() then
self.hp = self:GetAbility():GetSpecialValueFor( "hero_bonus_hp" )
self.dmg = self:GetAbility():GetSpecialValueFor( "hero_bonus_damage" )
elseif self:GetParent():IsControllableByAnyPlayer() then
self.hp = self:GetAbility():GetSpecialValueFor( "unit_bonus_hp" )
self.dmg = self:GetAbility():GetSpecialValueFor( "unit_bonus_damage" )
end
if IsServer() then
if GameRules:IsDaytime() == false then
self.hp = self.hp * 2
self.dmg = self.dmg * 2
end
end
end
function modifier_script_lycan_howl:DeclareFunctions()
local funcs = {
MODIFIER_PROPERTY_HEALTH_BONUS,
MODIFIER_PROPERTY_PREATTACK_BONUS_DAMAGE,
}
return funcs
end
function modifier_script_lycan_howl:GetModifierHealthBonus()
return self.hp
end
function modifier_script_lycan_howl:GetModifierPreAttack_BonusDamage()
return self.dmg
end