Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
D
dota2-ai
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
List
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issues
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
JoyJ
dota2-ai
Commits
db14cddc
Commit
db14cddc
authored
Apr 24, 2023
by
JoyJ
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add push_tower_top (incompleted)
parent
49820c00
Changes
12
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
367 additions
and
44 deletions
+367
-44
BotLib/000hero_template copy.lua
BotLib/000hero_template copy.lua
+3
-0
FunLib/jmz_func.lua
FunLib/jmz_func.lua
+16
-0
hero_selection.lua
hero_selection.lua
+0
-1
mode_farm_generic.lua
mode_farm_generic.lua
+27
-12
mode_laning_generic.lua
mode_laning_generic.lua
+1
-1
mode_push_tower_top.lua
mode_push_tower_top.lua
+217
-0
mode_rune_generic.lua
mode_rune_generic.lua
+3
-2
mode_secret_shop_generic.lua
mode_secret_shop_generic.lua
+1
-1
mode_side_shop_generic.lua
mode_side_shop_generic.lua
+1
-1
mode_team_roam_generic.lua
mode_team_roam_generic.lua
+35
-25
mode_ward_generic.lua
mode_ward_generic.lua
+1
-1
rewrite_functions.lua
rewrite_functions.lua
+62
-0
No files found.
BotLib/000hero_template copy.lua
View file @
db14cddc
...
...
@@ -6,6 +6,9 @@ local X = {}
local
bDebugMode
=
false
local
bot
=
GetBot
()
--推进所需的最低装备。装备总价超过这个数值才会开始跟团推进,否则就分散打钱。
bot
.
NeedTotalWorth
=
5000
local
J
=
require
(
GetScriptDirectory
()
..
'/FunLib/jmz_func'
)
local
Minion
=
dofile
(
GetScriptDirectory
()
..
'/FunLib/aba_minion'
)
local
sTalentList
=
J
.
Skill
.
GetTalentList
(
bot
)
...
...
FunLib/jmz_func.lua
View file @
db14cddc
...
...
@@ -3341,6 +3341,22 @@ function J.GetNumOfTeamTotalKills( bEnemy )
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
)
...
...
hero_selection.lua
View file @
db14cddc
...
...
@@ -463,7 +463,6 @@ local sTankList = {
local
sMidList
=
{
"npc_dota_hero_abaddon"
,
"npc_dota_hero_abyssal_underlord"
,
"npc_dota_hero_alchemist"
,
"npc_dota_hero_arc_warden"
,
...
...
mode_farm_generic.lua
View file @
db14cddc
...
...
@@ -45,6 +45,7 @@ local teamTime = 0;
local
countTime
=
0
;
local
countCD
=
5
.
0
;
local
allyKills
=
0
;
local
allyKillsWithoutHuman
=
0
local
enemyKills
=
0
;
local
nLostCount
=
RandomInt
(
35
,
45
);
...
...
@@ -282,7 +283,7 @@ function GetDesire()
return
BOT_MODE_DESIRE_NONE
;
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
bot
:
IsAlive
()
and
bot
:
HasModifier
(
'modifier_arc_warden_tempest_double'
)
...
...
@@ -317,6 +318,7 @@ function GetDesire()
then
countTime
=
DotaTime
();
allyKills
=
J
.
GetNumOfTeamTotalKills
(
false
);
allyKillsWithoutHuman
=
J
.
GetNumOfTeamTotalKillsWithoutHuman
(
false
);
enemyKills
=
J
.
GetNumOfTeamTotalKills
(
true
);
...
...
@@ -342,8 +344,8 @@ function GetDesire()
end
end
if
allyKills
>
enemyKills
+
20
and
aliveAllyCount
>=
4
then
return
BOT_MODE_DESIRE_NONE
;
end
if
allyKills
WithoutHuman
>
10
and
allyKillsWithoutHuman
>
enemyKills
*
1
.
5
and
aliveAllyCount
>=
4
then
return
BOT_MODE_DESIRE_NONE
end
local
nAlliesCount
=
J
.
GetAllyCount
(
bot
,
1400
);
if
nAlliesCount
>=
4
...
...
@@ -396,7 +398,7 @@ function GetDesire()
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
)
)
then
if
J
.
GetDistanceFromEnemyFountain
(
bot
)
>
4000
if
J
.
GetDistanceFromEnemyFountain
(
bot
)
>
4000
then
hLaneCreepList
=
bot
:
GetNearbyLaneCreeps
(
1600
,
true
);
if
#
hLaneCreepList
==
0
...
...
@@ -418,7 +420,7 @@ function GetDesire()
then
preferedCamp
=
nil
;
return
BOT_MODE_DESIRE_NONE
;
elseif
bot
:
GetHealth
()
<=
200
elseif
bot
:
GetHealth
Percent
()
<=
20
then
preferedCamp
=
nil
;
teamTime
=
DotaTime
();
...
...
@@ -589,20 +591,24 @@ function Think()
if
bot
:
FindItemSlot
(
"item_quelling_blade"
)
>
0
or
bot
:
FindItemSlot
(
"item_bfury"
)
>
0
then
botDamage
=
botDamage
+
13
;
if
bot
:
IsRangedAttacker
()
then
botDamage
=
botDamage
+
4
else
botDamage
=
botDamage
+
8
end
end
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
bot
:
Action_ClearActions
(
true
);
return
end
end
if
bot
:
GetAttackRange
()
>
310
if
bot
:
GetAttackRange
()
>
310
then
if
GetUnitToUnitDistance
(
bot
,
farmTarget
)
>
bot
:
GetAttackRange
()
+
180
if
bot
:
GetDistanceToUnit
(
farmTarget
)
>
bot
:
GetAttackRange
()
+
180
then
bot
:
Action_MoveToLocation
(
farmTarget
:
GetLocation
());
return
...
...
@@ -1054,7 +1060,7 @@ function X.ShouldRun(bot)
local
info
=
GetHeroLastSeenInfo
(
enemyPids
[
i
])
if
info
~=
nil
then
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
then
enemyCount
=
enemyCount
+
1
;
...
...
@@ -1173,7 +1179,7 @@ function X.CouldBlink(bot,nLocation)
return
false
;
elseif
bDist
<
maxBlinkDist
+
1
then
if
botName
==
"npc_dota_hero_antimage"
if
botName
==
"npc_dota_hero_antimage"
or
botName
==
"npc_dota_hero_queenofpain"
then
bot
:
Action_ClearActions
(
true
);
...
...
@@ -1192,7 +1198,7 @@ function X.CouldBlink(bot,nLocation)
elseif
IsLocationPassable
(
maxBlinkLoc
)
then
if
botName
==
"npc_dota_hero_antimage"
if
botName
==
"npc_dota_hero_antimage"
or
botName
==
"npc_dota_hero_queenofpain"
then
bot
:
Action_ClearActions
(
true
);
...
...
@@ -1248,6 +1254,9 @@ function X.IsNormalFarmer(bot)
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"
end
...
...
@@ -1273,6 +1282,9 @@ function X.IsHighFarmer(bot)
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"
end
...
...
@@ -1288,6 +1300,9 @@ function X.IsVeryHighFarmer(bot)
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"
end
...
...
mode_laning_generic.lua
View file @
db14cddc
...
...
@@ -4,7 +4,7 @@
--- Link:http://steamcommunity.com/sharedfiles/filedetails/?id=1573671599
--- 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
end
...
...
mode_push_tower_top.lua
0 → 100644
View file @
db14cddc
---------------------------------------------------------------------------
--- 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..
mode_rune_generic.lua
View file @
db14cddc
...
...
@@ -7,7 +7,7 @@
--- 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
end
...
...
@@ -19,7 +19,7 @@ local Item = require( GetScriptDirectory()..'/FunLib/aba_item')
local
bot
=
GetBot
()
local
minute
=
0
local
sec
=
0
local
closestRune
=
-
1
local
closestRune
,
closestDist
=
-
1
,
nil
local
runeStatus
=
-
1
local
ProxDist
=
1600
local
teamPlayers
=
nil
...
...
@@ -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_swift_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
or
(
bot
:
GetUnitName
()
==
"npc_dota_hero_antimage"
or
bot
:
GetUnitName
()
==
"npc_dota_hero_queenofpain"
)
...
...
mode_secret_shop_generic.lua
View file @
db14cddc
...
...
@@ -6,7 +6,7 @@
--- Link:http://steamcommunity.com/sharedfiles/filedetails/?id=1573671599
--- 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
;
end
...
...
mode_side_shop_generic.lua
View file @
db14cddc
...
...
@@ -4,7 +4,7 @@
--- Link:http://steamcommunity.com/sharedfiles/filedetails/?id=1573671599
--- 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
;
end
...
...
mode_team_roam_generic.lua
View file @
db14cddc
...
...
@@ -6,7 +6,7 @@
--- Link:http://steamcommunity.com/sharedfiles/filedetails/?id=1573671599
--- 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
;
end
...
...
@@ -77,28 +77,32 @@ function GetDesire()
end
end
--捡A杖会崩客户端
-- local pickScepterHero = J.GetPickUltimateScepterUnit();
-- if pickScepterHero ~= nil and false
-- and pickScepterHero:IsBot()
-- and bot == pickScepterHero
-- and J.Item.GetEmptyInventoryAmount(bot) > 0
-- then
-- local item = nil;
-- local dropped = GetDroppedItemList();
-- for _,drop in pairs(dropped)
-- do
-- if drop.item:GetName() == "item_ultimate_scepter_2"
-- then
-- item = drop;
-- break;
-- end
-- end
-- if item ~= nil then
--捡A杖会崩客户端,总之做个提示然后放过去
local
pickScepterHero
=
J
.
GetPickUltimateScepterUnit
();
if
pickScepterHero
~=
nil
and
false
and
pickScepterHero
:
IsBot
()
and
bot
==
pickScepterHero
and
J
.
Item
.
GetEmptyInventoryAmount
(
bot
)
>
0
then
local
item
=
nil
;
local
dropped
=
GetDroppedItemList
();
for
_
,
drop
in
pairs
(
dropped
)
do
if
drop
.
item
:
GetName
()
==
"item_ultimate_scepter_2"
then
bot
:
ActionImmediate_Chat
(
"目前版本的DOTA2客户端,AI捡起阿哈利姆福佑会导致客户端崩溃"
,
false
)
bot
:
ActionImmediate_Chat
(
"为防止此bug,天地星AI不会捡起这个福佑"
,
false
)
--item = drop;
--break
end
end
--if item ~= nil then
-- pickedItem = item;
-- return BOT_MODE_DESIRE_VERYHIGH;
--
end
--
end
--end
end
droppedCheck
=
DotaTime
();
end
...
...
@@ -134,7 +138,7 @@ function GetDesire()
if
GetGameMode
()
==
GAMEMODE_1V1MID
and
bot
:
GetAssignedLane
()
~=
LANE_MID
then
return
BOT_MODE_DESIRE_ABSOLUTE
;
return
BOT_MODE_DESIRE_ABSOLUTE
end
if
beTechies
or
J
.
Role
[
'bStopAction'
]
then
return
2
.
0
end
...
...
@@ -143,20 +147,26 @@ function GetDesire()
then
if
cAbility
==
nil
then
cAbility
=
bot
:
GetAbilityByName
(
"pugna_life_drain"
)
end
;
if
cAbility
:
IsInAbilityPhase
()
or
bot
:
IsChanneling
()
then
return
BOT_MODE_DESIRE_ABSOLUTE
;
return
BOT_MODE_DESIRE_ABSOLUTE
end
elseif
botName
==
"npc_dota_hero_drow_ranger"
then
if
cAbility
==
nil
then
cAbility
=
bot
:
GetAbilityByName
(
"drow_ranger_multishot"
)
end
;
if
cAbility
:
IsInAbilityPhase
()
or
bot
:
IsChanneling
()
then
return
BOT_MODE_DESIRE_ABSOLUTE
;
return
BOT_MODE_DESIRE_ABSOLUTE
end
elseif
botName
==
"npc_dota_hero_shadow_shaman"
then
if
cAbility
==
nil
then
cAbility
=
bot
:
GetAbilityByName
(
"shadow_shaman_shackles"
)
end
;
if
cAbility
:
IsInAbilityPhase
()
or
bot
:
IsChanneling
()
then
return
BOT_MODE_DESIRE_ABSOLUTE
;
return
BOT_MODE_DESIRE_ABSOLUTE
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
if
beSpecialSupport
...
...
mode_ward_generic.lua
View file @
db14cddc
...
...
@@ -7,7 +7,7 @@
--- 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
;
end
...
...
rewrite_functions.lua
View file @
db14cddc
...
...
@@ -119,6 +119,67 @@ function CDOTABaseAbility_BotScript.GetVal(ability, name)
end
return
f
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
--------------------------------
...
...
@@ -130,6 +191,7 @@ function CDOTA_Bot_Script.GetLocation(unit)
if
not
unit
:
CanBeSeen
()
then
local
id
=
unit
:
GetPlayerID
()
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
return
info
.
location
end
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment