Commit db14cddc authored by JoyJ's avatar JoyJ

add push_tower_top (incompleted)

parent 49820c00
...@@ -6,6 +6,9 @@ local X = {} ...@@ -6,6 +6,9 @@ local X = {}
local bDebugMode = false local bDebugMode = false
local bot = GetBot() local bot = GetBot()
--推进所需的最低装备。装备总价超过这个数值才会开始跟团推进,否则就分散打钱。
bot.NeedTotalWorth = 5000
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' )
local sTalentList = J.Skill.GetTalentList( bot ) local sTalentList = J.Skill.GetTalentList( bot )
......
...@@ -3341,6 +3341,22 @@ function J.GetNumOfTeamTotalKills( bEnemy ) ...@@ -3341,6 +3341,22 @@ function J.GetNumOfTeamTotalKills( bEnemy )
end end
function J.GetNumOfTeamTotalKillsWithoutHuman( bEnemy )
local count = 0
local nTeam = GetOpposingTeam()
if bEnemy then nTeam = GetTeam() end
for i, id in pairs( GetTeamPlayers( nTeam ) ) do
if IsPlayerBot(bot) then
count = count + GetHeroDeaths( id )
end
end
return count
end
function J.ConsiderForMkbDisassembleMask( bot ) function J.ConsiderForMkbDisassembleMask( bot )
......
...@@ -463,7 +463,6 @@ local sTankList = { ...@@ -463,7 +463,6 @@ local sTankList = {
local sMidList = { local sMidList = {
"npc_dota_hero_abaddon",
"npc_dota_hero_abyssal_underlord", "npc_dota_hero_abyssal_underlord",
"npc_dota_hero_alchemist", "npc_dota_hero_alchemist",
"npc_dota_hero_arc_warden", "npc_dota_hero_arc_warden",
......
...@@ -45,6 +45,7 @@ local teamTime = 0; ...@@ -45,6 +45,7 @@ local teamTime = 0;
local countTime = 0; local countTime = 0;
local countCD = 5.0; local countCD = 5.0;
local allyKills = 0; local allyKills = 0;
local allyKillsWithoutHuman = 0
local enemyKills = 0; local enemyKills = 0;
local nLostCount = RandomInt(35,45); local nLostCount = RandomInt(35,45);
...@@ -282,7 +283,7 @@ function GetDesire() ...@@ -282,7 +283,7 @@ function GetDesire()
return BOT_MODE_DESIRE_NONE; return BOT_MODE_DESIRE_NONE;
end end
if bot:GetActiveMode() == BOT_MODE_LANING then laningTime = DotaTime(); end if bot:GetActiveMode() == BOT_MODE_LANING then laningTime = DotaTime() end
if DotaTime() - laningTime < 15.0 and GetHeroDeaths(bot:GetPlayerID()) <= 2 then return BOT_MODE_DESIRE_NONE; end if DotaTime() - laningTime < 15.0 and GetHeroDeaths(bot:GetPlayerID()) <= 2 then return BOT_MODE_DESIRE_NONE; end
if bot:IsAlive() and bot:HasModifier('modifier_arc_warden_tempest_double') if bot:IsAlive() and bot:HasModifier('modifier_arc_warden_tempest_double')
...@@ -317,6 +318,7 @@ function GetDesire() ...@@ -317,6 +318,7 @@ function GetDesire()
then then
countTime = DotaTime(); countTime = DotaTime();
allyKills = J.GetNumOfTeamTotalKills(false); allyKills = J.GetNumOfTeamTotalKills(false);
allyKillsWithoutHuman = J.GetNumOfTeamTotalKillsWithoutHuman(false);
enemyKills = J.GetNumOfTeamTotalKills(true); enemyKills = J.GetNumOfTeamTotalKills(true);
...@@ -342,8 +344,8 @@ function GetDesire() ...@@ -342,8 +344,8 @@ function GetDesire()
end end
end end
if allyKills > enemyKills + 20 and aliveAllyCount >= 4 if allyKillsWithoutHuman > 10 and allyKillsWithoutHuman > enemyKills * 1.5 and aliveAllyCount >= 4
then return BOT_MODE_DESIRE_NONE; end then return BOT_MODE_DESIRE_NONE end
local nAlliesCount = J.GetAllyCount(bot,1400); local nAlliesCount = J.GetAllyCount(bot,1400);
if nAlliesCount >= 4 if nAlliesCount >= 4
...@@ -396,7 +398,7 @@ function GetDesire() ...@@ -396,7 +398,7 @@ function GetDesire()
and ( bot:GetNextItemPurchaseValue() > 0 or not bot:HasModifier("modifier_item_moon_shard_consumed") ) and ( bot:GetNextItemPurchaseValue() > 0 or not bot:HasModifier("modifier_item_moon_shard_consumed") )
and ( DotaTime() > 7 * 60 or bot:GetLevel() >= 8 or ( bot:GetAttackRange() < 220 and bot:GetLevel() >= 6 ) ) and ( DotaTime() > 7 * 60 or bot:GetLevel() >= 8 or ( bot:GetAttackRange() < 220 and bot:GetLevel() >= 6 ) )
then then
if J.GetDistanceFromEnemyFountain(bot) > 4000 if J.GetDistanceFromEnemyFountain(bot) > 4000
then then
hLaneCreepList = bot:GetNearbyLaneCreeps(1600, true); hLaneCreepList = bot:GetNearbyLaneCreeps(1600, true);
if #hLaneCreepList == 0 if #hLaneCreepList == 0
...@@ -418,7 +420,7 @@ function GetDesire() ...@@ -418,7 +420,7 @@ function GetDesire()
then then
preferedCamp = nil; preferedCamp = nil;
return BOT_MODE_DESIRE_NONE; return BOT_MODE_DESIRE_NONE;
elseif bot:GetHealth() <= 200 elseif bot:GetHealthPercent() <= 20
then then
preferedCamp = nil; preferedCamp = nil;
teamTime = DotaTime(); teamTime = DotaTime();
...@@ -589,20 +591,24 @@ function Think() ...@@ -589,20 +591,24 @@ function Think()
if bot:FindItemSlot("item_quelling_blade") > 0 if bot:FindItemSlot("item_quelling_blade") > 0
or bot:FindItemSlot("item_bfury") > 0 or bot:FindItemSlot("item_bfury") > 0
then then
botDamage = botDamage + 13; if bot:IsRangedAttacker() then
botDamage = botDamage + 4
else
botDamage = botDamage + 8
end
end end
if not J.CanKillTarget(farmTarget, botDamage * nDamageReduce, DAMAGE_TYPE_PHYSICAL) if not J.CanKillTarget(farmTarget, botDamage * nDamageReduce, DAMAGE_TYPE_PHYSICAL)
and J.CanKillTarget(farmTarget, (botDamage +99) * nDamageReduce, DAMAGE_TYPE_PHYSICAL) and J.CanKillTarget(farmTarget, (botDamage * 1.5) * nDamageReduce, DAMAGE_TYPE_PHYSICAL)
then then
bot:Action_ClearActions( true ); bot:Action_ClearActions( true );
return return
end end
end end
if bot:GetAttackRange() > 310 if bot:GetAttackRange() > 310
then then
if GetUnitToUnitDistance(bot,farmTarget) > bot:GetAttackRange() + 180 if bot:GetDistanceToUnit(farmTarget) > bot:GetAttackRange() + 180
then then
bot:Action_MoveToLocation(farmTarget:GetLocation()); bot:Action_MoveToLocation(farmTarget:GetLocation());
return return
...@@ -1054,7 +1060,7 @@ function X.ShouldRun(bot) ...@@ -1054,7 +1060,7 @@ function X.ShouldRun(bot)
local info = GetHeroLastSeenInfo(enemyPids[i]) local info = GetHeroLastSeenInfo(enemyPids[i])
if info ~= nil then if info ~= nil then
local dInfo = info[1]; local dInfo = info[1];
if dInfo ~= nil and dInfo.time_since_seen < 2.0 if dInfo ~= nil and dInfo.time_since_seen and dInfo.time_since_seen < 2.0
and GetUnitToLocationDistance(bot,dInfo.location) < 1000 and GetUnitToLocationDistance(bot,dInfo.location) < 1000
then then
enemyCount = enemyCount +1; enemyCount = enemyCount +1;
...@@ -1173,7 +1179,7 @@ function X.CouldBlink(bot,nLocation) ...@@ -1173,7 +1179,7 @@ function X.CouldBlink(bot,nLocation)
return false; return false;
elseif bDist < maxBlinkDist +1 elseif bDist < maxBlinkDist +1
then then
if botName == "npc_dota_hero_antimage" if botName == "npc_dota_hero_antimage" or botName == "npc_dota_hero_queenofpain"
then then
bot:Action_ClearActions(true); bot:Action_ClearActions(true);
...@@ -1192,7 +1198,7 @@ function X.CouldBlink(bot,nLocation) ...@@ -1192,7 +1198,7 @@ function X.CouldBlink(bot,nLocation)
elseif IsLocationPassable(maxBlinkLoc) elseif IsLocationPassable(maxBlinkLoc)
then then
if botName == "npc_dota_hero_antimage" if botName == "npc_dota_hero_antimage" or botName == "npc_dota_hero_queenofpain"
then then
bot:Action_ClearActions(true); bot:Action_ClearActions(true);
...@@ -1248,6 +1254,9 @@ function X.IsNormalFarmer(bot) ...@@ -1248,6 +1254,9 @@ function X.IsNormalFarmer(bot)
or botName == "npc_dota_hero_viper" or botName == "npc_dota_hero_viper"
or botName == "npc_dota_hero_clinkz" or botName == "npc_dota_hero_clinkz"
or botName == "npc_dota_hero_mirana" or botName == "npc_dota_hero_mirana"
or botName == "npc_dota_hero_abyssal_underlord"
or botName == "npc_dota_hero_axe"
or botName == "npc_dota_hero_centaur"
end end
...@@ -1273,6 +1282,9 @@ function X.IsHighFarmer(bot) ...@@ -1273,6 +1282,9 @@ function X.IsHighFarmer(bot)
or botName == "npc_dota_hero_naga_siren" or botName == "npc_dota_hero_naga_siren"
or botName == "npc_dota_hero_legion_commander" or botName == "npc_dota_hero_legion_commander"
or botName == "npc_dota_hero_obsidian_destroyer" or botName == "npc_dota_hero_obsidian_destroyer"
or botName == "npc_dota_hero_muerta"
or botName == "npc_dota_hero_sven"
or botName == "npc_dota_hero_venomancer"
end end
...@@ -1288,6 +1300,9 @@ function X.IsVeryHighFarmer(bot) ...@@ -1288,6 +1300,9 @@ function X.IsVeryHighFarmer(bot)
or botName == "npc_dota_hero_naga_siren" or botName == "npc_dota_hero_naga_siren"
or botName == "npc_dota_hero_phantom_lancer" or botName == "npc_dota_hero_phantom_lancer"
or botName == "npc_dota_hero_razor" or botName == "npc_dota_hero_razor"
or botName == "npc_dota_hero_alchemist"
or botName == "npc_dota_hero_life_stealer"
or botName == "npc_dota_hero_terrorblade"
end end
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
--- Link:http://steamcommunity.com/sharedfiles/filedetails/?id=1573671599 --- Link:http://steamcommunity.com/sharedfiles/filedetails/?id=1573671599
--- Link:http://steamcommunity.com/sharedfiles/filedetails/?id=1627071163 --- Link:http://steamcommunity.com/sharedfiles/filedetails/?id=1627071163
--------------------------------------------------------------------------- ---------------------------------------------------------------------------
if GetBot():IsInvulnerable() or not GetBot():IsHero() or not string.find(GetBot():GetUnitName(), "hero") or GetBot():IsIllusion() then if not GetBot():IsHero() or not string.find(GetBot():GetUnitName(), "hero") or GetBot():IsIllusion() then
return return
end end
......
---------------------------------------------------------------------------
--- The Creation Come From: A Beginner AI
--- Author: 决明子 Email: dota2jmz@163.com 微博@Dota2_决明子
--- Link:http://steamcommunity.com/sharedfiles/filedetails/?id=1573671599
--- Link:http://steamcommunity.com/sharedfiles/filedetails/?id=1627071163
---------------------------------------------------------------------------
if not GetBot():IsHero() or not string.find(GetBot():GetUnitName(), "hero") or GetBot():IsIllusion() then
return
end
local X = {}
require(GetScriptDirectory() .. "/rewrite_functions")
local J = require( GetScriptDirectory()..'/FunLib/jmz_func')
local bot = GetBot()
function GetTeamLaneTowerStatus(...)
local args = {...}
local result = 1
for _,tower in pairs(args) do
local unit=GetTower(GetTeam(),tower)
if not unit or not unit:IsAlive() then
result = result + 1
else
return result
end
end
return result
end
function GetEnemyLaneTowerStatus(...)
local args = {...}
local result = 1
for _,tower in pairs(args) do
local unit=GetTower(GetOpposingTeam(),tower)
if not unit or not unit:IsAlive() then
result = result + 1
else
return result
end
end
return result
end
function GetFirstAliveTower(...)
local args = {...}
for _,tower in pairs(args) do
local unit=GetTower(GetTeam(),tower)
if unit and unit:IsAlive() then
return unit
end
end
return nil
end
function GetDesire()
local now = DotaTime()
local lv = bot:GetLevel()
local isCurrentLine = bot:GetAssignedLane() == LANE_TOP
local allyKills = J.GetNumOfTeamTotalKillsWithoutHuman(false);
local enemyKills = J.GetNumOfTeamTotalKills(true);
local front = GetLaneFrontAmount(GetTeam(), LANE_TOP, false)
local front_other = math.min(GetLaneFrontAmount(GetTeam(), LANE_MID, false), GetLaneFrontAmount(GetTeam(), LANE_BOT, false))
--当前Bot经济在己方阵营的排名。1为第一名,2为第二名,以此类推。
local worthRank = 1
local allies = GetUnitList(UNIT_LIST_ALLIED_HEROES)
allies = FilterTable(allies,function(u)
return not u:IsIllusion() and u:IsAlive()
end)
local team={}
team[bot:GetPlayerID()] = true
for ally in pairs(allies) do
if not ally:IsIllusion() and ally:GetNetWorth() > bot and not team[ally:GetPlayerID()] then
team[ally:GetPlayerID()] = true
worthRank = worthRank + 1
end
end
local aliveEnemyCount = J.GetNumOfAliveHeroes(true);
local aliveAllyCount = #allies;
local tower_top = GetEnemyLaneTowerStatus(TOWER_TOP_1,TOWER_TOP_2,TOWER_TOP_3,BARRACKS_TOP_MELEE)
local tower_mid = GetEnemyLaneTowerStatus(TOWER_MID_1,TOWER_MID_2,TOWER_MID_3,BARRACKS_MID_MELEE)
local tower_bot = GetEnemyLaneTowerStatus(TOWER_BOT_1,TOWER_TOP_2,TOWER_BOT_3,BARRACKS_BOT_MELEE)
--前线位置
local front_loc = GetLaneFrontLocation(GetTeam(), LANE_TOP, 0)
--前线友军小兵数量
local front_ally_creeps_num = GetUnitList(UNIT_LIST_ALLIED_CREEPS)
front_ally_creeps_num = #(FilterTable(front_ally_creeps_num,function(u)
return u:IsAlive() and u:GetDistanceToLocation(front_loc) < 1200
end))
--前线敌军小兵数量
local front_enemy_creeps_num = GetUnitList(UNIT_LIST_ENEMY_CREEPS)
front_enemy_creeps_num = #(FilterTable(front_enemy_creeps_num,function(u)
return u:IsAlive() and u:GetDistanceToLocation(front_loc) < 1200
end))
--前线敌军英雄数量
local front_enemy_hero_num = 0
local enemyTeam = GetTeamPlayers(GetOpposingTeam())
for _,player in pairs(enemyTeam) do
local info = GetHeroLastSeenInfo(player)
if info ~= nil then
local dInfo = info[1]
if dInfo ~= nil and dInfo.time_since_seen and dInfo.time_since_seen < 10.0
and J.GetDistanceFromVectorToVector(front_loc,dInfo.location) < 1000
then
front_enemy_hero_num = front_enemy_hero_num + 1;
end
end
end
local enemyCount = 0
for i = 1, #enemyTeam do
local info = GetHeroLastSeenInfo(enemyTeam[i])
if info ~= nil then
local dInfo = info[1]
if dInfo ~= nil and dInfo.time_since_seen and dInfo.time_since_seen < 30.0
and GetUnitToLocationDistance(bot,dInfo.location) < 1000
then
front_enemy_hero_num = enemyCount +1;
end
end
end
front_enemy_hero_num = enemyCount
--前线友军英雄数量
local self_tower_top = GetTeamLaneTowerStatus(TOWER_TOP_1,TOWER_TOP_2,TOWER_TOP_3,BARRACKS_TOP_MELEE)
--自己最前方的塔
local front_tower = GetFirstAliveTower(TOWER_TOP_1,TOWER_TOP_2,TOWER_TOP_3,BARRACKS_TOP_MELEE)
--对方上路已破路且自己没破路,则除非被推到家门口,否则完全不去管理
--让最穷的人去守,剩下的人该干啥干啥
if tower_top == 5 and front_tower then
if front < 0.2 and front > front_other and worthRank==#team then
return BOT_ACTION_DESIRE_MODERATE * (0.2 - front) * 5
end
return BOT_ACTION_DESIRE_NONE
end
--出兵前,推个锤子
if now <= 10 then
return BOT_ACTION_DESIRE_NONE
end
--7级之前的情况。基本上可以认为不换路。
if lv <= 7 then
if isCurrentLine then
return BOT_ACTION_DESIRE_MODERATE
else
return BOT_ACTION_DESIRE_NONE
end
end
if lv <= 12 then
local base = 0.1
if tower_top > tower_mid and tower_top > tower_bot then
base = base + 0.4
elseif tower_top > tower_mid or tower_top > tower_bot then
base = base + 0.2
end
if isCurrentLine then
base = base + 0.4
end
return base
end
local farm = bot:GetFarmWorth()
if J.IsFarmer(bot) then
farm = 10000
end
if J.IsHighFarmer(bot) then
farm = 15000
end
if J.IsVeryHighFarmer(bot) then
farm = 20000
end
local desire = 0.1
--如果最基本的装备不足,则以猥琐打钱和防守为主
if bot:GetNetWorth() < farm then
if isCurrentLine then
desire = desire + 0.4
end
end
--大推进时间!凑够基本装备以后就可以开始抱团推进了
if tower_top > tower_mid and tower_top > tower_bot then
desire = desire + 0.4
elseif tower_top > tower_mid or tower_top > tower_bot then
desire = desire + 0.2
end
desire = desire - aliveEnemyCount * 0.05
return BOT_ACTION_DESIRE_NONE
end
-- dota2jmz@163.com QQ:2462331592..
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
--- Link:http://steamcommunity.com/sharedfiles/filedetails/?id=1627071163 --- Link:http://steamcommunity.com/sharedfiles/filedetails/?id=1627071163
---------------------------------------------------------------------------------------------------- ----------------------------------------------------------------------------------------------------
if GetBot():IsInvulnerable() or not GetBot():IsHero() or not string.find(GetBot():GetUnitName(), "hero") or GetBot():IsIllusion() then if not GetBot():IsHero() or not string.find(GetBot():GetUnitName(), "hero") or GetBot():IsIllusion() then
return return
end end
...@@ -19,7 +19,7 @@ local Item = require( GetScriptDirectory()..'/FunLib/aba_item') ...@@ -19,7 +19,7 @@ local Item = require( GetScriptDirectory()..'/FunLib/aba_item')
local bot = GetBot() local bot = GetBot()
local minute = 0 local minute = 0
local sec = 0 local sec = 0
local closestRune = -1 local closestRune,closestDist = -1, nil
local runeStatus = -1 local runeStatus = -1
local ProxDist = 1600 local ProxDist = 1600
local teamPlayers = nil local teamPlayers = nil
...@@ -603,6 +603,7 @@ function X.CouldBlink(bot,nLocation) ...@@ -603,6 +603,7 @@ function X.CouldBlink(bot,nLocation)
if not blinkSlot then blinkSlot = bot:FindItemSlot("item_overwhelming_blink") end if not blinkSlot then blinkSlot = bot:FindItemSlot("item_overwhelming_blink") end
if not blinkSlot then blinkSlot = bot:FindItemSlot("item_swift_blink") end if not blinkSlot then blinkSlot = bot:FindItemSlot("item_swift_blink") end
if not blinkSlot then blinkSlot = bot:FindItemSlot("item_arcane_blink") end if not blinkSlot then blinkSlot = bot:FindItemSlot("item_arcane_blink") end
if not blinkSlot then blinkSlot = bot:FindItemSlot("item_fallen_sky") end
if bot:GetItemSlotType(blinkSlot) == ITEM_SLOT_TYPE_MAIN if bot:GetItemSlotType(blinkSlot) == ITEM_SLOT_TYPE_MAIN
or (bot:GetUnitName() == "npc_dota_hero_antimage" or bot:GetUnitName() == "npc_dota_hero_queenofpain") or (bot:GetUnitName() == "npc_dota_hero_antimage" or bot:GetUnitName() == "npc_dota_hero_queenofpain")
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
--- Link:http://steamcommunity.com/sharedfiles/filedetails/?id=1573671599 --- Link:http://steamcommunity.com/sharedfiles/filedetails/?id=1573671599
--- Link:http://steamcommunity.com/sharedfiles/filedetails/?id=1627071163 --- Link:http://steamcommunity.com/sharedfiles/filedetails/?id=1627071163
---------------------------------------------------------------------------------------------------- ----------------------------------------------------------------------------------------------------
if GetBot():IsInvulnerable() or not GetBot():IsHero() or not string.find(GetBot():GetUnitName(), "hero") or GetBot():IsIllusion() then if not GetBot():IsHero() or not string.find(GetBot():GetUnitName(), "hero") or GetBot():IsIllusion() then
return; return;
end end
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
--- Link:http://steamcommunity.com/sharedfiles/filedetails/?id=1573671599 --- Link:http://steamcommunity.com/sharedfiles/filedetails/?id=1573671599
--- Link:http://steamcommunity.com/sharedfiles/filedetails/?id=1627071163 --- Link:http://steamcommunity.com/sharedfiles/filedetails/?id=1627071163
----------------------------------------------------------------------------- -----------------------------------------------------------------------------
if GetBot():IsInvulnerable() or not GetBot():IsHero() or not string.find(GetBot():GetUnitName(), "hero") or GetBot():IsIllusion() then if not GetBot():IsHero() or not string.find(GetBot():GetUnitName(), "hero") or GetBot():IsIllusion() then
return; return;
end end
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
--- Link:http://steamcommunity.com/sharedfiles/filedetails/?id=1573671599 --- Link:http://steamcommunity.com/sharedfiles/filedetails/?id=1573671599
--- Link:http://steamcommunity.com/sharedfiles/filedetails/?id=1627071163 --- Link:http://steamcommunity.com/sharedfiles/filedetails/?id=1627071163
---------------------------------------------------------------------------------------------------- ----------------------------------------------------------------------------------------------------
if GetBot():IsInvulnerable() or not GetBot():IsHero() or not string.find(GetBot():GetUnitName(), "hero") or GetBot():IsIllusion() then if not GetBot():IsHero() or not string.find(GetBot():GetUnitName(), "hero") or GetBot():IsIllusion() then
return; return;
end end
...@@ -77,28 +77,32 @@ function GetDesire() ...@@ -77,28 +77,32 @@ function GetDesire()
end end
end end
--捡A杖会崩客户端 --捡A杖会崩客户端,总之做个提示然后放过去
-- local pickScepterHero = J.GetPickUltimateScepterUnit(); local pickScepterHero = J.GetPickUltimateScepterUnit();
-- if pickScepterHero ~= nil and false if pickScepterHero ~= nil and false
-- and pickScepterHero:IsBot() and pickScepterHero:IsBot()
-- and bot == pickScepterHero and bot == pickScepterHero
-- and J.Item.GetEmptyInventoryAmount(bot) > 0 and J.Item.GetEmptyInventoryAmount(bot) > 0
-- then then
-- local item = nil; local item = nil;
-- local dropped = GetDroppedItemList(); local dropped = GetDroppedItemList();
-- for _,drop in pairs(dropped) for _,drop in pairs(dropped)
-- do do
-- if drop.item:GetName() == "item_ultimate_scepter_2" if drop.item:GetName() == "item_ultimate_scepter_2"
-- then then
-- item = drop; bot:ActionImmediate_Chat("目前版本的DOTA2客户端,AI捡起阿哈利姆福佑会导致客户端崩溃",false)
-- break; bot:ActionImmediate_Chat("为防止此bug,天地星AI不会捡起这个福佑",false)
-- end
-- end --item = drop;
-- if item ~= nil then --break
end
end
--if item ~= nil then
-- pickedItem = item; -- pickedItem = item;
-- return BOT_MODE_DESIRE_VERYHIGH; -- return BOT_MODE_DESIRE_VERYHIGH;
-- end --end
-- end end
droppedCheck = DotaTime(); droppedCheck = DotaTime();
end end
...@@ -134,7 +138,7 @@ function GetDesire() ...@@ -134,7 +138,7 @@ function GetDesire()
if GetGameMode() == GAMEMODE_1V1MID and bot:GetAssignedLane() ~= LANE_MID then if GetGameMode() == GAMEMODE_1V1MID and bot:GetAssignedLane() ~= LANE_MID then
return BOT_MODE_DESIRE_ABSOLUTE; return BOT_MODE_DESIRE_ABSOLUTE
end end
if beTechies or J.Role['bStopAction'] then return 2.0 end if beTechies or J.Role['bStopAction'] then return 2.0 end
...@@ -143,20 +147,26 @@ function GetDesire() ...@@ -143,20 +147,26 @@ function GetDesire()
then then
if cAbility == nil then cAbility = bot:GetAbilityByName( "pugna_life_drain" ) end; if cAbility == nil then cAbility = bot:GetAbilityByName( "pugna_life_drain" ) end;
if cAbility:IsInAbilityPhase() or bot:IsChanneling() then if cAbility:IsInAbilityPhase() or bot:IsChanneling() then
return BOT_MODE_DESIRE_ABSOLUTE; return BOT_MODE_DESIRE_ABSOLUTE
end end
elseif botName == "npc_dota_hero_drow_ranger" elseif botName == "npc_dota_hero_drow_ranger"
then then
if cAbility == nil then cAbility = bot:GetAbilityByName( "drow_ranger_multishot" ) end; if cAbility == nil then cAbility = bot:GetAbilityByName( "drow_ranger_multishot" ) end;
if cAbility:IsInAbilityPhase() or bot:IsChanneling() then if cAbility:IsInAbilityPhase() or bot:IsChanneling() then
return BOT_MODE_DESIRE_ABSOLUTE; return BOT_MODE_DESIRE_ABSOLUTE
end end
elseif botName == "npc_dota_hero_shadow_shaman" elseif botName == "npc_dota_hero_shadow_shaman"
then then
if cAbility == nil then cAbility = bot:GetAbilityByName( "shadow_shaman_shackles" ) end; if cAbility == nil then cAbility = bot:GetAbilityByName( "shadow_shaman_shackles" ) end;
if cAbility:IsInAbilityPhase() or bot:IsChanneling() then if cAbility:IsInAbilityPhase() or bot:IsChanneling() then
return BOT_MODE_DESIRE_ABSOLUTE; return BOT_MODE_DESIRE_ABSOLUTE
end end
elseif botName == "npc_dota_hero_abyssal_underlord"
then
if cAbility == nil then cAbility = bot:GetAbilityByName( "abyssal_underlord_dark_rift" ) end;
if cAbility:IsInAbilityPhase() or bot:IsChanneling() then
return BOT_MODE_DESIRE_ABSOLUTE
end
end end
if beSpecialSupport if beSpecialSupport
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
--- Link:http://steamcommunity.com/sharedfiles/filedetails/?id=1627071163 --- Link:http://steamcommunity.com/sharedfiles/filedetails/?id=1627071163
---------------------------------------------------------------------------------------------------- ----------------------------------------------------------------------------------------------------
if GetBot():IsInvulnerable() or not GetBot():IsHero() or not string.find(GetBot():GetUnitName(), "hero") or GetBot():IsIllusion() then if not GetBot():IsHero() or not string.find(GetBot():GetUnitName(), "hero") or GetBot():IsIllusion() then
return; return;
end end
......
...@@ -119,6 +119,67 @@ function CDOTABaseAbility_BotScript.GetVal(ability, name) ...@@ -119,6 +119,67 @@ function CDOTABaseAbility_BotScript.GetVal(ability, name)
end end
return f return f
end end
--返回需要凑齐的基本装价格。不到这个价格的情况下猥琐打钱,避免硬性推进
function CDOTA_Bot_Script.GetPushGoldNeed(bot)
if bot.NeedTotalWorth then return bot.NeedTotalWorth end
local botName = bot:GetUnitName()
if botName == "npc_dota_hero_chaos_knight"
or botName == "npc_dota_hero_dragon_knight"
or botName == "npc_dota_hero_ogre_magi"
or botName == "npc_dota_hero_omniknight"
or botName == "npc_dota_hero_bristleback"
or botName == "npc_dota_hero_sand_king"
or botName == "npc_dota_hero_skeleton_king"
or botName == "npc_dota_hero_kunkka"
or botName == "npc_dota_hero_sniper"
or botName == "npc_dota_hero_viper"
or botName == "npc_dota_hero_clinkz"
or botName == "npc_dota_hero_mirana"
or botName == "npc_dota_hero_abyssal_underlord"
or botName == "npc_dota_hero_axe"
or botName == "npc_dota_hero_centaur" then
return 10000
elseif botName == "npc_dota_hero_nevermore"
or botName == "npc_dota_hero_templar_assassin"
or botName == "npc_dota_hero_phantom_assassin"
or botName == "npc_dota_hero_phantom_lancer"
or botName == "npc_dota_hero_drow_ranger"
or botName == "npc_dota_hero_luna"
or botName == "npc_dota_hero_antimage"
or botName == "npc_dota_hero_arc_warden"
or botName == "npc_dota_hero_bloodseeker"
or botName == "npc_dota_hero_medusa"
or botName == "npc_dota_hero_razor"
or botName == "npc_dota_hero_huskar"
or botName == "npc_dota_hero_juggernaut"
or botName == "npc_dota_hero_slark"
or botName == "npc_dota_hero_naga_siren"
or botName == "npc_dota_hero_legion_commander"
or botName == "npc_dota_hero_obsidian_destroyer"
or botName == "npc_dota_hero_muerta"
or botName == "npc_dota_hero_sven"
or botName == "npc_dota_hero_venomancer" then
return 15000
elseif botName == "npc_dota_hero_nevermore"
or botName == "npc_dota_hero_luna"
or botName == "npc_dota_hero_antimage"
or botName == "npc_dota_hero_medusa"
or botName == "npc_dota_hero_naga_siren"
or botName == "npc_dota_hero_phantom_lancer"
or botName == "npc_dota_hero_razor"
or botName == "npc_dota_hero_alchemist"
or botName == "npc_dota_hero_life_stealer"
or botName == "npc_dota_hero_terrorblade" then
return 20000
end
return 5000
end
-------------------------------- --------------------------------
--rewrite functions CDOTA_Bot_Script --rewrite functions CDOTA_Bot_Script
-------------------------------- --------------------------------
...@@ -130,6 +191,7 @@ function CDOTA_Bot_Script.GetLocation(unit) ...@@ -130,6 +191,7 @@ function CDOTA_Bot_Script.GetLocation(unit)
if not unit:CanBeSeen() then if not unit:CanBeSeen() then
local id=unit:GetPlayerID() local id=unit:GetPlayerID()
local info=GetHeroLastSeenInfo(id) local info=GetHeroLastSeenInfo(id)
if info and info[1] then info = info[1] end
if info and info.time_since_seen and info.time_since_seen < 2.0 then if info and info.time_since_seen and info.time_since_seen < 2.0 then
return info.location return info.location
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