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
2e89661a
Commit
2e89661a
authored
Apr 23, 2023
by
JoyJ
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
7.33 stuffs
parent
5523aee7
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
65 additions
and
26 deletions
+65
-26
BotLib/hero_bane.lua
BotLib/hero_bane.lua
+17
-17
BotLib/hero_muerta.lua
BotLib/hero_muerta.lua
+3
-1
BotLib/hero_oracle.lua
BotLib/hero_oracle.lua
+41
-5
FunLib/jmz_func.lua
FunLib/jmz_func.lua
+4
-3
No files found.
BotLib/hero_bane.lua
View file @
2e89661a
...
...
@@ -285,7 +285,7 @@ function X.ConsiderE()
for
_
,
npcEnemy
in
pairs
(
nInBonusEnemyList
)
do
if
J
.
IsValid
(
npcEnemy
)
and
J
.
CanCastOn
Non
MagicImmune
(
npcEnemy
)
and
J
.
CanCastOnMagicImmune
(
npcEnemy
)
and
J
.
CanCastOnTargetAdvanced
(
npcEnemy
)
then
if
npcEnemy
:
IsChanneling
()
...
...
@@ -306,7 +306,7 @@ function X.ConsiderE()
for
_
,
npcEnemy
in
pairs
(
nInBonusEnemyList
)
do
if
J
.
IsValid
(
npcEnemy
)
and
J
.
CanCastOn
Non
MagicImmune
(
npcEnemy
)
and
J
.
CanCastOnMagicImmune
(
npcEnemy
)
and
J
.
CanCastOnTargetAdvanced
(
npcEnemy
)
and
not
J
.
IsDisabled
(
npcEnemy
)
and
not
npcEnemy
:
IsDisarmed
()
...
...
@@ -329,7 +329,7 @@ function X.ConsiderE()
for
_
,
npcEnemy
in
pairs
(
hEnemyList
)
do
if
J
.
IsValid
(
npcEnemy
)
and
J
.
CanCastOn
Non
MagicImmune
(
npcEnemy
)
and
J
.
CanCastOnMagicImmune
(
npcEnemy
)
then
nEnemyCount
=
nEnemyCount
+
1
if
J
.
CanCastOnTargetAdvanced
(
npcEnemy
)
...
...
@@ -366,7 +366,7 @@ function X.ConsiderE()
do
if
J
.
IsValid
(
npcEnemy
)
and
npcEnemy
:
GetPlayerID
()
~=
botTarget
:
GetPlayerID
()
and
J
.
CanCastOn
Non
MagicImmune
(
npcEnemy
)
and
J
.
CanCastOnMagicImmune
(
npcEnemy
)
and
J
.
CanCastOnTargetAdvanced
(
npcEnemy
)
and
not
J
.
IsDisabled
(
npcEnemy
)
and
not
npcEnemy
:
IsDisarmed
()
...
...
@@ -382,7 +382,7 @@ function X.ConsiderE()
and
J
.
IsRunning
(
botTarget
)
and
bot
:
IsFacingLocation
(
botTarget
:
GetLocation
(),
20
)
and
not
botTarget
:
IsFacingLocation
(
bot
:
GetLocation
(),
150
)
and
J
.
CanCastOn
Non
MagicImmune
(
botTarget
)
and
J
.
CanCastOnMagicImmune
(
botTarget
)
and
J
.
CanCastOnTargetAdvanced
(
botTarget
)
then
local
allyList
=
botTarget
:
GetNearbyHeroes
(
500
,
true
,
BOT_MODE_NONE
)
...
...
@@ -430,7 +430,7 @@ function X.ConsiderW()
for
_
,
npcEnemy
in
pairs
(
nInBonusEnemyList
)
do
if
J
.
IsValid
(
npcEnemy
)
and
J
.
CanCastOn
Non
MagicImmune
(
npcEnemy
)
and
J
.
CanCastOnMagicImmune
(
npcEnemy
)
and
J
.
CanCastOnTargetAdvanced
(
npcEnemy
)
then
if
J
.
WillMagicKillTarget
(
bot
,
npcEnemy
,
nDamage
,
nCastPoint
)
...
...
@@ -458,7 +458,7 @@ function X.ConsiderW()
for
_
,
npcEnemy
in
pairs
(
nInRangeEnemyList
)
do
if
J
.
IsValid
(
npcEnemy
)
and
J
.
CanCastOn
Non
MagicImmune
(
npcEnemy
)
and
J
.
CanCastOnMagicImmune
(
npcEnemy
)
and
J
.
CanCastOnTargetAdvanced
(
npcEnemy
)
then
local
npcEnemyHealth
=
npcEnemy
:
GetHealth
()
...
...
@@ -483,7 +483,7 @@ function X.ConsiderW()
if
J
.
IsGoingOnSomeone
(
bot
)
then
if
J
.
IsValidHero
(
botTarget
)
and
J
.
CanCastOn
Non
MagicImmune
(
botTarget
)
and
J
.
CanCastOnMagicImmune
(
botTarget
)
and
J
.
CanCastOnTargetAdvanced
(
botTarget
)
and
J
.
IsInRange
(
botTarget
,
bot
,
nCastRange
+
50
)
then
...
...
@@ -506,7 +506,7 @@ function X.ConsiderW()
for
_
,
npcEnemy
in
pairs
(
nInRangeEnemyList
)
do
if
J
.
IsValid
(
npcEnemy
)
and
J
.
CanCastOn
Non
MagicImmune
(
npcEnemy
)
and
J
.
CanCastOnMagicImmune
(
npcEnemy
)
and
not
J
.
IsDisabled
(
npcEnemy
)
and
not
npcEnemy
:
IsDisarmed
()
and
bot
:
IsFacingLocation
(
npcEnemy
:
GetLocation
(),
45
)
...
...
@@ -524,7 +524,7 @@ function X.ConsiderW()
for
_
,
npcEnemy
in
pairs
(
nInRangeEnemyList
)
do
if
J
.
IsValid
(
npcEnemy
)
and
J
.
CanCastOn
Non
MagicImmune
(
npcEnemy
)
and
J
.
CanCastOnMagicImmune
(
npcEnemy
)
and
J
.
CanCastOnTargetAdvanced
(
npcEnemy
)
and
(
bot
:
WasRecentlyDamagedByHero
(
npcEnemy
,
5
.
0
)
or
nLostHealth
>
nDamage
*
2
)
then
...
...
@@ -542,7 +542,7 @@ function X.ConsiderW()
for
_
,
creep
in
pairs
(
creepList
)
do
if
J
.
IsValid
(
creep
)
and
J
.
CanCastOn
Non
MagicImmune
(
creep
)
and
J
.
CanCastOnMagicImmune
(
creep
)
then
hCastTarget
=
creep
sCastMotive
=
'W-通过小兵回血'
...
...
@@ -620,7 +620,7 @@ function X.ConsiderW()
for
_
,
npcEnemy
in
pairs
(
nInRangeEnemyList
)
do
if
J
.
IsValid
(
npcEnemy
)
and
J
.
CanCastOn
Non
MagicImmune
(
npcEnemy
)
and
J
.
CanCastOnMagicImmune
(
npcEnemy
)
and
J
.
CanCastOnTargetAdvanced
(
npcEnemy
)
then
hCastTarget
=
npcEnemy
...
...
@@ -660,7 +660,7 @@ function X.ConsiderQ()
then
if
J
.
IsValidHero
(
botTarget
)
and
not
botTarget
:
HasModifier
(
'modifier_bane_enfeeble'
)
and
J
.
CanCastOn
Non
MagicImmune
(
botTarget
)
and
J
.
CanCastOnMagicImmune
(
botTarget
)
and
J
.
CanCastOnTargetAdvanced
(
botTarget
)
and
J
.
IsInRange
(
botTarget
,
bot
,
nCastRange
+
50
)
then
...
...
@@ -676,7 +676,7 @@ function X.ConsiderQ()
do
if
J
.
IsValid
(
npcEnemy
)
and
not
npcEnemy
:
HasModifier
(
'modifier_bane_enfeeble'
)
and
J
.
CanCastOn
Non
MagicImmune
(
npcEnemy
)
and
J
.
CanCastOnMagicImmune
(
npcEnemy
)
and
J
.
CanCastOnTargetAdvanced
(
npcEnemy
)
then
hCastTarget
=
npcEnemy
...
...
@@ -716,7 +716,7 @@ function X.ConsiderR()
for
_
,
npcEnemy
in
pairs
(
nInBonusEnemyList
)
do
if
J
.
IsValid
(
npcEnemy
)
and
J
.
CanCastOn
Non
MagicImmune
(
npcEnemy
)
and
J
.
CanCastOnMagicImmune
(
npcEnemy
)
and
J
.
CanCastOnTargetAdvanced
(
npcEnemy
)
then
if
npcEnemy
:
IsChanneling
()
...
...
@@ -751,7 +751,7 @@ function X.ConsiderR()
for
_
,
npcEnemy
in
pairs
(
hEnemyList
)
do
if
J
.
IsValid
(
npcEnemy
)
and
J
.
CanCastOn
Non
MagicImmune
(
npcEnemy
)
and
J
.
CanCastOnMagicImmune
(
npcEnemy
)
and
J
.
CanCastOnTargetAdvanced
(
npcEnemy
)
and
not
J
.
IsDisabled
(
npcEnemy
)
then
...
...
@@ -779,7 +779,7 @@ function X.ConsiderR()
then
if
J
.
IsValidHero
(
botTarget
)
and
J
.
IsInRange
(
botTarget
,
bot
,
nCastRange
+
50
)
and
J
.
CanCastOn
Non
MagicImmune
(
botTarget
)
and
J
.
CanCastOnMagicImmune
(
botTarget
)
and
J
.
CanCastOnTargetAdvanced
(
botTarget
)
then
hCastTarget
=
botTarget
...
...
BotLib/hero_muerta.lua
View file @
2e89661a
...
...
@@ -33,9 +33,10 @@ tOutFitList['outfit_carry'] = {
"item_ranged_carry_outfit"
,
"item_maelstrom"
,
"item_aghanims_shard"
,
"item_mask_of_madness"
,
"item_dragon_lance"
,
"item_black_king_bar"
,
"item_dragon_lance"
,
"item_travel_boots"
,
"item_monkey_king_bar"
,
"item_hurricane_pike"
,
...
...
@@ -51,6 +52,7 @@ tOutFitList['outfit_priest'] = {
"item_priest_outfit"
,
"item_mekansm"
,
"item_aghanims_shard"
,
"item_shadow_amulet"
,
"item_guardian_greaves"
,
"item_spirit_vessel"
,
...
...
BotLib/hero_oracle.lua
View file @
2e89661a
...
...
@@ -39,10 +39,12 @@ tOutFitList['outfit_carry'] = {
-- "item_glimmer_cape",
"item_aghanims_shard"
,
"item_rod_of_atos"
,
"item_ultimate_scepter"
,
"item_cyclone"
,
"item_lotus_orb"
,
"item_sheepstick"
,
"item_gungir"
,
"item_ultimate_scepter_2"
,
"item_wind_waker"
,
"item_moon_shard"
,
...
...
@@ -54,13 +56,15 @@ tOutFitList['outfit_priest'] = {
'item_priest_outfit'
,
"item_urn_of_shadows"
,
"item_aghanims_shard"
,
"item_mekansm"
,
"item_ultimate_scepter"
,
"item_glimmer_cape"
,
"item_aghanims_shard"
,
"item_guardian_greaves"
,
"item_spirit_vessel"
,
"item_cyclone"
,
"item_shivas_guard"
,
"item_ultimate_scepter_2"
,
"item_sheepstick"
,
"item_moon_shard"
,
"item_wind_waker"
,
...
...
@@ -71,12 +75,14 @@ tOutFitList['outfit_mage'] = {
'item_mage_outfit'
,
"item_ancient_janggo"
,
"item_aghanims_shard"
,
"item_glimmer_cape"
,
"item_ultimate_scepter"
,
"item_boots_of_bearing"
,
"item_pipe"
,
"item_aghanims_shard"
,
"item_veil_of_discord"
,
"item_cyclone"
,
"item_ultimate_scepter_2"
,
"item_sheepstick"
,
"item_wind_waker"
,
"item_moon_shard"
,
...
...
@@ -249,13 +255,44 @@ function X.ConsiderD()
if
not
abilityD
:
IsTrained
()
or
not
abilityD
:
IsFullyCastable
()
then
return
0
end
local
nSkillLV
=
abilityD
:
GetLevel
()
local
nCastRange
=
650
+
aetherRange
local
nCastRange
=
abilityD
:
GetCastRange
()
+
aetherRange
local
nCastPoint
=
abilityD
:
GetCastPoint
()
local
nManaCost
=
abilityD
:
GetManaCost
()
local
nDamage
=
abilityD
:
GetAbilityDamage
()
local
nDamageType
=
DAMAGE_TYPE_MAGICAL
local
nRadius
=
650
local
nRadius
=
abilityD
:
GetVal
(
'radius'
)
local
allies
=
bot
:
GetNearbyHeroes
(
nCastRange
,
false
,
BOT_MODE_NONE
)
local
enemies
=
bot
:
GetNearbyHeroes
(
nCastRange
,
true
,
BOT_MODE_NONE
)
allies
=
FilterTable
(
enemies
,
function
(
u
)
return
not
u
:
IsMagicImmune
()
end
)
local
group
=
J
.
MergeGroup
(
allies
,
enemies
)
local
aoeLoc
=
bot
:
FindAoELocation
(
true
,
true
,
bot
:
GetLocation
(),
nCastRange
,
nRadius
,
2
)
local
aoeLoc2
=
bot
:
FindAoELocation
(
false
,
true
,
bot
:
GetLocation
(),
nCastRange
,
nRadius
,
2
)
local
aoeLoc3
if
aoeLoc
and
not
aoeLoc2
then
aoeLoc3
=
aoeLoc
.
targetloc
end
if
aoeLoc2
and
not
aoeLoc
then
aoeLoc3
=
aoeLoc2
.
targetloc
end
if
aoeLoc
and
aoeLoc2
then
aoeLoc3
=
RandomVector
(
0
.
0
)
aoeLoc3
.
x
=
(
aoeLoc
.
targetloc
.
x
+
aoeLoc2
.
targetloc
.
x
)
/
2
aoeLoc3
.
y
=
(
aoeLoc
.
targetloc
.
y
+
aoeLoc2
.
targetloc
.
y
)
/
2
FilterTable
(
group
,
function
(
u
)
return
u
:
GetDistanceToLocation
(
aoeLoc3
)
<
nRadius
end
)
if
#
group
>
aoeLoc
.
count
and
#
group
<
aoeLoc2
.
count
then
aoeLoc3
=
aoeLoc2
.
targetloc
end
if
#
group
<
aoeLoc
.
count
and
#
group
>
aoeLoc2
.
count
then
aoeLoc3
=
aoeLoc
.
targetloc
end
end
if
aoeLoc3
then
return
BOT_ACTION_DESIRE_HIGH
,
aoeLoc3
,
"D-AoE"
end
if
J
.
IsGoingOnSomeone
(
bot
)
then
...
...
@@ -268,7 +305,6 @@ function X.ConsiderD()
end
end
return
BOT_ACTION_DESIRE_NONE
...
...
FunLib/jmz_func.lua
View file @
2e89661a
...
...
@@ -3462,12 +3462,13 @@ function J.GetMagicToPhysicalDamage( bot, nUnit, nMagicDamage )
end
function
J
.
MergeGroup
(
nList
,
...
)
function
J
.
MergeGroup
(
...
)
local
args
=
{
...
}
local
result
=
{}
for
a
in
arg
do
table.insert
(
nLis
t
,
a
)
table.insert
(
resul
t
,
a
)
end
return
nLis
t
return
resul
t
end
function
J
.
Not
(
f
)
...
...
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