Commit 688807e9 authored by JoyJ's avatar JoyJ

fix underlord and life stealer

parent 7d2982ba
...@@ -102,6 +102,9 @@ local castWDesire, castWLocation ...@@ -102,6 +102,9 @@ local castWDesire, castWLocation
local castEDesire, castETarget local castEDesire, castETarget
local castRDesire, castRLocation local castRDesire, castRLocation
local lastWLocation = nil
local lastWTime = 0
local nKeepMana, nMP, nHP, nLV, hEnemyList, hAllyList, botTarget, sMotive local nKeepMana, nMP, nHP, nLV, hEnemyList, hAllyList, botTarget, sMotive
local aetherRange = 0 local aetherRange = 0
...@@ -142,6 +145,10 @@ function X.SkillsComplement() ...@@ -142,6 +145,10 @@ function X.SkillsComplement()
J.SetQueuePtToINT( bot, true ) J.SetQueuePtToINT( bot, true )
bot:ActionQueue_UseAbilityOnLocation( abilityW, castWLocation ) bot:ActionQueue_UseAbilityOnLocation( abilityW, castWLocation )
lastWLocation = castWLocation
lastWTime = DotaTime()
return return
end end
...@@ -156,6 +163,15 @@ function X.SkillsComplement() ...@@ -156,6 +163,15 @@ function X.SkillsComplement()
return return
end end
if lastWLocation~=nil and DotaTime()-lastWTime >= 1.5 then
local itemGungir = J.IsItemAvailable("item_gungir")
if itemGungir and itemGungir:IsFullyCastable() then
bot:ActionQueue_UseAbilityOnLocation( itemGungir, lastWLocation )
end
lastWTime = 0
lastWLocation = nil
end
end end
...@@ -447,7 +463,7 @@ function X.ConsiderR() ...@@ -447,7 +463,7 @@ function X.ConsiderR()
if botAmount.distance > nMinTPDistance if botAmount.distance > nMinTPDistance
or botAmount.amount < laneFront / 5 or botAmount.amount < laneFront / 5
then then
tpLoc = X.GetDefendTPLocation( nDefendLane ) tpLoc = GetLaneFrontLocation( GetTeam(), nDefendLane, -950 )
end end
if tpLoc ~= nil if tpLoc ~= nil
...@@ -473,7 +489,7 @@ function X.ConsiderR() ...@@ -473,7 +489,7 @@ function X.ConsiderR()
if botAmount.distance > nMinTPDistance if botAmount.distance > nMinTPDistance
or botAmount.amount < laneFront / 5 or botAmount.amount < laneFront / 5
then then
tpLoc = X.GetPushTPLocation( nPushLane ) tpLoc = GetLaneFrontLocation( GetTeam(), nPushLane, -950 )
end end
if tpLoc ~= nil if tpLoc ~= nil
...@@ -496,10 +512,8 @@ function X.ConsiderR() ...@@ -496,10 +512,8 @@ function X.ConsiderR()
and target:IsHero() and target:IsHero()
and GetUnitToUnitDistance( bot, target ) > nMinTPDistance and GetUnitToUnitDistance( bot, target ) > nMinTPDistance
then then
local bestTpLoc = J.GetNearbyLocationToTp( target:GetLocation() ) local bestTpLoc = target:GetLocation()
if bestTpLoc ~= nil if GetUnitToLocationDistance( bot, bestTpLoc ) > nMinTPDistance - 800 then
and GetUnitToLocationDistance( bot, bestTpLoc ) > nMinTPDistance - 800
then
tpLoc = bestTpLoc tpLoc = bestTpLoc
end end
end end
...@@ -538,12 +552,11 @@ function X.ConsiderR() ...@@ -538,12 +552,11 @@ function X.ConsiderR()
end end
--第二种情况:有多个敌人但可以卡视野TP --第二种情况:有多个敌人但可以强行TP
local nAttackAllyList = bot:GetNearbyHeroes( 1500, false, BOT_MODE_ATTACK ) local nAttackAllyList = bot:GetNearbyHeroes( 1500, false, BOT_MODE_ATTACK )
if botHP < ( 0.15 + 0.24 * nEnemyCount ) if botHP < ( 0.15 + 0.24 * nEnemyCount )
and #nAttackAllyList == 0 and #nAttackAllyList == 0
and bot:WasRecentlyDamagedByAnyHero( 6.0 ) and bot:WasRecentlyDamagedByAnyHero( 6.0 )
and X.CanJuke()
and nEnemyCount <= ( botHP < 0.4 and 2 or 3 ) and nEnemyCount <= ( botHP < 0.4 and 2 or 3 )
and nAllyCount <= 2 and nAllyCount <= 2
and itemFlask == nil and itemFlask == nil
...@@ -555,7 +568,7 @@ function X.ConsiderR() ...@@ -555,7 +568,7 @@ function X.ConsiderR()
and bot:DistanceFromFountain() > nMinTPDistance - 600 and bot:DistanceFromFountain() > nMinTPDistance - 600
then then
tpLoc = J.GetTeamFountain() tpLoc = J.GetTeamFountain()
sCastMotive = 'R-撤退-尝试卡视野跑路' sCastMotive = 'R-撤退-尝试强行跑路'
return BOT_ACTION_DESIRE_HIGH, tpLoc, sCastMotive return BOT_ACTION_DESIRE_HIGH, tpLoc, sCastMotive
end end
...@@ -564,7 +577,6 @@ function X.ConsiderR() ...@@ -564,7 +577,6 @@ function X.ConsiderR()
if ( botHP < 0.34 or botHP + botMP < 0.43 ) if ( botHP < 0.34 or botHP + botMP < 0.43 )
and #nAttackAllyList == 0 and #nAttackAllyList == 0
and bot:GetLevel() >= 9 and bot:GetLevel() >= 9
and X.CanJuke()
and nEnemyCount <= 1 and nEnemyCount <= 1
and nAllyCount <= 2 and nAllyCount <= 2
and itemFlask == nil and itemFlask == nil
...@@ -590,7 +602,6 @@ function X.ConsiderR() ...@@ -590,7 +602,6 @@ function X.ConsiderR()
--TP发育带线 --TP发育带线
if bot:GetLevel() >= 10 if bot:GetLevel() >= 10
and nMode ~= BOT_MODE_ROSHAN and nMode ~= BOT_MODE_ROSHAN
and not X.IsBaseTowerDestroyed()
and J.GetAllyCount( bot, 1600 ) <= 2 and J.GetAllyCount( bot, 1600 ) <= 2
and J.Role.ShouldTpToFarm() and J.Role.ShouldTpToFarm()
and not J.Role.IsAllyHaveAegis() and not J.Role.IsAllyHaveAegis()
...@@ -627,7 +638,6 @@ function X.ConsiderR() ...@@ -627,7 +638,6 @@ function X.ConsiderR()
and nMode ~= BOT_MODE_ROSHAN and nMode ~= BOT_MODE_ROSHAN
and nMode ~= BOT_MODE_ATTACK and nMode ~= BOT_MODE_ATTACK
and ( botTarget == nil or not botTarget:IsHero() ) and ( botTarget == nil or not botTarget:IsHero() )
--and J.GetAllyCount( bot, 1600 ) <= 3 --守护遗迹bug
then then
local nNearEnemyList = bot:GetNearbyHeroes( 1400, true, BOT_MODE_NONE ) local nNearEnemyList = bot:GetNearbyHeroes( 1400, true, BOT_MODE_NONE )
local nTeamFightLocation = J.GetTeamFightLocation( bot ) local nTeamFightLocation = J.GetTeamFightLocation( bot )
...@@ -690,8 +700,7 @@ function X.ConsiderR() ...@@ -690,8 +700,7 @@ function X.ConsiderR()
and bot:GetUnitName() ~= 'npc_dota_hero_slark' and bot:GetUnitName() ~= 'npc_dota_hero_slark'
and not bot:HasModifier( "modifier_arc_warden_tempest_double" ) and not bot:HasModifier( "modifier_arc_warden_tempest_double" )
then then
if X.CanJuke() if bot:DistanceFromFountain() > nMinTPDistance + 200
and bot:DistanceFromFountain() > nMinTPDistance + 200
and nEnemyCount <= 1 and nAllyCount <= 1 and nEnemyCount <= 1 and nAllyCount <= 1
and J.GetProperTarget( bot ) == nil and J.GetProperTarget( bot ) == nil
and itemFlask == nil and itemFlask == nil
...@@ -721,8 +730,7 @@ function X.ConsiderR() ...@@ -721,8 +730,7 @@ function X.ConsiderR()
and J.GetModifierTime( bot, "modifier_bloodseeker_rupture" ) >= 3.1 and J.GetModifierTime( bot, "modifier_bloodseeker_rupture" ) >= 3.1
then then
local nAllyCount = bot:GetNearbyHeroes( 1000, false, BOT_MODE_NONE ) local nAllyCount = bot:GetNearbyHeroes( 1000, false, BOT_MODE_NONE )
if #nAllyCount <= 1 and X.CanJuke() if #nAllyCount <= 1 then
then
tpLoc = J.GetTeamFountain() tpLoc = J.GetTeamFountain()
end end
...@@ -734,22 +742,6 @@ function X.ConsiderR() ...@@ -734,22 +742,6 @@ function X.ConsiderR()
end end
end end
--处理特殊情况一
if X.IsFarmingAlways( bot )
then
tpLoc = GetAncient( GetTeam() ):GetLocation()
sCastMotive = 'R-停止刷钱'
return BOT_ACTION_DESIRE_HIGH, tpLoc, sCastMotive
end
--处理特殊情况二
if J.IsStuck( bot ) --and nEnemyCount == 0
then
tpLoc = GetAncient( GetTeam() ):GetLocation()
sCastMotive = 'R-尝试解决卡住问题'
return BOT_ACTION_DESIRE_HIGH, tpLoc, sCastMotive
end
if J.Role.ShouldTpToDefend() if J.Role.ShouldTpToDefend()
and bot:DistanceFromFountain() > 3800 and bot:DistanceFromFountain() > 3800
then then
......
...@@ -161,7 +161,7 @@ function X.SkillsComplement() ...@@ -161,7 +161,7 @@ function X.SkillsComplement()
end end
end end
function ConsiderQ() function X.ConsiderQ()
if not abilityQ:IsFullyCastable() then return BOT_ACTION_DESIRE_NONE end if not abilityQ:IsFullyCastable() then return BOT_ACTION_DESIRE_NONE end
...@@ -179,8 +179,7 @@ function ConsiderQ() ...@@ -179,8 +179,7 @@ function ConsiderQ()
and not bot:HasModifier( 'modifier_antimage_spell_shield' ) and not bot:HasModifier( 'modifier_antimage_spell_shield' )
and ( J.IsGoingOnSomeone( bot ) or J.IsRetreating( bot ) ) and ( J.IsGoingOnSomeone( bot ) or J.IsRetreating( bot ) )
then then
if bot:IsRooted() if bot:IsRooted() then
then
sCastMotive = '解缠绕' sCastMotive = '解缠绕'
return BOT_ACTION_DESIRE_HIGH, sCastMotive return BOT_ACTION_DESIRE_HIGH, sCastMotive
end end
...@@ -209,6 +208,11 @@ function ConsiderQ() ...@@ -209,6 +208,11 @@ function ConsiderQ()
return BOT_ACTION_DESIRE_HIGH, sCastMotive return BOT_ACTION_DESIRE_HIGH, sCastMotive
end end
if J.IsRetreating(bot) and bot:GetActiveMode()~=BOT_MODE_FARM then
sCastMotive = '撤退魔免'
return BOT_ACTION_DESIRE_HIGH, sCastMotive
end
end end
return BOT_ACTION_DESIRE_NONE return BOT_ACTION_DESIRE_NONE
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment