Skip to content

Commit

Permalink
Some more 7.20 fixed (attack range function rename mainly)
Browse files Browse the repository at this point in the history
  • Loading branch information
Wouterz90 committed Nov 29, 2018
1 parent ea97470 commit 9eae883
Show file tree
Hide file tree
Showing 27 changed files with 50 additions and 43 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -633,7 +633,7 @@ function imba_abaddon_curse_of_avernus:GetCooldown()
end

function imba_abaddon_curse_of_avernus:GetCastRange()
return self:GetCaster():GetAttackRange()
return self:GetCaster():Script_GetAttackRange()
end

function imba_abaddon_curse_of_avernus:OnSpellStart()
Expand Down
2 changes: 1 addition & 1 deletion src/game/scripts/vscripts/abilities/dota_imba/hero_axe.lua
Original file line number Diff line number Diff line change
Expand Up @@ -556,7 +556,7 @@ function modifier_imba_battle_hunger_debuff_dot:OnAttackStart(keys)
if keys.attacker == self.parent and self.parent:IsHero() and keys.target ~= self.caster then

if not self.cmd_restricted and RollPseudoRandom(self.maddening_chance_pct, self) then
local targets = FindUnitsInRadius(self.parent:GetTeamNumber(), self.parent:GetAbsOrigin(), nil, self.parent:GetAttackRange() + self.maddening_buffer_distance, DOTA_UNIT_TARGET_TEAM_BOTH, DOTA_UNIT_TARGET_HERO + DOTA_UNIT_TARGET_BASIC, DOTA_UNIT_TARGET_FLAG_MAGIC_IMMUNE_ENEMIES, FIND_ANY_ORDER, false)
local targets = FindUnitsInRadius(self.parent:GetTeamNumber(), self.parent:GetAbsOrigin(), nil, self.parent:Script_GetAttackRange() + self.maddening_buffer_distance, DOTA_UNIT_TARGET_TEAM_BOTH, DOTA_UNIT_TARGET_HERO + DOTA_UNIT_TARGET_BASIC, DOTA_UNIT_TARGET_FLAG_MAGIC_IMMUNE_ENEMIES, FIND_ANY_ORDER, false)

-- If no one but us or us + current target are around, do nothing
if #targets <= 2 then
Expand Down
6 changes: 3 additions & 3 deletions src/game/scripts/vscripts/abilities/dota_imba/hero_clinkz.lua
Original file line number Diff line number Diff line change
Expand Up @@ -319,7 +319,7 @@ end

function imba_clinkz_searing_arrows:GetCastRange(location, target)
local caster = self:GetCaster()
return caster:GetAttackRange()
return caster:Script_GetAttackRange()
end

function imba_clinkz_searing_arrows:IsHiddenWhenStolen()
Expand Down Expand Up @@ -1622,7 +1622,7 @@ function modifier_imba_death_pact_spirit_attack_range:OnCreated()
self.ability = self:GetAbility()
self.parent = self:GetParent()

self.spirit_attack_range = self.caster:GetAttackRange()
self.spirit_attack_range = self.caster:Script_GetAttackRange()
self.spirit_damage = self.caster:GetAttackDamage() -- GetBaseDamageMax

self:StartIntervalThink(1)
Expand All @@ -1631,7 +1631,7 @@ end

function modifier_imba_death_pact_spirit_attack_range:OnIntervalThink()
if IsServer() then
self.spirit_attack_range = self.caster:GetAttackRange()
self.spirit_attack_range = self.caster:Script_GetAttackRange()
end
end

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ end
function imba_drow_ranger_frost_arrows:GetCastRange(Location, Target)
-- Get caster's cast range
local caster = self:GetCaster()
return caster:GetAttackRange()
return caster:Script_GetAttackRange()
end

