Commit f2ecbf86 authored by JoyJ's avatar JoyJ

update legion commander

parent f9c0f12d
......@@ -10,7 +10,7 @@ local sOutfitType = J.Item.GetOutfitType( bot )
local tTalentTreeList = {
['t25'] = {10, 0},
['t20'] = {0, 10},
['t20'] = {10, 0},
['t15'] = {10, 0},
['t10'] = {10, 0},
}
......@@ -28,7 +28,7 @@ local tOutFitList = {}
tOutFitList['outfit_priest'] = {
"item_mage_outfit",
-- "item_glimmer_cape",
"item_glimmer_cape",
-- "item_rod_of_atos",
"item_aghanims_shard",
"item_holy_locket",
......
......@@ -246,13 +246,22 @@ function X.ConsiderQ()
local nSkillLV = abilityQ:GetLevel()
local nCastRange = 600
local nRadius = 600
local nCastPoint = abilityQ:GetCastPoint()
local nManaCost = abilityQ:GetManaCost()
local nDamage = abilityQ:GetSpecialValueInt( 'damage' ) * 2
local nInRangeEnemyList = bot:GetNearbyHeroes( nCastRange, true, BOT_MODE_NONE )
local nInRangeEnemyCreepList = bot:GetNearbyLaneCreeps(nCastRange, true)
nInRangeEnemyCreepList = J.MergeGroup(nInRangeEnemyCreepList,bot:GetNearbyNeutralCreeps(nCastRange))
local t=bot:GetTalent('special_bonus_unique_legion_commander_4')
local damagePerHero = abilityQ:GetVal('damage_per_hero')
if t then damagePerHero = damagePerHero + 75 end
local nDamage = abilityQ:GetVal('damage')
+ abilityQ:GetVal('damage_per_unit') * #nInRangeEnemyCreepList
+ damagePerHero * #nInRangeEnemyList
local nDamageType = DAMAGE_TYPE_MAGICAL
local nInRangeEnemyList = J.GetAroundEnemyHeroList( nCastRange )
local nInBonusEnemyList = J.GetAroundEnemyHeroList( nCastRange + 200 )
local hCastTarget = nil
local sCastMotive = nil
......@@ -264,85 +273,21 @@ function X.ConsiderQ()
and J.WillMagicKillTarget( bot, npcEnemy, nDamage, nCastPoint )
then
hCastTarget = npcEnemy:GetLocation()
return BOT_ACTION_DESIRE_HIGH, hCastTarget, 'Q-击杀'..J.Chat.GetNormName( npcEnemy )
return BOT_ACTION_DESIRE_HIGH, 'Q-击杀'..J.Chat.GetNormName( npcEnemy )
end
end
--消耗
local nCanHurtEnemyAoE = bot:FindAoELocation( true, true, bot:GetLocation(), 10, 590, 0, 0 )
if nCanHurtEnemyAoE.count >= 3
then
if (#nInRangeEnemyCreepList + #nInRangeEnemyList * 2) >= 4 then
hCastTarget = nCanHurtEnemyAoE.targetloc
return BOT_ACTION_DESIRE_HIGH, hCastTarget, 'Q-消耗'
end
--对线消耗或补刀
if J.IsLaning( bot )
then
--对线消耗
local nAoeLoc = J.GetAoeEnemyHeroLocation( bot, 50, 450, 2 )
if nAoeLoc ~= nil and nMP > 0.38
then
hCastTarget = nAoeLoc
return BOT_ACTION_DESIRE_HIGH, hCastTarget, 'Q-对线消耗'
end
end
--团战
if J.IsInTeamFight( bot, 1200 )
then
local nAoeLoc = J.GetAoeEnemyHeroLocation( bot, 49, 499, 2 )
if nAoeLoc ~= nil
then
hCastTarget = nAoeLoc
return BOT_ACTION_DESIRE_HIGH, hCastTarget, 'Q-团战'
end
end
--打架时先手
if J.IsGoingOnSomeone( bot )
then
if J.IsValidHero( botTarget )
and J.CanCastOnNonMagicImmune( botTarget )
and J.IsInRange( botTarget, bot, nCastRange -80 )
then
if nSkillLV >= 2 or nMP > 0.68 or J.GetHP( botTarget ) < 0.38
then
hCastTarget = J.GetCastLocation( bot, botTarget, 10, 490 )
if hCastTarget ~= nil
then
return BOT_ACTION_DESIRE_HIGH, hCastTarget, 'Q-攻击'..J.Chat.GetNormName( botTarget )
end
end
end
return BOT_ACTION_DESIRE_HIGH, 'Q-消耗'
end
--撤退前加速
if J.IsRetreating( bot )
and not bot:HasModifier( 'modifier_legion_commander_overwhelming_odds' )
then
for _, npcEnemy in pairs( nInRangeEnemyList )
do
if J.IsValid( npcEnemy )
and bot:WasRecentlyDamagedByHero( npcEnemy, 5.0 )
and J.CanCastOnNonMagicImmune( npcEnemy )
--and bot:IsFacingLocation( npcEnemy:GetLocation(), 40 )
then
hCastTarget = npcEnemy:GetLocation()
return BOT_ACTION_DESIRE_HIGH, hCastTarget, 'Q-撤退'..J.Chat.GetNormName( npcEnemy )
end
end
end
--打钱
if J.IsFarming( bot )
and nSkillLV >= 3
and J.IsAllowedToSpam( bot, nManaCost * 0.25 )
and J.IsAllowedToSpam( bot, nManaCost )
then
if J.IsValid( botTarget )
and botTarget:GetTeam() == TEAM_NEUTRAL
......@@ -350,11 +295,8 @@ function X.ConsiderQ()
and ( botTarget:GetMagicResist() < 0.4 or nMP > 0.9 )
then
local nShouldHurtCount = nMP > 0.55 and 3 or 4
local locationAoE = bot:FindAoELocation( true, false, bot:GetLocation(), 40, 400, 0, 0 )
if ( locationAoE.count >= nShouldHurtCount )
then
hCastTarget = locationAoE.targetloc
return BOT_ACTION_DESIRE_HIGH, hCastTarget, "Q-打钱"..locationAoE.count
if #nInRangeEnemyCreepList >= nShouldHurtCount then
return BOT_ACTION_DESIRE_HIGH,"Q-打钱"
end
end
end
......@@ -366,18 +308,12 @@ function X.ConsiderQ()
and nSkillLV >= 2 and DotaTime() > 6 * 60
and #hAllyList <= 3 and #hEnemyList == 0
then
local laneCreepList = bot:GetNearbyLaneCreeps( 1400, true )
if #laneCreepList >= 4
local laneCreepList = bot:GetNearbyLaneCreeps( nCastRange, true )
if #laneCreepList >= 3
and J.IsValid( laneCreepList[1] )
and not laneCreepList[1]:HasModifier( "modifier_fountain_glyph" )
then
and not laneCreepList[1]:HasModifier( "modifier_fountain_glyph" ) then
local locationAoEHurt = bot:FindAoELocation( true, false, bot:GetLocation(), 30, 400, 0, 0 )
if locationAoEHurt.count >= 4
then
hCastTarget = locationAoEHurt.targetloc
return BOT_ACTION_DESIRE_HIGH, hCastTarget, "Q-带线"..locationAoEHurt.count
end
return BOT_ACTION_DESIRE_HIGH, "Q-带线"
end
end
......
......@@ -55,9 +55,8 @@ _G.FilterTable = function(t,filter)
end
return newGroup
end
function CDOTA_Bot_Script.IsAlly(unit)
return GetBot():GetTeam() == unit:GetTeam()
return unit:CanBeSeen() and GetBot():GetTeam() == unit:GetTeam()
end
function CDOTA_Bot_Script.GetHealthPercent(unit)
return unit:GetHealth() / unit:GetMaxHealth() * 100.0
......@@ -108,6 +107,11 @@ end
function CDOTA_Bot_Script.GetAllAttributes(unit)
return unit:GetStrength() + unit:GetAgility() + unit:GetIntellect()
end
function CDOTA_Bot_Script.GetTalent(unit, talent)
if not unit:CanBeSeen() or not unit:IsAlly() then return nil end
local t=unit:GetAbilityByName(talent)
if t and t:IsTrained() then return t end
end
function CDOTABaseAbility_BotScript.GetVal(ability, name)
local f=ability:GetSpecialValueFloat(name)
if math.abs(f)<0.0001 then
......
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