235 lines
9.0 KiB
Lua
235 lines
9.0 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.ability_incandescent_fury = __TS__Class()
|
|
local ability_incandescent_fury = ____exports.ability_incandescent_fury
|
|
ability_incandescent_fury.name = "ability_incandescent_fury"
|
|
ability_incandescent_fury.____file_path = "scripts/vscripts/abilities/heroes/smaug/ability_incandescent_fury.lua"
|
|
__TS__ClassExtends(ability_incandescent_fury, BaseAbility)
|
|
function ability_incandescent_fury.prototype.GetCastRange(self, vLocation, hTarget)
|
|
return self:GetSpecialValueFor("cast_range")
|
|
end
|
|
function ability_incandescent_fury.prototype.OnSpellStart(self)
|
|
if not IsServer() then
|
|
return
|
|
end
|
|
local caster = self:GetCaster()
|
|
local point = self:GetCursorPosition()
|
|
local dir = point - caster:GetAbsOrigin()
|
|
dir.z = 0
|
|
dir = dir:Normalized()
|
|
local duration = self:GetSpecialValueFor("duration")
|
|
CreateModifierThinker(
|
|
caster,
|
|
self,
|
|
____exports.modifier_incandescent_fury_thinker.name,
|
|
{duration = duration, x = dir.x, y = dir.y},
|
|
caster:GetAbsOrigin(),
|
|
caster:GetTeamNumber(),
|
|
false
|
|
)
|
|
EmitSoundOn("Hero_Jakiro.Macropyre.Cast", caster)
|
|
end
|
|
ability_incandescent_fury = __TS__Decorate(
|
|
ability_incandescent_fury,
|
|
ability_incandescent_fury,
|
|
{registerAbility(nil)},
|
|
{kind = "class", name = "ability_incandescent_fury"}
|
|
)
|
|
____exports.ability_incandescent_fury = ability_incandescent_fury
|
|
____exports.modifier_incandescent_fury = __TS__Class()
|
|
local modifier_incandescent_fury = ____exports.modifier_incandescent_fury
|
|
modifier_incandescent_fury.name = "modifier_incandescent_fury"
|
|
modifier_incandescent_fury.____file_path = "scripts/vscripts/abilities/heroes/smaug/ability_incandescent_fury.lua"
|
|
__TS__ClassExtends(modifier_incandescent_fury, BaseModifier)
|
|
function modifier_incandescent_fury.prototype.IsHidden(self)
|
|
return false
|
|
end
|
|
function modifier_incandescent_fury.prototype.IsDebuff(self)
|
|
return true
|
|
end
|
|
function modifier_incandescent_fury.prototype.IsStunDebuff(self)
|
|
return false
|
|
end
|
|
function modifier_incandescent_fury.prototype.IsPurgable(self)
|
|
return false
|
|
end
|
|
function modifier_incandescent_fury.prototype.OnCreated(self, kv)
|
|
if not IsServer() then
|
|
return
|
|
end
|
|
local ability = self:GetAbility()
|
|
local caster = self:GetCaster()
|
|
if not ability or not caster then
|
|
return
|
|
end
|
|
self.damageTable = {
|
|
victim = self:GetParent(),
|
|
attacker = caster,
|
|
damage = (kv.damage or 0) + caster:GetAttackDamage() * (ability:GetSpecialValueFor("pct_dmg") / 100),
|
|
damage_type = kv.damage_type or ability:GetAbilityDamageType(),
|
|
ability = ability
|
|
}
|
|
if kv.interval then
|
|
self:StartIntervalThink(kv.interval)
|
|
end
|
|
end
|
|
function modifier_incandescent_fury.prototype.OnRefresh(self, kv)
|
|
if not IsServer() or not self.damageTable then
|
|
return
|
|
end
|
|
local ability = self:GetAbility()
|
|
local caster = self:GetCaster()
|
|
if not ability or not caster then
|
|
return
|
|
end
|
|
self.damageTable.damage = (kv.damage or 0) + caster:GetAttackDamage() * (ability:GetSpecialValueFor("pct_dmg") / 100)
|
|
self.damageTable.damage_type = kv.damage_type or ability:GetAbilityDamageType()
|
|
end
|
|
function modifier_incandescent_fury.prototype.OnIntervalThink(self)
|
|
if not IsServer() or not self.damageTable then
|
|
return
|
|
end
|
|
ApplyDamage(self.damageTable)
|
|
end
|
|
function modifier_incandescent_fury.prototype.GetEffectName(self)
|
|
return "particles/units/heroes/hero_jakiro/jakiro_liquid_fire_debuff.vpcf"
|
|
end
|
|
function modifier_incandescent_fury.prototype.GetEffectAttachType(self)
|
|
return PATTACH_ABSORIGIN_FOLLOW
|
|
end
|
|
modifier_incandescent_fury = __TS__Decorate(
|
|
modifier_incandescent_fury,
|
|
modifier_incandescent_fury,
|
|
{registerModifier(nil)},
|
|
{kind = "class", name = "modifier_incandescent_fury"}
|
|
)
|
|
____exports.modifier_incandescent_fury = modifier_incandescent_fury
|
|
____exports.modifier_incandescent_fury_thinker = __TS__Class()
|
|
local modifier_incandescent_fury_thinker = ____exports.modifier_incandescent_fury_thinker
|
|
modifier_incandescent_fury_thinker.name = "modifier_incandescent_fury_thinker"
|
|
modifier_incandescent_fury_thinker.____file_path = "scripts/vscripts/abilities/heroes/smaug/ability_incandescent_fury.lua"
|
|
__TS__ClassExtends(modifier_incandescent_fury_thinker, BaseModifier)
|
|
function modifier_incandescent_fury_thinker.prototype.____constructor(self, ...)
|
|
BaseModifier.prototype.____constructor(self, ...)
|
|
self.radius = 0
|
|
self.duration = 0
|
|
self.interval = 0
|
|
self.range = 0
|
|
self.damage = 0
|
|
end
|
|
function modifier_incandescent_fury_thinker.prototype.IsHidden(self)
|
|
return false
|
|
end
|
|
function modifier_incandescent_fury_thinker.prototype.IsDebuff(self)
|
|
return false
|
|
end
|
|
function modifier_incandescent_fury_thinker.prototype.IsStunDebuff(self)
|
|
return false
|
|
end
|
|
function modifier_incandescent_fury_thinker.prototype.IsPurgable(self)
|
|
return false
|
|
end
|
|
function modifier_incandescent_fury_thinker.prototype.OnCreated(self, kv)
|
|
if not IsServer() then
|
|
return
|
|
end
|
|
self.caster = self:GetCaster()
|
|
self.parent = self:GetParent()
|
|
local ability = self:GetAbility()
|
|
if not ability or not self.caster or not self.parent then
|
|
return
|
|
end
|
|
self.radius = ability:GetSpecialValueFor("path_radius")
|
|
self.duration = ability:GetSpecialValueFor("linger_duration")
|
|
self.interval = ability:GetSpecialValueFor("burn_interval")
|
|
self.range = ability:GetCastRange(
|
|
self.parent:GetAbsOrigin(),
|
|
nil
|
|
) + self.caster:GetCastRangeBonus()
|
|
self.damage = ability:GetSpecialValueFor("damage")
|
|
self.abilityDamageType = ability:GetAbilityDamageType()
|
|
self.abilityTargetTeam = ability:GetAbilityTargetTeam()
|
|
self.abilityTargetType = ability:GetAbilityTargetType()
|
|
self.abilityTargetFlags = ability:GetAbilityTargetFlags()
|
|
local startRange = 234
|
|
self.direction = Vector(kv.x or 0, kv.y or 0, 0)
|
|
self.startpoint = self.parent:GetAbsOrigin() + self.direction * startRange
|
|
self.endpoint = self.startpoint + self.direction * self.range
|
|
local step = 0
|
|
while step < self.range and self.startpoint and self.direction do
|
|
local loc = self.startpoint + self.direction * step
|
|
GridNav:DestroyTreesAroundPoint(loc, self.radius, true)
|
|
step = step + self.radius
|
|
end
|
|
self:StartIntervalThink(self.interval)
|
|
local duration = self:GetDuration()
|
|
self.effectCast = ParticleManager:CreateParticle("particles/econ/items/jakiro/jakiro_ti10_immortal/jakiro_ti10_macropyre.vpcf", PATTACH_WORLDORIGIN, self.parent)
|
|
if self.startpoint ~= nil and self.startpoint ~= nil and self.endpoint ~= nil and self.endpoint ~= nil then
|
|
ParticleManager:SetParticleControl(self.effectCast, 0, self.startpoint)
|
|
ParticleManager:SetParticleControl(self.effectCast, 1, self.endpoint)
|
|
end
|
|
ParticleManager:SetParticleControl(
|
|
self.effectCast,
|
|
2,
|
|
Vector(duration, 0, 0)
|
|
)
|
|
self:AddParticle(
|
|
self.effectCast,
|
|
false,
|
|
false,
|
|
-1,
|
|
false,
|
|
false
|
|
)
|
|
EmitSoundOn("hero_jakiro.macropyre", self.parent)
|
|
end
|
|
function modifier_incandescent_fury_thinker.prototype.OnDestroy(self)
|
|
if not IsServer() then
|
|
return
|
|
end
|
|
if self.parent then
|
|
UTIL_Remove(self.parent)
|
|
end
|
|
end
|
|
function modifier_incandescent_fury_thinker.prototype.OnIntervalThink(self)
|
|
if not IsServer() then
|
|
return
|
|
end
|
|
if not self.caster or not self.startpoint or not self.endpoint or not self.direction then
|
|
return
|
|
end
|
|
local ability = self:GetAbility()
|
|
if not ability then
|
|
return
|
|
end
|
|
local enemies = FindUnitsInLine(
|
|
self.caster:GetTeamNumber(),
|
|
self.startpoint,
|
|
self.endpoint,
|
|
nil,
|
|
self.radius,
|
|
self.abilityTargetTeam or DOTA_UNIT_TARGET_TEAM_ENEMY,
|
|
self.abilityTargetType or bit.bor(DOTA_UNIT_TARGET_HERO, DOTA_UNIT_TARGET_BASIC),
|
|
self.abilityTargetFlags or DOTA_UNIT_TARGET_FLAG_NONE
|
|
)
|
|
for ____, enemy in ipairs(enemies) do
|
|
enemy:AddNewModifier(self.caster, ability, ____exports.modifier_incandescent_fury.name, {duration = self.duration, interval = self.interval, damage = self.damage * self.interval, damage_type = self.abilityDamageType})
|
|
end
|
|
end
|
|
modifier_incandescent_fury_thinker = __TS__Decorate(
|
|
modifier_incandescent_fury_thinker,
|
|
modifier_incandescent_fury_thinker,
|
|
{registerModifier(nil)},
|
|
{kind = "class", name = "modifier_incandescent_fury_thinker"}
|
|
)
|
|
____exports.modifier_incandescent_fury_thinker = modifier_incandescent_fury_thinker
|
|
return ____exports
|