Files
Dota-Zombie-Invasion/scripts/vscripts/abilities/heroes/nagash/fighting_up.lua
T
2026-05-29 15:11:31 +07:00

112 lines
4.1 KiB
Lua

local ____lualib = require("lualib_bundle")
local __TS__Class = ____lualib.__TS__Class
local __TS__ClassExtends = ____lualib.__TS__ClassExtends
local __TS__Decorate = ____lualib.__TS__Decorate
local ____exports = {}
local ____dota_ts_adapter = require("lib.dota_ts_adapter")
local BaseAbility = ____dota_ts_adapter.BaseAbility
local BaseModifier = ____dota_ts_adapter.BaseModifier
local registerAbility = ____dota_ts_adapter.registerAbility
local registerModifier = ____dota_ts_adapter.registerModifier
____exports.fighting_up = __TS__Class()
local fighting_up = ____exports.fighting_up
fighting_up.name = "fighting_up"
fighting_up.____file_path = "scripts/vscripts/abilities/heroes/nagash/fighting_up.lua"
__TS__ClassExtends(fighting_up, BaseAbility)
function fighting_up.prototype.OnSpellStart(self)
if not IsServer() then
return
end
local caster = self:GetCaster()
local team = caster:GetTeamNumber()
local radius = self:GetSpecialValueFor("radius")
local duration = self:GetSpecialValueFor("duration")
local allies = FindUnitsInRadius(
team,
caster:GetAbsOrigin(),
nil,
radius,
DOTA_UNIT_TARGET_TEAM_FRIENDLY,
DOTA_UNIT_TARGET_HEROES_AND_CREEPS,
DOTA_UNIT_TARGET_FLAG_INVULNERABLE,
FIND_ANY_ORDER,
false
)
for ____, unit in ipairs(allies) do
do
if not IsValidEntity(unit) or not unit:IsAlive() then
goto __continue4
end
unit:AddNewModifier(caster, self, "modifier_fighting_up_buff", {duration = duration})
EmitSoundOn("Hero_Warlock.FatalBonds", unit)
end
::__continue4::
end
end
function fighting_up.prototype.GetAOERadius(self)
return self:GetSpecialValueFor("radius")
end
fighting_up = __TS__Decorate(
fighting_up,
fighting_up,
{registerAbility(nil)},
{kind = "class", name = "fighting_up"}
)
____exports.fighting_up = fighting_up
____exports.modifier_fighting_up_buff = __TS__Class()
local modifier_fighting_up_buff = ____exports.modifier_fighting_up_buff
modifier_fighting_up_buff.name = "modifier_fighting_up_buff"
modifier_fighting_up_buff.____file_path = "scripts/vscripts/abilities/heroes/nagash/fighting_up.lua"
__TS__ClassExtends(modifier_fighting_up_buff, BaseModifier)
function modifier_fighting_up_buff.prototype.____constructor(self, ...)
BaseModifier.prototype.____constructor(self, ...)
self.bonusHealth = 0
end
function modifier_fighting_up_buff.prototype.IsHidden(self)
return false
end
function modifier_fighting_up_buff.prototype.IsPurgable(self)
return true
end
function modifier_fighting_up_buff.prototype.GetEffectName(self)
return "particles/econ/items/warlock/warlock_ti10_head/warlock_ti_10_fatal_bonds_icon.vpcf"
end
function modifier_fighting_up_buff.prototype.GetEffectAttachType(self)
return PATTACH_OVERHEAD_FOLLOW
end
function modifier_fighting_up_buff.prototype.OnRefresh(self, params)
self:OnCreated(params)
end
function modifier_fighting_up_buff.prototype.DeclareFunctions(self)
return {MODIFIER_PROPERTY_DAMAGEOUTGOING_PERCENTAGE, MODIFIER_PROPERTY_MOVESPEED_BONUS_PERCENTAGE, MODIFIER_PROPERTY_ATTACKSPEED_PERCENTAGE}
end
function modifier_fighting_up_buff.prototype.GetModifierDamageOutgoing_Percentage(self, event)
local ability = self:GetAbility()
if not ability then
return 0
end
return ability:GetSpecialValueFor("bonus_damage_pct")
end
function modifier_fighting_up_buff.prototype.GetModifierMoveSpeedBonus_Percentage(self)
local ability = self:GetAbility()
if not ability then
return 0
end
return ability:GetSpecialValueFor("bonus_movespeed_pct")
end
function modifier_fighting_up_buff.prototype.GetModifierAttackSpeedPercentage(self)
local ability = self:GetAbility()
if not ability then
return 0
end
return ability:GetSpecialValueFor("bonus_attackspeed_pct")
end
modifier_fighting_up_buff = __TS__Decorate(
modifier_fighting_up_buff,
modifier_fighting_up_buff,
{registerModifier(nil)},
{kind = "class", name = "modifier_fighting_up_buff"}
)
____exports.modifier_fighting_up_buff = modifier_fighting_up_buff
return ____exports