Commit a4e4eb51 authored by JoyJ's avatar JoyJ

fixes

parent e2bc7f9b
...@@ -301,6 +301,7 @@ function X.ConsiderWM() ...@@ -301,6 +301,7 @@ function X.ConsiderWM()
local nCastRange = abilityW:GetCastRange() local nCastRange = abilityW:GetCastRange()
local nCastPoint = abilityW:GetCastPoint() local nCastPoint = abilityW:GetCastPoint()
local nRadius = abilityW:GetAOERadius() local nRadius = abilityW:GetAOERadius()
local nTargetLocation = nil
local nEnemysHeroesInView = hEnemyList local nEnemysHeroesInView = hEnemyList
local nEnemysHeroesNearBy = bot:GetNearbyHeroes( 500, true, BOT_MODE_NONE ) local nEnemysHeroesNearBy = bot:GetNearbyHeroes( 500, true, BOT_MODE_NONE )
......
...@@ -143,19 +143,12 @@ function X.SkillsComplement() ...@@ -143,19 +143,12 @@ function X.SkillsComplement()
hEnemyList = bot:GetNearbyHeroes( 1600, true, BOT_MODE_NONE ) hEnemyList = bot:GetNearbyHeroes( 1600, true, BOT_MODE_NONE )
hAllyList = J.GetAlliesNearLoc( bot:GetLocation(), 1600 ) hAllyList = J.GetAlliesNearLoc( bot:GetLocation(), 1600 )
--计算天赋可能带来的通用变化 --计算天赋可能带来的通用变化
local aether = J.IsItemAvailable( "item_aether_lens" ) local aether = J.IsItemAvailable( "item_aether_lens" )
if aether ~= nil then aetherRange = 250 end if aether ~= nil then aetherRange = 250 end
--无论如何,大招期间绝不逃跑
castRDesire, sMotive = X.ConsiderR() if bot:HasModifier('modifier_muerta_pierce_the_veil_buff') then
if castRDesire > 0 then
J.SetReportMotive( bDebugMode, sMotive )
J.SetQueuePtToINT( bot, true )
bot:Action_UseAbility( abilityR )
--释放BKB --释放BKB
local abilityBKB = J.IsItemAvailable( "item_black_king_bar" ) local abilityBKB = J.IsItemAvailable( "item_black_king_bar" )
...@@ -175,6 +168,22 @@ function X.SkillsComplement() ...@@ -175,6 +168,22 @@ function X.SkillsComplement()
bot:ActionQueue_UseAbility( abilityMoM ) bot:ActionQueue_UseAbility( abilityMoM )
end end
local attackList = J.FilterGroup(hEnemyList,function(u)
return not u:IsMagicImmune() and GetUnitToUnitDistance(bot,u)<=bot:GetAttackRange()+200
end)
if #attackList>0 then
bot:ActionQueue_AttackUnit(attackList[1],true)
return
end
end
castRDesire, sMotive = X.ConsiderR()
if castRDesire > 0 then
J.SetReportMotive( bDebugMode, sMotive )
J.SetQueuePtToINT( bot, true )
bot:ActionQueue_UseAbility( abilityR )
return return
end end
...@@ -185,7 +194,7 @@ function X.SkillsComplement() ...@@ -185,7 +194,7 @@ function X.SkillsComplement()
J.SetQueuePtToINT( bot, true ) J.SetQueuePtToINT( bot, true )
bot:ActionQueue_UseAbilityOnEntity(abilityQ,castQTarget) bot:ActionQueue_UseAbilityOnEntity(abilityQ, castQTarget)
return return
end end
...@@ -226,10 +235,18 @@ function X.ConsiderQ() ...@@ -226,10 +235,18 @@ function X.ConsiderQ()
end end
--团战 --团战
if J.IsInTeamFight( bot, 1200 ) and DotaTime() > 4 * 60 then if J.IsInTeamFight( bot, 1200 ) then
local npcEnemy = J.GetLeastHpUnit(nInRangeEnemyList)
if npcEnemy then
return BOT_ACTION_DESIRE_HIGH, npcEnemy, "Q-团战"..J.Chat.GetNormName( npcEnemy )
end
end
--通常
if nSkillLV>1 and J.IsAllowedToSpam(bot, nManaCost) then
local npcEnemy = J.GetLeastHpUnit(nInRangeEnemyList) local npcEnemy = J.GetLeastHpUnit(nInRangeEnemyList)
if npcEnemy then if npcEnemy then
return BOT_ACTION_DESIRE_HIGH, npcEnemy, "W-团战"..J.Chat.GetNormName( npcEnemy ) return BOT_ACTION_DESIRE_HIGH, npcEnemy, "Q-通常"..J.Chat.GetNormName( npcEnemy )
end end
end end
...@@ -302,8 +319,8 @@ function X.ConsiderW() ...@@ -302,8 +319,8 @@ function X.ConsiderW()
--攻击 --攻击
if J.IsValidHero( botTarget ) if J.IsValidHero( botTarget )
and J.IsInRange( bot, botTarget, nCastRange + nRadius - 200 ) and J.IsInRange( bot, botTarget, nCastRange + nRadius - 200 )
and J.CanCastOnNonMagicImmune( botTarget ) and not botTarget:IsMagicImmune()
and ( J.IsInRange( bot, botTarget, 700 ) or botTarget:IsFacingLocation( bot:GetLocation(), 40 ) ) and ( J.IsInRange( bot, botTarget, nCastRange ) or botTarget:IsFacingLocation( bot:GetLocation(), 40 ) )
and not J.IsDisabled( botTarget ) and not J.IsDisabled( botTarget )
then then
nTargetLocation = J.GetCastLocation( bot, botTarget, nCastRange, nRadius ) nTargetLocation = J.GetCastLocation( bot, botTarget, nCastRange, nRadius )
...@@ -339,6 +356,10 @@ function X.ConsiderR() ...@@ -339,6 +356,10 @@ function X.ConsiderR()
end end
end end
if J.IsRetreating(bot) and bot:WasRecentlyDamagedByAnyHero(2.0) and nHP<0.6 and #hEnemyList>0 then
return BOT_ACTION_DESIRE_HIGH
end
return 0 return 0
end end
......
...@@ -114,6 +114,7 @@ function X.SkillsComplement() ...@@ -114,6 +114,7 @@ function X.SkillsComplement()
nLV = bot:GetLevel() nLV = bot:GetLevel()
hEnemyHeroList = bot:GetNearbyHeroes( 1600, true, BOT_MODE_NONE ) hEnemyHeroList = bot:GetNearbyHeroes( 1600, true, BOT_MODE_NONE )
castRDesire = X.ConsiderR() castRDesire = X.ConsiderR()
if ( castRDesire > 0 ) if ( castRDesire > 0 )
then then
...@@ -148,6 +149,7 @@ function X.SkillsComplement() ...@@ -148,6 +149,7 @@ function X.SkillsComplement()
return return
end end
bot:ActionImmediate_Chat( "CheckD", true )
castDDesire = X.ConsiderD() castDDesire = X.ConsiderD()
if ( castDDesire > 0 ) then if ( castDDesire > 0 ) then
bot:ActionQueue_UseAbility( abilityD ) bot:ActionQueue_UseAbility( abilityD )
...@@ -216,9 +218,8 @@ end ...@@ -216,9 +218,8 @@ end
function X.ConsiderW() function X.ConsiderW()
if not abilityW:IsFullyCastable() or bot:IsRooted() then return BOT_ACTION_DESIRE_NONE end if not abilityW:IsFullyCastable() or bot:IsRooted()
or not bot:HasModifier('modifier_visage_soul_assumption') then return BOT_ACTION_DESIRE_NONE end
if not bot:HasModifier('modifier_visage_soul_assumption') then return end
local nCastRange = abilityW:GetCastRange() local nCastRange = abilityW:GetCastRange()
local nCastPoint = abilityW:GetCastPoint() local nCastPoint = abilityW:GetCastPoint()
...@@ -226,7 +227,7 @@ function X.ConsiderW() ...@@ -226,7 +227,7 @@ function X.ConsiderW()
local nSkillLV = abilityW:GetLevel() local nSkillLV = abilityW:GetLevel()
local nDamage = 70 local nDamage = 70
if nLV > 27 then nDamage=90 end if nLV > 27 then nDamage=90 end
local nSoul = bot:GetModifierStackCount('modifier_visage_soul_assumption') local nSoul = bot:GetModifierStackCount(bot:GetModifierByName( 'modifier_visage_soul_assumption' ))
nDamage = nSoul * nDamage + 20 nDamage = nSoul * nDamage + 20
local nEnemysHeroesInCastRange = bot:GetNearbyHeroes( nCastRange, true, BOT_MODE_NONE ) local nEnemysHeroesInCastRange = bot:GetNearbyHeroes( nCastRange, true, BOT_MODE_NONE )
...@@ -245,8 +246,7 @@ function X.ConsiderW() ...@@ -245,8 +246,7 @@ function X.ConsiderW()
end end
end end
end end
if nSoul < 2 + nSkillLV then return BOT_ACTION_DESIRE_NONE end
if nSoul < 2 + nSkillLV then return end
--追杀 --追杀
if J.IsGoingOnSomeone( bot ) then if J.IsGoingOnSomeone( bot ) then
...@@ -294,7 +294,7 @@ function X.ConsiderR() ...@@ -294,7 +294,7 @@ function X.ConsiderR()
local listFamiliar = GetUnitList(UNIT_LIST_ALLIES) local listFamiliar = GetUnitList(UNIT_LIST_ALLIES)
for _,unit in pairs(listFamiliar) do for _,unit in pairs(listFamiliar) do
if Minion.IsFamiliar(unit:GetUnitName()) then if Minion.IsFamiliar(unit:GetUnitName()) and unit:IsAlive() then
nMaxUnit = nMaxUnit - 1 nMaxUnit = nMaxUnit - 1
end end
end end
......
...@@ -3398,6 +3398,12 @@ function J.GetRandomPointInCircle(center, max, min) ...@@ -3398,6 +3398,12 @@ function J.GetRandomPointInCircle(center, max, min)
return J.GetVectorFromVectorToAngleWithDistance(center, angle, r, nil) return J.GetVectorFromVectorToAngleWithDistance(center, angle, r, nil)
end end
function J.DebugMessage(str,b)
if b then
bot:ActionImmediate_Chat( str, true )
end
end
return J return J
--[[ --[[
......
...@@ -1002,7 +1002,7 @@ function Think() ...@@ -1002,7 +1002,7 @@ function Think()
end end
--if GetTeam() ~= TEAM_DIRE and i == 1 then sSelectHero = "npc_dota_hero_alchemist" end --if GetTeam() ~= TEAM_DIRE and i == 1 then sSelectHero = "npc_dota_hero_alchemist" end
--if GetTeam() ~= TEAM_DIRE and i == 3 then sSelectHero = "npc_dota_hero_centaur" end if GetTeam() ~= TEAM_DIRE and i == 3 then sSelectHero = "npc_dota_hero_muerta" end
-------******************************----------------------------------------------- -------******************************-----------------------------------------------
-- if GetTeam() ~= TEAM_DIRE and i == 2 then sSelectHero = "npc_dota_hero_lina" end -- if GetTeam() ~= TEAM_DIRE and i == 2 then sSelectHero = "npc_dota_hero_lina" end
-- if GetTeam() ~= TEAM_DIRE and i == 1 then sSelectHero = "npc_dota_hero_antimage" end -- if GetTeam() ~= TEAM_DIRE and i == 1 then sSelectHero = "npc_dota_hero_antimage" end
......
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