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
f2ecbf86
Commit
f2ecbf86
authored
Apr 23, 2023
by
JoyJ
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update legion commander
parent
f9c0f12d
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
31 additions
and
91 deletions
+31
-91
BotLib/hero_abaddon.lua
BotLib/hero_abaddon.lua
+2
-2
BotLib/hero_legion_commander.lua
BotLib/hero_legion_commander.lua
+23
-87
rewrite_functions.lua
rewrite_functions.lua
+6
-2
No files found.
BotLib/hero_abaddon.lua
View file @
f2ecbf86
...
...
@@ -10,7 +10,7 @@ local sOutfitType = J.Item.GetOutfitType( bot )
local
tTalentTreeList
=
{
[
't25'
]
=
{
10
,
0
},
[
't20'
]
=
{
0
,
1
0
},
[
't20'
]
=
{
10
,
0
},
[
't15'
]
=
{
10
,
0
},
[
't10'
]
=
{
10
,
0
},
}
...
...
@@ -28,7 +28,7 @@ local tOutFitList = {}
tOutFitList
[
'outfit_priest'
]
=
{
"item_mage_outfit"
,
--
"item_glimmer_cape",
"item_glimmer_cape"
,
-- "item_rod_of_atos",
"item_aghanims_shard"
,
"item_holy_locket"
,
...
...
BotLib/hero_legion_commander.lua
View file @
f2ecbf86
...
...
@@ -246,13 +246,22 @@ function X.ConsiderQ()
local
nSkillLV
=
abilityQ
:
GetLevel
()
local
nCastRange
=
600
local
nRadius
=
600
local
nCastPoint
=
abilityQ
:
GetCastPoint
()
local
nManaCost
=
abilityQ
:
GetManaCost
()
local
nDamage
=
abilityQ
:
GetSpecialValueInt
(
'damage'
)
*
2
local
nInRangeEnemyList
=
bot
:
GetNearbyHeroes
(
nCastRange
,
true
,
BOT_MODE_NONE
)
local
nInRangeEnemyCreepList
=
bot
:
GetNearbyLaneCreeps
(
nCastRange
,
true
)
nInRangeEnemyCreepList
=
J
.
MergeGroup
(
nInRangeEnemyCreepList
,
bot
:
GetNearbyNeutralCreeps
(
nCastRange
))
local
t
=
bot
:
GetTalent
(
'special_bonus_unique_legion_commander_4'
)
local
damagePerHero
=
abilityQ
:
GetVal
(
'damage_per_hero'
)
if
t
then
damagePerHero
=
damagePerHero
+
75
end
local
nDamage
=
abilityQ
:
GetVal
(
'damage'
)
+
abilityQ
:
GetVal
(
'damage_per_unit'
)
*
#
nInRangeEnemyCreepList
+
damagePerHero
*
#
nInRangeEnemyList
local
nDamageType
=
DAMAGE_TYPE_MAGICAL
local
nInRangeEnemyList
=
J
.
GetAroundEnemyHeroList
(
nCastRange
)
local
nInBonusEnemyList
=
J
.
GetAroundEnemyHeroList
(
nCastRange
+
200
)
local
hCastTarget
=
nil
local
sCastMotive
=
nil
...
...
@@ -264,85 +273,21 @@ function X.ConsiderQ()
and
J
.
WillMagicKillTarget
(
bot
,
npcEnemy
,
nDamage
,
nCastPoint
)
then
hCastTarget
=
npcEnemy
:
GetLocation
()
return
BOT_ACTION_DESIRE_HIGH
,
hCastTarget
,
'Q-击杀'
..
J
.
Chat
.
GetNormName
(
npcEnemy
)
return
BOT_ACTION_DESIRE_HIGH
,
'Q-击杀'
..
J
.
Chat
.
GetNormName
(
npcEnemy
)
end
end
--消耗
local
nCanHurtEnemyAoE
=
bot
:
FindAoELocation
(
true
,
true
,
bot
:
GetLocation
(),
10
,
590
,
0
,
0
)
if
nCanHurtEnemyAoE
.
count
>=
3
then
if
(
#
nInRangeEnemyCreepList
+
#
nInRangeEnemyList
*
2
)
>=
4
then
hCastTarget
=
nCanHurtEnemyAoE
.
targetloc
return
BOT_ACTION_DESIRE_HIGH
,
hCastTarget
,
'Q-消耗'
end
--对线消耗或补刀
if
J
.
IsLaning
(
bot
)
then
--对线消耗
local
nAoeLoc
=
J
.
GetAoeEnemyHeroLocation
(
bot
,
50
,
450
,
2
)
if
nAoeLoc
~=
nil
and
nMP
>
0
.
38
then
hCastTarget
=
nAoeLoc
return
BOT_ACTION_DESIRE_HIGH
,
hCastTarget
,
'Q-对线消耗'
end
end
--团战
if
J
.
IsInTeamFight
(
bot
,
1200
)
then
local
nAoeLoc
=
J
.
GetAoeEnemyHeroLocation
(
bot
,
49
,
499
,
2
)
if
nAoeLoc
~=
nil
then
hCastTarget
=
nAoeLoc
return
BOT_ACTION_DESIRE_HIGH
,
hCastTarget
,
'Q-团战'
end
end
--打架时先手
if
J
.
IsGoingOnSomeone
(
bot
)
then
if
J
.
IsValidHero
(
botTarget
)
and
J
.
CanCastOnNonMagicImmune
(
botTarget
)
and
J
.
IsInRange
(
botTarget
,
bot
,
nCastRange
-
80
)
then
if
nSkillLV
>=
2
or
nMP
>
0
.
68
or
J
.
GetHP
(
botTarget
)
<
0
.
38
then
hCastTarget
=
J
.
GetCastLocation
(
bot
,
botTarget
,
10
,
490
)
if
hCastTarget
~=
nil
then
return
BOT_ACTION_DESIRE_HIGH
,
hCastTarget
,
'Q-攻击'
..
J
.
Chat
.
GetNormName
(
botTarget
)
end
end
end
return
BOT_ACTION_DESIRE_HIGH
,
'Q-消耗'
end
--撤退前加速
if
J
.
IsRetreating
(
bot
)
and
not
bot
:
HasModifier
(
'modifier_legion_commander_overwhelming_odds'
)
then
for
_
,
npcEnemy
in
pairs
(
nInRangeEnemyList
)
do
if
J
.
IsValid
(
npcEnemy
)
and
bot
:
WasRecentlyDamagedByHero
(
npcEnemy
,
5
.
0
)
and
J
.
CanCastOnNonMagicImmune
(
npcEnemy
)
--and bot:IsFacingLocation( npcEnemy:GetLocation(), 40 )
then
hCastTarget
=
npcEnemy
:
GetLocation
()
return
BOT_ACTION_DESIRE_HIGH
,
hCastTarget
,
'Q-撤退'
..
J
.
Chat
.
GetNormName
(
npcEnemy
)
end
end
end
--打钱
if
J
.
IsFarming
(
bot
)
and
nSkillLV
>=
3
and
J
.
IsAllowedToSpam
(
bot
,
nManaCost
*
0
.
25
)
and
J
.
IsAllowedToSpam
(
bot
,
nManaCost
)
then
if
J
.
IsValid
(
botTarget
)
and
botTarget
:
GetTeam
()
==
TEAM_NEUTRAL
...
...
@@ -350,11 +295,8 @@ function X.ConsiderQ()
and
(
botTarget
:
GetMagicResist
()
<
0
.
4
or
nMP
>
0
.
9
)
then
local
nShouldHurtCount
=
nMP
>
0
.
55
and
3
or
4
local
locationAoE
=
bot
:
FindAoELocation
(
true
,
false
,
bot
:
GetLocation
(),
40
,
400
,
0
,
0
)
if
(
locationAoE
.
count
>=
nShouldHurtCount
)
then
hCastTarget
=
locationAoE
.
targetloc
return
BOT_ACTION_DESIRE_HIGH
,
hCastTarget
,
"Q-打钱"
..
locationAoE
.
count
if
#
nInRangeEnemyCreepList
>=
nShouldHurtCount
then
return
BOT_ACTION_DESIRE_HIGH
,
"Q-打钱"
end
end
end
...
...
@@ -366,18 +308,12 @@ function X.ConsiderQ()
and
nSkillLV
>=
2
and
DotaTime
()
>
6
*
60
and
#
hAllyList
<=
3
and
#
hEnemyList
==
0
then
local
laneCreepList
=
bot
:
GetNearbyLaneCreeps
(
1400
,
true
)
if
#
laneCreepList
>=
4
local
laneCreepList
=
bot
:
GetNearbyLaneCreeps
(
nCastRange
,
true
)
if
#
laneCreepList
>=
3
and
J
.
IsValid
(
laneCreepList
[
1
]
)
and
not
laneCreepList
[
1
]:
HasModifier
(
"modifier_fountain_glyph"
)
then
and
not
laneCreepList
[
1
]:
HasModifier
(
"modifier_fountain_glyph"
)
then
local
locationAoEHurt
=
bot
:
FindAoELocation
(
true
,
false
,
bot
:
GetLocation
(),
30
,
400
,
0
,
0
)
if
locationAoEHurt
.
count
>=
4
then
hCastTarget
=
locationAoEHurt
.
targetloc
return
BOT_ACTION_DESIRE_HIGH
,
hCastTarget
,
"Q-带线"
..
locationAoEHurt
.
count
end
return
BOT_ACTION_DESIRE_HIGH
,
"Q-带线"
end
end
...
...
rewrite_functions.lua
View file @
f2ecbf86
...
...
@@ -55,9 +55,8 @@ _G.FilterTable = function(t,filter)
end
return
newGroup
end
function
CDOTA_Bot_Script
.
IsAlly
(
unit
)
return
GetBot
():
GetTeam
()
==
unit
:
GetTeam
()
return
unit
:
CanBeSeen
()
and
GetBot
():
GetTeam
()
==
unit
:
GetTeam
()
end
function
CDOTA_Bot_Script
.
GetHealthPercent
(
unit
)
return
unit
:
GetHealth
()
/
unit
:
GetMaxHealth
()
*
100
.
0
...
...
@@ -108,6 +107,11 @@ end
function
CDOTA_Bot_Script
.
GetAllAttributes
(
unit
)
return
unit
:
GetStrength
()
+
unit
:
GetAgility
()
+
unit
:
GetIntellect
()
end
function
CDOTA_Bot_Script
.
GetTalent
(
unit
,
talent
)
if
not
unit
:
CanBeSeen
()
or
not
unit
:
IsAlly
()
then
return
nil
end
local
t
=
unit
:
GetAbilityByName
(
talent
)
if
t
and
t
:
IsTrained
()
then
return
t
end
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