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
f9c0f12d
Commit
f9c0f12d
authored
Apr 23, 2023
by
JoyJ
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
7.33 ites
parent
d1cf3a7d
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
128 additions
and
11 deletions
+128
-11
BotLib/hero_abaddon.lua
BotLib/hero_abaddon.lua
+1
-1
FunLib/aba_chat.lua
FunLib/aba_chat.lua
+51
-3
FunLib/jmz_func.lua
FunLib/jmz_func.lua
+10
-0
ability_item_usage_generic.lua
ability_item_usage_generic.lua
+47
-1
hero_selection.lua
hero_selection.lua
+1
-1
mode_team_roam_generic.lua
mode_team_roam_generic.lua
+3
-5
rewrite_functions.lua
rewrite_functions.lua
+15
-0
No files found.
BotLib/hero_abaddon.lua
View file @
f9c0f12d
...
...
@@ -91,7 +91,7 @@ end
--[[
npc_dota_hero_
oracle
npc_dota_hero_
abaddon
"Ability1" "abaddon_death_coil"
"Ability2" "abaddon_aphotic_shield"
...
...
FunLib/aba_chat.lua
View file @
f9c0f12d
...
...
@@ -2169,7 +2169,7 @@ Chat['tItemNameList'] = {
},
[
23
0
]
=
{
[
23
1
]
=
{
[
'sRawName'
]
=
'item_apex'
,
[
'sShortName'
]
=
'itemNull'
,
[
'sCnName'
]
=
'极'
,
...
...
@@ -2464,7 +2464,7 @@ Chat['tItemNameList'] = {
[
267
]
=
{
[
'sRawName'
]
=
'item_black_powder_bag'
,
[
'sShortName'
]
=
'itemNull'
,
[
'sCnName'
]
=
'
炸雷服
'
,
[
'sCnName'
]
=
'
雷火弹
'
,
[
'sEnName'
]
=
0
,
},
...
...
@@ -2640,7 +2640,7 @@ Chat['tItemNameList'] = {
},
[
28
8
]
=
{
[
28
9
]
=
{
[
'sRawName'
]
=
'item_pavise'
,
[
'sShortName'
]
=
'itemNull'
,
[
'sCnName'
]
=
'长盾'
,
...
...
@@ -2648,6 +2648,54 @@ Chat['tItemNameList'] = {
},
[
290
]
=
{
[
'sRawName'
]
=
'item_spark_of_courage'
,
[
'sShortName'
]
=
'itemNull'
,
[
'sCnName'
]
=
'勇气之光'
,
[
'sEnName'
]
=
0
,
},
[
291
]
=
{
[
'sRawName'
]
=
'item_duelist_gloves'
,
[
'sShortName'
]
=
'itemNull'
,
[
'sCnName'
]
=
'勇气之光'
,
[
'sEnName'
]
=
0
,
},
[
292
]
=
{
[
'sRawName'
]
=
'item_gossamer_cape'
,
[
'sShortName'
]
=
'itemNull'
,
[
'sCnName'
]
=
'蛛丝斗篷'
,
[
'sEnName'
]
=
0
,
},
[
293
]
=
{
[
'sRawName'
]
=
'item_dandelion_amulet'
,
[
'sShortName'
]
=
'itemNull'
,
[
'sCnName'
]
=
'蒲公英护符'
,
[
'sEnName'
]
=
0
,
},
[
294
]
=
{
[
'sRawName'
]
=
'item_defiant_shell'
,
[
'sShortName'
]
=
'itemNull'
,
[
'sCnName'
]
=
'不羁甲壳'
,
[
'sEnName'
]
=
0
,
},
[
295
]
=
{
[
'sRawName'
]
=
'item_vindicators_axe'
,
[
'sShortName'
]
=
'itemNull'
,
[
'sCnName'
]
=
'正义之斧'
,
[
'sEnName'
]
=
0
,
},
}
...
...
FunLib/jmz_func.lua
View file @
f9c0f12d
...
...
@@ -3723,6 +3723,16 @@ function J.GetVal(ability, name)
return
f
end
function
J
.
WontDie
(
unit
)
if
not
unit
:
CanBeSeen
()
then
return
false
end
for
_
,
buff
in
J
.
Buff
[
'enemy_is_undead'
]
do
if
unit
:
HasModifier
(
buff
)
then
return
true
end
end
return
false
end
return
J
--[[
...
...
ability_item_usage_generic.lua
View file @
f9c0f12d
...
...
@@ -5376,7 +5376,7 @@ X.ConsiderItemDesire["item_demonicon"] = function( hItem )
end
--
堕天斧
--
天崩
X
.
ConsiderItemDesire
[
"item_fallen_sky"
]
=
function
(
hItem
)
local
nCastRange
=
1600
...
...
@@ -5507,6 +5507,7 @@ X.ConsiderItemDesire["item_book_of_shadows"] = function( hItem )
end
--[[
--风暴宝器
X.ConsiderItemDesire["item_stormcrafter"] = function( hItem )
...
...
@@ -5539,6 +5540,7 @@ X.ConsiderItemDesire["item_stormcrafter"] = function( hItem )
return BOT_ACTION_DESIRE_NONE
end
]]
--
--欺诈师斗篷
X
.
ConsiderItemDesire
[
"item_trickster_cloak"
]
=
function
(
hItem
)
...
...
@@ -6026,6 +6028,50 @@ end
--灵匣/item_phylactery,分散到各个脚本里单独处理
--浩劫巨锤
X
.
ConsiderItemDesire
[
"item_havoc_hammer"
]
=
function
(
hItem
)
local
nCastRange
=
hItem
:
GetVal
(
'range'
)
local
sCastType
=
'none'
local
hEffectTarget
=
nil
local
sCastMotive
=
nil
local
damage
=
hItem
:
GetVal
(
'nuke_base_dmg'
)
+
hItem
:
GetVal
(
'nuke_str_dmg'
)
*
bot
:
GetStrength
()
local
nInRangeEnmyList
=
bot
:
GetNearbyHeroes
(
nCastRange
,
true
,
BOT_MODE_NONE
)
if
#
nInRangeEnmyList
<
1
then
return
BOT_ACTION_DESIRE_NONE
end
if
#
nInRangeEnmyList
>
2
or
bot
:
GetHealthPercent
()
<=
50
then
return
BOT_ACTION_DESIRE_HIGH
,
nil
,
sCastType
,
"击退多个敌人或保命"
end
for
_
,
unit
in
pairs
(
nInRangeEnmyList
)
do
if
J
.
WillMagicKillTarget
(
bot
,
unit
,
damage
,
0
)
then
return
BOT_ACTION_DESIRE_HIGH
,
nil
,
sCastType
,
"击杀"
end
end
return
BOT_ACTION_DESIRE_NONE
end
--烈士鳞甲
X
.
ConsiderItemDesire
[
"item_martyrs_plate"
]
=
function
(
hItem
)
local
nCastRange
=
hItem
:
GetVal
(
'aura_radius'
)
local
sCastType
=
'none'
local
hEffectTarget
=
nil
local
sCastMotive
=
nil
local
allies
=
bot
:
GetNearbyHeroes
(
nCastRange
,
false
,
BOT_MODE_NONE
)
FilterTable
(
allies
,
function
(
u
)
return
u
~=
bot
and
u
:
WasRecentlyDamagedByAnyHero
(
2
.
0
)
and
u
:
GetHealth
()
<
bot
:
GetHealth
()
end
)
if
J
.
IsInTeamFight
(
bot
,
nCastRange
)
and
#
allies
>
0
and
bot
:
GetHealthPercent
()
>
50
then
return
BOT_ACTION_DESIRE_HIGH
,
hEffectTarget
,
sCastType
,
'烈士鳞甲'
end
end
--新物品
X
.
ConsiderItemDesire
[
"item_new"
]
=
function
(
hItem
)
...
...
hero_selection.lua
View file @
f9c0f12d
...
...
@@ -989,7 +989,7 @@ function Think()
if
not
IsPlayerBot
(
id
)
then
sSelectHero
=
Chat
[
'sAllHeroList'
][
RandomInt
(
2
,
121
)]
end
end
if
GetTeam
()
~=
TEAM_DIRE
and
i
==
2
then
sSelectHero
=
"npc_dota_hero_abaddon"
end
--
if GetTeam() ~= TEAM_DIRE and i == 2 then sSelectHero = "npc_dota_hero_abaddon" end
SelectHero
(
id
,
sSelectHero
)
if
Role
[
"bLobbyGame"
]
==
false
then
Role
[
"bLobbyGame"
]
=
true
end
...
...
mode_team_roam_generic.lua
View file @
f9c0f12d
...
...
@@ -1721,8 +1721,7 @@ end
function
X
.
ShouldNotRetreat
(
bot
)
if
bot
:
HasModifier
(
"modifier_item_satanic_unholy"
)
or
bot
:
HasModifier
(
"modifier_abaddon_borrowed_time"
)
or
bot
:
HasModifier
(
'modifier_abaddon_borrowed_time_immolate'
)
or
J
.
WontDie
(
bot
)
or
(
bot
:
GetCurrentMovementSpeed
()
<
240
and
not
bot
:
HasModifier
(
"modifier_arc_warden_spark_wraith_purge"
)
)
then
return
true
;
...
...
@@ -1766,10 +1765,9 @@ function X.ShouldNotRetreat(bot)
if
(
J
.
GetHP
(
ally
)
>
0
.
88
and
ally
:
GetLevel
()
>=
12
and
ally
:
GetActiveMode
()
~=
BOT_MODE_RETREAT
)
or
(
ally
:
HasModifier
(
"modifier_black_king_bar_immune"
)
or
ally
:
IsMagicImmune
()
)
or
(
ally
:
HasModifier
(
"modifier_item_mask_of_madness_berserk"
)
and
ally
:
GetAttackTarget
()
~=
nil
)
or
ally
:
HasModifier
(
"modifier_abaddon_borrowed_time"
)
or
J
.
WontDie
(
ally
)
or
ally
:
HasModifier
(
"modifier_item_satanic_unholy"
)
or
ally
:
HasModifier
(
"modifier_oracle_false_promise_timer"
)
then
or
not
ally
:
IsBot
()
then
return
true
;
end
end
...
...
rewrite_functions.lua
View file @
f9c0f12d
...
...
@@ -93,6 +93,21 @@ function CDOTA_Bot_Script.IsCanInvisible(unit)
end
return
true
end
function
CDOTA_Bot_Script
.
GetStrength
(
unit
)
if
not
unit
:
CanBeSeen
()
or
not
unit
:
IsHero
()
then
return
0
end
return
unit
:
GetAttributeValue
(
ATTRIBUTE_STRENGTH
)
end
function
CDOTA_Bot_Script
.
GetAgility
(
unit
)
if
not
unit
:
CanBeSeen
()
or
not
unit
:
IsHero
()
then
return
0
end
return
unit
:
GetAttributeValue
(
ATTRIBUTE_AGILITY
)
end
function
CDOTA_Bot_Script
.
GetIntellect
(
unit
)
if
not
unit
:
CanBeSeen
()
or
not
unit
:
IsHero
()
then
return
0
end
return
unit
:
GetAttributeValue
(
ATTRIBUTE_INTELLECT
)
end
function
CDOTA_Bot_Script
.
GetAllAttributes
(
unit
)
return
unit
:
GetStrength
()
+
unit
:
GetAgility
()
+
unit
:
GetIntellect
()
end
function
CDOTABaseAbility_BotScript
.
GetVal
(
ability
,
name
)
local
f
=
ability
:
GetSpecialValueFloat
(
name
)
if
math.abs
(
f
)
<
0
.
0001
then
...
...
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