Commit ce98ce1a authored by JoyJ's avatar JoyJ

fix alchemist

parent 4c73dc3b
local X = {} local X = {}
local bDebugMode = false local bDebugMode = true
local bot = GetBot() local bot = GetBot()
_G.W2Time = _G.W2Time or {}
_G.W2Time[bot] = _G.W2Time[bot] or 999999
local J = require( GetScriptDirectory()..'/FunLib/jmz_func' ) local J = require( GetScriptDirectory()..'/FunLib/jmz_func' )
local Minion = dofile( GetScriptDirectory()..'/FunLib/aba_minion' ) local Minion = dofile( GetScriptDirectory()..'/FunLib/aba_minion' )
...@@ -27,11 +29,12 @@ local tOutFitList = {} ...@@ -27,11 +29,12 @@ local tOutFitList = {}
tOutFitList['outfit_carry'] = { tOutFitList['outfit_carry'] = {
"item_melee_carry_outfit", "item_bristleback_outfit",
"item_radiance", "item_soul_ring",
"item_yasha", "item_yasha",
"item_sange_and_yasha",
"item_black_king_bar", "item_black_king_bar",
"item_radiance",
"item_sange_and_yasha",
"item_basher", "item_basher",
"item_assault", "item_assault",
"item_abyssal_blade", "item_abyssal_blade",
...@@ -45,6 +48,7 @@ X['sBuyList'] = tOutFitList[sOutfitType] ...@@ -45,6 +48,7 @@ X['sBuyList'] = tOutFitList[sOutfitType]
X['sSellList'] = { X['sSellList'] = {
"item_magic_wand", "item_magic_wand",
"item_glimmer_cape", "item_glimmer_cape",
"item_soul_ring",
} }
if J.Role.IsPvNMode() or J.Role.IsAllShadow() then X['sBuyList'], X['sSellList'] = { 'PvN_melee_carry' }, {} end if J.Role.IsPvNMode() or J.Role.IsAllShadow() then X['sBuyList'], X['sSellList'] = { 'PvN_melee_carry' }, {} end
...@@ -71,7 +75,7 @@ local abilityW2 = bot:GetAbilityByName( 'alchemist_unstable_concoction_throw' ) ...@@ -71,7 +75,7 @@ local abilityW2 = bot:GetAbilityByName( 'alchemist_unstable_concoction_throw' )
local abilityE = bot:GetAbilityByName( sAbilityList[3] ) local abilityE = bot:GetAbilityByName( sAbilityList[3] )
local abilityD = bot:GetAbilityByName( sAbilityList[4] ) local abilityD = bot:GetAbilityByName( sAbilityList[4] )
local abilityR = bot:GetAbilityByName( sAbilityList[6] ) local abilityR = bot:GetAbilityByName( sAbilityList[6] )
local W2Time = 0 local W2Time = _G.W2Time[bot]
local castQDesire, castQLocation local castQDesire, castQLocation
local castWDesire local castWDesire
...@@ -100,7 +104,7 @@ function X.SkillsComplement() ...@@ -100,7 +104,7 @@ function X.SkillsComplement()
if aether ~= nil then aetherRange = 250 end if aether ~= nil then aetherRange = 250 end
castW2Desire, castW2Target, sMotive = X.ConsiderW2() castW2Desire, castW2Target, sMotive = X.ConsiderW2()
if ( castW2Desire > 0 ) then if ( castW2Desire > 0 ) then
J.SetReportMotive( bDebugMode, sMotive ) J.SetReportMotive( bDebugMode, sMotive )
...@@ -117,10 +121,9 @@ function X.SkillsComplement() ...@@ -117,10 +121,9 @@ function X.SkillsComplement()
J.SetQueuePtToINT( bot, true ) J.SetQueuePtToINT( bot, true )
bot:ActionQueue_UseAbilityOnEntity( abilityW, castWTarget ) 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
...@@ -145,14 +148,14 @@ function X.SkillsComplement() ...@@ -145,14 +148,14 @@ function X.SkillsComplement()
return return
end end
castDDesire, sMotive = X.ConsiderD() castDDesire, castDTarget, sMotive = X.ConsiderD()
if ( castDDesire > 0 ) then if ( castDDesire > 0 ) then
J.SetReportMotive( bDebugMode, sMotive ) J.SetReportMotive( bDebugMode, sMotive )
J.SetQueuePtToINT( bot, true ) J.SetQueuePtToINT( bot, true )
bot:ActionQueue_UseAbility( abilityR ) bot:ActionQueue_UseAbilityOnEntity( abilityD, castDTarget )
return return
end end
...@@ -160,8 +163,11 @@ function X.SkillsComplement() ...@@ -160,8 +163,11 @@ function X.SkillsComplement()
end end
function X.ConsiderW2() function X.ConsiderW2()
if W2Time>0 and (abilityW2:IsHidden() or not abilityW2:IsFullyCastable()) then if _G.W2Time[bot]<999999 and (abilityW2:IsHidden() or not abilityW2:IsTrained() or not abilityW2:IsFullyCastable()) then
W2Time = 0 _G.W2Time[bot] = 999999
return 0
end
if abilityW2:IsHidden() or not abilityW2:IsTrained() or not abilityW2:IsFullyCastable() then
return 0 return 0
end end
...@@ -172,7 +178,7 @@ function X.ConsiderW2() ...@@ -172,7 +178,7 @@ function X.ConsiderW2()
local nEnemysHeroesInView = bot:GetNearbyHeroes( 880, true, BOT_MODE_NONE ) local nEnemysHeroesInView = bot:GetNearbyHeroes( 880, true, BOT_MODE_NONE )
local nSkillLV = abilityW:GetLevel() local nSkillLV = abilityW:GetLevel()
local nCastPoint = abilityW2:GetCastPoint() local nCastPoint = abilityW2:GetCastPoint()
local remainTime = 5.4 - nCastPoint - (time - W2Time) local remainTime = 5.4 - nCastPoint - (time - _G.W2Time[bot])
--打断 --打断
if #nEnemysHeroesInView > 0 then if #nEnemysHeroesInView > 0 then
...@@ -187,11 +193,13 @@ function X.ConsiderW2() ...@@ -187,11 +193,13 @@ function X.ConsiderW2()
end end
end end
if not time > W2Time + 2.0 then return 0 end print(time)
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 - W2Time) nDamage = nDamage * (time - _G.W2Time[bot])
--击杀 --击杀
if #nEnemysHeroesInCastRange > 0 then if #nEnemysHeroesInCastRange > 0 then
...@@ -277,20 +285,16 @@ function X.ConsiderQ() ...@@ -277,20 +285,16 @@ function X.ConsiderQ()
local nCastRange = abilityQ:GetCastRange() + aetherRange local nCastRange = abilityQ:GetCastRange() + aetherRange
local nCastPoint = abilityQ:GetCastPoint() local nCastPoint = abilityQ:GetCastPoint()
local nManaCost = abilityQ:GetManaCost() local nManaCost = abilityQ:GetManaCost()
local nDamageType = DAMAGE_TYPE_MAGICAL local nDamageType = DAMAGE_TYPE_PHYSICAL
local nRadius = 425 local nRadius = 425
if bot:GetLevel()>=10 then nRadius = 525 end if bot:GetLevel()>=10 then nRadius = 525 end
local nPercentDamage = 0.005*nSkillLV + 0.01
if bot:GetLevel()>=20 then nPercentDamage = nPercentDamage + 0.01 end
nPercentDamage = nPercentDamage * 2 -- 2秒的输出
local nInRangeEnemyList = bot:GetNearbyHeroes( nCastRange + nRadius * 0.5, true, BOT_MODE_NONE ) local nInRangeEnemyList = bot:GetNearbyHeroes( nCastRange + nRadius * 0.5, true, BOT_MODE_NONE )
local nTargetLocation = nil local nTargetLocation = nil
--消耗,保持一定魔量 --消耗,保持一定魔量
local nCanHurtEnemyAoE = bot:FindAoELocation( true, false, bot:GetLocation(), nCastRange, nRadius + 20, 0, 0 ) local nCanHurtEnemyAoE = bot:FindAoELocation( true, false, bot:GetLocation(), nCastRange, nRadius + 20, 0, 0 )
if nSkillLV>1 and J.IsAllowedToSpam( bot, nManaCost) and nCanHurtEnemyAoE.count >= 3 then if J.IsAllowedToSpam( bot, nManaCost) and nCanHurtEnemyAoE.count >= 3 then
nTargetLocation = nCanHurtEnemyAoE.targetloc nTargetLocation = nCanHurtEnemyAoE.targetloc
return BOT_ACTION_DESIRE_HIGH, nTargetLocation, 'Q消耗' return BOT_ACTION_DESIRE_HIGH, nTargetLocation, 'Q消耗'
end end
...@@ -349,7 +353,7 @@ function X.ConsiderQ() ...@@ -349,7 +353,7 @@ function X.ConsiderQ()
and J.IsValid( laneCreepList[1] ) and J.IsValid( laneCreepList[1] )
and not laneCreepList[1]:HasModifier( "modifier_fountain_glyph" ) and not laneCreepList[1]:HasModifier( "modifier_fountain_glyph" )
then then
local locationAoEHurt = bot:FindAoELocation( true, false, bot:GetLocation(), nCastRange, nRadius + 50, 0.5, 0 ) local locationAoEHurt = bot:FindAoELocation( true, false, bot:GetLocation(), nCastRange, nRadius + 50, 0, 0 )
if locationAoEHurt.count >= 3 then if locationAoEHurt.count >= 3 then
nTargetLocation = locationAoEHurt.targetloc nTargetLocation = locationAoEHurt.targetloc
return BOT_ACTION_DESIRE_HIGH, nTargetLocation, "Q带线"..locationAoEHurt.count return BOT_ACTION_DESIRE_HIGH, nTargetLocation, "Q带线"..locationAoEHurt.count
...@@ -395,7 +399,7 @@ function X.ConsiderW() ...@@ -395,7 +399,7 @@ function X.ConsiderW()
and J.CanCastOnTargetAdvanced( nEnemysHeroesInView[i] ) and J.CanCastOnTargetAdvanced( nEnemysHeroesInView[i] )
and nEnemysHeroesInView[i]:IsChanneling() and nEnemysHeroesInView[i]:IsChanneling()
then then
W2Time = time _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
...@@ -413,8 +417,8 @@ function X.ConsiderW() ...@@ -413,8 +417,8 @@ 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
W2Time = time _G.W2Time[bot] = time
return BOT_ACTION_DESIRE_HIGH, nEnemysHeroesInCastRange[i], "W-击杀-开摇"..J.Chat.GetNormName( botTarget ) return BOT_ACTION_DESIRE_HIGH, "W-击杀-开摇"..J.Chat.GetNormName( botTarget )
end end
end end
end end
...@@ -443,7 +447,7 @@ function X.ConsiderW() ...@@ -443,7 +447,7 @@ function X.ConsiderW()
if ( npcMostDangerousEnemy ~= nil ) if ( npcMostDangerousEnemy ~= nil )
then then
W2Time = time _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
...@@ -460,7 +464,7 @@ function X.ConsiderW() ...@@ -460,7 +464,7 @@ 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
W2Time = time _G.W2Time[bot] = time
return BOT_ACTION_DESIRE_HIGH, "W-追杀-开摇" return BOT_ACTION_DESIRE_HIGH, "W-追杀-开摇"
end end
end end
...@@ -475,7 +479,7 @@ function X.ConsiderW() ...@@ -475,7 +479,7 @@ 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
W2Time = time _G.W2Time[bot] = time
return BOT_ACTION_DESIRE_HIGH, "W-撤退-开摇" return BOT_ACTION_DESIRE_HIGH, "W-撤退-开摇"
end end
end end
...@@ -490,7 +494,7 @@ function X.ConsiderR() ...@@ -490,7 +494,7 @@ function X.ConsiderR()
if J.IsInTeamFight( bot, 1200 ) then if J.IsInTeamFight( bot, 1200 ) then
return BOT_ACTION_DESIRE_HIGH, "R-开战" return BOT_ACTION_DESIRE_HIGH, "R-开战"
end end
if nHP(bot)<0.5 or (bot:WasRecentlyDamagedByAnyHero(3.0) and nHP<0.7) then if nHP<0.5 or (bot:WasRecentlyDamagedByAnyHero(3.0) and nHP<0.7) then
return BOT_ACTION_DESIRE_HIGH, "R-回复" return BOT_ACTION_DESIRE_HIGH, "R-回复"
end end
if J.IsGoingOnSomeone(bot) and J.IsValidHero( J.GetProperTarget( bot ) ) then if J.IsGoingOnSomeone(bot) and J.IsValidHero( J.GetProperTarget( bot ) ) then
......
...@@ -991,7 +991,7 @@ function Think() ...@@ -991,7 +991,7 @@ function Think()
sSelectHero = sSelectList[i] sSelectHero = sSelectList[i]
end end
--if GetTeam() ~= TEAM_DIRE and i == 2 then sSelectHero = "npc_dota_hero_abyssal_underlord" 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_abaddon" end --if GetTeam() ~= TEAM_DIRE and i == 3 then sSelectHero = "npc_dota_hero_abaddon" 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
......
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