function imba_drow_ranger_frost_arrows:IsStealable()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -725,7 +725,7 @@ end
function imba_jakiro_liquid_fire:GetCastRange(Location, Target)
local caster = self:GetCaster()
-- #4 Talent: Liquid Fire Cast Range Increase
return caster:GetAttackRange() + self:GetSpecialValueFor("extra_cast_range") + caster:FindTalentValue("special_bonus_imba_jakiro_4")
return caster:Script_GetAttackRange() + self:GetSpecialValueFor("extra_cast_range") + caster:FindTalentValue("special_bonus_imba_jakiro_4")
end

function imba_jakiro_liquid_fire:OnAbilityPhaseStart()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -801,7 +801,7 @@ function imba_kunkka_tidebringer:GetIntrinsicModifierName()
end

function imba_kunkka_tidebringer:GetCastRange(location, target)
return self:GetCaster():GetAttackRange()
return self:GetCaster():Script_GetAttackRange()
end

function imba_kunkka_tidebringer:IsStealable()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ end
function imba_obsidian_destroyer_arcane_orb:GetCastRange(location, target)
-- Get caster's cast range
local caster = self:GetCaster()
return caster:GetAttackRange()
return caster:Script_GetAttackRange()
end


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -649,7 +649,7 @@ function imba_omniknight_hammer_of_virtue:IsStealable()
end

function imba_omniknight_hammer_of_virtue:GetCastRange(location, target)
return self:GetCaster():GetAttackRange()
return self:GetCaster():Script_GetAttackRange()
end

