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
cb1dec71
Commit
cb1dec71
authored
Oct 17, 2022
by
JoyJ
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix underlord; add alchemist
parent
22d65b13
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
617 additions
and
2 deletions
+617
-2
BotLib/hero_abyssal_underlord.lua
BotLib/hero_abyssal_underlord.lua
+2
-1
BotLib/hero_alchemist.lua
BotLib/hero_alchemist.lua
+610
-0
hero_selection.lua
hero_selection.lua
+5
-1
No files found.
BotLib/hero_abyssal_underlord.lua
View file @
cb1dec71
...
@@ -278,7 +278,8 @@ function X.ConsiderW()
...
@@ -278,7 +278,8 @@ function X.ConsiderW()
local
nCastPoint
=
abilityW
:
GetCastPoint
()
+
0
.
5
local
nCastPoint
=
abilityW
:
GetCastPoint
()
+
0
.
5
local
nManaCost
=
abilityW
:
GetManaCost
()
local
nManaCost
=
abilityW
:
GetManaCost
()
local
nDamageType
=
DAMAGE_TYPE_MAGICAL
local
nDamageType
=
DAMAGE_TYPE_MAGICAL
local
nRadius
=
abilityW
:
GetSpecialValueInt
(
"light_strike_array_aoe"
)
local
nRadius
=
400
if
nLV
>=
27
then
nRadius
=
475
end
local
nInRangeEnemyList
=
bot
:
GetNearbyHeroes
(
nCastRange
+
nRadius
*
0
.
5
,
true
,
BOT_MODE_NONE
)
local
nInRangeEnemyList
=
bot
:
GetNearbyHeroes
(
nCastRange
+
nRadius
*
0
.
5
,
true
,
BOT_MODE_NONE
)
...
...
BotLib/hero_alchemist.lua
0 → 100644
View file @
cb1dec71
local
X
=
{}
local
bDebugMode
=
false
local
bot
=
GetBot
()
local
J
=
require
(
GetScriptDirectory
()
..
'/FunLib/jmz_func'
)
local
Minion
=
dofile
(
GetScriptDirectory
()
..
'/FunLib/aba_minion'
)
local
sTalentList
=
J
.
Skill
.
GetTalentList
(
bot
)
local
sAbilityList
=
J
.
Skill
.
GetAbilityList
(
bot
)
local
sOutfitType
=
J
.
Item
.
GetOutfitType
(
bot
)
local
tTalentTreeList
=
{
[
't25'
]
=
{
10
,
0
},
[
't20'
]
=
{
0
,
10
},
[
't15'
]
=
{
10
,
0
},
[
't10'
]
=
{
0
,
10
},
}
local
tAllAbilityBuildList
=
{
{
3
,
1
,
1
,
3
,
1
,
6
,
3
,
1
,
2
,
3
,
6
,
2
,
2
,
2
,
6
},
}
local
nAbilityBuildList
=
J
.
Skill
.
GetRandomBuild
(
tAllAbilityBuildList
)
local
nTalentBuildList
=
J
.
Skill
.
GetTalentBuild
(
tTalentTreeList
)
local
tOutFitList
=
{}
tOutFitList
[
'outfit_carry'
]
=
{
"item_melee_carry_outfit"
,
"item_aghanims_shard"
,
"item_aether_lens"
,
"item_urn_of_shadows"
,
"item_mekansm"
,
"item_glimmer_cape"
,
"item_octarine_core"
,
"item_sphere"
,
"item_radiance"
,
}
tOutFitList
[
'outfit_tank'
]
=
{
"item_bristleback_outfit"
,
"item_aghanims_shard"
,
"item_pipe"
,
"item_glimmer_cape"
,
"item_aether_lens"
,
"item_rod_of_atos"
,
"item_octarine_core"
,
"item_gungir"
,
"item_heart"
,
"item_radiance"
,
"item_ultimate_scepter_2"
,
}
tOutFitList
[
'outfit_mid'
]
=
tOutFitList
[
'outfit_tank'
]
X
[
'sBuyList'
]
=
tOutFitList
[
sOutfitType
]
X
[
'sSellList'
]
=
{
"item_magic_wand"
,
"item_glimmer_cape"
,
}
if
J
.
Role
.
IsPvNMode
()
or
J
.
Role
.
IsAllShadow
()
then
X
[
'sBuyList'
],
X
[
'sSellList'
]
=
{
'PvN_mage'
},
{}
end
nAbilityBuildList
,
nTalentBuildList
,
X
[
'sBuyList'
],
X
[
'sSellList'
]
=
J
.
SetUserHeroInit
(
nAbilityBuildList
,
nTalentBuildList
,
X
[
'sBuyList'
],
X
[
'sSellList'
]
)
X
[
'sSkillList'
]
=
J
.
Skill
.
GetSkillList
(
sAbilityList
,
nAbilityBuildList
,
sTalentList
,
nTalentBuildList
)
X
[
'bDeafaultAbility'
]
=
true
X
[
'bDeafaultItem'
]
=
true
function
X
.
MinionThink
(
hMinionUnit
)
if
Minion
.
IsValidUnit
(
hMinionUnit
)
then
Minion
.
IllusionThink
(
hMinionUnit
)
end
end
local
abilityQ
=
bot
:
GetAbilityByName
(
sAbilityList
[
1
]
)
local
abilityW
=
bot
:
GetAbilityByName
(
sAbilityList
[
2
]
)
local
abilityW2
=
bot
:
GetAbilityByName
(
'alchemist_unstable_concoction_throw'
)
local
abilityE
=
bot
:
GetAbilityByName
(
sAbilityList
[
3
]
)
local
abilityD
=
bot
:
GetAbilityByName
(
sAbilityList
[
4
]
)
local
abilityR
=
bot
:
GetAbilityByName
(
sAbilityList
[
6
]
)
local
W2Time
=
0
local
castQDesire
,
castQLocation
local
castWDesire
local
castW2Desire
,
castW2Target
--local castEDesire, castETarget
local
castDDesire
,
castDTarget
local
castRDesire
local
nKeepMana
,
nMP
,
nHP
,
nLV
,
hEnemyList
,
hAllyList
,
botTarget
,
sMotive
local
aetherRange
=
0
function
X
.
SkillsComplement
()
if
J
.
CanNotUseAbility
(
bot
)
or
bot
:
IsInvisible
()
then
return
end
nKeepMana
=
350
aetherRange
=
0
nLV
=
bot
:
GetLevel
()
nMP
=
bot
:
GetMana
()
/
bot
:
GetMaxMana
()
nHP
=
bot
:
GetHealth
()
/
bot
:
GetMaxHealth
()
botTarget
=
J
.
GetProperTarget
(
bot
)
hEnemyList
=
bot
:
GetNearbyHeroes
(
1600
,
true
,
BOT_MODE_NONE
)
hAllyList
=
J
.
GetAlliesNearLoc
(
bot
:
GetLocation
(),
1600
)
local
aether
=
J
.
IsItemAvailable
(
"item_aether_lens"
)
if
aether
~=
nil
then
aetherRange
=
250
end
castW2Desire
,
castW2Target
,
sMotive
=
X
.
ConsiderW2
()
if
(
castW2Desire
>
0
)
then
J
.
SetReportMotive
(
bDebugMode
,
sMotive
)
J
.
SetQueuePtToINT
(
bot
,
true
)
bot
:
ActionQueue_UseAbilityOnEntity
(
abilityW2
,
castW2Target
)
return
end
castWDesire
,
sMotive
=
X
.
ConsiderW
()
if
(
castWDesire
>
0
)
then
J
.
SetReportMotive
(
bDebugMode
,
sMotive
)
J
.
SetQueuePtToINT
(
bot
,
true
)
bot
:
ActionQueue_UseAbilityOnEntity
(
abilityW
,
castWTarget
)
return
end
castQDesire
,
castQLocation
,
sMotive
=
X
.
ConsiderQ
()
if
(
castQDesire
>
0
)
then
J
.
SetReportMotive
(
bDebugMode
,
sMotive
)
J
.
SetQueuePtToINT
(
bot
,
true
)
bot
:
ActionQueue_UseAbilityOnLocation
(
abilityQ
,
castQLocation
)
return
end
castRDesire
,
sMotive
=
X
.
ConsiderR
()
if
(
castRDesire
>
0
)
then
J
.
SetReportMotive
(
bDebugMode
,
sMotive
)
J
.
SetQueuePtToINT
(
bot
,
true
)
bot
:
ActionQueue_UseAbility
(
abilityR
)
return
end
castDDesire
,
sMotive
=
X
.
ConsiderD
()
if
(
castDDesire
>
0
)
then
J
.
SetReportMotive
(
bDebugMode
,
sMotive
)
J
.
SetQueuePtToINT
(
bot
,
true
)
bot
:
ActionQueue_UseAbility
(
abilityR
)
return
end
end
function
X
.
ConsiderW2
()
if
abilityW2
:
IsHidden
()
or
not
abilityW2
:
IsFullyCastable
()
then
W2Time
=
0
return
0
end
local
time
=
DotaTime
()
local
nCastRange
=
abilityW2
:
GetCastRange
()
+
aetherRange
local
nEnemysHeroesInCastRange
=
bot
:
GetNearbyHeroes
(
nCastRange
+
99
,
true
,
BOT_MODE_NONE
)
local
nEnemysHeroesInView
=
bot
:
GetNearbyHeroes
(
880
,
true
,
BOT_MODE_NONE
)
local
nSkillLV
=
abilityW
:
GetLevel
()
local
nCastPoint
=
abilityW2
:
GetCastPoint
()
local
remainTime
=
5
.
4
-
nCastPoint
-
(
time
-
W2Time
)
--打断
if
#
nEnemysHeroesInView
>
0
then
for
i
=
1
,
#
nEnemysHeroesInView
do
if
J
.
IsValid
(
nEnemysHeroesInView
[
i
]
)
and
J
.
CanCastOnNonMagicImmune
(
nEnemysHeroesInView
[
i
]
)
and
J
.
CanCastOnTargetAdvanced
(
nEnemysHeroesInView
[
i
]
)
and
nEnemysHeroesInView
[
i
]:
IsChanneling
()
then
return
BOT_ACTION_DESIRE_HIGH
,
nEnemysHeroesInView
[
i
],
"W-打断"
..
J
.
Chat
.
GetNormName
(
botTarget
)
end
end
end
if
not
time
>
W2Time
+
2
.
0
then
return
0
end
local
nDamage
=
16
+
14
*
nSkillLV
if
nLV
>=
28
then
nDamage
=
nDamage
+
80
end
nDamage
=
nDamage
*
(
time
-
W2Time
)
--击杀
if
#
nEnemysHeroesInCastRange
>
0
then
for
i
=
1
,
#
nEnemysHeroesInCastRange
do
if
J
.
IsValid
(
nEnemysHeroesInCastRange
[
i
]
)
and
J
.
CanCastOnNonMagicImmune
(
nEnemysHeroesInCastRange
[
i
]
)
and
J
.
CanCastOnTargetAdvanced
(
nEnemysHeroesInCastRange
[
i
]
)
and
J
.
WillKillTarget
(
nEnemysHeroesInCastRange
[
i
],
DAMAGE_TYPE_PHYSICAL
,
nCastPoint
+
GetUnitToUnitDistance
(
bot
,
nEnemysHeroesInCastRange
[
i
])
/
900
)
then
return
BOT_ACTION_DESIRE_HIGH
,
nEnemysHeroesInCastRange
[
i
],
"W-击杀"
..
J
.
Chat
.
GetNormName
(
botTarget
)
end
end
end
--团战
if
J
.
IsInTeamFight
(
bot
,
1200
)
and
DotaTime
()
>
4
*
60
then
local
npcMostDangerousEnemy
=
nil
local
nMostDangerousDamage
=
0
for
_
,
npcEnemy
in
pairs
(
nEnemysHeroesInCastRange
)
do
if
J
.
IsValid
(
npcEnemy
)
and
J
.
CanCastOnNonMagicImmune
(
npcEnemy
)
and
J
.
CanCastOnTargetAdvanced
(
npcEnemy
)
and
not
J
.
IsDisabled
(
npcEnemy
)
and
not
npcEnemy
:
IsDisarmed
()
then
local
npcEnemyDamage
=
npcEnemy
:
GetEstimatedDamageToTarget
(
false
,
bot
,
3
.
0
,
DAMAGE_TYPE_ALL
)
if
(
npcEnemyDamage
>
nMostDangerousDamage
)
then
nMostDangerousDamage
=
npcEnemyDamage
npcMostDangerousEnemy
=
npcEnemy
end
end
end
if
(
npcMostDangerousEnemy
~=
nil
)
then
return
BOT_ACTION_DESIRE_HIGH
,
npcMostDangerousEnemy
,
"W-团战晕眩高威胁目标"
..
J
.
Chat
.
GetNormName
(
botTarget
)
end
end
--常规
if
J
.
IsGoingOnSomeone
(
bot
)
then
local
target
=
J
.
GetProperTarget
(
bot
)
if
J
.
IsValidHero
(
target
)
and
J
.
CanCastOnNonMagicImmune
(
target
)
and
J
.
CanCastOnTargetAdvanced
(
target
)
and
J
.
IsInRange
(
target
,
bot
,
nCastRange
)
and
(((
GetUnitToLocationDistance
(
bot
,
target
:
GetExtrapolatedLocation
(
0
.
5
+
nCastPoint
))
>
(
nCastRange
/
4
*
3
))
and
not
J
.
IsDisabled
(
target
)
and
not
target
:
IsDisarmed
())
or
remainTime
<=
0
.
5
or
nHP
<
0
.
2
)
then
return
BOT_ACTION_DESIRE_HIGH
,
target
,
"W-追杀"
..
J
.
Chat
.
GetNormName
(
target
)
end
end
--撤退
if
J
.
IsRetreating
(
bot
)
then
if
J
.
IsValid
(
nEnemysHeroesInCastRange
[
1
]
)
and
J
.
CanCastOnNonMagicImmune
(
nEnemysHeroesInCastRange
[
1
]
)
and
J
.
CanCastOnTargetAdvanced
(
nEnemysHeroesInCastRange
[
1
]
)
and
not
J
.
IsDisabled
(
nEnemysHeroesInCastRange
[
1
]
)
and
not
nEnemysHeroesInCastRange
[
1
]:
IsDisarmed
()
and
(((
GetUnitToLocationDistance
(
bot
,
target
:
GetExtrapolatedLocation
(
0
.
5
+
nCastPoint
))
>
(
nCastRange
/
4
*
3
))
and
not
J
.
IsDisabled
(
target
)
and
not
target
:
IsDisarmed
())
or
remainTime
<=
0
.
5
or
nHP
<
0
.
2
)
then
return
BOT_ACTION_DESIRE_HIGH
,
nEnemysHeroesInCastRange
[
1
],
"W-撤退"
..
J
.
Chat
.
GetNormName
(
nEnemysHeroesInCastRange
[
1
]
)
end
end
return
BOT_ACTION_DESIRE_NONE
end
function
X
.
ConsiderQ
()
if
not
abilityQ
:
IsFullyCastable
()
then
return
0
end
local
nSkillLV
=
abilityQ
:
GetLevel
()
local
nCastRange
=
abilityQ
:
GetCastRange
()
+
aetherRange
local
nCastPoint
=
abilityQ
:
GetCastPoint
()
local
nManaCost
=
abilityQ
:
GetManaCost
()
local
nDamageType
=
DAMAGE_TYPE_MAGICAL
local
nRadius
=
425
if
bot
:
GetLevel
()
>=
10
then
nRadius
=
525
end
local
nPercentDamage
=
0
.
005
*
nSkillLV
+
0
.
01
if
bot
:
GetLevel
()
>=
20
then
nPercentDamage
=
nPercentDamage
+
0
.
01
end
nPercentDamage
=
nPercentDamage
*
2
-- 2秒的输出
local
nInRangeEnemyList
=
bot
:
GetNearbyHeroes
(
nCastRange
+
nRadius
*
0
.
5
,
true
,
BOT_MODE_NONE
)
local
nTargetLocation
=
nil
--消耗,保持一定魔量
local
nCanHurtEnemyAoE
=
bot
:
FindAoELocation
(
true
,
false
,
bot
:
GetLocation
(),
nCastRange
,
nRadius
+
20
,
0
,
0
)
if
nSkillLV
>
1
and
J
.
IsAllowedToSpam
(
bot
,
nManaCost
)
and
nCanHurtEnemyAoE
.
count
>=
3
then
nTargetLocation
=
nCanHurtEnemyAoE
.
targetloc
return
BOT_ACTION_DESIRE_HIGH
,
nTargetLocation
,
'Q消耗'
end
--团战
if
J
.
IsInTeamFight
(
bot
,
1200
)
then
local
nAoeLoc
=
J
.
GetAoeEnemyHeroLocation
(
bot
,
nCastRange
,
nRadius
,
2
)
if
nAoeLoc
~=
nil
then
nTargetLocation
=
nAoeLoc
return
BOT_ACTION_DESIRE_HIGH
,
nTargetLocation
,
'Q团战'
end
end
--追杀,目标速度不快就放
if
J
.
IsGoingOnSomeone
(
bot
)
then
if
J
.
IsValidHero
(
botTarget
)
and
J
.
CanCastOnNonMagicImmune
(
botTarget
)
and
J
.
IsInRange
(
botTarget
,
bot
,
nCastRange
-
30
)
and
(
botTarget
:
GetCurrentMovementSpeed
()
<
240
or
botTarget
:
IsStunned
())
then
nTargetLocation
=
J
.
GetDelayCastLocation
(
bot
,
botTarget
,
nCastRange
,
nRadius
,
nCastPoint
)
if
nTargetLocation
~=
nil
then
return
BOT_ACTION_DESIRE_HIGH
,
nTargetLocation
,
"Q追杀"
..
J
.
Chat
.
GetNormName
(
botTarget
)
end
end
end
--打野
if
J
.
IsFarming
(
bot
)
and
nSkillLV
>=
2
and
J
.
IsAllowedToSpam
(
bot
,
nManaCost
)
then
if
J
.
IsValid
(
botTarget
)
and
botTarget
:
GetTeam
()
==
TEAM_NEUTRAL
and
J
.
IsInRange
(
bot
,
botTarget
,
1000
)
and
nMP
>
0
.
4
then
local
nShouldHurtCount
=
nMP
>
0
.
6
and
2
or
3
local
locationAoE
=
bot
:
FindAoELocation
(
true
,
false
,
bot
:
GetLocation
(),
nCastRange
,
nRadius
,
0
,
0
)
if
(
locationAoE
.
count
>=
nShouldHurtCount
)
then
nTargetLocation
=
locationAoE
.
targetloc
return
BOT_ACTION_DESIRE_HIGH
,
nTargetLocation
,
"Q打钱"
..
locationAoE
.
count
end
end
end
--带线
if
(
J
.
IsPushing
(
bot
)
or
J
.
IsDefending
(
bot
)
or
J
.
IsFarming
(
bot
)
)
and
J
.
IsAllowedToSpam
(
bot
,
nManaCost
)
and
nSkillLV
>=
3
and
DotaTime
()
>
9
*
60
and
#
hEnemyList
==
0
then
local
laneCreepList
=
bot
:
GetNearbyLaneCreeps
(
nCastRange
+
200
,
true
)
if
#
laneCreepList
>=
4
and
J
.
IsValid
(
laneCreepList
[
1
]
)
and
not
laneCreepList
[
1
]:
HasModifier
(
"modifier_fountain_glyph"
)
then
local
locationAoEHurt
=
bot
:
FindAoELocation
(
true
,
false
,
bot
:
GetLocation
(),
nCastRange
,
nRadius
+
50
,
0
.
5
,
0
)
if
locationAoEHurt
.
count
>=
3
then
nTargetLocation
=
locationAoEHurt
.
targetloc
return
BOT_ACTION_DESIRE_HIGH
,
nTargetLocation
,
"Q带线"
..
locationAoEHurt
.
count
end
end
end
--肉山
if
bot
:
GetActiveMode
()
==
BOT_MODE_ROSHAN
and
bot
:
GetMana
()
>=
600
then
if
J
.
IsRoshan
(
botTarget
)
and
J
.
GetHP
(
botTarget
)
>
0
.
1
and
J
.
IsInRange
(
botTarget
,
bot
,
nCastRange
)
then
nTargetLocation
=
botTarget
:
GetLocation
()
return
BOT_ACTION_DESIRE_HIGH
,
nTargetLocation
,
'Q肉山'
end
end
return
BOT_ACTION_DESIRE_NONE
end
function
X
.
ConsiderW
()
if
abilityW
:
IsHidden
()
or
not
abilityW
:
IsFullyCastable
()
then
return
0
end
local
time
=
DotaTime
()
local
nCastRange
=
abilityQ
:
GetCastRange
()
+
aetherRange
local
nEnemysHeroesInCastRange
=
bot
:
GetNearbyHeroes
(
nCastRange
/
4
*
3
,
true
,
BOT_MODE_NONE
)
local
nEnemysHeroesInView
=
bot
:
GetNearbyHeroes
(
880
,
true
,
BOT_MODE_NONE
)
local
nSkillLV
=
abilityW
:
GetLevel
()
local
nCastPoint
=
abilityW2
:
GetCastPoint
()
--打断
if
#
nEnemysHeroesInView
>
0
then
for
i
=
1
,
#
nEnemysHeroesInView
do
if
J
.
IsValid
(
nEnemysHeroesInView
[
i
]
)
and
J
.
CanCastOnNonMagicImmune
(
nEnemysHeroesInView
[
i
]
)
and
J
.
CanCastOnTargetAdvanced
(
nEnemysHeroesInView
[
i
]
)
and
nEnemysHeroesInView
[
i
]:
IsChanneling
()
then
W2Time
=
time
return
BOT_ACTION_DESIRE_HIGH
,
"W-打断-开摇"
..
J
.
Chat
.
GetNormName
(
botTarget
)
end
end
end
local
nDamage
=
16
+
14
*
nSkillLV
if
nLV
>=
28
then
nDamage
=
nDamage
+
80
end
nDamage
=
nDamage
*
2
.
0
--击杀
if
#
nEnemysHeroesInCastRange
>
0
then
for
i
=
1
,
#
nEnemysHeroesInCastRange
do
if
J
.
IsValid
(
nEnemysHeroesInCastRange
[
i
]
)
and
J
.
CanCastOnNonMagicImmune
(
nEnemysHeroesInCastRange
[
i
]
)
and
J
.
CanCastOnTargetAdvanced
(
nEnemysHeroesInCastRange
[
i
]
)
and
J
.
WillKillTarget
(
nEnemysHeroesInCastRange
[
i
],
DAMAGE_TYPE_PHYSICAL
,
nCastPoint
+
GetUnitToUnitDistance
(
bot
,
nEnemysHeroesInCastRange
[
i
])
/
900
)
then
W2Time
=
time
return
BOT_ACTION_DESIRE_HIGH
,
nEnemysHeroesInCastRange
[
i
],
"W-击杀-开摇"
..
J
.
Chat
.
GetNormName
(
botTarget
)
end
end
end
--团战
if
J
.
IsInTeamFight
(
bot
,
1200
)
and
DotaTime
()
>
4
*
60
then
local
npcMostDangerousEnemy
=
nil
local
nMostDangerousDamage
=
0
for
_
,
npcEnemy
in
pairs
(
nEnemysHeroesInCastRange
)
do
if
J
.
IsValid
(
npcEnemy
)
and
J
.
CanCastOnNonMagicImmune
(
npcEnemy
)
and
J
.
CanCastOnTargetAdvanced
(
npcEnemy
)
and
not
J
.
IsDisabled
(
npcEnemy
)
and
not
npcEnemy
:
IsDisarmed
()
then
local
npcEnemyDamage
=
npcEnemy
:
GetEstimatedDamageToTarget
(
false
,
bot
,
3
.
0
,
DAMAGE_TYPE_ALL
)
if
(
npcEnemyDamage
>
nMostDangerousDamage
)
then
nMostDangerousDamage
=
npcEnemyDamage
npcMostDangerousEnemy
=
npcEnemy
end
end
end
if
(
npcMostDangerousEnemy
~=
nil
)
then
W2Time
=
time
return
BOT_ACTION_DESIRE_HIGH
,
"W-团战晕眩高威胁目标-开摇"
..
J
.
Chat
.
GetNormName
(
botTarget
)
end
end
--常规
if
J
.
IsGoingOnSomeone
(
bot
)
then
local
target
=
J
.
GetProperTarget
(
bot
)
if
J
.
IsValidHero
(
target
)
and
J
.
CanCastOnNonMagicImmune
(
target
)
and
J
.
CanCastOnTargetAdvanced
(
target
)
and
J
.
IsInRange
(
target
,
bot
,
nCastRange
)
and
(((
GetUnitToLocationDistance
(
bot
,
target
:
GetExtrapolatedLocation
(
0
.
5
+
nCastPoint
))
>
nCastRange
/
4
*
3
)
and
not
J
.
IsDisabled
(
target
)
and
not
target
:
IsDisarmed
())
or
remainTime
<=
0
.
5
)
then
W2Time
=
time
return
BOT_ACTION_DESIRE_HIGH
,
"W-追杀-开摇"
end
end
--撤退
if
J
.
IsRetreating
(
bot
)
then
if
J
.
IsValid
(
nEnemysHeroesInCastRange
[
1
]
)
and
J
.
CanCastOnNonMagicImmune
(
nEnemysHeroesInCastRange
[
1
]
)
and
J
.
CanCastOnTargetAdvanced
(
nEnemysHeroesInCastRange
[
1
]
)
and
not
J
.
IsDisabled
(
nEnemysHeroesInCastRange
[
1
]
)
and
not
nEnemysHeroesInCastRange
[
1
]:
IsDisarmed
()
and
(
GetUnitToLocationDistance
(
bot
,
target
:
GetExtrapolatedLocation
(
0
.
5
+
nCastPoint
))
>
nCastRange
/
4
*
3
)
then
W2Time
=
time
return
BOT_ACTION_DESIRE_HIGH
,
"W-撤退-开摇"
end
end
return
BOT_ACTION_DESIRE_NONE
end
function
X
.
ConsiderR
()
if
not
abilityR
:
IsFullyCastable
()
then
return
0
end
if
J
.
IsInTeamFight
(
bot
,
1200
)
then
return
BOT_ACTION_DESIRE_HIGH
,
"R-开战"
end
if
nHP
(
bot
)
<
0
.
5
or
(
bot
:
WasRecentlyDamagedByAnyHero
(
3
.
0
)
and
nHP
<
0
.
7
)
then
return
BOT_ACTION_DESIRE_HIGH
,
"R-回复"
end
if
J
.
IsGoingOnSomeone
(
bot
)
and
J
.
IsValidHero
(
J
.
GetProperTarget
(
bot
)
)
then
return
BOT_ACTION_DESIRE_HIGH
,
"R-追杀"
end
return
BOT_ACTION_DESIRE_NONE
end
function
X
.
ConsiderD
()
if
not
abilityD
:
IsTrained
()
or
not
abilityD
:
IsFullyCastable
()
then
return
BOT_ACTION_DESIRE_NONE
end
local
nCastRange
=
abilityW
:
GetCastRange
()
+
aetherRange
local
nCastPoint
=
abilityW
:
GetCastPoint
()
local
nManaCost
=
abilityW
:
GetManaCost
()
local
nHealHealth
=
400
local
hCastTarget
=
nil
local
sCastMotive
=
nil
for
_
,
npcAlly
in
pairs
(
hAllyList
)
do
if
J
.
IsValidHero
(
npcAlly
)
and
J
.
IsInRange
(
bot
,
npcAlly
,
nCastRange
+
300
)
and
not
npcAlly
:
HasModifier
(
'modifier_alchemist_berserk_potion'
)
and
not
npcAlly
:
IsMagicImmune
()
and
not
npcAlly
:
IsInvulnerable
()
and
not
npcAlly
:
IsIllusion
()
then
--为加Buff
if
npcAlly
:
GetAttackTarget
()
~=
nil
and
npcAlly
:
GetAttackTarget
():
IsHero
()
and
npcAlly
:
GetMaxHealth
()
-
npcAlly
:
GetHealth
()
>=
nHealHealth
*
0
.
8
then
hCastTarget
=
npcAlly
sCastMotive
=
'D-加Buff:'
..
J
.
Chat
.
GetNormName
(
hCastTarget
)
return
BOT_ACTION_DESIRE_HIGH
,
hCastTarget
,
sCastMotive
end
--为被减速队友解减速
if
npcAlly
:
GetCurrentMovementSpeed
()
<
npcAlly
:
GetBaseMovementSpeed
()
then
hCastTarget
=
npcAlly
sCastMotive
=
'D-解减速:'
..
J
.
Chat
.
GetNormName
(
hCastTarget
)
return
BOT_ACTION_DESIRE_HIGH
,
hCastTarget
,
sCastMotive
end
--为撤退中的队友加血
if
J
.
IsRetreating
(
npcAlly
)
and
not
npcAlly
:
HasModifier
(
'modifier_fountain_aura'
)
and
npcAlly
:
GetMaxHealth
()
-
npcAlly
:
GetHealth
()
>=
nHealHealth
*
0
.
7
and
npcAlly
:
WasRecentlyDamagedByAnyHero
(
3
.
0
)
then
hCastTarget
=
npcAlly
sCastMotive
=
'D-加撤退中的队友:'
..
J
.
Chat
.
GetNormName
(
hCastTarget
)
return
BOT_ACTION_DESIRE_HIGH
,
hCastTarget
,
sCastMotive
end
--为准备打架的力量/敏捷队友辅助
if
J
.
IsGoingOnSomeone
(
npcAlly
)
and
npcAlly
:
GetPrimaryAttribute
()
~=
ATTRIBUTE_INTELLECT
then
local
allyTarget
=
J
.
GetProperTarget
(
npcAlly
)
if
J
.
IsValidHero
(
allyTarget
)
and
npcAlly
:
IsFacingLocation
(
allyTarget
:
GetLocation
(),
20
)
and
J
.
IsInRange
(
npcAlly
,
allyTarget
,
npcAlly
:
GetAttackRange
()
+
60
)
then
hCastTarget
=
npcAlly
sCastMotive
=
'D-进攻辅助队友:'
..
J
.
Chat
.
GetNormName
(
hCastTarget
)
return
BOT_ACTION_DESIRE_HIGH
,
hCastTarget
,
sCastMotive
end
end
--为残血队友buff
if
J
.
GetHP
(
npcAlly
)
<
0
.
5
and
(
npcAlly
:
WasRecentlyDamagedByAnyHero
(
5
.
0
)
or
J
.
GetHP
(
npcAlly
)
<
0
.
25
)
and
not
npcAlly
:
HasModifier
(
'modifier_fountain_aura'
)
then
hCastTarget
=
npcAlly
sCastMotive
=
'D-为队友回血:'
..
J
.
Chat
.
GetNormName
(
hCastTarget
)
return
BOT_ACTION_DESIRE_HIGH
,
hCastTarget
,
sCastMotive
end
end
end
return
BOT_ACTION_DESIRE_NONE
end
return
X
-- dota2jmz@163.com QQ:2462331592..
hero_selection.lua
View file @
cb1dec71
...
@@ -174,6 +174,7 @@ local sHasDevelopmentHeroList = {
...
@@ -174,6 +174,7 @@ local sHasDevelopmentHeroList = {
"npc_dota_hero_abaddon"
,
"npc_dota_hero_abaddon"
,
"npc_dota_hero_abyssal_underlord"
,
"npc_dota_hero_abyssal_underlord"
,
"npc_dota_hero_alchemist"
,
"npc_dota_hero_silencer"
,
"npc_dota_hero_silencer"
,
"npc_dota_hero_warlock"
,
"npc_dota_hero_warlock"
,
"npc_dota_hero_necrolyte"
,
"npc_dota_hero_necrolyte"
,
...
@@ -237,6 +238,7 @@ local sHasDevelopmentHeroList = {
...
@@ -237,6 +238,7 @@ local sHasDevelopmentHeroList = {
local
sFirstList
=
{
local
sFirstList
=
{
"npc_dota_hero_silencer"
,
"npc_dota_hero_silencer"
,
"npc_dota_hero_alchemist"
,
"npc_dota_hero_warlock"
,
"npc_dota_hero_warlock"
,
"npc_dota_hero_necrolyte"
,
"npc_dota_hero_necrolyte"
,
"npc_dota_hero_oracle"
,
"npc_dota_hero_oracle"
,
...
@@ -294,7 +296,7 @@ local sFourthList = {
...
@@ -294,7 +296,7 @@ local sFourthList = {
"npc_dota_hero_bristleback"
,
"npc_dota_hero_bristleback"
,
"npc_dota_hero_dragon_knight"
,
"npc_dota_hero_dragon_knight"
,
"npc_dota_hero_kunkka"
,
"npc_dota_hero_kunkka"
,
"npc_dota_hero_skeleton_king"
,
"npc_dota_hero_skeleton_king"
,
"npc_dota_hero_ogre_magi"
,
"npc_dota_hero_ogre_magi"
,
"npc_dota_hero_sand_king"
,
"npc_dota_hero_sand_king"
,
"npc_dota_hero_bounty_hunter"
,
"npc_dota_hero_bounty_hunter"
,
...
@@ -372,6 +374,7 @@ local sMageList = {
...
@@ -372,6 +374,7 @@ local sMageList = {
local
sCarryList
=
{
local
sCarryList
=
{
"npc_dota_hero_antimage"
,
"npc_dota_hero_antimage"
,
"npc_dota_hero_alchemist"
,
"npc_dota_hero_arc_warden"
,
"npc_dota_hero_arc_warden"
,
"npc_dota_hero_bloodseeker"
,
"npc_dota_hero_bloodseeker"
,
"npc_dota_hero_bristleback"
,
"npc_dota_hero_bristleback"
,
...
@@ -412,6 +415,7 @@ local sCarryList = {
...
@@ -412,6 +415,7 @@ local sCarryList = {
local
sTankList
=
{
local
sTankList
=
{
"npc_dota_hero_abaddon"
,
"npc_dota_hero_abaddon"
,
"npc_dota_hero_alchemist"
,
"npc_dota_hero_bristleback"
,
"npc_dota_hero_bristleback"
,
"npc_dota_hero_abyssal_underlord"
,
"npc_dota_hero_abyssal_underlord"
,
"npc_dota_hero_chaos_knight"
,
"npc_dota_hero_chaos_knight"
,
...
...
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