diff --git a/abilityUse/abilityUse_crystal_maiden.lua b/abilityUse/abilityUse_crystal_maiden.lua index e918041..5e2649a 100644 --- a/abilityUse/abilityUse_crystal_maiden.lua +++ b/abilityUse/abilityUse_crystal_maiden.lua @@ -270,7 +270,7 @@ function ConsiderQ() end -- If we're seriously retreating, see if we can land a stun on someone who's damaged us recently - if modeName == "retreat" then + if modeName == "retreat" or modeName == "shrine" then local tableNearbyEnemyHeroes = gHeroVar.GetNearbyEnemies( bot, CastRange + Radius + 200 ) for _, npcEnemy in pairs( tableNearbyEnemyHeroes ) do if bot:WasRecentlyDamagedByHero( npcEnemy, 2.0 ) then @@ -402,7 +402,7 @@ function ConsiderW() end -- If we're seriously retreating, see if we can land a stun on someone who's damaged us recently - if modeName == "retreat" then + if modeName == "retreat" or modeName == "shrine" then local tableNearbyEnemyHeroes = gHeroVar.GetNearbyEnemies( bot, CastRange ) for _, npcEnemy in pairs( tableNearbyEnemyHeroes ) do if bot:WasRecentlyDamagedByHero( npcEnemy, 2.0 ) then diff --git a/abilityUse/abilityUse_drow_ranger.lua b/abilityUse/abilityUse_drow_ranger.lua index ee34976..f07c914 100644 --- a/abilityUse/abilityUse_drow_ranger.lua +++ b/abilityUse/abilityUse_drow_ranger.lua @@ -199,7 +199,7 @@ function ConsiderW() end -- protect myself - if modeName == "retreat" then + if modeName == "retreat" or modeName == "shrine" then local closeEnemies = gHeroVar.GetNearbyEnemies(bot, 350) for _, npcEnemy in pairs( closeEnemies ) do if utils.ValidTarget(npcEnemy) and not utils.IsTargetMagicImmune( npcEnemy ) and not utils.IsCrowdControlled(npcEnemy) then diff --git a/abilityUse/abilityUse_invoker.lua b/abilityUse/abilityUse_invoker.lua index 5aaec94..73b9936 100644 --- a/abilityUse/abilityUse_invoker.lua +++ b/abilityUse/abilityUse_invoker.lua @@ -778,7 +778,7 @@ function ConsiderTornado() -------------------------------------- --------- RETREATING ----------------------- - if modeName == "retreat" then + if modeName == "retreat" or modeName == "shrine" then for _, npcEnemy in pairs( nearbyEnemyHeroes ) do if utils.ValidTarget(npcEnemy) and bot:WasRecentlyDamagedByHero( npcEnemy, 2.0 ) and not utils.IsTargetMagicImmune(npcEnemy) then @@ -847,7 +847,7 @@ function ConsiderIceWall() end --------- RETREATING ----------------------- - if modeName == "retreat" then + if modeName == "retreat" or modeName == "shrine" then local nearbyEnemyHeroes = gHeroVar.GetNearbyEnemies(bot, 1200) for _, npcEnemy in pairs( nearbyEnemyHeroes ) do if utils.ValidTarget(npcEnemy) and bot:WasRecentlyDamagedByHero( npcEnemy, 2.0 ) and @@ -1137,7 +1137,7 @@ function ConsiderGhostWalk() end -- WE ARE RETREATING AND THEY ARE ON US - if modeName == "retreat" then + if modeName == "retreat" or modeName == "shrine" then local nearbyEnemyHeroes = gHeroVar.GetNearbyEnemies(bot, 1200) for _, npcEnemy in pairs( nearbyEnemyHeroes ) do if utils.ValidTarget(npcEnemy) and (bot:WasRecentlyDamagedByHero( npcEnemy, 1.0 ) @@ -1259,7 +1259,7 @@ function ConsiderColdSnap() end -- If we're seriously retreating, see if we can land a stun on someone who's damaged us recently - if modeName == "retreat" then + if modeName == "retreat" or modeName == "shrine" then local tableNearbyEnemyHeroes = gHeroVar.GetNearbyEnemies( bot, nCastRange ) for _, npcEnemy in pairs( tableNearbyEnemyHeroes ) do if bot:WasRecentlyDamagedByHero( npcEnemy, 2.0 ) then diff --git a/abilityUse/abilityUse_legion_commander.lua b/abilityUse/abilityUse_legion_commander.lua index 9d8590f..5313747 100644 --- a/abilityUse/abilityUse_legion_commander.lua +++ b/abilityUse/abilityUse_legion_commander.lua @@ -201,8 +201,8 @@ function ConsiderW() end -- If we're farming - local creeps = gHeroVar.GetNearbyEnemyCreep( bot, 900 ) if modeName == "laning" or modeName == "jungling" then + local creeps = gHeroVar.GetNearbyEnemyCreep( bot, 900 ) if #creeps >= 2 and HealthPerc < 0.5 then if ManaPerc > 0.4 then if not utils.IsTargetMagicImmune( bot ) then @@ -223,6 +223,10 @@ function ConsiderR() end local CastRange = abilityR:GetCastRange() + local Duration = abilityR:GetSpecialValueFloat("duration") + if bot:HasScepter() then + Duration = abilityR:GetSpecialValueFloat("duration_scepter") + end local modeName = bot.SelfRef:getCurrentMode():GetName() @@ -239,7 +243,13 @@ function ConsiderR() if modeName ~= "retreat" then if utils.ValidTarget(WeakestEnemy) then if not WeakestEnemy:IsInvulnerable() then - if HeroHealth <= WeakestEnemy:GetActualIncomingDamage( bot:GetOffensivePower(), DAMAGE_TYPE_ALL ) and + local extraDmg = 0.0 + if utils.IsItemAvailable("item_blade_mail") then + extraDmg = WeakestEnemy:GetEstimatedDamageToTarget(true, bot, Min(4.5, Duration), DAMAGE_TYPE_PHYSICAL) + extraDmg = WeakestEnemy:GetActualIncomingDamage(extraDmg, DAMAGE_TYPE_PHYSICAL) + end + + if HeroHealth <= (bot:GetEstimatedDamageToTarget(true, WeakestEnemy, Duration, DAMAGE_TYPE_PHYSICAL) + extraDmg) and #allies >= #enemies then return BOT_ACTION_DESIRE_HIGH, WeakestEnemy end @@ -256,9 +266,17 @@ function ConsiderR() if npcEnemy == nil then npcEnemy = getHeroVar("Target") end if utils.ValidTarget(npcEnemy) then - if not npcEnemy:IsInvulnerable() and GetUnitToUnitDistance(bot, npcEnemy) < CastRange and - #allies >= #enemies then - return BOT_ACTION_DESIRE_MODERATE, npcEnemy + local extraDmg = 0.0 + if utils.IsItemAvailable("item_blade_mail") then + extraDmg = npcEnemy:GetEstimatedDamageToTarget(true, bot, Min(4.5, Duration), DAMAGE_TYPE_PHYSICAL) + extraDmg = npcEnemy:GetActualIncomingDamage(extraDmg, DAMAGE_TYPE_PHYSICAL) + end + + if not npcEnemy:IsInvulnerable() and GetUnitToUnitDistance(bot, npcEnemy) < CastRange then + if HeroHealth <= (bot:GetEstimatedDamageToTarget(true, npcEnemy, Duration, DAMAGE_TYPE_PHYSICAL) + extraDmg) and + #allies >= #enemies then + return BOT_ACTION_DESIRE_MODERATE, npcEnemy + end end end end @@ -299,7 +317,13 @@ function genericAbility:AbilityUsageThink(bot) end if castRDesire > 0 then - gHeroVar.HeroUseAbilityOnEntity(bot, abilityR, castRTarget ) + if utils.IsItemAvailable("item_blade_mail") then + bot:Action_ClearActions(false) + item_usage.UseBladeMail(bot) + gHeroVar.HeroQueueUseAbilityOnEntity(bot, abilityR, castRTarget ) + else + gHeroVar.HeroUseAbilityOnEntity(bot, abilityR, castRTarget ) + end return true end diff --git a/abilityUse/abilityUse_lina.lua b/abilityUse/abilityUse_lina.lua index 073c0c9..3fded4a 100644 --- a/abilityUse/abilityUse_lina.lua +++ b/abilityUse/abilityUse_lina.lua @@ -365,7 +365,7 @@ function ConsiderW() end -- If we're seriously retreating, see if we can land a stun on someone who's damaged us recently - if modeName == "retreat" then + if modeName == "retreat" or modeName == "shrine" then local tableNearbyEnemyHeroes = gHeroVar.GetNearbyEnemies( bot, CastRange ) for _, npcEnemy in pairs( tableNearbyEnemyHeroes ) do if bot:WasRecentlyDamagedByHero( npcEnemy, 2.0 ) then diff --git a/abilityUse/abilityUse_phantom_assassin.lua b/abilityUse/abilityUse_phantom_assassin.lua index 162ccfc..f23fe7d 100644 --- a/abilityUse/abilityUse_phantom_assassin.lua +++ b/abilityUse/abilityUse_phantom_assassin.lua @@ -9,6 +9,8 @@ local genericAbility = BotsInit.CreateGeneric() local utils = require( GetScriptDirectory().."/utility" ) local gHeroVar = require( GetScriptDirectory().."/global_hero_data" ) +require( GetScriptDirectory().."/modifiers" ) + function setHeroVar(var, value) local bot = GetBot() gHeroVar.SetVar(bot:GetPlayerID(), var, value) @@ -24,102 +26,160 @@ local abilityW = "" local abilityE = "" local abilityR = "" -function UseQ(bot) - if not abilityQ:IsFullyCastable() then - return false; - end; - - local daggerCastRange = abilityQ:GetCastRange(); - local daggerDamage = 65 + abilityQ:GetSpecialValueInt("attack_factor_tooltip") / 100 * bot:GetAttackDamage(); --Add abilityQ:GetBaseDamage() instead of 65 (patches ruin everything) - local inRangeEnemyCreeps = gHeroVar.GetNearbyEnemyCreep(bot, daggerCastRange); - local inRangeEnemyHeroes = gHeroVar.GetNearbyEnemies(bot, daggerCastRange); - local creepTarget, _ = utils.GetWeakestCreep(inRangeEnemyCreeps); - local scariestHeroTarget = nil; +local AttackRange = 0 +local ManaPerc = 0.0 +local HealthPerc = 0.0 +local modeName = nil + +function ConsiderQ() + local bot = GetBot() - if (#inRangeEnemyHeroes > 0) then - if (#inRangeEnemyHeroes > 1) then - table.sort(inRangeEnemyHeroes, function(a,b) return a:GetRawOffensivePower() > b:GetRawOffensivePower() end); - end; - scariestHeroTarget = inRangeEnemyHeroes[1]; - end; + if not abilityQ:IsFullyCastable() then + return BOT_ACTION_DESIRE_NONE, nil + end + + local daggerCastRange = abilityQ:GetCastRange() + local daggerDamage = abilityQ:GetSpecialValueInt("base_damage") + abilityQ:GetSpecialValueInt("attack_factor_tooltip") / 100 * bot:GetAttackDamage() - --Code for lasthitting creeps as my first try - --Need to check if there is an actual creep with the lowest health - if (creepTarget ~= nil) then - local trueDaggerDamage = creepTarget:GetActualIncomingDamage(daggerDamage, DAMAGE_TYPE_PHYSICAL); - if (creepTarget:GetHealth() <= trueDaggerDamage) then - gHeroVar.HeroUseAbilityOnEntity(bot, abilityQ, creepTarget); - return true; - end; - end; + -- Try to kill enemy hero + local WeakestEnemy, HeroHealth = utils.GetWeakestHero(bot, daggerCastRange) + if modeName ~= "retreat" or (modeName == "retreat" and bot.SelfRef:getCurrentModeValue() < BOT_MODE_DESIRE_VERYHIGH) then + if utils.ValidTarget(WeakestEnemy) then + if not modifiers.IsPhysicalImmune(WeakestEnemy) then + if HeroHealth <= WeakestEnemy:GetActualIncomingDamage(daggerDamage, DAMAGE_TYPE_PHYSICAL) then + return BOT_ACTION_DESIRE_HIGH, WeakestEnemy + end + end + end + end - --Code for harassing enemy heroes as my second try - --Need to check if there is an actual hero scary hero within dagger range - if (scariestHeroTarget ~= nil) then - if (not utils.IsTargetMagicImmune(scariestHeroTarget)) then - gHeroVar.HeroUseAbilityOnEntity(bot, abilityQ, scariestHeroTarget); - return true; - end; - end; + -- farming/laning + if modeName == "jungling" or modeName == "laning" then + if ManaPerc > 0.25 then + local eCreep = gHeroVar.GetNearbyEnemyCreep(bot, daggerCastRange) + local weakestCreep, weakestCreepHealth = utils.GetWeakestCreep(eCreep) + if utils.ValidTarget(weakestCreep) then + local dist = GetUnitToUnitDistance(bot, weakestCreep) + if dist > 1.25*AttackRange then + return BOT_ACTION_DESIRE_LOW, weakestCreep + end + end + + -- in lane harass + if utils.ValidTarget(WeakestEnemy) then + if not modifiers.IsPhysicalImmune(WeakestEnemy) then + return BOT_ACTION_DESIRE_LOW, WeakestEnemy + end + end + end + end -return false; -end; - -function UseW(bot) - if not abilityW:IsFullyCastable() then - return false; - end; - - local phantomStrikeCastRange = abiltyW:GetCastRange(); - local totalAttackDamage = 4 * bot:GetAttackDamage(); -- phantom_assassin_phantom_strike adds 4 very fast attacks - local inRangeEnemyCreeps = gHeroVar.GetNearbyEnemyCreep(bot, phantomStrikeCastRange); - local inRangeEnemyHeroes = gHeroVar.GetNearbyEnemies(bot, phantomStrikeCastRange); - local creepTarget, _ = utils.GetWeakestCreep(inRangeEnemyCreeps); - local scariestHeroTarget = nil; - local modeName = getHeroVar("Self"):getCurrentMode():GetName(); + -- If we're seriously retreating, see if we can land a stun on someone who's damaged us recently + if modeName == "retreat" then + local tableNearbyEnemyHeroes = gHeroVar.GetNearbyEnemies( bot, daggerCastRange ) + for _, npcEnemy in pairs( tableNearbyEnemyHeroes ) do + if bot:WasRecentlyDamagedByHero( npcEnemy, 2.0 ) then + if not modifiers.IsPhysicalImmune( npcEnemy ) then + return BOT_ACTION_DESIRE_MODERATE, npcEnemy + end + end + end + end + + -- If we're going after someone + if modeName == "roam" or modeName == "defendally" or modeName == "fight" then + local npcEnemy = getHeroVar("RoamTarget") + if npcEnemy == nil then npcEnemy = getHeroVar("Target") end + + if utils.ValidTarget(npcEnemy) then + if not utils.IsTargetMagicImmune(npcEnemy) and not utils.IsCrowdControlled(npcEnemy) then + return BOT_ACTION_DESIRE_HIGH, npcEnemy + end + end + end + + return BOT_ACTION_DESIRE_NONE, nil +end +function ConsiderW() + local bot = GetBot() + if not abilityW:IsFullyCastable() then + return BOT_ACTION_DESIRE_NONE, nil + end + + local phantomStrikeCastRange = abilityW:GetCastRange() + local totalAttackDamage = 4 * bot:GetAttackDamage() -- phantom_assassin_phantom_strike adds 4 very fast attacks + + -- Try to kill enemy hero + local WeakestEnemy, HeroHealth = utils.GetWeakestHero(bot, phantomStrikeCastRange + 300) + if modeName ~= "retreat" or (modeName == "retreat" and bot.SelfRef:getCurrentModeValue() < BOT_MODE_DESIRE_VERYHIGH) then + if utils.ValidTarget(WeakestEnemy) then + if not modifiers.IsPhysicalImmune(WeakestEnemy) then + if HeroHealth <= WeakestEnemy:GetActualIncomingDamage(totalAttackDamage, DAMAGE_TYPE_PHYSICAL) then + return BOT_ACTION_DESIRE_HIGH, WeakestEnemy + end + end + end + end + + --phantom_assassin_phantom_strike to roshan + if modeName == "roshan" then + if GetUnitToLocationDistance(bot, utils.ROSHAN) < 600 then + local eCreep = gHeroVar.GetNearbyEnemyCreep(bot, 600) + local roshan = nil + for _, creep in pairs(eCreep) do + if creep:GetUnitName() == "npc_dota_roshan" then + roshan = creep + break + end + end + if utils.ValidTarget(roshan) then + return BOT_ACTION_DESIRE_LOW, roshan + end + end + end + + --phantom_assassin_phantom_strike to farm, pushlane, defendlane + if (modeName == "jungling" and ManaPerc > 0.5) or + (modeName == "defendlane" and ManaPerc > 0.3) or + (modeName == "pushlane" and ManaPerc > 0.25) then + local eCreep = gHeroVar.GetNearbyEnemyCreep(bot, phantomStrikeCastRange) + table.sort(eCreep, function(n1,n2) return n1:GetHealth() > n2:GetHealth() end) + if utils.ValidTarget(eCreep[1]) then + return BOT_ACTION_DESIRE_LOW, eCreep[1] + end + end - if (#inRangeEnemyHeroes > 0) then - if (#inRangeEnemyHeroes > 1) then - table.sort(inRangeEnemyHeroes, function(a,b) return a:GetRawOffensivePower() > b:GetRawOffensivePower() end); - end; - scariestHeroTarget = inRangeEnemyHeroes[1]; - end; + -- If we're going after someone + if modeName == "roam" or modeName == "defendally" or modeName == "fight" then + local npcEnemy = getHeroVar("RoamTarget") + if npcEnemy == nil then npcEnemy = getHeroVar("Target") end + + if utils.ValidTarget(npcEnemy) and not modifiers.IsPhysicalImmune(npcEnemy) then + return BOT_ACTION_DESIRE_MODERATE, npcEnemy + end + end - --phantom_assassin_phantom_strike to kill - --Need to check if there is an actual hero scary hero within phantom_assassin_phantom_strike range - if (scariestHeroTarget ~= nil) then - if (not utils.IsTargetMagicImmune(scariestHeroTarget)) then - local trueTotalAttackDamage = scariestHeroTarget:GetActualIncomingDamage(totalAttackDamage, DAMAGE_TYPE_PHYSICAL); - if (scariestHeroTarget:GetHealth() <= trueTotalAttackDamage) then - gHeroVar.HeroUseAbilityOnEntity(bot, abilityW, scariestHeroTarget); - return true; - end; - end; - end; - - --phantom_assassin_phantom_strike to roshan - - --phantom_assassin_phantom_strike to farm - if (modeName == "jungling") then - if (creepTarget ~= nil) then - if (not utils.IsTargetMagicImmune(creepTarget)) then - gHeroVar.HeroUseAbilityOnEntity(bot, abilityW, creepTarget); - return true; - end; - end; - end; - --phantom_assassin_phantom_strike to escape - -return false; -end; + --phantom_assassin_phantom_strike to escape + if modeName == "retreat" or modeName == "shrine" then + local nearAllies = gHeroVar.GetNearbyAllies(bot, phantomStrikeCastRange + 100) + local nearAlliedCreep = gHeroVar.GetNearbyAlliedCreep(bot, phantomStrikeCastRange + 100) + local combinedList = { unpack(nearAllies), unpack(nearAlliedCreep) } + if #combinedList > 0 then + table.sort(combinedList, function(n1,n2) return n1:DistanceFromFountain() < n2:DistanceFromFountain() end) + return BOT_ACTION_DESIRE_HIGH, combinedList[1] + end + end + + return BOT_ACTION_DESIRE_NONE, nil +end function genericAbility:AbilityUsageThink(bot) -- Check if we're already using an ability if utils.IsBusy(bot) then return true end - + -- Check to see if we are CC'ed if utils.IsUnableToCast(bot) then return false end @@ -127,9 +187,26 @@ function genericAbility:AbilityUsageThink(bot) if abilityW == "" then abilityW = bot:GetAbilityByName( "phantom_assassin_phantom_strike" ) end if abilityE == "" then abilityE = bot:GetAbilityByName( "phantom_assassin_blur" ) end if abilityR == "" then abilityR = bot:GetAbilityByName( "phantom_assassin_coup_de_grace" ) end + + AttackRange = bot:GetAttackRange() + bot:GetBoundingRadius() + ManaPerc = bot:GetMana()/bot:GetMaxMana() + HealthPerc = bot:GetHealth()/bot:GetMaxHealth() + modeName = bot.SelfRef:getCurrentMode():GetName() -- WRITE CODE HERE -- - if UseQ(bot) then return true end + -- Consider using each ability + local castQDesire, castQTarget = ConsiderQ() + local castWDesire, castWTarget = ConsiderW() + + if castWDesire > 0 and castWDesire > castQDesire then + gHeroVar.HeroUseAbilityOnEntity(bot, abilityW, castWTarget) + return true + end + + if castQDesire > 0 then + gHeroVar.HeroUseAbilityOnEntity(bot, abilityQ, castQTarget) + return true + end return false end @@ -144,17 +221,17 @@ function genericAbility:nukeDamage( bot, enemy ) local stunTime = 0 local slowTime = 0 local engageDist = 10000 - + -- WRITE CODE HERE -- - + return dmgTotal, comboQueue, castTime, stunTime, slowTime, engageDist end function genericAbility:queueNuke(bot, enemy, castQueue, engageDist) if not utils.ValidTarget(enemy) then return false end - + -- WRITE CODE HERE -- - + return false end diff --git a/abilityUse/abilityUse_spirit_breaker.lua b/abilityUse/abilityUse_spirit_breaker.lua index f3f1dbd..dbaa904 100644 --- a/abilityUse/abilityUse_spirit_breaker.lua +++ b/abilityUse/abilityUse_spirit_breaker.lua @@ -156,7 +156,7 @@ function ConsiderQ() -- Mode based usage -------------------------------------- -- If we're retreating, see if we can run to another safe lane - if modeName == "retreat" then + if modeName == "retreat" or modeName == "shrine" then if bot:WasRecentlyDamagedByAnyHero( 2.0 ) then for _, npcAlly in pairs(GetUnitList(UNIT_LIST_ALLIED_HEROES)) do if npcAlly:IsAlive() then @@ -203,7 +203,7 @@ function ConsiderW() -- Mode based usage -------------------------------------- -- If we're retreating - if modeName == "retreat" then + if modeName == "retreat" or modeName == "shrine" then if bot:WasRecentlyDamagedByAnyHero( 2.0 ) then return BOT_ACTION_DESIRE_HIGH end @@ -263,7 +263,7 @@ function ConsiderR() -- Mode based usage -------------------------------------- -- If we're retreating, see if we can land a stun on someone who's damaged us recently - if modeName == "retreat" then + if modeName == "retreat" or modeName == "shrine" then for _, npcEnemy in pairs( enemies ) do if bot:WasRecentlyDamagedByHero( npcEnemy, 2.0 ) then if not utils.IsTargetMagicImmune( npcEnemy ) and not utils.IsCrowdControlled(npcEnemy) and diff --git a/abilityUse/abilityUse_venomancer.lua b/abilityUse/abilityUse_venomancer.lua index 96dde6f..7208e49 100644 --- a/abilityUse/abilityUse_venomancer.lua +++ b/abilityUse/abilityUse_venomancer.lua @@ -140,7 +140,7 @@ function ConsiderE() local enemies = gHeroVar.GetNearbyEnemies( bot, 1200 ) -- if I'm retreating - if modeName == "retreat" then + if modeName == "retreat" or modeName == "shrine" then if #enemies >= 1 or bot:WasRecentlyDamagedByAnyHero(5.0) then return BOT_ACTION_DESIRE_MODERATE, bot:GetLocation() + RandomVector( RandomInt(0, CastRange) ) end diff --git a/buildings_status.lua b/buildings_status.lua index bdfea63..2bcea67 100644 --- a/buildings_status.lua +++ b/buildings_status.lua @@ -94,6 +94,8 @@ local function Initialize() tableBuildings[TEAM_DIRE][i].LastSeenHealth = health tableBuildings[TEAM_DIRE][i].Vector = pos_dire end + + --printBuildings() end function Update(forceUpdate) @@ -185,11 +187,11 @@ end function printBuildings() print("Buildings Radiant") for i, building in pairs(tableBuildings[TEAM_RADIANT]) do - print(i, building.LastSeenHealth) + print(i, building.LastSeenHealth, building.Vector) end print("Buildings Dire") for i, building in pairs(tableBuildings[TEAM_DIRE]) do - print(i, building.LastSeenHealth) + print(i, building.LastSeenHealth, building.Vector) end end diff --git a/decision.lua b/decision.lua index 61a00d8..5f51aa8 100644 --- a/decision.lua +++ b/decision.lua @@ -307,7 +307,7 @@ function X:AnalyzeLanes(nLane) end function X:DoChangeLane(bot) - local listBuildings = global_game_state.GetLatestVulnerableEnemyBuildings() + local listBuildings = buildings_status.GetStandingBuildingIDs(utils.GetOtherTeam()) local nLane = {} -- check Tier 1 towers @@ -329,13 +329,9 @@ function X:DoChangeLane(bot) end -- check Tier 3 towers & buildings - local topBuildings = GetVulnerableBuildingIDs(utils.GetOtherTeam(), LANE_TOP) - local midBuildings = GetVulnerableBuildingIDs(utils.GetOtherTeam(), LANE_MID) - local botBuildings = GetVulnerableBuildingIDs(utils.GetOtherTeam(), LANE_BOT) - - if utils.InTable(listBuildings, 3) or utils.InTable(topBuildings, 12) or utils.InTable(topBuildings, 13) then table.insert(nLane, LANE_TOP) end - if utils.InTable(listBuildings, 6) or utils.InTable(midBuildings, 14) or utils.InTable(midBuildings, 15) then table.insert(nLane, LANE_MID) end - if utils.InTable(listBuildings, 9) or utils.InTable(botBuildings, 16) or utils.InTable(botBuildings, 17) then table.insert(nLane, LANE_BOT) end + if utils.InTable(listBuildings, 3) or utils.InTable(listBuildings, 12) or utils.InTable(listBuildings, 13) then table.insert(nLane, LANE_TOP) end + if utils.InTable(listBuildings, 6) or utils.InTable(listBuildings, 14) or utils.InTable(listBuildings, 15) then table.insert(nLane, LANE_MID) end + if utils.InTable(listBuildings, 9) or utils.InTable(listBuildings, 16) or utils.InTable(listBuildings, 17) then table.insert(nLane, LANE_BOT) end -- if we have found a standing Tier 3 tower, end if #nLane > 0 then return self:AnalyzeLanes(nLane) diff --git a/hero_selection.lua b/hero_selection.lua index 7f90175..434a5db 100644 --- a/hero_selection.lua +++ b/hero_selection.lua @@ -7,7 +7,7 @@ local utils = require( GetScriptDirectory().."/utility" ) local Pos_1_Pool = { "npc_dota_hero_drow_ranger", - --"npc_dota_hero_phantom_assassin" + "npc_dota_hero_phantom_assassin" } local Pos_2_Pool = {