Commit 987b4584 authored by JoyJ's avatar JoyJ

fix alchemist

parent ce98ce1a
...@@ -117,6 +117,9 @@ function X.SkillsComplement() ...@@ -117,6 +117,9 @@ function X.SkillsComplement()
castWDesire, sMotive = X.ConsiderW() castWDesire, sMotive = X.ConsiderW()
if ( castWDesire > 0 ) then if ( castWDesire > 0 ) then
_G.W2Time[bot] = DotaTime()
J.SetReportMotive( bDebugMode, sMotive ) J.SetReportMotive( bDebugMode, sMotive )
J.SetQueuePtToINT( bot, true ) J.SetQueuePtToINT( bot, true )
...@@ -124,6 +127,7 @@ function X.SkillsComplement() ...@@ -124,6 +127,7 @@ function X.SkillsComplement()
bot:ActionQueue_UseAbility( abilityW ) bot:ActionQueue_UseAbility( abilityW )
return return
end end
castQDesire, castQLocation, sMotive = X.ConsiderQ() castQDesire, castQLocation, sMotive = X.ConsiderQ()
if ( castQDesire > 0 ) then if ( castQDesire > 0 ) then
...@@ -163,15 +167,16 @@ function X.SkillsComplement() ...@@ -163,15 +167,16 @@ function X.SkillsComplement()
end end
function X.ConsiderW2() function X.ConsiderW2()
if _G.W2Time[bot]<999999 and (abilityW2:IsHidden() or not abilityW2:IsTrained() or not abilityW2:IsFullyCastable()) then if abilityW2:IsHidden() or not abilityW2:IsTrained() or not abilityW2:IsFullyCastable() then
_G.W2Time[bot] = 999999 _G.W2Time[bot] = 999999
return 0 return 0
end end
if abilityW2:IsHidden() or not abilityW2:IsTrained() or not abilityW2:IsFullyCastable() then local time = DotaTime()
return 0 if _G.W2Time[bot] == 999999 then
--异常状况
_G.W2Time[bot] = time - 0.5
end end
local time = DotaTime()
local nCastRange = abilityW2:GetCastRange() + aetherRange local nCastRange = abilityW2:GetCastRange() + aetherRange
local nEnemysHeroesInCastRange = bot:GetNearbyHeroes( nCastRange + 99, true, BOT_MODE_NONE ) local nEnemysHeroesInCastRange = bot:GetNearbyHeroes( nCastRange + 99, true, BOT_MODE_NONE )
...@@ -193,13 +198,11 @@ function X.ConsiderW2() ...@@ -193,13 +198,11 @@ function X.ConsiderW2()
end end
end end
print(time) if remainTime > 3.0 then return 0 end
print(_G.W2Time[bot])
if not (time > ( _G.W2Time[bot] + 2.0)) then return 0 end
local nDamage = 16+14*nSkillLV local nDamage = 16+14*nSkillLV
if nLV >= 28 then nDamage = nDamage + 80 end if nLV >= 28 then nDamage = nDamage + 80 end
nDamage = nDamage * (time - _G.W2Time[bot]) nDamage = nDamage * (4.5 - remainTime)
--击杀 --击杀
if #nEnemysHeroesInCastRange > 0 then if #nEnemysHeroesInCastRange > 0 then
...@@ -250,9 +253,9 @@ function X.ConsiderW2() ...@@ -250,9 +253,9 @@ function X.ConsiderW2()
and J.CanCastOnNonMagicImmune( target ) and J.CanCastOnNonMagicImmune( target )
and J.CanCastOnTargetAdvanced( target ) and J.CanCastOnTargetAdvanced( target )
and J.IsInRange( target, bot, nCastRange ) and J.IsInRange( target, bot, nCastRange )
and (((GetUnitToLocationDistance(bot,target:GetExtrapolatedLocation(0.5 + nCastPoint))>(nCastRange/4*3)) and (((GetUnitToLocationDistance(bot,target:GetExtrapolatedLocation(0.5 + nCastPoint))>(nCastRange/2))
and not J.IsDisabled( target ) and not J.IsDisabled( target )
and not target:IsDisarmed()) or remainTime <= 0.5 or nHP < 0.2) and not target:IsDisarmed()) or remainTime <= 1.0 or nHP < 0.2 or target:GetHealth() < 500 )
then then
return BOT_ACTION_DESIRE_HIGH, target,"W-追杀"..J.Chat.GetNormName( target ) return BOT_ACTION_DESIRE_HIGH, target,"W-追杀"..J.Chat.GetNormName( target )
end end
...@@ -262,13 +265,11 @@ function X.ConsiderW2() ...@@ -262,13 +265,11 @@ function X.ConsiderW2()
if J.IsRetreating( bot ) if J.IsRetreating( bot )
then then
if J.IsValid( nEnemysHeroesInCastRange[1] ) if J.IsValid( nEnemysHeroesInCastRange[1] )
and J.CanCastOnNonMagicImmune( nEnemysHeroesInCastRange[1] ) and ((J.CanCastOnNonMagicImmune( nEnemysHeroesInCastRange[1] )
and J.CanCastOnTargetAdvanced( nEnemysHeroesInCastRange[1] ) and J.CanCastOnTargetAdvanced( nEnemysHeroesInCastRange[1] )
and not J.IsDisabled( nEnemysHeroesInCastRange[1] ) and not J.IsDisabled( nEnemysHeroesInCastRange[1] )
and not nEnemysHeroesInCastRange[1]:IsDisarmed() and not nEnemysHeroesInCastRange[1]:IsDisarmed())
and (((GetUnitToLocationDistance(bot,target:GetExtrapolatedLocation(0.5 + nCastPoint))>(nCastRange/4*3)) or (remainTime <= 1.0 or nHP < 0.2))
and not J.IsDisabled( target )
and not target:IsDisarmed()) or remainTime <= 0.5 or nHP < 0.2)
then then
return BOT_ACTION_DESIRE_HIGH, nEnemysHeroesInCastRange[1],"W-撤退"..J.Chat.GetNormName( nEnemysHeroesInCastRange[1] ) return BOT_ACTION_DESIRE_HIGH, nEnemysHeroesInCastRange[1],"W-撤退"..J.Chat.GetNormName( nEnemysHeroesInCastRange[1] )
end end
...@@ -399,7 +400,6 @@ function X.ConsiderW() ...@@ -399,7 +400,6 @@ function X.ConsiderW()
and J.CanCastOnTargetAdvanced( nEnemysHeroesInView[i] ) and J.CanCastOnTargetAdvanced( nEnemysHeroesInView[i] )
and nEnemysHeroesInView[i]:IsChanneling() and nEnemysHeroesInView[i]:IsChanneling()
then then
_G.W2Time[bot] = time
return BOT_ACTION_DESIRE_HIGH, "W-打断-开摇"..J.Chat.GetNormName( botTarget ) return BOT_ACTION_DESIRE_HIGH, "W-打断-开摇"..J.Chat.GetNormName( botTarget )
end end
end end
...@@ -417,7 +417,6 @@ function X.ConsiderW() ...@@ -417,7 +417,6 @@ function X.ConsiderW()
and J.CanCastOnTargetAdvanced( nEnemysHeroesInCastRange[i] ) and J.CanCastOnTargetAdvanced( nEnemysHeroesInCastRange[i] )
and J.WillKillTarget(nEnemysHeroesInCastRange[i],DAMAGE_TYPE_PHYSICAL, nCastPoint + GetUnitToUnitDistance(bot,nEnemysHeroesInCastRange[i])/900) and J.WillKillTarget(nEnemysHeroesInCastRange[i],DAMAGE_TYPE_PHYSICAL, nCastPoint + GetUnitToUnitDistance(bot,nEnemysHeroesInCastRange[i])/900)
then then
_G.W2Time[bot] = time
return BOT_ACTION_DESIRE_HIGH, "W-击杀-开摇"..J.Chat.GetNormName( botTarget ) return BOT_ACTION_DESIRE_HIGH, "W-击杀-开摇"..J.Chat.GetNormName( botTarget )
end end
end end
...@@ -447,7 +446,6 @@ function X.ConsiderW() ...@@ -447,7 +446,6 @@ function X.ConsiderW()
if ( npcMostDangerousEnemy ~= nil ) if ( npcMostDangerousEnemy ~= nil )
then then
_G.W2Time[bot] = time
return BOT_ACTION_DESIRE_HIGH, "W-团战晕眩高威胁目标-开摇"..J.Chat.GetNormName( botTarget ) return BOT_ACTION_DESIRE_HIGH, "W-团战晕眩高威胁目标-开摇"..J.Chat.GetNormName( botTarget )
end end
end end
...@@ -464,7 +462,6 @@ function X.ConsiderW() ...@@ -464,7 +462,6 @@ function X.ConsiderW()
and not J.IsDisabled( target ) and not J.IsDisabled( target )
and not target:IsDisarmed()) or remainTime <= 0.5) and not target:IsDisarmed()) or remainTime <= 0.5)
then then
_G.W2Time[bot] = time
return BOT_ACTION_DESIRE_HIGH, "W-追杀-开摇" return BOT_ACTION_DESIRE_HIGH, "W-追杀-开摇"
end end
end end
...@@ -479,7 +476,6 @@ function X.ConsiderW() ...@@ -479,7 +476,6 @@ function X.ConsiderW()
and not nEnemysHeroesInCastRange[1]:IsDisarmed() and not nEnemysHeroesInCastRange[1]:IsDisarmed()
and (GetUnitToLocationDistance(bot,target:GetExtrapolatedLocation(0.5 + nCastPoint))>nCastRange/4*3) and (GetUnitToLocationDistance(bot,target:GetExtrapolatedLocation(0.5 + nCastPoint))>nCastRange/4*3)
then then
_G.W2Time[bot] = time
return BOT_ACTION_DESIRE_HIGH, "W-撤退-开摇" return BOT_ACTION_DESIRE_HIGH, "W-撤退-开摇"
end end
end end
...@@ -501,6 +497,14 @@ function X.ConsiderR() ...@@ -501,6 +497,14 @@ function X.ConsiderR()
return BOT_ACTION_DESIRE_HIGH, "R-追杀" return BOT_ACTION_DESIRE_HIGH, "R-追杀"
end end
--肉山
if bot:GetActiveMode() == BOT_MODE_ROSHAN then
if J.IsRoshan( botTarget ) and J.GetHP( botTarget ) > 0.1
and J.IsInRange( botTarget, bot, 500 ) then
return BOT_ACTION_DESIRE_HIGH, 'R肉山'
end
end
return BOT_ACTION_DESIRE_NONE return BOT_ACTION_DESIRE_NONE
end 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