Commit a4e4eb51 authored by JoyJ's avatar JoyJ

fixes

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