Commit 2e89661a authored by JoyJ's avatar JoyJ

7.33 stuffs

parent 5523aee7
......@@ -285,7 +285,7 @@ function X.ConsiderE()
for _, npcEnemy in pairs( nInBonusEnemyList )
do
if J.IsValid( npcEnemy )
and J.CanCastOnNonMagicImmune( npcEnemy )
and J.CanCastOnMagicImmune( npcEnemy )
and J.CanCastOnTargetAdvanced( npcEnemy )
then
if npcEnemy:IsChanneling()
......@@ -306,7 +306,7 @@ function X.ConsiderE()
for _, npcEnemy in pairs( nInBonusEnemyList )
do
if J.IsValid( npcEnemy )
and J.CanCastOnNonMagicImmune( npcEnemy )
and J.CanCastOnMagicImmune( npcEnemy )
and J.CanCastOnTargetAdvanced( npcEnemy )
and not J.IsDisabled( npcEnemy )
and not npcEnemy:IsDisarmed()
......@@ -329,7 +329,7 @@ function X.ConsiderE()
for _, npcEnemy in pairs( hEnemyList )
do
if J.IsValid( npcEnemy )
and J.CanCastOnNonMagicImmune( npcEnemy )
and J.CanCastOnMagicImmune( npcEnemy )
then
nEnemyCount = nEnemyCount + 1
if J.CanCastOnTargetAdvanced( npcEnemy )
......@@ -366,7 +366,7 @@ function X.ConsiderE()
do
if J.IsValid( npcEnemy )
and npcEnemy:GetPlayerID() ~= botTarget:GetPlayerID()
and J.CanCastOnNonMagicImmune( npcEnemy )
and J.CanCastOnMagicImmune( npcEnemy )
and J.CanCastOnTargetAdvanced( npcEnemy )
and not J.IsDisabled( npcEnemy )
and not npcEnemy:IsDisarmed()
......@@ -382,7 +382,7 @@ function X.ConsiderE()
and J.IsRunning( botTarget )
and bot:IsFacingLocation( botTarget:GetLocation(), 20 )
and not botTarget:IsFacingLocation( bot:GetLocation(), 150 )
and J.CanCastOnNonMagicImmune( botTarget )
and J.CanCastOnMagicImmune( botTarget )
and J.CanCastOnTargetAdvanced( botTarget )
then
local allyList = botTarget:GetNearbyHeroes( 500, true, BOT_MODE_NONE )
......@@ -430,7 +430,7 @@ function X.ConsiderW()
for _, npcEnemy in pairs( nInBonusEnemyList )
do
if J.IsValid( npcEnemy )
and J.CanCastOnNonMagicImmune( npcEnemy )
and J.CanCastOnMagicImmune( npcEnemy )
and J.CanCastOnTargetAdvanced( npcEnemy )
then
if J.WillMagicKillTarget( bot, npcEnemy, nDamage, nCastPoint )
......@@ -458,7 +458,7 @@ function X.ConsiderW()
for _, npcEnemy in pairs( nInRangeEnemyList )
do
if J.IsValid( npcEnemy )
and J.CanCastOnNonMagicImmune( npcEnemy )
and J.CanCastOnMagicImmune( npcEnemy )
and J.CanCastOnTargetAdvanced( npcEnemy )
then
local npcEnemyHealth = npcEnemy:GetHealth()
......@@ -483,7 +483,7 @@ function X.ConsiderW()
if J.IsGoingOnSomeone( bot )
then
if J.IsValidHero( botTarget )
and J.CanCastOnNonMagicImmune( botTarget )
and J.CanCastOnMagicImmune( botTarget )
and J.CanCastOnTargetAdvanced( botTarget )
and J.IsInRange( botTarget, bot, nCastRange + 50 )
then
......@@ -506,7 +506,7 @@ function X.ConsiderW()
for _, npcEnemy in pairs( nInRangeEnemyList )
do
if J.IsValid( npcEnemy )
and J.CanCastOnNonMagicImmune( npcEnemy )
and J.CanCastOnMagicImmune( npcEnemy )
and not J.IsDisabled( npcEnemy )
and not npcEnemy:IsDisarmed()
and bot:IsFacingLocation( npcEnemy:GetLocation(), 45 )
......@@ -524,7 +524,7 @@ function X.ConsiderW()
for _, npcEnemy in pairs( nInRangeEnemyList )
do
if J.IsValid( npcEnemy )
and J.CanCastOnNonMagicImmune( npcEnemy )
and J.CanCastOnMagicImmune( npcEnemy )
and J.CanCastOnTargetAdvanced( npcEnemy )
and ( bot:WasRecentlyDamagedByHero( npcEnemy, 5.0 ) or nLostHealth > nDamage * 2 )
then
......@@ -542,7 +542,7 @@ function X.ConsiderW()
for _, creep in pairs( creepList )
do
if J.IsValid( creep )
and J.CanCastOnNonMagicImmune( creep )
and J.CanCastOnMagicImmune( creep )
then
hCastTarget = creep
sCastMotive = 'W-通过小兵回血'
......@@ -620,7 +620,7 @@ function X.ConsiderW()
for _, npcEnemy in pairs( nInRangeEnemyList )
do
if J.IsValid( npcEnemy )
and J.CanCastOnNonMagicImmune( npcEnemy )
and J.CanCastOnMagicImmune( npcEnemy )
and J.CanCastOnTargetAdvanced( npcEnemy )
then
hCastTarget = npcEnemy
......@@ -660,7 +660,7 @@ function X.ConsiderQ()
then
if J.IsValidHero( botTarget )
and not botTarget:HasModifier( 'modifier_bane_enfeeble' )
and J.CanCastOnNonMagicImmune( botTarget )
and J.CanCastOnMagicImmune( botTarget )
and J.CanCastOnTargetAdvanced( botTarget )
and J.IsInRange( botTarget, bot, nCastRange + 50 )
then
......@@ -676,7 +676,7 @@ function X.ConsiderQ()
do
if J.IsValid( npcEnemy )
and not npcEnemy:HasModifier( 'modifier_bane_enfeeble' )
and J.CanCastOnNonMagicImmune( npcEnemy )
and J.CanCastOnMagicImmune( npcEnemy )
and J.CanCastOnTargetAdvanced( npcEnemy )
then
hCastTarget = npcEnemy
......@@ -716,7 +716,7 @@ function X.ConsiderR()
for _, npcEnemy in pairs( nInBonusEnemyList )
do
if J.IsValid( npcEnemy )
and J.CanCastOnNonMagicImmune( npcEnemy )
and J.CanCastOnMagicImmune( npcEnemy )
and J.CanCastOnTargetAdvanced( npcEnemy )
then
if npcEnemy:IsChanneling()
......@@ -751,7 +751,7 @@ function X.ConsiderR()
for _, npcEnemy in pairs( hEnemyList )
do
if J.IsValid( npcEnemy )
and J.CanCastOnNonMagicImmune( npcEnemy )
and J.CanCastOnMagicImmune( npcEnemy )
and J.CanCastOnTargetAdvanced( npcEnemy )
and not J.IsDisabled( npcEnemy )
then
......@@ -779,7 +779,7 @@ function X.ConsiderR()
then
if J.IsValidHero( botTarget )
and J.IsInRange( botTarget, bot, nCastRange + 50 )
and J.CanCastOnNonMagicImmune( botTarget )
and J.CanCastOnMagicImmune( botTarget )
and J.CanCastOnTargetAdvanced( botTarget )
then
hCastTarget = botTarget
......
......@@ -33,9 +33,10 @@ tOutFitList['outfit_carry'] = {
"item_ranged_carry_outfit",
"item_maelstrom",
"item_aghanims_shard",
"item_mask_of_madness",
"item_dragon_lance",
"item_black_king_bar",
"item_dragon_lance",
"item_travel_boots",
"item_monkey_king_bar",
"item_hurricane_pike",
......@@ -51,6 +52,7 @@ tOutFitList['outfit_priest'] = {
"item_priest_outfit",
"item_mekansm",
"item_aghanims_shard",
"item_shadow_amulet",
"item_guardian_greaves",
"item_spirit_vessel",
......
......@@ -39,10 +39,12 @@ tOutFitList['outfit_carry'] = {
-- "item_glimmer_cape",
"item_aghanims_shard",
"item_rod_of_atos",
"item_ultimate_scepter",
"item_cyclone",
"item_lotus_orb",
"item_sheepstick",
"item_gungir",
"item_ultimate_scepter_2",
"item_wind_waker",
"item_moon_shard",
......@@ -54,13 +56,15 @@ tOutFitList['outfit_priest'] = {
'item_priest_outfit',
"item_urn_of_shadows",
"item_aghanims_shard",
"item_mekansm",
"item_ultimate_scepter",
"item_glimmer_cape",
"item_aghanims_shard",
"item_guardian_greaves",
"item_spirit_vessel",
"item_cyclone",
"item_shivas_guard",
"item_ultimate_scepter_2",
"item_sheepstick",
"item_moon_shard",
"item_wind_waker",
......@@ -71,12 +75,14 @@ tOutFitList['outfit_mage'] = {
'item_mage_outfit',
"item_ancient_janggo",
"item_aghanims_shard",
"item_glimmer_cape",
"item_ultimate_scepter",
"item_boots_of_bearing",
"item_pipe",
"item_aghanims_shard",
"item_veil_of_discord",
"item_cyclone",
"item_ultimate_scepter_2",
"item_sheepstick",
"item_wind_waker",
"item_moon_shard",
......@@ -249,13 +255,44 @@ function X.ConsiderD()
if not abilityD:IsTrained() or not abilityD:IsFullyCastable() then return 0 end
local nSkillLV = abilityD:GetLevel()
local nCastRange = 650 + aetherRange
local nCastRange = abilityD:GetCastRange() + aetherRange
local nCastPoint = abilityD:GetCastPoint()
local nManaCost = abilityD:GetManaCost()
local nDamage = abilityD:GetAbilityDamage()
local nDamageType = DAMAGE_TYPE_MAGICAL
local nRadius = 650
local nRadius = abilityD:GetVal('radius')
local allies = bot:GetNearbyHeroes(nCastRange, false, BOT_MODE_NONE)
local enemies = bot:GetNearbyHeroes(nCastRange, true, BOT_MODE_NONE)
allies = FilterTable(enemies, function(u)
return not u:IsMagicImmune()
end)
local group = J.MergeGroup(allies, enemies)
local aoeLoc = bot:FindAoELocation(true,true,bot:GetLocation(),nCastRange,nRadius,2)
local aoeLoc2 = bot:FindAoELocation(false,true,bot:GetLocation(),nCastRange,nRadius,2)
local aoeLoc3
if aoeLoc and not aoeLoc2 then aoeLoc3 = aoeLoc.targetloc end
if aoeLoc2 and not aoeLoc then aoeLoc3 = aoeLoc2.targetloc end
if aoeLoc and aoeLoc2 then
aoeLoc3 = RandomVector(0.0)
aoeLoc3.x = (aoeLoc.targetloc.x + aoeLoc2.targetloc.x) / 2
aoeLoc3.y = (aoeLoc.targetloc.y + aoeLoc2.targetloc.y) / 2
FilterTable(group,function(u)
return u:GetDistanceToLocation(aoeLoc3) < nRadius
end)
if #group > aoeLoc.count and #group < aoeLoc2.count then
aoeLoc3 = aoeLoc2.targetloc
end
if #group < aoeLoc.count and #group > aoeLoc2.count then
aoeLoc3 = aoeLoc.targetloc
end
end
if aoeLoc3 then return BOT_ACTION_DESIRE_HIGH, aoeLoc3, "D-AoE" end
if J.IsGoingOnSomeone( bot )
then
......@@ -268,7 +305,6 @@ function X.ConsiderD()
end
end
return BOT_ACTION_DESIRE_NONE
......
......@@ -3462,12 +3462,13 @@ function J.GetMagicToPhysicalDamage( bot, nUnit, nMagicDamage )
end
function J.MergeGroup(nList,...)
function J.MergeGroup(...)
local args = {...}
local result = {}
for a in arg do
table.insert(nList,a)
table.insert(result,a)
end
return nList
return result
end
function J.Not(f)
......
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