function imba_omniknight_hammer_of_virtue:GetAbilityTextureName()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ function modifier_imba_mass_serpent_ward:OnAttack(params)
local enemies = FindUnitsInRadius(parent:GetTeamNumber(),
parent:GetAbsOrigin(),
nil,
parent:GetAttackRange(),
parent:Script_GetAttackRange(),
DOTA_UNIT_TARGET_TEAM_ENEMY,
DOTA_UNIT_TARGET_HERO + DOTA_UNIT_TARGET_BASIC + DOTA_UNIT_TARGET_BUILDING,
DOTA_UNIT_TARGET_FLAG_FOW_VISIBLE +DOTA_UNIT_TARGET_FLAG_NO_INVIS,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,7 @@ function imba_silencer_glaives_of_wisdom:IsNetherWardStealable() return false en
function imba_silencer_glaives_of_wisdom:IsStealable() return false end

function imba_silencer_glaives_of_wisdom:GetCastRange()
return self:GetCaster():GetAttackRange()
return self:GetCaster():Script_GetAttackRange()
end

function imba_silencer_glaives_of_wisdom:GetIntrinsicModifierName()
Expand Down
4 changes: 2 additions & 2 deletions src/game/scripts/vscripts/abilities/dota_imba/hero_sniper.lua
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,7 @@ function modifier_imba_shrapnel_attack:GetModifierDamageOutgoing_Percentage()
end

-- Get the caster's attack range
local caster_attack_range = self.caster:GetAttackRange()
local caster_attack_range = self.caster:Script_GetAttackRange()

-- If the caster's range isn't buffed, do nothing
if caster_attack_range < self.global_fire_distance then
Expand Down Expand Up @@ -1114,7 +1114,7 @@ end
function modifier_imba_take_aim_range:OnIntervalThink()
if IsServer() then

self.caster:SetAcquisitionRange(self.caster:GetAttackRange() + 100)
self.caster:SetAcquisitionRange(self.caster:Script_GetAttackRange() + 100)

-- If the next shot should be an Aimed Shot, set stacks to 0, otherwise set to 1
if self.ability:IsCooldownReady() and self.ability:GetAutoCastState() and self.caster:IsRealHero() then
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -893,7 +893,7 @@ function modifier_imba_death_ward:OnCreated()
ParticleManager:SetParticleControlEnt(self.wardParticle, 0, self:GetParent(), PATTACH_POINT_FOLLOW, "attach_attack1", self:GetParent():GetAbsOrigin(), true)
ParticleManager:SetParticleControl(self.wardParticle, 2, self:GetParent():GetAbsOrigin())

self.attack_range_bonus = self:GetAbility():GetSpecialValueFor("attack_range") - self:GetParent():GetAttackRange()
self.attack_range_bonus = self:GetAbility():GetSpecialValueFor("attack_range") - self:GetParent():Script_GetAttackRange()

if IsServer() then
self:StartIntervalThink( self:GetParent():GetBaseAttackTime() )
Expand All @@ -915,7 +915,7 @@ function modifier_imba_death_ward:OnIntervalThink()
if hCaster:HasScepter() then
bounces = hAbility:GetSpecialValueFor("bounces_scepter") + 1
end
local range = hParent:GetAttackRange()
local range = hParent:Script_GetAttackRange()
if self.attack_target then
if not ((((self.attack_target:GetAbsOrigin() - hParent:GetAbsOrigin()):Length2D()) <= range) and UnitFilter( self.attack_target, hAbility:GetAbilityTargetTeam(), hAbility:GetAbilityTargetType(), hAbility:GetAbilityTargetFlags(), hCaster:GetTeamNumber()) == 0) then
self.attack_target = nil
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ hawkeye_ricochet = class({})
LinkLuaModifier("modifier_rapidfire_damage_reduction","abilities/dusk/hawkeye_ricochet",LUA_MODIFIER_MOTION_NONE)

function hawkeye_ricochet:GetCastRange()
return self:GetCaster():GetAttackRange()+50
return self:GetCaster():Script_GetAttackRange()+50
end

function hawkeye_ricochet:OnSpellStart()
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
function StrafeAttack(keys)
local caster = keys.caster
local radius = caster:GetAttackRange()
local radius = caster:Script_GetAttackRange()
local abilityName = keys.ability:GetName()

if caster:IsRangedAttacker() == false then
Expand Down
14 changes: 5 additions & 9 deletions src/game/scripts/vscripts/abilities/items/aeon_disk.lua
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ modifier_item_aeon_disk_consumable = class({
return {
MODIFIER_PROPERTY_HEALTH_BONUS,
MODIFIER_PROPERTY_MANA_BONUS,
MODIFIER_PROPERTY_STATUS_RESISTANCE,

MODIFIER_EVENT_ON_TAKEDAMAGE,
}
end,
Expand All @@ -104,13 +104,7 @@ modifier_item_aeon_disk_consumable = class({
end
return self:GetAbility():GetSpecialValueFor("aeon_disk_bonus_mana")
end,
GetModifierStatusResistance = function(self)
if not self:GetAbility() then
self:Destroy()
return
end
return self:GetAbility():GetSpecialValueFor("aeon_disk_status_resistance")
end,


OnTakeDamage = function(self, keys)
if not IsServer() or self:GetParent() ~= keys.unit then return end
Expand Down Expand Up @@ -150,7 +144,9 @@ modifier_item_aeon_disk_consumable_buff = class({
IsHidden = function() return false end,
IsPurgable = function() return false end,
GetTexture = function() return "item_aeon_disk" end,
DeclareFunctions = function() return {MODIFIER_PROPERTY_INCOMING_DAMAGE_PERCENTAGE, MODIFIER_PROPERTY_TOTALDAMAGEOUTGOING_PERCENTAGE} end,
DeclareFunctions = function() return {MODIFIER_PROPERTY_INCOMING_DAMAGE_PERCENTAGE, MODIFIER_PROPERTY_STATUS_RESISTANCE, MODIFIER_PROPERTY_TOTALDAMAGEOUTGOING_PERCENTAGE} end,
GetModifierIncomingDamage_Percentage = function() return -100 end,
GetModifierTotalDamageOutgoing_Percentage = function() return -100 end,
GetModifierStatusResistance = function(self) return self:GetAbility():GetSpecialValueFor("aeon_disk_status_resistance")
end,
})
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@ modifier_movespeed_cap = class({})

function modifier_movespeed_cap:DeclareFunctions()
local funcs = {
MODIFIER_PROPERTY_MOVESPEED_MAX,
MODIFIER_PROPERTY_MOVESPEED_ABSOLUTE_MAX,
MODIFIER_PROPERTY_MOVESPEED_LIMIT,
}

return funcs
end

function modifier_movespeed_cap:GetModifierMoveSpeed_Max( params )
function modifier_movespeed_cap:GetModifierMoveSpeed_AbsoluteMax( params )
return 5000
end

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@ modifier_movespeed_cap_900 = class({})

function modifier_movespeed_cap_900:DeclareFunctions()
local funcs = {
MODIFIER_PROPERTY_MOVESPEED_MAX,
MODIFIER_PROPERTY_MOVESPEED_ABSOLUTE_MAX,
MODIFIER_PROPERTY_MOVESPEED_LIMIT,
}

return funcs
end

function modifier_movespeed_cap_900:GetModifierMoveSpeed_Max( params )
function modifier_movespeed_cap_900:GetModifierMoveSpeed_AbsoluteMax( params )
return 900
end

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ function metamorphosis_mod:OnCreated( kv )
self.nFXIndex = ParticleManager:CreateParticle( "particles/neutral_fx/roshan_spawn.vpcf", PATTACH_ABSORIGIN_FOLLOW, self:GetParent() )
ParticleManager:SetParticleControl(self.nFXIndex, 0, self:GetCaster():GetOrigin())
ParticleManager:ReleaseParticleIndex(self.nFXIndex)
self.AttackBonus = (self:GetParent():GetAttackRange() - self:GetAbility():GetSpecialValueFor("attack_range")) * -1
self.AttackBonus = (self:GetParent():Script_GetAttackRange() - self:GetAbility():GetSpecialValueFor("attack_range")) * -1
self.OriginalAtkCap = self:GetParent():GetAttackCapability()
self:GetParent():SetAttackCapability(DOTA_UNIT_CAP_MELEE_ATTACK)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ function night_wolf_mod:OnCreated( kv )
local nFXIndex = ParticleManager:CreateParticle( "particles/units/heroes/hero_night_stalker/nightstalker_ulti.vpcf", PATTACH_ABSORIGIN_FOLLOW, self:GetParent() )
ParticleManager:SetParticleControl(nFXIndex, 0, self:GetCaster():GetOrigin())
ParticleManager:ReleaseParticleIndex(nFXIndex)
self.AttackBonus = (self:GetParent():GetAttackRange() - self:GetAbility():GetSpecialValueFor("attack_range")) * -1
self.AttackBonus = (self:GetParent():Script_GetAttackRange() - self:GetAbility():GetSpecialValueFor("attack_range")) * -1
self.OriginalAtkCap = self:GetParent():GetAttackCapability()
self:GetParent():SetAttackCapability(DOTA_UNIT_CAP_MELEE_ATTACK)
self:StartIntervalThink( 1 )
Expand Down
9 changes: 6 additions & 3 deletions src/game/scripts/vscripts/abilities/pocket_tower.lua
Original file line number Diff line number Diff line change
Expand Up @@ -71,9 +71,12 @@ end
function modifier_redux_tower_ability:OnIntervalThink()
if IsServer() then
local tower = self:GetParent()
local enemies = FindUnitsInRadius(tower:GetTeam(), tower:GetAbsOrigin(), nil, tower:GetAttackRange() + 144, DOTA_UNIT_TARGET_TEAM_ENEMY, DOTA_UNIT_TARGET_BUILDING + DOTA_UNIT_TARGET_HERO + DOTA_UNIT_TARGET_BASIC, DOTA_UNIT_TARGET_FLAG_MAGIC_IMMUNE_ENEMIES + DOTA_UNIT_TARGET_FLAG_NOT_ATTACK_IMMUNE, FIND_CLOSEST, false)
if enemies[1] then
tower:MoveToTargetToAttack(enemies[1])
local enemies = FindUnitsInRadius(tower:GetTeam(), tower:GetAbsOrigin(), nil, tower:Script_GetAttackRange() + 144, DOTA_UNIT_TARGET_TEAM_ENEMY, DOTA_UNIT_TARGET_BUILDING + DOTA_UNIT_TARGET_HERO + DOTA_UNIT_TARGET_BASIC, DOTA_UNIT_TARGET_FLAG_MAGIC_IMMUNE_ENEMIES + DOTA_UNIT_TARGET_FLAG_NOT_ATTACK_IMMUNE, FIND_CLOSEST, false)
for _,enemy in pairs(enemies) do
if not enemy:IsBuilding() or enemy:IsTower() then
--if enemies[1] then
tower:MoveToTargetToAttack(enemies[1])
end
end
end
end
Expand Down
2 changes: 1 addition & 1 deletion src/game/scripts/vscripts/abilities/tower_abilities.lua
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ function Multishot( keys )
if caster:PassivesDisabled() then return end
if not caster:IsRealHero() and not caster:IsBuilding() then return nil end
-- Parameters
local tower_range = caster:GetAttackRange() + 128
local tower_range = caster:Script_GetAttackRange() + 128

-- Find nearby enemies
local enemies = FindUnitsInRadius(caster:GetTeamNumber(), caster:GetAbsOrigin(), nil, tower_range, DOTA_UNIT_TARGET_TEAM_ENEMY, DOTA_UNIT_TARGET_HERO + DOTA_UNIT_TARGET_BASIC, DOTA_UNIT_TARGET_FLAG_MAGIC_IMMUNE_ENEMIES + DOTA_UNIT_TARGET_FLAG_NO_INVIS, FIND_ANY_ORDER, false)
Expand Down
2 changes: 1 addition & 1 deletion src/game/scripts/vscripts/dota-api.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2063,7 +2063,7 @@ declare abstract class CDOTA_BaseNPC extends CBaseFlex {
/**
* Gets this unit's attack range after all modifiers.
*/
GetAttackRange(): number;
Script_GetAttackRange(): number;
/**
* Gets the attack range buffer.
*/
Expand Down
4 changes: 2 additions & 2 deletions src/game/scripts/vscripts/ingame.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1802,9 +1802,9 @@ function Ingame:giveAntiRatProtection()
local direTowers = 0
for k,v in pairs(towers) do
if not v:IsNull() and v:IsAlive() then
if v:GetTeamNumber() == 2 then
if v:GetTeamNumber() == 2 and not v:HasModifier("modifier_redux_tower_ability") then
radiantTowers = radiantTowers + 1
else
elseif v:GetTeamNumber() == 3 and not v:HasModifier("modifier_redux_tower_ability")
direTowers = direTowers + 1
end
end
Expand Down
2 changes: 1 addition & 1 deletion src/game/scripts/vscripts/items/pocket_tower.lua
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ end
function modifier_redux_tower:OnIntervalThink()
if IsServer() then
local tower = self:GetParent()
local enemies = FindUnitsInRadius(tower:GetTeam(), tower:GetAbsOrigin(), nil, tower:GetAttackRange() + 144, DOTA_UNIT_TARGET_TEAM_ENEMY, DOTA_UNIT_TARGET_BUILDING + DOTA_UNIT_TARGET_HERO + DOTA_UNIT_TARGET_BASIC, DOTA_UNIT_TARGET_FLAG_MAGIC_IMMUNE_ENEMIES + DOTA_UNIT_TARGET_FLAG_NOT_ATTACK_IMMUNE, FIND_CLOSEST, false)
local enemies = FindUnitsInRadius(tower:GetTeam(), tower:GetAbsOrigin(), nil, tower:Script_GetAttackRange() + 144, DOTA_UNIT_TARGET_TEAM_ENEMY, DOTA_UNIT_TARGET_BUILDING + DOTA_UNIT_TARGET_HERO + DOTA_UNIT_TARGET_BASIC, DOTA_UNIT_TARGET_FLAG_MAGIC_IMMUNE_ENEMIES + DOTA_UNIT_TARGET_FLAG_NOT_ATTACK_IMMUNE, FIND_CLOSEST, false)
if enemies[1] then
tower:MoveToTargetToAttack(enemies[1])
end
Expand Down
2 changes: 1 addition & 1 deletion src/game/scripts/vscripts/items/pocket_tower_permanent.lua
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ end
function modifier_redux_tower_permanent:OnIntervalThink()
if IsServer() then
local tower = self:GetParent()
local enemies = FindUnitsInRadius(tower:GetTeam(), tower:GetAbsOrigin(), nil, tower:GetAttackRange() + 144, DOTA_UNIT_TARGET_TEAM_ENEMY, DOTA_UNIT_TARGET_BUILDING + DOTA_UNIT_TARGET_HERO + DOTA_UNIT_TARGET_BASIC, DOTA_UNIT_TARGET_FLAG_MAGIC_IMMUNE_ENEMIES + DOTA_UNIT_TARGET_FLAG_NOT_ATTACK_IMMUNE, FIND_CLOSEST, false)
local enemies = FindUnitsInRadius(tower:GetTeam(), tower:GetAbsOrigin(), nil, tower:Script_GetAttackRange() + 144, DOTA_UNIT_TARGET_TEAM_ENEMY, DOTA_UNIT_TARGET_BUILDING + DOTA_UNIT_TARGET_HERO + DOTA_UNIT_TARGET_BASIC, DOTA_UNIT_TARGET_FLAG_MAGIC_IMMUNE_ENEMIES + DOTA_UNIT_TARGET_FLAG_NOT_ATTACK_IMMUNE, FIND_CLOSEST, false)
if enemies[1] then
tower:MoveToTargetToAttack(enemies[1])
end
Expand Down
1 change: 1 addition & 0 deletions src/game/scripts/vscripts/pregame.lua
Original file line number Diff line number Diff line change
Expand Up @@ -8068,6 +8068,7 @@ function Pregame:fixSpawnedHero( spawnedUnit )
}

local disabledPerks = {
npc_dota_hero_vengefulspirit_perk = true,
--npc_dota_hero_windrunner = false,
--npc_dota_hero_shadow_demon = true,
-- npc_dota_hero_spirit_breaker = true,
Expand Down
9 changes: 8 additions & 1 deletion src/localization/addon_english.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17954,6 +17954,13 @@
"DOTA_Tooltip_ability_pushing_blast_Description" "Create a wave of light around you, pushing foes back and damaging and slowing them"
"DOTA_Tooltip_ability_pushing_blast_radius" "RADIUS:"
"DOTA_Tooltip_ability_pushing_blast_damage" "DAMAGE:"
"DOTA_Tooltip_ability_pushing_blast_duration" "DURATION"
"DOTA_Tooltip_ability_pushing_blast_duration" "DURATION"

"DOTA_Tooltip_ability_dazzle_bad_juju_redux" "Bad Juju"
"DOTA_Tooltip_ability_dazzle_bad_juju_redux_Description" "Passively reduces cooldowns on your abilities and items. Anytime you cast a speall nearby enemies will have their armor reduced. Debuff stacks and refreshes duration."
"DOTA_Tooltip_ability_dazzle_bad_juju_redux_cooldown_reduction" "%COOLDOWN REDUCTION:"
"DOTA_Tooltip_ability_dazzle_bad_juju_redux_armor_reduction" "ARMOR REDUCTION:"
"DOTA_Tooltip_ability_dazzle_bad_juju_redux_duration" "DURATION:"
"DOTA_Tooltip_ability_dazzle_bad_juju_redux_radius" "RADIUS:"

}

0 comments on commit 9eae883

Please sign in to comment.