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
ce98ce1a
Commit
ce98ce1a
authored
Oct 17, 2022
by
JoyJ
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix alchemist
parent
4c73dc3b
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
34 additions
and
30 deletions
+34
-30
BotLib/hero_alchemist.lua
BotLib/hero_alchemist.lua
+33
-29
hero_selection.lua
hero_selection.lua
+1
-1
No files found.
BotLib/hero_alchemist.lua
View file @
ce98ce1a
local
X
=
{}
local
bDebugMode
=
fals
e
local
bDebugMode
=
tru
e
local
bot
=
GetBot
()
_G
.
W2Time
=
_G
.
W2Time
or
{}
_G
.
W2Time
[
bot
]
=
_G
.
W2Time
[
bot
]
or
999999
local
J
=
require
(
GetScriptDirectory
()
..
'/FunLib/jmz_func'
)
local
Minion
=
dofile
(
GetScriptDirectory
()
..
'/FunLib/aba_minion'
)
...
...
@@ -27,11 +29,12 @@ local tOutFitList = {}
tOutFitList
[
'outfit_carry'
]
=
{
"item_
melee_carry
_outfit"
,
"item_
radiance
"
,
"item_
bristleback
_outfit"
,
"item_
soul_ring
"
,
"item_yasha"
,
"item_sange_and_yasha"
,
"item_black_king_bar"
,
"item_radiance"
,
"item_sange_and_yasha"
,
"item_basher"
,
"item_assault"
,
"item_abyssal_blade"
,
...
...
@@ -45,6 +48,7 @@ X['sBuyList'] = tOutFitList[sOutfitType]
X
[
'sSellList'
]
=
{
"item_magic_wand"
,
"item_glimmer_cape"
,
"item_soul_ring"
,
}
if
J
.
Role
.
IsPvNMode
()
or
J
.
Role
.
IsAllShadow
()
then
X
[
'sBuyList'
],
X
[
'sSellList'
]
=
{
'PvN_melee_carry'
},
{}
end
...
...
@@ -71,7 +75,7 @@ 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
W2Time
=
_G
.
W2Time
[
bot
]
local
castQDesire
,
castQLocation
local
castWDesire
...
...
@@ -117,10 +121,9 @@ function X.SkillsComplement()
J
.
SetQueuePtToINT
(
bot
,
true
)
bot
:
ActionQueue_UseAbility
OnEntity
(
abilityW
,
castWTarget
)
bot
:
ActionQueue_UseAbility
(
abilityW
)
return
end
castQDesire
,
castQLocation
,
sMotive
=
X
.
ConsiderQ
()
if
(
castQDesire
>
0
)
then
...
...
@@ -145,14 +148,14 @@ function X.SkillsComplement()
return
end
castDDesire
,
sMotive
=
X
.
ConsiderD
()
castDDesire
,
castDTarget
,
sMotive
=
X
.
ConsiderD
()
if
(
castDDesire
>
0
)
then
J
.
SetReportMotive
(
bDebugMode
,
sMotive
)
J
.
SetQueuePtToINT
(
bot
,
true
)
bot
:
ActionQueue_UseAbility
(
abilityR
)
bot
:
ActionQueue_UseAbility
OnEntity
(
abilityD
,
castDTarget
)
return
end
...
...
@@ -160,8 +163,11 @@ function X.SkillsComplement()
end
function
X
.
ConsiderW2
()
if
W2Time
>
0
and
(
abilityW2
:
IsHidden
()
or
not
abilityW2
:
IsFullyCastable
())
then
W2Time
=
0
if
_G
.
W2Time
[
bot
]
<
999999
and
(
abilityW2
:
IsHidden
()
or
not
abilityW2
:
IsTrained
()
or
not
abilityW2
:
IsFullyCastable
())
then
_G
.
W2Time
[
bot
]
=
999999
return
0
end
if
abilityW2
:
IsHidden
()
or
not
abilityW2
:
IsTrained
()
or
not
abilityW2
:
IsFullyCastable
()
then
return
0
end
...
...
@@ -172,7 +178,7 @@ function X.ConsiderW2()
local
nEnemysHeroesInView
=
bot
:
GetNearbyHeroes
(
880
,
true
,
BOT_MODE_NONE
)
local
nSkillLV
=
abilityW
:
GetLevel
()
local
nCastPoint
=
abilityW2
:
GetCastPoint
()
local
remainTime
=
5
.
4
-
nCastPoint
-
(
time
-
W2Time
)
local
remainTime
=
5
.
4
-
nCastPoint
-
(
time
-
_G
.
W2Time
[
bot
]
)
--打断
if
#
nEnemysHeroesInView
>
0
then
...
...
@@ -187,11 +193,13 @@ function X.ConsiderW2()
end
end
if
not
time
>
W2Time
+
2
.
0
then
return
0
end
print
(
time
)
print
(
_G
.
W2Time
[
bot
])
if
not
(
time
>
(
_G
.
W2Time
[
bot
]
+
2
.
0
))
then
return
0
end
local
nDamage
=
16
+
14
*
nSkillLV
if
nLV
>=
28
then
nDamage
=
nDamage
+
80
end
nDamage
=
nDamage
*
(
time
-
W2Time
)
nDamage
=
nDamage
*
(
time
-
_G
.
W2Time
[
bot
]
)
--击杀
if
#
nEnemysHeroesInCastRange
>
0
then
...
...
@@ -277,20 +285,16 @@ function X.ConsiderQ()
local
nCastRange
=
abilityQ
:
GetCastRange
()
+
aetherRange
local
nCastPoint
=
abilityQ
:
GetCastPoint
()
local
nManaCost
=
abilityQ
:
GetManaCost
()
local
nDamageType
=
DAMAGE_TYPE_
MAG
ICAL
local
nDamageType
=
DAMAGE_TYPE_
PHYS
ICAL
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
if
J
.
IsAllowedToSpam
(
bot
,
nManaCost
)
and
nCanHurtEnemyAoE
.
count
>=
3
then
nTargetLocation
=
nCanHurtEnemyAoE
.
targetloc
return
BOT_ACTION_DESIRE_HIGH
,
nTargetLocation
,
'Q消耗'
end
...
...
@@ -349,7 +353,7 @@ function X.ConsiderQ()
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
)
local
locationAoEHurt
=
bot
:
FindAoELocation
(
true
,
false
,
bot
:
GetLocation
(),
nCastRange
,
nRadius
+
50
,
0
,
0
)
if
locationAoEHurt
.
count
>=
3
then
nTargetLocation
=
locationAoEHurt
.
targetloc
return
BOT_ACTION_DESIRE_HIGH
,
nTargetLocation
,
"Q带线"
..
locationAoEHurt
.
count
...
...
@@ -395,7 +399,7 @@ function X.ConsiderW()
and
J
.
CanCastOnTargetAdvanced
(
nEnemysHeroesInView
[
i
]
)
and
nEnemysHeroesInView
[
i
]:
IsChanneling
()
then
W2Time
=
time
_G
.
W2Time
[
bot
]
=
time
return
BOT_ACTION_DESIRE_HIGH
,
"W-打断-开摇"
..
J
.
Chat
.
GetNormName
(
botTarget
)
end
end
...
...
@@ -413,8 +417,8 @@ function X.ConsiderW()
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
)
_G
.
W2Time
[
bot
]
=
time
return
BOT_ACTION_DESIRE_HIGH
,
"W-击杀-开摇"
..
J
.
Chat
.
GetNormName
(
botTarget
)
end
end
end
...
...
@@ -443,7 +447,7 @@ function X.ConsiderW()
if
(
npcMostDangerousEnemy
~=
nil
)
then
W2Time
=
time
_G
.
W2Time
[
bot
]
=
time
return
BOT_ACTION_DESIRE_HIGH
,
"W-团战晕眩高威胁目标-开摇"
..
J
.
Chat
.
GetNormName
(
botTarget
)
end
end
...
...
@@ -460,7 +464,7 @@ function X.ConsiderW()
and
not
J
.
IsDisabled
(
target
)
and
not
target
:
IsDisarmed
())
or
remainTime
<=
0
.
5
)
then
W2Time
=
time
_G
.
W2Time
[
bot
]
=
time
return
BOT_ACTION_DESIRE_HIGH
,
"W-追杀-开摇"
end
end
...
...
@@ -475,7 +479,7 @@ function X.ConsiderW()
and
not
nEnemysHeroesInCastRange
[
1
]:
IsDisarmed
()
and
(
GetUnitToLocationDistance
(
bot
,
target
:
GetExtrapolatedLocation
(
0
.
5
+
nCastPoint
))
>
nCastRange
/
4
*
3
)
then
W2Time
=
time
_G
.
W2Time
[
bot
]
=
time
return
BOT_ACTION_DESIRE_HIGH
,
"W-撤退-开摇"
end
end
...
...
@@ -490,7 +494,7 @@ function X.ConsiderR()
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
if
nHP
<
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
...
...
hero_selection.lua
View file @
ce98ce1a
...
...
@@ -991,7 +991,7 @@ function Think()
sSelectHero
=
sSelectList
[
i
]
end
--if GetTeam() ~= TEAM_DIRE and i == 2 then sSelectHero = "npc_dota_hero_abyssal_underlord
" end
if
GetTeam
()
~=
TEAM_DIRE
and
i
==
1
then
sSelectHero
=
"npc_dota_hero_alchemist
"
end
--if GetTeam() ~= TEAM_DIRE and i == 3 then sSelectHero = "npc_dota_hero_abaddon" end
-------******************************-----------------------------------------------
-- if GetTeam() ~= TEAM_DIRE and i == 2 then sSelectHero = "npc_dota_hero_lina" 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