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 local ____heal_tracker = require("utils.heal_tracker") local HealWithBattlePass = ____heal_tracker.HealWithBattlePass local ____modifier_overheating = require("abilities.heroes.sargatanas.modifier_overheating") local modifier_overheating = ____modifier_overheating.modifier_overheating local function DamageHell(self, unit) if unit:HasModifier(modifier_overheating.name) then local modif = unit:FindModifierByName(modifier_overheating.name) if modif then return modif:GetStackCount() / 100 + 1 end end return 1 end local function ModifierStackInc(self, unit, modifierName, setStack, dur, beginStack, ability) local modifier = unit:FindModifierByName(modifierName) if modifier then modifier:SetStackCount(modifier:GetStackCount() + setStack) modifier:SetDuration(dur, true) else modifier = unit:AddNewModifier(unit, ability, modifierName, {duration = dur}) if modifier then modifier:SetStackCount(beginStack) end end end ____exports.ability_hellstep = __TS__Class() local ability_hellstep = ____exports.ability_hellstep ability_hellstep.name = "ability_hellstep" ability_hellstep.____file_path = "scripts/vscripts/abilities/heroes/sargatanas/ability_hellstep.lua" __TS__ClassExtends(ability_hellstep, BaseAbility) function ability_hellstep.prototype.GetAOERadius(self) return self:GetSpecialValueFor("radius") end function ability_hellstep.prototype.GetBehavior(self) if self:GetCaster():HasModifier("modifier_ability_metamorphosis") then return bit.bor(DOTA_ABILITY_BEHAVIOR_UNIT_TARGET, DOTA_ABILITY_BEHAVIOR_AOE) else return bit.bor(DOTA_ABILITY_BEHAVIOR_POINT, DOTA_ABILITY_BEHAVIOR_AOE) end end function ability_hellstep.prototype.OnSpellStart(self) if not IsServer() then return end local caster = self:GetCaster() if caster:HasModifier("modifier_ability_metamorphosis") then caster:AddNewModifier( caster, self, ____exports.modifier_ability_hellstep_aura.name, {duration = self:GetSpecialValueFor("duration")} ) else local point = self:GetCursorPosition() local projectileSpeed = self:GetSpecialValueFor("projectile_speed") local vector = point - caster:GetAbsOrigin() local projectileDistance = vector:Length2D() local projectileDirection = vector projectileDirection.z = 0 projectileDirection = projectileDirection:Normalized() GridNav:DestroyTreesAroundPoint( point, self:GetSpecialValueFor("radius"), true ) local info = { Ability = self, EffectName = "", vSpawnOrigin = caster:GetAbsOrigin(), fDistance = projectileDistance, fStartRadius = 0, fEndRadius = 0, Source = caster, bHasFrontalCone = false, iUnitTargetTeam = DOTA_UNIT_TARGET_TEAM_ENEMY, iUnitTargetFlags = DOTA_UNIT_TARGET_FLAG_NONE, iUnitTargetType = bit.bor(DOTA_UNIT_TARGET_HERO, DOTA_UNIT_TARGET_BASIC), vVelocity = projectileDirection * projectileSpeed, bProvidesVision = false, iVisionRadius = 0, iVisionTeamNumber = caster:GetTeamNumber() } ProjectileManager:CreateLinearProjectile(info) end end function ability_hellstep.prototype.OnProjectileHit(self, target, location) if target then return false end if not IsServer() then return false end local duration = self:GetSpecialValueFor("duration") CreateModifierThinker( self:GetCaster(), self, ____exports.modifier_ability_hellstep_thinker.name, {duration = duration}, location, self:GetCaster():GetTeamNumber(), false ) return false end ability_hellstep = __TS__Decorate( ability_hellstep, ability_hellstep, {registerAbility(nil)}, {kind = "class", name = "ability_hellstep"} ) ____exports.ability_hellstep = ability_hellstep ____exports.modifier_ability_hellstep_thinker = __TS__Class() local modifier_ability_hellstep_thinker = ____exports.modifier_ability_hellstep_thinker modifier_ability_hellstep_thinker.name = "modifier_ability_hellstep_thinker" modifier_ability_hellstep_thinker.____file_path = "scripts/vscripts/abilities/heroes/sargatanas/ability_hellstep.lua" __TS__ClassExtends(modifier_ability_hellstep_thinker, BaseModifier) function modifier_ability_hellstep_thinker.prototype.____constructor(self, ...) BaseModifier.prototype.____constructor(self, ...) self.radius = 0 end function modifier_ability_hellstep_thinker.prototype.IsHidden(self) return true end function modifier_ability_hellstep_thinker.prototype.IsPurgable(self) return false end function modifier_ability_hellstep_thinker.prototype.IsPurgeException(self) return false end function modifier_ability_hellstep_thinker.prototype.IsDebuff(self) return false end function modifier_ability_hellstep_thinker.prototype.IsBuff(self) return true end function modifier_ability_hellstep_thinker.prototype.RemoveOnDeath(self) return true end function modifier_ability_hellstep_thinker.prototype.OnCreated(self) if not IsServer() then return end local ability = self:GetAbility() if not ability then return end self.radius = ability:GetSpecialValueFor("radius") EmitSoundOn( "Hero_DragonKnight.BreathFire", self:GetParent() ) local fx = ParticleManager:CreateParticle( "particles/units/heroes/hero_dragon_knight/dragon_knight_shard_fireball.vpcf", PATTACH_CUSTOMORIGIN, self:GetCaster() ) ParticleManager:SetParticleControl( fx, 0, self:GetParent():GetAbsOrigin() ) ParticleManager:SetParticleControl( fx, 1, self:GetParent():GetAbsOrigin() ) ParticleManager:SetParticleControl( fx, 2, Vector(self.radius, 0, 0) ) self:AddParticle( fx, false, false, 0, false, false ) Timers:CreateTimer( ability:GetSpecialValueFor("duration"), function() ParticleManager:DestroyParticle(self.fx, true) return nil end ) end function modifier_ability_hellstep_thinker.prototype.IsAura(self) return true end function modifier_ability_hellstep_thinker.prototype.GetModifierAura(self) return ____exports.modifier_ability_hellstep.name end function modifier_ability_hellstep_thinker.prototype.GetAuraRadius(self) return self.radius end function modifier_ability_hellstep_thinker.prototype.GetAuraSearchTeam(self) return DOTA_UNIT_TARGET_TEAM_BOTH end function modifier_ability_hellstep_thinker.prototype.GetAuraDuration(self) return 0.5 end function modifier_ability_hellstep_thinker.prototype.GetAuraSearchType(self) return bit.bor(DOTA_UNIT_TARGET_HERO, DOTA_UNIT_TARGET_BASIC) end function modifier_ability_hellstep_thinker.prototype.GetAuraSearchFlags(self) return DOTA_UNIT_TARGET_FLAG_NONE end modifier_ability_hellstep_thinker = __TS__Decorate( modifier_ability_hellstep_thinker, modifier_ability_hellstep_thinker, {registerModifier(nil)}, {kind = "class", name = "modifier_ability_hellstep_thinker"} ) ____exports.modifier_ability_hellstep_thinker = modifier_ability_hellstep_thinker ____exports.modifier_ability_hellstep_aura = __TS__Class() local modifier_ability_hellstep_aura = ____exports.modifier_ability_hellstep_aura modifier_ability_hellstep_aura.name = "modifier_ability_hellstep_aura" modifier_ability_hellstep_aura.____file_path = "scripts/vscripts/abilities/heroes/sargatanas/ability_hellstep.lua" __TS__ClassExtends(modifier_ability_hellstep_aura, BaseModifier) function modifier_ability_hellstep_aura.prototype.____constructor(self, ...) BaseModifier.prototype.____constructor(self, ...) self.radius = 0 end function modifier_ability_hellstep_aura.prototype.IsHidden(self) return false end function modifier_ability_hellstep_aura.prototype.IsPurgable(self) return false end function modifier_ability_hellstep_aura.prototype.IsDebuff(self) return false end function modifier_ability_hellstep_aura.prototype.IsBuff(self) return true end function modifier_ability_hellstep_aura.prototype.RemoveOnDeath(self) return true end function modifier_ability_hellstep_aura.prototype.OnCreated(self) if not IsServer() then return end local ability = self:GetAbility() if not ability then return end self.radius = ability:GetSpecialValueFor("radius") EmitSoundOn( "Hero_DragonKnight.BreathFire", self:GetParent() ) self.effectCast = ParticleManager:CreateParticle( "particles/units/heroes/hero_doom_bringer/doom_scorched_earth.vpcf", PATTACH_ABSORIGIN_FOLLOW, self:GetParent() ) ParticleManager:SetParticleControl( self.effectCast, 1, Vector(self.radius, 0, 0) ) end function modifier_ability_hellstep_aura.prototype.OnRefresh(self) self:OnCreated() end function modifier_ability_hellstep_aura.prototype.IsAura(self) return true end function modifier_ability_hellstep_aura.prototype.GetModifierAura(self) return ____exports.modifier_ability_hellstep.name end function modifier_ability_hellstep_aura.prototype.GetAuraRadius(self) return self.radius end function modifier_ability_hellstep_aura.prototype.GetAuraDuration(self) return 0.5 end function modifier_ability_hellstep_aura.prototype.GetAuraSearchTeam(self) return DOTA_UNIT_TARGET_TEAM_BOTH end function modifier_ability_hellstep_aura.prototype.GetAuraSearchType(self) return bit.bor(DOTA_UNIT_TARGET_HERO, DOTA_UNIT_TARGET_BASIC) end function modifier_ability_hellstep_aura.prototype.GetAuraSearchFlags(self) return DOTA_UNIT_TARGET_FLAG_NONE end function modifier_ability_hellstep_aura.prototype.OnDestroy(self) if not IsServer() then return end if self.effectCast ~= nil then ParticleManager:DestroyParticle(self.effectCast, true) end StopSoundOn( "Hero_DragonKnight.BreathFire", self:GetParent() ) end modifier_ability_hellstep_aura = __TS__Decorate( modifier_ability_hellstep_aura, modifier_ability_hellstep_aura, {registerModifier(nil)}, {kind = "class", name = "modifier_ability_hellstep_aura"} ) ____exports.modifier_ability_hellstep_aura = modifier_ability_hellstep_aura ____exports.modifier_ability_hellstep = __TS__Class() local modifier_ability_hellstep = ____exports.modifier_ability_hellstep modifier_ability_hellstep.name = "modifier_ability_hellstep" modifier_ability_hellstep.____file_path = "scripts/vscripts/abilities/heroes/sargatanas/ability_hellstep.lua" __TS__ClassExtends(modifier_ability_hellstep, BaseModifier) function modifier_ability_hellstep.prototype.____constructor(self, ...) BaseModifier.prototype.____constructor(self, ...) self.bonusDamage = 0 self.bonusAttackSpeed = 0 self.minDamage = 0 self.maxDamage = 0 self.maxDuration = 0 self.duration = 0 self.damageMidPerTick = 0 self.damagePerTick = 0 self.stackOverhell = 0 self.ticks = 1 self.timeOld = 0 end function modifier_ability_hellstep.prototype.IsHidden(self) return false end function modifier_ability_hellstep.prototype.IsPurgable(self) return false end function modifier_ability_hellstep.prototype.IsPurgeException(self) return false end function modifier_ability_hellstep.prototype.IsDebuff(self) return true end function modifier_ability_hellstep.prototype.IsBuff(self) return false end function modifier_ability_hellstep.prototype.RemoveOnDeath(self) return true end function modifier_ability_hellstep.prototype.DeclareFunctions(self) return {MODIFIER_PROPERTY_ATTACKSPEED_BONUS_CONSTANT, MODIFIER_PROPERTY_PREATTACK_BONUS_DAMAGE} end function modifier_ability_hellstep.prototype.GetAttributes(self) return MODIFIER_ATTRIBUTE_MULTIPLE end function modifier_ability_hellstep.prototype.OnCreated(self) if not IsServer() then return end local ability = self:GetAbility() if not ability then return end self.bonusDamage = ability:GetSpecialValueFor("bonus_damage") self.bonusAttackSpeed = ability:GetSpecialValueFor("bonus_attack_speed") self.minDamage = ability:GetSpecialValueFor("min_damage") self.maxDamage = ability:GetSpecialValueFor("max_damage") self.maxDuration = ability:GetSpecialValueFor("max_duration") self.duration = ability:GetSpecialValueFor("duration") self.damageMidPerTick = (self.maxDamage - self.minDamage) / (self.duration / 0.4) self.damagePerTick = 0.05 * math.ceil(100 * self.damageMidPerTick) self.stackOverhell = ability:GetSpecialValueFor("stack_overhell") self.ticks = 1 self.timeOld = GameRules:GetGameTime() self:StartIntervalThink(0.5) self.effectCast = ParticleManager:CreateParticle( "particles/econ/items/wraith_king/wraith_king_ti6_bracer/wraith_king_ti6_ambient_fireball_lava.vpcf", PATTACH_CUSTOMORIGIN_FOLLOW, self:GetCaster() ) ParticleManager:SetParticleControlEnt( self.effectCast, 0, self:GetParent(), PATTACH_ABSORIGIN_FOLLOW, "", self:GetParent():GetAbsOrigin(), true ) self:AddParticle( self.effectCast, false, false, -1, false, false ) end function modifier_ability_hellstep.prototype.GetModifierAttackSpeedBonus_Constant(self) local parent = self:GetParent() local caster = self:GetCaster() if not parent or not caster then return 0 end if parent:GetTeamNumber() == caster:GetTeamNumber() then return self.bonusAttackSpeed end return 0 end function modifier_ability_hellstep.prototype.GetModifierPreAttack_BonusDamage(self) local parent = self:GetParent() local caster = self:GetCaster() if not parent or not caster then return 0 end if parent:GetTeamNumber() == caster:GetTeamNumber() then return self.bonusDamage end return 0 end function modifier_ability_hellstep.prototype.OnIntervalThink(self) if not IsServer() then return end local timeNow = GameRules:GetGameTime() if math.floor(timeNow - self.timeOld) <= self.maxDuration then self.ticks = self.ticks + 1 end local damage = self.damagePerTick * self.ticks local ability = self:GetAbility() local caster = self:GetCaster() if not ability or not caster then return end if self:GetParent():GetTeamNumber() ~= caster:GetTeamNumber() then ApplyDamage({ victim = self:GetParent(), attacker = caster, damage = damage * DamageHell( nil, self:GetParent() ), damage_type = ability:GetAbilityDamageType(), ability = ability }) if self:GetParent():GetTeamNumber() ~= caster:GetTeamNumber() then ModifierStackInc( nil, self:GetParent(), modifier_overheating.name, self.stackOverhell, 8, self.stackOverhell, ability ) end EmitSoundOn("Hero_Viper.NetherToxin.Damage", caster) else HealWithBattlePass( nil, caster, damage * DamageHell( nil, self:GetParent() ), ability, caster ) SendOverheadEventMessage( nil, OVERHEAD_ALERT_HEAL, caster, damage, caster:GetPlayerOwner() ) end end modifier_ability_hellstep = __TS__Decorate( modifier_ability_hellstep, modifier_ability_hellstep, {registerModifier(nil)}, {kind = "class", name = "modifier_ability_hellstep"} ) ____exports.modifier_ability_hellstep = modifier_ability_hellstep return ____exports