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
71e98103
Commit
71e98103
authored
Apr 03, 2023
by
JoyJ
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
updates from jodyjmaulana/aba-update
parent
f2f0e0bf
Changes
15
Hide whitespace changes
Inline
Side-by-side
Showing
15 changed files
with
2191 additions
and
29 deletions
+2191
-29
BotLib/hero_night_stalker.lua
BotLib/hero_night_stalker.lua
+588
-0
BotLib/hero_obsidian_destroyer.lua
BotLib/hero_obsidian_destroyer.lua
+498
-0
BotLib/hero_terrorblade.lua
BotLib/hero_terrorblade.lua
+701
-0
FunLib/aba_buff.lua
FunLib/aba_buff.lua
+146
-0
FunLib/aba_item.lua
FunLib/aba_item.lua
+23
-2
FunLib/aba_role.lua
FunLib/aba_role.lua
+7
-0
FunLib/aba_site.lua
FunLib/aba_site.lua
+76
-16
FunLib/aba_skill.lua
FunLib/aba_skill.lua
+11
-6
FunLib/jmz_func.lua
FunLib/jmz_func.lua
+49
-0
ability_item_usage_generic.lua
ability_item_usage_generic.lua
+60
-1
hero_selection.lua
hero_selection.lua
+11
-1
item_purchase_generic.lua
item_purchase_generic.lua
+5
-2
mode_farm_generic.lua
mode_farm_generic.lua
+6
-0
mode_laning_generic.lua
mode_laning_generic.lua
+5
-0
mode_team_roam_generic.lua
mode_team_roam_generic.lua
+5
-1
No files found.
BotLib/hero_night_stalker.lua
0 → 100644
View file @
71e98103
----------------------------------------------------------------------------------------------------
--- The Creation Come From: BOT EXPERIMENT Credit:FURIOUSPUPPY
--- BOT EXPERIMENT Author: Arizona Fauzie 2018.11.21
--- Link:http://steamcommunity.com/sharedfiles/filedetails/?id=837040016
--- Refactor: 决明子 Email: dota2jmz@163.com 微博@Dota2_决明子
--- Link:http://steamcommunity.com/sharedfiles/filedetails/?id=1573671599
--- Link:http://steamcommunity.com/sharedfiles/filedetails/?id=1627071163
--- Updated: Nikel
--- carry, tank
----------------------------------------------------------------------------------------------------
local
X
=
{}
local
bDebugMode
=
(
1
==
10
)
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
=
{
[
'outfit_carry'
]
=
{
[
't25'
]
=
{
0
,
10
},
[
't20'
]
=
{
10
,
0
},
[
't15'
]
=
{
0
,
10
},
[
't10'
]
=
{
10
,
0
},
},
[
'outfit_mid'
]
=
{
[
't25'
]
=
{
0
,
10
},
[
't20'
]
=
{
10
,
0
},
[
't15'
]
=
{
0
,
10
},
[
't10'
]
=
{
10
,
0
},
},
[
'outfit_priest'
]
=
{
[
't25'
]
=
{
10
,
0
},
[
't20'
]
=
{
0
,
10
},
[
't15'
]
=
{
10
,
0
},
[
't10'
]
=
{
0
,
10
},
},
[
'outfit_mage'
]
=
{
[
't25'
]
=
{
10
,
0
},
[
't20'
]
=
{
0
,
10
},
[
't15'
]
=
{
10
,
0
},
[
't10'
]
=
{
0
,
10
},
},
[
'outfit_tank'
]
=
{
[
't25'
]
=
{
10
,
0
},
[
't20'
]
=
{
0
,
10
},
[
't15'
]
=
{
10
,
0
},
[
't10'
]
=
{
0
,
10
},
},
}
local
tAllAbilityBuildList
=
{
[
'outfit_carry'
]
=
{
{
1
,
3
,
1
,
3
,
2
,
6
,
1
,
1
,
3
,
3
,
6
,
2
,
2
,
2
,
6
}
},
[
'outfit_mid'
]
=
{
{
1
,
3
,
1
,
3
,
2
,
6
,
1
,
1
,
3
,
3
,
6
,
2
,
2
,
2
,
6
}
},
[
'outfit_priest'
]
=
{
{
1
,
3
,
1
,
3
,
2
,
6
,
1
,
1
,
3
,
3
,
6
,
2
,
2
,
2
,
6
}
},
[
'outfit_mage'
]
=
{
{
1
,
3
,
1
,
3
,
2
,
6
,
1
,
1
,
3
,
3
,
6
,
2
,
2
,
2
,
6
}
},
[
'outfit_tank'
]
=
{
{
1
,
3
,
1
,
3
,
2
,
6
,
1
,
1
,
3
,
3
,
6
,
2
,
2
,
2
,
6
}
},
}
local
nAbilityBuildList
=
J
.
Skill
.
GetRandomBuild
(
tAllAbilityBuildList
[
sOutfitType
]
)
local
nTalentBuildList
=
J
.
Skill
.
GetTalentBuild
(
tTalentTreeList
[
sOutfitType
]
)
local
tOutFitList
=
{}
tOutFitList
[
'outfit_carry'
]
=
{
"item_sven_outfit"
,
"item_echo_sabre"
,
"item_black_king_bar"
,
"item_basher"
,
"item_blink"
,
"item_abyssal_blade"
,
"item_assault"
,
"item_aghanims_shard"
,
"item_ultimate_scepter"
,
"item_travel_boots"
,
"item_overwhelming_blink"
,
"item_ultimate_scepter_2"
,
"item_nullifier"
,
"item_moon_shard"
,
"item_travel_boots_2"
,
}
tOutFitList
[
'outfit_mid'
]
=
tOutFitList
[
'outfit_carry'
]
tOutFitList
[
'outfit_priest'
]
=
tOutFitList
[
'outfit_carry'
]
tOutFitList
[
'outfit_mage'
]
=
tOutFitList
[
'outfit_carry'
]
tOutFitList
[
'outfit_tank'
]
=
tOutFitList
[
'outfit_carry'
]
X
[
'sBuyList'
]
=
tOutFitList
[
sOutfitType
]
X
[
'sSellList'
]
=
{
"item_basher"
,
"item_quelling_blade"
,
"item_blink"
,
"item_magic_wand"
,
"item_assault"
,
"item_bracer"
,
"item_ultimate_scepter"
,
"item_echo_sabre"
,
"item_travel_boots"
,
"item_phase_boots"
,
}
if
J
.
Role
.
IsPvNMode
()
or
J
.
Role
.
IsAllShadow
()
then
X
[
'sBuyList'
],
X
[
'sSellList'
]
=
{
'PvN_melee_carry'
},
{}
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'
]
=
false
X
[
'bDeafaultItem'
]
=
false
function
X
.
MinionThink
(
hMinionUnit
)
if
Minion
.
IsValidUnit
(
hMinionUnit
)
then
Minion
.
IllusionThink
(
hMinionUnit
)
end
end
--[[
npc_dota_hero_night_stalker
"Ability1" "night_stalker_void"
"Ability2" "night_stalker_crippling_fear"
"Ability3" "night_stalker_hunter_in_the_night"
"Ability4" "generic_hidden"
"Ability5" "generic_hidden"
"Ability6" "night_stalker_darkness"
"Ability10" "special_bonus_unique_night_stalker_4"
"Ability11" "special_bonus_unique_night_stalker_7"
"Ability12" "special_bonus_unique_night_stalker_3"
"Ability13" "special_bonus_unique_night_stalker_hunter_status_resist"
"Ability14" "special_bonus_unique_night_stalker_6"
"Ability15" "special_bonus_strength_20"
"Ability16" "special_bonus_unique_night_stalker_2"
"Ability17" "special_bonus_unique_night_stalker"
modifier_night_stalker_void
modifier_stunned
modifier_night_stalker_crippling_fear_aura
modifier_night_stalker_crippling_fear
modifier_night_stalker_hunter_in_the_night
modifier_night_stalker_darkness
--]]
local
abilityQ
=
bot
:
GetAbilityByName
(
sAbilityList
[
1
]
)
local
abilityW
=
bot
:
GetAbilityByName
(
sAbilityList
[
2
]
)
local
abilityE
=
bot
:
GetAbilityByName
(
sAbilityList
[
3
]
)
local
abilityR
=
bot
:
GetAbilityByName
(
sAbilityList
[
6
]
)
local
talent1
=
bot
:
GetAbilityByName
(
sTalentList
[
1
]
)
local
castQDesire
,
castQTargetLocation
local
castWDesire
local
castEDesire
,
castETarget
local
castRDesire
local
nKeepMana
,
nMP
,
nHP
,
nLV
,
botTarget
,
hEnemyList
,
hAllyList
,
sMotive
local
bonusRange
=
0
function
X
.
SkillsComplement
()
if
J
.
CanNotUseAbility
(
bot
)
or
bot
:
IsInvisible
()
then
return
end
nKeepMana
=
400
bonusRange
=
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
)
bonusRange
=
J
.
GetBonusCastRange
(
bot
)
castRDesire
,
sMotive
=
X
.
ConsiderR
()
if
castRDesire
>
0
then
J
.
SetReportMotive
(
bDebugMode
,
sMotive
)
J
.
SetQueuePtToINT
(
bot
,
false
)
bot
:
ActionQueue_UseAbility
(
abilityR
)
return
end
castQDesire
,
castQTargetLocation
,
sMotive
=
X
.
ConsiderQ
()
if
castQDesire
>
0
then
J
.
SetReportMotive
(
bDebugMode
,
sMotive
)
J
.
SetQueuePtToINT
(
bot
,
false
)
if
bot
:
HasScepter
()
then
bot
:
ActionQueue_UseAbilityOnLocation
(
abilityQ
,
castQTargetLocation
)
else
bot
:
ActionQueue_UseAbilityOnEntity
(
abilityQ
,
castQTargetLocation
)
end
return
end
castWDesire
,
sMotive
=
X
.
ConsiderW
()
if
castWDesire
>
0
then
J
.
SetReportMotive
(
bDebugMode
,
sMotive
)
J
.
SetQueuePtToINT
(
bot
,
false
)
bot
:
ActionQueue_UseAbility
(
abilityW
)
return
end
castEDesire
,
castETarget
,
sMotive
=
X
.
ConsiderE
()
if
castEDesire
>
0
then
J
.
SetReportMotive
(
bDebugMode
,
sMotive
)
J
.
SetQueuePtToINT
(
bot
,
false
)
bot
:
ActionQueue_UseAbilityOnEntity
(
abilityE
,
castETarget
)
return
end
end
function
X
.
ConsiderQ
()
if
not
abilityQ
:
IsFullyCastable
()
then
return
BOT_ACTION_DESIRE_NONE
,
nil
end
local
nSkillLV
=
abilityQ
:
GetLevel
()
local
nCastRange
=
abilityQ
:
GetCastRange
()
+
bonusRange
local
nRadius
=
0
local
nCastPoint
=
abilityQ
:
GetCastPoint
()
local
nManaCost
=
abilityQ
:
GetManaCost
()
local
nDamage
=
abilityQ
:
GetSpecialValueInt
(
'damage'
)
local
nTargetLocation
=
nil
if
bot
:
HasScepter
()
then
nRadius
=
abilityQ
:
GetSpecialValueInt
(
'radius_scepter'
)
end
if
talent1
:
IsTrained
()
then
nDamage
=
nDamage
+
50
end
local
nEnemyHeroesInRange
=
bot
:
GetNearbyHeroes
(
nCastRange
+
nRadius
,
true
,
BOT_MODE_NONE
)
for
_
,
npcEnemy
in
pairs
(
nEnemyHeroesInRange
)
do
if
J
.
IsValidHero
(
npcEnemy
)
and
J
.
CanCastOnNonMagicImmune
(
npcEnemy
)
and
(
bot
:
HasScepter
()
or
J
.
CanCastOnTargetAdvanced
(
npcEnemy
)
)
and
J
.
WillMagicKillTarget
(
bot
,
npcEnemy
,
nDamage
,
nCastPoint
)
then
if
bot
:
HasScepter
()
then
nTargetLocation
=
npcEnemy
:
GetLocation
()
return
BOT_ACTION_DESIRE_HIGH
,
nTargetLocation
,
'Q-Kill:'
..
J
.
Chat
.
GetNormName
(
npcEnemy
)
else
return
BOT_ACTION_DESIRE_HIGH
,
npcEnemy
,
'Q-Kill:'
..
J
.
Chat
.
GetNormName
(
npcEnemy
)
end
end
if
J
.
IsValidHero
(
npcEnemy
)
and
J
.
CanCastOnNonMagicImmune
(
npcEnemy
)
and
(
bot
:
HasScepter
()
or
J
.
CanCastOnTargetAdvanced
(
npcEnemy
)
)
and
npcEnemy
:
IsChanneling
()
then
if
bot
:
HasScepter
()
then
nTargetLocation
=
npcEnemy
:
GetLocation
()
return
BOT_ACTION_DESIRE_HIGH
,
nTargetLocation
,
'Q-Interrupt:'
..
J
.
Chat
.
GetNormName
(
npcEnemy
)
else
return
BOT_ACTION_DESIRE_HIGH
,
npcEnemy
,
'Q-Interrupt:'
..
J
.
Chat
.
GetNormName
(
npcEnemy
)
end
end
end
if
J
.
IsInTeamFight
(
bot
,
1200
)
then
if
bot
:
HasScepter
()
then
local
nAoeLoc
=
J
.
GetAoeEnemyHeroLocation
(
bot
,
nCastRange
,
nRadius
,
2
)
if
nAoeLoc
~=
nil
then
nTargetLocation
=
nAoeLoc
return
BOT_ACTION_DESIRE_HIGH
,
nTargetLocation
,
'Q-Battle'
end
else
local
npcWeakestEnemy
=
J
.
GetVulnerableWeakestUnitWithLotusCheck
(
bot
,
true
,
true
,
nCastRange
)
if
npcWeakestEnemy
~=
nil
then
return
BOT_ACTION_DESIRE_HIGH
,
npcWeakestEnemy
,
'Q-Battle-Weakest:'
..
J
.
Chat
.
GetNormName
(
npcWeakestEnemy
)
end
end
end
if
J
.
IsGoingOnSomeone
(
bot
)
then
if
J
.
IsValidHero
(
botTarget
)
and
J
.
CanCastOnNonMagicImmune
(
botTarget
)
and
(
bot
:
HasScepter
()
or
J
.
CanCastOnTargetAdvanced
(
botTarget
)
)
and
J
.
IsInRange
(
botTarget
,
bot
,
nCastRange
+
nRadius
)
then
if
bot
:
HasScepter
()
then
nTargetLocation
=
botTarget
:
GetLocation
()
return
BOT_ACTION_DESIRE_HIGH
,
nTargetLocation
,
'Q-Attack:'
..
J
.
Chat
.
GetNormName
(
botTarget
)
else
return
BOT_ACTION_DESIRE_HIGH
,
botTarget
,
'Q-Attack:'
..
J
.
Chat
.
GetNormName
(
botTarget
)
end
end
end
if
J
.
IsRetreating
(
bot
)
then
for
_
,
npcEnemy
in
pairs
(
nEnemyHeroesInRange
)
do
if
J
.
IsValid
(
npcEnemy
)
and
bot
:
WasRecentlyDamagedByHero
(
npcEnemy
,
3
.
0
)
and
J
.
CanCastOnNonMagicImmune
(
npcEnemy
)
and
(
bot
:
HasScepter
()
or
J
.
CanCastOnTargetAdvanced
(
npcEnemy
)
)
and
bot
:
IsFacingLocation
(
npcEnemy
:
GetExtrapolatedLocation
(
nCastPoint
),
20
)
then
if
bot
:
HasScepter
()
then
nTargetLocation
=
J
.
GetCastLocation
(
bot
,
npcEnemy
,
nCastRange
,
nRadius
)
return
BOT_ACTION_DESIRE_HIGH
,
nTargetLocation
,
'Q-Retreat:'
..
J
.
Chat
.
GetNormName
(
npcEnemy
)
else
return
BOT_ACTION_DESIRE_HIGH
,
npcEnemy
,
'Q-Retreat:'
..
J
.
Chat
.
GetNormName
(
npcEnemy
)
end
end
end
end
if
J
.
IsLaning
(
bot
)
and
J
.
IsAllowedToSpam
(
bot
,
nManaCost
)
and
nMP
>=
0
.
55
then
local
nEnemyCreeps
=
bot
:
GetNearbyCreeps
(
nCastRange
+
nRadius
,
true
)
for
_
,
creep
in
pairs
(
nEnemyCreeps
)
do
if
J
.
IsValid
(
creep
)
and
not
creep
:
HasModifier
(
'modifier_fountain_glyph'
)
and
J
.
IsKeyWordUnit
(
'ranged'
,
creep
)
and
J
.
WillMagicKillTarget
(
bot
,
creep
,
nDamage
,
nCastPoint
)
then
if
bot
:
HasScepter
()
then
nTargetLocation
=
J
.
GetCastLocation
(
bot
,
creep
,
nCastRange
,
nRadius
)
return
BOT_ACTION_DESIRE_HIGH
,
nTargetLocation
,
'Q-Farm'
else
return
BOT_ACTION_DESIRE_HIGH
,
creep
,
'Q-Farm'
end
end
end
for
_
,
npcEnemy
in
pairs
(
nEnemyHeroesInRange
)
do
if
J
.
IsValid
(
npcEnemy
)
and
J
.
CanCastOnNonMagicImmune
(
npcEnemy
)
and
(
bot
:
HasScepter
()
or
J
.
CanCastOnTargetAdvanced
(
npcEnemy
)
)
and
X
.
IsNighttime
()
then
if
bot
:
HasScepter
()
then
nTargetLocation
=
J
.
GetAoeEnemyHeroLocation
(
bot
,
nCastRange
,
nRadius
,
2
)
return
BOT_ACTION_DESIRE_HIGH
,
nTargetLocation
,
'Q-Harass'
else
return
BOT_ACTION_DESIRE_HIGH
,
npcEnemy
,
'Q-Harass:'
..
J
.
Chat
.
GetNormName
(
npcEnemy
)
end
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
()
>
8
*
60
and
bot
:
HasScepter
()
then
local
nEnemyCreeps
=
bot
:
GetNearbyCreeps
(
nCastRange
+
nRadius
,
true
)
if
#
nEnemyCreeps
>=
3
and
J
.
IsValid
(
nEnemyCreeps
[
1
]
)
and
not
nEnemyCreeps
[
1
]:
HasModifier
(
"modifier_fountain_glyph"
)
then
local
nAoeLoc
=
bot
:
FindAoELocation
(
true
,
false
,
bot
:
GetLocation
(),
nCastRange
,
nRadius
,
0
,
0
)
if
nAoeLoc
.
count
>=
3
then
nTargetLocation
=
nAoeLoc
.
targetloc
return
BOT_ACTION_DESIRE_HIGH
,
nTargetLocation
,
"Q-ClearWave:"
..
nAoeLoc
.
count
end
end
end
return
BOT_ACTION_DESIRE_NONE
,
nil
end
function
X
.
ConsiderW
()
if
not
abilityW
:
IsFullyCastable
()
then
return
BOT_ACTION_DESIRE_NONE
,
nil
end
local
nRadius
=
abilityW
:
GetSpecialValueInt
(
'radius'
)
local
nEnemyHeroesInRange
=
bot
:
GetNearbyHeroes
(
nRadius
+
150
,
true
,
BOT_MODE_NONE
)
if
J
.
IsInTeamFight
(
bot
,
1200
)
then
for
_
,
npcEnemy
in
pairs
(
nEnemyHeroesInRange
)
do
if
J
.
IsValidHero
(
npcEnemy
)
and
J
.
CanCastOnNonMagicImmune
(
npcEnemy
)
then
return
BOT_ACTION_DESIRE_HIGH
,
'W-Battle'
end
end
end
if
J
.
IsGoingOnSomeone
(
bot
)
then
if
J
.
IsValidHero
(
botTarget
)
and
J
.
CanCastOnNonMagicImmune
(
botTarget
)
and
J
.
CanCastOnTargetAdvanced
(
botTarget
)
and
J
.
IsInRange
(
botTarget
,
bot
,
nRadius
)
then
return
BOT_ACTION_DESIRE_HIGH
,
'W-Chase:'
..
J
.
Chat
.
GetNormName
(
botTarget
)
end
end
if
J
.
IsRetreating
(
bot
)
then
if
bot
:
WasRecentlyDamagedByAnyHero
(
1
.
5
)
and
#
nEnemyHeroesInRange
>=
1
then
return
BOT_ACTION_DESIRE_HIGH
,
'W-Retreat'
end
end
return
BOT_ACTION_DESIRE_NONE
,
nil
end
function
X
.
ConsiderE
()
if
not
abilityE
:
IsFullyCastable
()
or
abilityE
:
GetBehavior
()
~=
ABILITY_BEHAVIOR_UNIT_TARGET
then
return
BOT_ACTION_DESIRE_NONE
,
nil
end
local
nCastRange
=
abilityE
:
GetSpecialValueInt
(
'shard_cast_range'
)
+
bonusRange
if
nHP
<=
0
.
65
or
nMP
<=
0
.
75
or
(
nHP
<=
0
.
7
and
nMP
<=
0
.
8
)
then
local
nEnemyCreeps
=
bot
:
GetNearbyCreeps
(
nCastRange
+
600
,
true
)
for
_
,
creep
in
pairs
(
nEnemyCreeps
)
do
if
J
.
IsValid
(
creep
)
then
return
BOT_ACTION_DESIRE_HIGH
,
creep
,
'E-Heal-EnemyCreep'
end
end
local
nNeutralCreeps
=
bot
:
GetNearbyNeutralCreeps
(
nCastRange
+
600
)
for
_
,
creep
in
pairs
(
nNeutralCreeps
)
do
if
J
.
IsValid
(
creep
)
and
(
not
creep
:
IsAncientCreep
()
or
X
.
IsNighttime
()
)
then
return
BOT_ACTION_DESIRE_HIGH
,
creep
,
'E-Heal-NeutralCreep'
end
end
local
nAlliedCreeps
=
bot
:
GetNearbyCreeps
(
nCastRange
+
600
,
false
)
for
_
,
creep
in
pairs
(
nAlliedCreeps
)
do
if
J
.
IsValid
(
creep
)
then
return
BOT_ACTION_DESIRE_HIGH
,
creep
,
'E-Heal-AlliedCreep'
end
end
end
return
BOT_ACTION_DESIRE_NONE
,
nil
end
function
X
.
ConsiderR
()
if
not
abilityR
:
IsFullyCastable
()
then
return
BOT_ACTION_DESIRE_NONE
,
nil
end
if
J
.
IsInTeamFight
(
bot
,
1200
)
then
if
#
hEnemyList
>=
#
hAllyList
then
return
BOT_ACTION_DESIRE_HIGH
,
"R-Battle"
end
end
if
J
.
IsGoingOnSomeone
(
bot
)
then
if
J
.
IsValidHero
(
botTarget
)
and
J
.
IsInRange
(
botTarget
,
bot
,
700
)
and
abilityQ
:
IsFullyCastable
()
and
J
.
CanCastOnNonMagicImmune
(
botTarget
)
and
(
bot
:
HasScepter
()
or
J
.
CanCastOnTargetAdvanced
(
botTarget
)
)
then
return
BOT_ACTION_DESIRE_HIGH
,
"R-Chase:"
..
J
.
Chat
.
GetNormName
(
botTarget
)
end
end
return
BOT_ACTION_DESIRE_NONE
,
nil
end
function
X
.
IsNighttime
()
if
bot
:
HasModifier
(
'modifier_phoenix_sun_debuff'
)
then
return
false
end
if
bot
:
HasModifier
(
'modifier_night_stalker_darkness'
)
then
return
true
end
local
nCurrentTime
=
DotaTime
()
local
nCurrentMinute
=
math.floor
(
nCurrentTime
/
60
)
if
nCurrentMinute
%
10
>=
5
then
return
true
end
end
return
X
\ No newline at end of file
BotLib/hero_obsidian_destroyer.lua
0 → 100644
View file @
71e98103
----------------------------------------------------------------------------------------------------
--- The Creation Come From: BOT EXPERIMENT Credit:FURIOUSPUPPY
--- BOT EXPERIMENT Author: Arizona Fauzie 2018.11.21
--- Link:http://steamcommunity.com/sharedfiles/filedetails/?id=837040016
--- Refactor: 决明子 Email: dota2jmz@163.com 微博@Dota2_决明子
--- Link:http://steamcommunity.com/sharedfiles/filedetails/?id=1573671599
--- Link:http://steamcommunity.com/sharedfiles/filedetails/?id=1627071163
--- Updated: Nikel
--- carry, mid, tank
----------------------------------------------------------------------------------------------------
local
X
=
{}
local
bDebugMode
=
(
1
==
10
)
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
=
{
[
'outfit_carry'
]
=
{
[
't25'
]
=
{
0
,
10
},
[
't20'
]
=
{
10
,
0
},
[
't15'
]
=
{
0
,
10
},
[
't10'
]
=
{
10
,
0
},
},
[
'outfit_mid'
]
=
{
[
't25'
]
=
{
10
,
0
},
[
't20'
]
=
{
10
,
0
},
[
't15'
]
=
{
0
,
10
},
[
't10'
]
=
{
10
,
0
},
},
[
'outfit_priest'
]
=
{
[
't25'
]
=
{
10
,
0
},
[
't20'
]
=
{
0
,
10
},
[
't15'
]
=
{
10
,
0
},
[
't10'
]
=
{
0
,
10
},
},
[
'outfit_mage'
]
=
{
[
't25'
]
=
{
10
,
0
},
[
't20'
]
=
{
0
,
10
},
[
't15'
]
=
{
10
,
0
},
[
't10'
]
=
{
0
,
10
},
},
[
'outfit_tank'
]
=
{
[
't25'
]
=
{
10
,
0
},
[
't20'
]
=
{
10
,
0
},
[
't15'
]
=
{
0
,
10
},
[
't10'
]
=
{
10
,
0
},
},
}
local
tAllAbilityBuildList
=
{
[
'outfit_carry'
]
=
{
{
1
,
3
,
2
,
1
,
1
,
6
,
1
,
3
,
3
,
3
,
6
,
2
,
2
,
2
,
6
}
},
[
'outfit_mid'
]
=
{
{
1
,
3
,
2
,
2
,
2
,
6
,
2
,
1
,
1
,
1
,
6
,
3
,
3
,
3
,
6
}
},
[
'outfit_priest'
]
=
{
{
1
,
3
,
2
,
2
,
2
,
6
,
2
,
1
,
1
,
1
,
6
,
3
,
3
,
3
,
6
}
},
[
'outfit_mage'
]
=
{
{
1
,
3
,
2
,
2
,
2
,
6
,
2
,
1
,
1
,
1
,
6
,
3
,
3
,
3
,
6
}
},
[
'outfit_tank'
]
=
{
{
1
,
3
,
2
,
2
,
2
,
6
,
2
,
1
,
1
,
1
,
6
,
3
,
3
,
3
,
6
}
},
}
local
nAbilityBuildList
=
J
.
Skill
.
GetRandomBuild
(
tAllAbilityBuildList
[
sOutfitType
]
)
local
nTalentBuildList
=
J
.
Skill
.
GetTalentBuild
(
tTalentTreeList
[
sOutfitType
]
)
local
tOutFitList
=
{}
tOutFitList
[
'outfit_carry'
]
=
{
"item_crystal_maiden_outfit"
,
"item_witch_blade"
,
"item_dragon_lance"
,
"item_black_king_bar"
,
"item_hurricane_pike"
,
"item_ultimate_scepter"
,
"item_aghanims_shard"
,
"item_orchid"
,
"item_travel_boots"
,
"item_bloodthorn"
,
"item_ultimate_scepter_2"
,
"item_sheepstick"
,
"item_revenants_brooch"
,
"item_moon_shard"
,
"item_travel_boots_2"
,
}
tOutFitList
[
'outfit_mid'
]
=
{
"item_obsidian_destroyer_outfit"
,
"item_hand_of_midas"
,
"item_blink"
,
"item_ultimate_scepter"
,
"item_aghanims_shard"
,
"item_sphere"
,
"item_sheepstick"
,
"item_ultimate_scepter_2"
,
"item_cyclone"
,
"item_wind_waker"
,
"item_travel_boots"
,
"item_moon_shard"
,
"item_octarine_core"
,
"item_arcane_blink"
,
"item_travel_boots_2"
,
}
tOutFitList
[
'outfit_priest'
]
=
tOutFitList
[
'outfit_carry'
]
tOutFitList
[
'outfit_mage'
]
=
tOutFitList
[
'outfit_carry'
]
tOutFitList
[
'outfit_tank'
]
=
tOutFitList
[
'outfit_mid'
]
X
[
'sBuyList'
]
=
tOutFitList
[
sOutfitType
]
X
[
'sSellList'
]
=
{
"item_sheepstick"
,
"item_meteor_hammer"
,
"item_hand_of_midas"
,
"item_octarine_core"
,
"item_travel_boots"
,
"item_power_treads"
,
"item_ultimate_scepter"
,
"item_magic_wand"
,
"item_orchid"
,
"item_null_talisman"
,
}
if
J
.
Role
.
IsPvNMode
()
or
J
.
Role
.
IsAllShadow
()
then
X
[
'sBuyList'
],
X
[
'sSellList'
]
=
{
'PvN_mid'
},
{}
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'
]
=
false
X
[
'bDeafaultItem'
]
=
false
function
X
.
MinionThink
(
hMinionUnit
)
if
Minion
.
IsValidUnit
(
hMinionUnit
)
then
Minion
.
IllusionThink
(
hMinionUnit
)
end
end
--[[
npc_dota_hero_obsidian_destroyer
"Ability1" "obsidian_destroyer_arcane_orb"
"Ability2" "obsidian_destroyer_astral_imprisonment"
"Ability3" "obsidian_destroyer_equilibrium"
"Ability4" "generic_hidden"
"Ability5" "generic_hidden"
"Ability6" "obsidian_destroyer_sanity_eclipse"
"Ability10" "special_bonus_hp_200"
"Ability11" "special_bonus_attack_speed_20"
"Ability12" "special_bonus_unique_outworld_devourer_astral_castrange"
"Ability13" "special_bonus_movement_speed_30"
"Ability14" "special_bonus_strength_20"
"Ability15" "special_bonus_unique_outworld_devourer_4"
"Ability16" "special_bonus_unique_outworld_devourer"
"Ability17" "special_bonus_unique_outworld_devourer_5"
modifier_obsidian_destroyer_arcane_orb
modifier_obsidian_destroyer_astral_imprisonment_prison
modifier_obsidian_destroyer_equilibrium_buff
modifier_obsidian_destroyer_equilibrium_buff_counter
modifier_obsidian_destroyer_equilibrium_debuff
modifier_obsidian_destroyer_equilibrium_debuff_counter
modifier_obsidian_destroyer_equilibrium
--]]
local
abilityQ
=
bot
:
GetAbilityByName
(
sAbilityList
[
1
]
)
local
abilityW
=
bot
:
GetAbilityByName
(
sAbilityList
[
2
]
)
local
abilityR
=
bot
:
GetAbilityByName
(
sAbilityList
[
6
]
)
local
talent6
=
bot
:
GetAbilityByName
(
sTalentList
[
6
]
)
local
talent7
=
bot
:
GetAbilityByName
(
sTalentList
[
7
]
)
local
castQDesire
,
castQTarget
local
castWDesire
,
castWTarget
local
castRDesire
,
castRLocation
local
nKeepMana
,
nMP
,
nHP
,
nLV
,
botTarget
,
hEnemyList
,
hAllyList
,
sMotive
local
bonusRange
=
0
function
X
.
SkillsComplement
()
if
J
.
CanNotUseAbility
(
bot
)
or
bot
:
IsInvisible
()
then
return
end
nKeepMana
=
400
bonusRange
=
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
)
bonusRange
=
J
.
GetBonusCastRange
(
bot
)
castWDesire
,
castWTarget
,
sMotive
=
X
.
ConsiderW
()
if
castWDesire
>
0
then
J
.
SetReportMotive
(
bDebugMode
,
sMotive
)
J
.
SetQueuePtToINT
(
bot
,
false
)
bot
:
ActionQueue_UseAbilityOnEntity
(
abilityW
,
castWTarget
)
return
end
castQDesire
,
castQTarget
,
sMotive
=
X
.
ConsiderQ
()
if
castQDesire
>
0
then
J
.
SetReportMotive
(
bDebugMode
,
sMotive
)
J
.
SetQueuePtToINT
(
bot
,
false
)
bot
:
ActionQueue_UseAbilityOnEntity
(
abilityQ
,
castQTarget
)
return
end
castRDesire
,
castRLocation
,
sMotive
=
X
.
ConsiderR
()
if
castRDesire
>
0
then
J
.
SetReportMotive
(
bDebugMode
,
sMotive
)
J
.
SetQueuePtToINT
(
bot
,
false
)
bot
:
ActionQueue_UseAbilityOnLocation
(
abilityR
,
castRLocation
)
return
end
end
function
X
.
ConsiderQ
()
if
not
abilityQ
:
IsFullyCastable
()
or
bot
:
IsDisarmed
()
then
return
BOT_ACTION_DESIRE_NONE
,
nil
end
local
nSkillLV
=
abilityQ
:
GetLevel
()
local
nAttackDamage
=
bot
:
GetAttackDamage
()
local
nAttackRange
=
bot
:
GetAttackRange
()
local
nAbilityDamage
=
abilityQ
:
GetSpecialValueInt
(
'mana_pool_damage_pct'
)
*
bot
:
GetMana
()
*
0
.
01
local
nDamageType
=
DAMAGE_TYPE_PURE
if
talent7
:
IsTrained
()
then
nAbilityDamage
=
(
abilityQ
:
GetSpecialValueInt
(
'mana_pool_damage_pct'
)
+
2
)
*
bot
:
GetMana
()
*
0
.
01
end
if
nSkillLV
==
4
then
if
not
abilityQ
:
GetAutoCastState
()
then
abilityQ
:
ToggleAutoCast
()
end
else
if
abilityQ
:
GetAutoCastState
()
then
abilityQ
:
ToggleAutoCast
()
end
end
if
J
.
IsValidHero
(
botTarget
)
and
J
.
CanCastOnNonMagicImmune
(
botTarget
)
and
not
botTarget
:
IsAttackImmune
()
and
nSkillLV
<
4
then
return
BOT_ACTION_DESIRE_HIGH
,
botTarget
,
"Q-Attack:"
..
J
.
Chat
.
GetNormName
(
botTarget
)
end
if
(
J
.
IsLaning
(
bot
)
or
J
.
IsFarming
(
bot
)
)
and
nSkillLV
<
4
then
local
nEnemyCreeps
=
bot
:
GetNearbyLaneCreeps
(
nAttackRange
,
true
)
for
_
,
creep
in
pairs
(
nEnemyCreeps
)
do
local
nAttackProDelayTime
=
J
.
GetAttackProDelayTime
(
bot
,
creep
)
if
J
.
IsValid
(
creep
)
and
not
creep
:
HasModifier
(
"modifier_fountain_glyph"
)
and
J
.
WillMixedDamageKillTarget
(
creep
,
nAttackDamage
,
0
,
nAbilityDamage
,
nAttackProDelayTime
)
then
return
BOT_ACTION_DESIRE_HIGH
,
creep
,
"Q-KillCreep"
end
end
end
return
BOT_ACTION_DESIRE_NONE
,
nil
end
function
X
.
ConsiderW
()
if
not
abilityW
:
IsFullyCastable
()
then
return
BOT_ACTION_DESIRE_NONE
,
nil
end
local
nSkillLV
=
abilityW
:
GetLevel
()
local
nCastRange
=
abilityW
:
GetSpecialValueInt
(
'AbilityCastRange'
)
+
bonusRange
local
nCastPoint
=
abilityW
:
GetCastPoint
()
local
nManaCost
=
abilityW
:
GetManaCost
()
local
nDamage
=
abilityW
:
GetSpecialValueInt
(
'damage'
)
local
nDamageType
=
DAMAGE_TYPE_MAGICAL
local
nAlliedHeroesInRange
=
bot
:
GetNearbyHeroes
(
nCastRange
+
300
,
false
,
BOT_MODE_NONE
)
local
nEnemyHeroesInRange
=
bot
:
GetNearbyHeroes
(
nCastRange
+
300
,
true
,
BOT_MODE_NONE
)
for
_
,
npcAlly
in
pairs
(
nAlliedHeroesInRange
)
do
if
J
.
CanCastOnNonMagicImmune
(
npcAlly
)
and
not
npcAlly
:
HasModifier
(
'modifier_abaddon_borrowed_time'
)
and
not
npcAlly
:
HasModifier
(
'modifier_obsidian_destroyer_astral_imprisonment_prison'
)
and
(
npcAlly
:
HasModifier
(
'modifier_winter_wyvern_winters_curse'
)
or
npcAlly
:
HasModifier
(
'modifier_necrolyte_reapers_scythe'
)
or
(
npcAlly
:
HasModifier
(
'modifier_legion_commander_duel'
)
and
npcAlly
:
GetUnitName
()
~=
"npc_dota_hero_legion_commander"
)
or
(
npcAlly
:
HasModifier
(
'modifier_sniper_assassinate'
)
and
J
.
IsWillBeCastUnitTargetSpell
(
npcAlly
,
1400
)
)
)
then
return
BOT_ACTION_DESIRE_HIGH
,
npcAlly
,
'W-Protect:'
..
J
.
Chat
.
GetNormName
(
npcAlly
)
end
if
J
.
IsDisabled
(
npcAlly
)
and
J
.
CanCastOnNonMagicImmune
(
npcAlly
)
and
npcAlly
:
WasRecentlyDamagedByAnyHero
(
2
.
0
)
and
not
npcAlly
:
HasModifier
(
'modifier_abaddon_borrowed_time'
)
and
not
npcAlly
:
HasModifier
(
'modifier_obsidian_destroyer_astral_imprisonment_prison'
)
then
return
BOT_ACTION_DESIRE_HIGH
,
npcAlly
,
'W-Protect:'
..
J
.
Chat
.
GetNormName
(
npcAlly
)
end
if
J
.
IsRetreating
(
npcAlly
)
and
J
.
IsUnitTargetProjectileIncoming
(
npcAlly
,
400
)
and
not
npcAlly
:
IsChanneling
()
and
J
.
CanCastOnNonMagicImmune
(
npcAlly
)
and
npcAlly
:
WasRecentlyDamagedByAnyHero
(
1
.
0
)
and
not
npcAlly
:
HasModifier
(
'modifier_abaddon_borrowed_time'
)
and
not
npcAlly
:
HasModifier
(
'modifier_obsidian_destroyer_astral_imprisonment_prison'
)
then
return
BOT_ACTION_DESIRE_HIGH
,
npcAlly
,
'W-Protect:'
..
J
.
Chat
.
GetNormName
(
npcAlly
)
end
end
local
nMostManaEnemy
=
nil
local
nMostMana
=
0
for
_
,
npcEnemy
in
pairs
(
nEnemyHeroesInRange
)
do
if
J
.
IsValidHero
(
npcEnemy
)
and
J
.
CanCastOnNonMagicImmune
(
npcEnemy
)
and
J
.
CanCastOnTargetAdvanced
(
npcEnemy
)
and
(
npcEnemy
:
IsChanneling
()
or
npcEnemy
:
IsCastingAbility
()
)
and
not
J
.
IsDisabled
(
botTarget
)
then
return
BOT_ACTION_DESIRE_HIGH
,
npcEnemy
,
'W-Interrupt:'
..
J
.
Chat
.
GetNormName
(
npcEnemy
)
end
if
J
.
IsValidHero
(
npcEnemy
)
and
J
.
CanCastOnNonMagicImmune
(
npcEnemy
)
and
J
.
CanCastOnTargetAdvanced
(
npcEnemy
)
and
J
.
WillMagicKillTarget
(
bot
,
npcEnemy
,
nDamage
,
nCastPoint
)
and
not
J
.
IsDisabled
(
botTarget
)
then
return
BOT_ACTION_DESIRE_HIGH
,
npcEnemy
,
'W-Kill:'
..
J
.
Chat
.
GetNormName
(
npcEnemy
)
end
if
J
.
IsValidHero
(
npcEnemy
)
and
J
.
CanCastOnNonMagicImmune
(
npcEnemy
)
and
J
.
CanCastOnTargetAdvanced
(
npcEnemy
)
and
not
J
.
IsDisabled
(
botTarget
)
and
npcEnemy
:
GetMaxMana
()
>
nMostMana
then
nMostManaEnemy
=
npcEnemy
nMostMana
=
npcEnemy
:
GetMaxMana
()
end
if
(
nMostManaEnemy
~=
nil
)
then
return
BOT_ACTION_DESIRE_HIGH
,
nMostManaEnemy
,
'W-Attack:'
..
J
.
Chat
.
GetNormName
(
npcEnemy
)
..
' CastRange:'
..
nCastRange
end
end
if
J
.
IsGoingOnSomeone
(
bot
)
then
if
J
.
IsValidHero
(
botTarget
)
and
J
.
CanCastOnNonMagicImmune
(
botTarget
)
and
J
.
CanCastOnTargetAdvanced
(
botTarget
)
and
J
.
IsInRange
(
botTarget
,
bot
,
nCastRange
)
and
not
J
.
IsDisabled
(
botTarget
)
then
return
BOT_ACTION_DESIRE_HIGH
,
botTarget
,
'W-Attack:'
..
J
.
Chat
.
GetNormName
(
botTarget
)
..
' CastRange:'
..
nCastRange
end
end
return
BOT_ACTION_DESIRE_NONE
,
nil
end
function
X
.
ConsiderR
()
if
not
abilityR
:
IsFullyCastable
()
or
abilityW
:
IsFullyCastable
()
then
return
BOT_ACTION_DESIRE_NONE
,
nil
end
local
nSkillLV
=
abilityR
:
GetLevel
()
local
nCastRange
=
abilityR
:
GetSpecialValueInt
(
'cast_range'
)
+
bonusRange
local
nRadius
=
abilityR
:
GetSpecialValueInt
(
'radius'
)
local
nCastPoint
=
abilityR
:
GetCastPoint
()
local
nManaCost
=
abilityR
:
GetManaCost
()
local
nBaseDamage
=
abilityR
:
GetSpecialValueInt
(
'base_damage'
)
local
nDamageMultiplier
=
abilityR
:
GetSpecialValueFloat
(
'damage_multiplier'
)
local
nDamageType
=
DAMAGE_TYPE_MAGICAL
local
nAlliedHeroesInRange
=
bot
:
GetNearbyHeroes
(
nCastRange
+
nRadius
,
false
,
BOT_MODE_NONE
)
local
nEnemyHeroesInRange
=
bot
:
GetNearbyHeroes
(
nCastRange
+
nRadius
,
true
,
BOT_MODE_NONE
)
if
talent6
:
IsTrained
()
then
nDamageMultiplier
=
nDamageMultiplier
+
0
.
15
end
local
nMinDamageThreshold
=
nBaseDamage
*
1
.
35
local
nAoeCount
=
0
local
nAoe
=
bot
:
FindAoELocation
(
true
,
true
,
bot
:
GetLocation
(),
nCastRange
,
nRadius
,
0
,
0
)
for
_
,
npcEnemy
in
pairs
(
nEnemyHeroesInRange
)
do
if
J
.
IsValidHero
(
npcEnemy
)
and
GetUnitToLocationDistance
(
npcEnemy
,
nAoe
.
targetloc
)
<=
nRadius
and
(
J
.
CanCastOnNonMagicImmune
(
npcEnemy
)
or
npcEnemy
:
HasModifier
(
'modifier_obsidian_destroyer_astral_imprisonment_prison'
)
)
then
local
nMagicalDamage
=
nBaseDamage
+
(
(
bot
:
GetMaxMana
()
-
npcEnemy
:
GetMaxMana
()
)
*
nDamageMultiplier
)
local
nRealMagicalDamge
=
npcEnemy
:
GetActualIncomingDamage
(
nMagicalDamage
,
DAMAGE_TYPE_MAGICAL
)
if
nRealMagicalDamge
>=
nMinDamageThreshold
then
nAoeCount
=
nAoeCount
+
1
end
if
J
.
GetHP
(
npcEnemy
)
>=
0
.
15
and
nRealMagicalDamge
>=
npcEnemy
:
GetHealth
()
then
return
BOT_ACTION_DESIRE_HIGH
,
nAoe
.
targetloc
,
'R-Kill'
end
end
end
if
nAoeCount
>=
2
then
return
BOT_ACTION_DESIRE_HIGH
,
nAoe
.
targetloc
,
'R-Battle'
end
if
J
.
IsInTeamFight
(
bot
,
1200
)
then
local
nAoeLoc
=
J
.
GetAoeEnemyHeroLocation
(
bot
,
nCastRange
,
nRadius
,
3
)
if
nAoeLoc
~=
nil
then
local
nTargetLocation
=
nAoeLoc
return
BOT_ACTION_DESIRE_HIGH
,
nTargetLocation
,
'R-Battle'
end
end
return
BOT_ACTION_DESIRE_NONE
,
nil
end
return
X
\ No newline at end of file
BotLib/hero_terrorblade.lua
0 → 100644
View file @
71e98103
----------------------------------------------------------------------------------------------------
--- The Creation Come From: BOT EXPERIMENT Credit:FURIOUSPUPPY
--- BOT EXPERIMENT Author: Arizona Fauzie 2018.11.21
--- Link:http://steamcommunity.com/sharedfiles/filedetails/?id=837040016
--- Refactor: 决明子 Email: dota2jmz@163.com 微博@Dota2_决明子
--- Link:http://steamcommunity.com/sharedfiles/filedetails/?id=1573671599
--- Link:http://steamcommunity.com/sharedfiles/filedetails/?id=1627071163
--- Updated: Nikel
--- carry
----------------------------------------------------------------------------------------------------
local
X
=
{}
local
bDebugMode
=
(
1
==
10
)
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
=
{
[
'outfit_carry'
]
=
{
[
't25'
]
=
{
0
,
10
},
[
't20'
]
=
{
10
,
0
},
[
't15'
]
=
{
10
,
0
},
[
't10'
]
=
{
10
,
0
},
},
[
'outfit_mid'
]
=
{
[
't25'
]
=
{
0
,
10
},
[
't20'
]
=
{
10
,
0
},
[
't15'
]
=
{
10
,
0
},
[
't10'
]
=
{
10
,
0
},
},
[
'outfit_priest'
]
=
{
[
't25'
]
=
{
0
,
10
},
[
't20'
]
=
{
10
,
0
},
[
't15'
]
=
{
10
,
0
},
[
't10'
]
=
{
10
,
0
},
},
[
'outfit_mage'
]
=
{
[
't25'
]
=
{
0
,
10
},
[
't20'
]
=
{
10
,
0
},
[
't15'
]
=
{
10
,
0
},
[
't10'
]
=
{
10
,
0
},
},
[
'outfit_tank'
]
=
{
[
't25'
]
=
{
0
,
10
},
[
't20'
]
=
{
10
,
0
},
[
't15'
]
=
{
10
,
0
},
[
't10'
]
=
{
10
,
0
},
},
}
local
tAllAbilityBuildList
=
{
[
'outfit_carry'
]
=
{
{
1
,
3
,
2
,
2
,
3
,
6
,
2
,
2
,
3
,
3
,
6
,
1
,
1
,
1
,
6
}
},
[
'outfit_mid'
]
=
{
{
1
,
3
,
2
,
2
,
3
,
6
,
2
,
2
,
3
,
3
,
6
,
1
,
1
,
1
,
6
}
},
[
'outfit_priest'
]
=
{
{
1
,
3
,
2
,
2
,
3
,
6
,
2
,
2
,
3
,
3
,
6
,
1
,
1
,
1
,
6
}
},
[
'outfit_mage'
]
=
{
{
1
,
3
,
2
,
2
,
3
,
6
,
2
,
2
,
3
,
3
,
6
,
1
,
1
,
1
,
6
}
},
[
'outfit_tank'
]
=
{
{
1
,
3
,
2
,
2
,
3
,
6
,
2
,
2
,
3
,
3
,
6
,
1
,
1
,
1
,
6
}
},
}
local
nAbilityBuildList
=
J
.
Skill
.
GetRandomBuild
(
tAllAbilityBuildList
[
sOutfitType
]
)
local
nTalentBuildList
=
J
.
Skill
.
GetTalentBuild
(
tTalentTreeList
[
sOutfitType
]
)
local
tOutFitList
=
{}
tOutFitList
[
'outfit_carry'
]
=
{
"item_melee_carry_outfit"
,
"item_manta"
,
"item_black_king_bar"
,
"item_skadi"
,
"item_lifesteal"
,
"item_aghanims_shard"
,
"item_satanic"
,
"item_ultimate_scepter"
,
"item_blink"
,
"item_ultimate_scepter_2"
,
"item_butterfly"
,
"item_swift_blink"
,
"item_moon_shard"
,
}
tOutFitList
[
'outfit_mid'
]
=
tOutFitList
[
'outfit_carry'
]
tOutFitList
[
'outfit_priest'
]
=
tOutFitList
[
'outfit_carry'
]
tOutFitList
[
'outfit_mage'
]
=
tOutFitList
[
'outfit_carry'
]
tOutFitList
[
'outfit_tank'
]
=
tOutFitList
[
'outfit_carry'
]
X
[
'sBuyList'
]
=
tOutFitList
[
sOutfitType
]
X
[
'sSellList'
]
=
{
"item_skadi"
,
"item_quelling_blade"
,
"item_lifesteal"
,
"item_magic_wand"
,
"item_ultimate_scepter"
,
"item_wraith_band"
,
"item_blink"
,
"item_power_treads"
,
}
if
J
.
Role
.
IsPvNMode
()
or
J
.
Role
.
IsAllShadow
()
then
X
[
'sBuyList'
],
X
[
'sSellList'
]
=
{
'PvN_melee_carry'
},
{}
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'
]
=
false
X
[
'bDeafaultItem'
]
=
false
function
X
.
MinionThink
(
hMinionUnit
)
if
Minion
.
IsValidUnit
(
hMinionUnit
)
then
Minion
.
IllusionThink
(
hMinionUnit
)
end
end
--[[
npc_dota_hero_terrorblade
"Ability1" "terrorblade_reflection"
"Ability2" "terrorblade_conjure_image"
"Ability3" "terrorblade_metamorphosis"
"Ability4" "terrorblade_demon_zeal"
"Ability5" "terrorblade_terror_wave"
"Ability6" "terrorblade_sunder"
"Ability10" "special_bonus_unique_terrorblade_2"
"Ability11" "special_bonus_unique_terrorblade_4"
"Ability12" "special_bonus_hp_300"
"Ability13" "special_bonus_unique_terrorblade_6"
"Ability14" "special_bonus_all_stats_10"
"Ability15" "special_bonus_unique_terrorblade_5"
"Ability16" "special_bonus_unique_terrorblade"
"Ability17" "special_bonus_unique_terrorblade_3"
modifier_terrorblade_reflection_invulnerability
modifier_illusion
modifier_invulnerable
modifier_terrorblade_reflection_slow
modifier_terrorblade_conjureimage
modifier_terrorblade_metamorphosis_transform
modifier_terrorblade_metamorphosis
modifier_terrorblade_metamorphosis_transform_aura
modifier_terrorblade_metamorphosis_transform_aura_applier
modifier_terrorblade_demon_zeal
modifier_metamorphosis_fear_thinker
modifier_terrorblade_fear
--]]
local
abilityQ
=
bot
:
GetAbilityByName
(
sAbilityList
[
1
]
)
local
abilityW
=
bot
:
GetAbilityByName
(
sAbilityList
[
2
]
)
local
abilityE
=
bot
:
GetAbilityByName
(
sAbilityList
[
3
]
)
local
abilityD
=
bot
:
GetAbilityByName
(
sAbilityList
[
4
]
)
local
abilityF
=
bot
:
GetAbilityByName
(
sAbilityList
[
5
]
)
local
abilityR
=
bot
:
GetAbilityByName
(
sAbilityList
[
6
]
)
local
castQDesire
,
castQLocation
local
castWDesire
local
castEDesire
local
castDDesire
local
castFDesire
local
castRDesire
,
castRTarget
local
nKeepMana
,
nMP
,
nHP
,
nLV
,
botTarget
,
hEnemyList
,
hAllyList
,
sMotive
local
bonusRange
=
0
function
X
.
SkillsComplement
()
if
J
.
CanNotUseAbility
(
bot
)
or
bot
:
IsInvisible
()
then
return
end
nKeepMana
=
400
bonusRange
=
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
)
bonusRange
=
J
.
GetBonusCastRange
(
bot
)
castFDesire
,
sMotive
=
X
.
ConsiderF
()
if
castFDesire
>
0
then
J
.
SetReportMotive
(
bDebugMode
,
sMotive
)
J
.
SetQueuePtToINT
(
bot
,
false
)
bot
:
ActionQueue_UseAbility
(
abilityF
)
return
end
castRDesire
,
castRTarget
,
sMotive
=
X
.
ConsiderR
()
if
castRDesire
>
0
then
J
.
SetReportMotive
(
bDebugMode
,
sMotive
)
J
.
SetQueuePtToINT
(
bot
,
false
)
bot
:
ActionQueue_UseAbilityOnEntity
(
abilityR
,
castRTarget
)
return
end
castQDesire
,
castQLocation
,
sMotive
=
X
.
ConsiderQ
()
if
castQDesire
>
0
then
J
.
SetReportMotive
(
bDebugMode
,
sMotive
)
J
.
SetQueuePtToINT
(
bot
,
false
)
bot
:
ActionQueue_UseAbilityOnLocation
(
abilityQ
,
castQLocation
)
return
end
castWDesire
,
sMotive
=
X
.
ConsiderW
()
if
castWDesire
>
0
then
J
.
SetReportMotive
(
bDebugMode
,
sMotive
)
J
.
SetQueuePtToINT
(
bot
,
false
)
bot
:
ActionQueue_UseAbility
(
abilityW
)
return
end
castEDesire
,
sMotive
=
X
.
ConsiderE
()
if
castEDesire
>
0
then
J
.
SetReportMotive
(
bDebugMode
,
sMotive
)
J
.
SetQueuePtToINT
(
bot
,
false
)
bot
:
ActionQueue_UseAbility
(
abilityE
)
return
end
castDDesire
,
sMotive
=
X
.
ConsiderD
()
if
castDDesire
>
0
then
J
.
SetReportMotive
(
bDebugMode
,
sMotive
)
J
.
SetQueuePtToINT
(
bot
,
false
)
bot
:
ActionQueue_UseAbility
(
abilityD
)
return
end
end
function
X
.
ConsiderQ
()
if
not
abilityQ
:
IsFullyCastable
()
then
return
BOT_ACTION_DESIRE_NONE
,
nil
end
local
nCastRange
=
abilityQ
:
GetCastRange
()
+
bonusRange
local
nRadius
=
abilityQ
:
GetSpecialValueInt
(
'range'
)
local
nCastPoint
=
abilityQ
:
GetCastPoint
()
local
nEnemyHeroesInRange
=
bot
:
GetNearbyHeroes
(
nCastRange
+
300
,
true
,
BOT_MODE_NONE
)
local
nTargetLocation
=
nil
if
J
.
IsInTeamFight
(
bot
,
1200
)
then
local
npcMostDangerousEnemy
=
nil
local
npcMostDangerousDamage
=
0
for
_
,
npcEnemy
in
pairs
(
nEnemyHeroesInRange
)
do
local
npcEnemyDamage
=
npcEnemy
:
GetEstimatedDamageToTarget
(
false
,
bot
,
3
.
0
,
DAMAGE_TYPE_PHYSICAL
)
if
J
.
IsValidHero
(
npcEnemy
)
and
J
.
CanCastOnNonMagicImmune
(
npcEnemy
)
and
not
J
.
IsDisabled
(
npcEnemy
)
and
not
npcEnemy
:
IsDisarmed
()
and
npcEnemyDamage
>
nMostDangerousDamage
then
npcMostDangerousEnemy
=
npcEnemy
npcMostDangerousDamage
=
npcEnemyDamage
end
end
if
(
npcMostDangerousEnemy
~=
nil
)
then
nTargetLocation
=
J
.
GetCastLocation
(
bot
,
botTarget
,
nCastRange
,
nRadius
)
return
BOT_ACTION_DESIRE_HIGH
,
nTargetLocation
,
'Q-Battle:'
..
J
.
Chat
.
GetNormName
(
botTarget
)
end
end
if
J
.
IsGoingOnSomeone
(
bot
)
then
local
nAoeLoc
=
J
.
GetAoeEnemyHeroLocation
(
bot
,
nCastRange
,
nRadius
,
2
)
if
nAoeLoc
~=
nil
then
nTargetLocation
=
nAoeLoc
return
BOT_ACTION_DESIRE_HIGH
,
nTargetLocation
,
'Q-Attack'
end
if
J
.
IsValidHero
(
botTarget
)
and
J
.
IsInRange
(
bot
,
botTarget
,
nCastRange
+
nRadius
)
and
J
.
CanCastOnNonMagicImmune
(
botTarget
)
and
not
botTarget
:
IsAttackImmune
()
then
nTargetLocation
=
J
.
GetCastLocation
(
bot
,
botTarget
,
nCastRange
,
nRadius
)
return
BOT_ACTION_DESIRE_HIGH
,
nTargetLocation
,
'Q-Attack:'
..
J
.
Chat
.
GetNormName
(
botTarget
)
end
end
if
J
.
IsRetreating
(
bot
)
then
for
_
,
npcEnemy
in
pairs
(
nEnemyHeroesInRange
)
do
if
J
.
IsValidHero
(
npcEnemy
)
and
bot
:
WasRecentlyDamagedByHero
(
npcEnemy
,
5
.
0
)
and
J
.
CanCastOnNonMagicImmune
(
npcEnemy
)
and
bot
:
IsFacingLocation
(
npcEnemy
:
GetExtrapolatedLocation
(
nCastPoint
),
20
)
then
nTargetLocation
=
npcEnemy
:
GetExtrapolatedLocation
(
nCastPoint
)
return
BOT_ACTION_DESIRE_HIGH
,
nTargetLocation
,
'Q-Retreat:'
..
J
.
Chat
.
GetNormName
(
npcEnemy
)
end
end
end
if
J
.
IsLaning
(
bot
)
then
local
nAoeLoc
=
J
.
GetAoeEnemyHeroLocation
(
bot
,
nCastRange
,
nRadius
,
2
)
if
nAoeLoc
~=
nil
and
nMP
>
0
.
7
then
nTargetLocation
=
nAoeLoc
return
BOT_ACTION_DESIRE_HIGH
,
nTargetLocation
,
'Q-Harass'
end
end
return
BOT_ACTION_DESIRE_NONE
,
nil
end
function
X
.
ConsiderW
()
if
not
abilityW
:
IsFullyCastable
()
then
return
BOT_ACTION_DESIRE_NONE
,
nil
end
local
nSkillLV
=
abilityW
:
GetLevel
()
local
nManaCost
=
abilityW
:
GetManaCost
()
if
J
.
IsInTeamFight
(
bot
,
1200
)
then
if
#
hEnemyList
>=
2
then
return
BOT_ACTION_DESIRE_HIGH
,
"W-Battle"
end
end
if
J
.
IsGoingOnSomeone
(
bot
)
then
if
J
.
IsValidHero
(
botTarget
)
and
J
.
IsInRange
(
bot
,
botTarget
,
700
)
then
return
BOT_ACTION_DESIRE_HIGH
,
"W-Attack"
end
end
if
J
.
IsRetreating
(
bot
)
then
if
bot
:
WasRecentlyDamagedByAnyHero
(
1
.
5
)
then
return
BOT_ACTION_DESIRE_HIGH
,
'W-Retreat:'
end
end
if
J
.
IsLaning
(
bot
)
then
if
J
.
IsValidHero
(
botTarget
)
and
J
.
IsInRange
(
bot
,
botTarget
,
700
)
and
nMP
>
0
.
5
then
return
BOT_ACTION_DESIRE_HIGH
,
"W-Harass"
end
end
if
(
J
.
IsPushing
(
bot
)
or
J
.
IsDefending
(
bot
)
or
J
.
IsFarming
(
bot
)
)
and
J
.
IsAllowedToSpam
(
bot
,
nManaCost
)
and
nSkillLV
>=
4
and
DotaTime
()
>
8
*
60
and
nMP
>
0
.
45
then
local
nEnemyCreeps
=
bot
:
GetNearbyLaneCreeps
(
700
,
true
)
if
#
nEnemyCreeps
>=
3
and
J
.
IsValid
(
nEnemyCreeps
[
1
]
)
and
not
nEnemyCreeps
[
1
]:
HasModifier
(
"modifier_fountain_glyph"
)
then
return
BOT_ACTION_DESIRE_HIGH
,
"W-Farm"
end
end
if
nSkillLV
>=
4
and
J
.
IsAllowedToSpam
(
bot
,
nManaCost
)
and
nMP
>=
0
.
5
then
local
nEnemyCreeps
=
bot
:
GetNearbyCreeps
(
700
,
true
)
if
#
nEnemyCreeps
>=
1
or
#
hEnemyList
>=
1
then
return
BOT_ACTION_DESIRE_HIGH
,
"W-Spam"
end
end
return
BOT_ACTION_DESIRE_NONE
,
nil
end
function
X
.
ConsiderE
()
if
not
abilityE
:
IsFullyCastable
()
or
(
J
.
GetHP
(
bot
)
<
0
.
3
and
not
abilityR
:
IsFullyCastable
()
)
then
return
BOT_ACTION_DESIRE_NONE
,
nil
end
local
nSkillLV
=
abilityE
:
GetLevel
()
local
nCastPoint
=
abilityE
:
GetCastPoint
()
local
nManaCost
=
abilityE
:
GetManaCost
()
if
J
.
IsInTeamFight
(
bot
,
1200
)
then
if
#
hEnemyList
>=
2
then
return
BOT_ACTION_DESIRE_HIGH
,
"E-Battle"
end
end
if
J
.
IsGoingOnSomeone
(
bot
)
then
if
J
.
IsValidHero
(
botTarget
)
and
J
.
IsInRange
(
botTarget
,
bot
,
700
)
then
return
BOT_ACTION_DESIRE_HIGH
,
"E-Attack"
end
end
if
(
J
.
IsPushing
(
bot
)
or
J
.
IsFarming
(
bot
)
or
J
.
IsDefending
(
bot
)
)
and
nLV
<=
16
then
if
#
hAllyList
>=
#
hEnemyList
then
return
BOT_ACTION_DESIRE_HIGH
,
"E-Farm/Push/Defend"
end
end
return
BOT_ACTION_DESIRE_NONE
,
nil
end
function
X
.
ConsiderD
()
if
not
abilityD
:
IsFullyCastable
()
then
return
BOT_ACTION_DESIRE_NONE
,
nil
end
local
nSkillLV
=
abilityD
:
GetLevel
()
local
nCastPoint
=
abilityD
:
GetCastPoint
()
local
nManaCost
=
abilityD
:
GetManaCost
()
if
J
.
IsInTeamFight
(
bot
,
1200
)
then
if
#
hEnemyList
>=
2
then
return
BOT_ACTION_DESIRE_HIGH
,
"D-Battle"
end
end
if
J
.
IsGoingOnSomeone
(
bot
)
then
if
J
.
IsValidHero
(
botTarget
)
and
J
.
IsInRange
(
botTarget
,
bot
,
700
)
then
return
BOT_ACTION_DESIRE_HIGH
,
"D-Attack"
end
end
if
J
.
IsRetreating
(
bot
)
then
if
bot
:
WasRecentlyDamagedByAnyHero
(
1
.
5
)
then
return
BOT_ACTION_DESIRE_HIGH
,
'D-Retreat'
end
end
if
(
J
.
IsPushing
(
bot
)
or
J
.
IsFarming
(
bot
)
or
J
.
IsDefending
(
bot
)
)
then
if
#
hAllyList
>=
#
hEnemyList
then
return
BOT_ACTION_DESIRE_HIGH
,
"D-Farm/Push/Defend"
end
end
end
function
X
.
ConsiderF
()
if
not
abilityF
:
IsFullyCastable
()
then
return
BOT_ACTION_DESIRE_NONE
,
nil
end
local
nSkillLV
=
abilityF
:
GetLevel
()
local
nCastPoint
=
abilityF
:
GetCastPoint
()
local
nManaCost
=
abilityF
:
GetManaCost
()
local
nRadius
=
abilityF
:
GetSpecialValueInt
(
'scepter_radius'
)
local
nAlliedHeroesInRange
=
bot
:
GetNearbyHeroes
(
nRadius
,
false
,
BOT_MODE_NONE
)
local
nEnemyHeroesInRange
=
bot
:
GetNearbyHeroes
(
nRadius
,
true
,
BOT_MODE_NONE
)
if
J
.
IsInTeamFight
(
bot
,
1200
)
then
for
_
,
npcEnemy
in
pairs
(
nEnemyHeroesInRange
)
do
if
J
.
IsValidHero
(
npcEnemy
)
and
J
.
CanCastOnNonMagicImmune
(
npcEnemy
)
and
npcEnemy
:
IsChanneling
()
then
return
BOT_ACTION_DESIRE_HIGH
,
"F-Battle-Interrupt"
end
end
for
_
,
npcAlly
in
pairs
(
nAlliedHeroesInRange
)
do
if
J
.
IsValidHero
(
npcAlly
)
and
J
.
IsDisabled
(
npcAlly
)
then
return
BOT_ACTION_DESIRE_HIGH
,
"F-Battle-Protect"
end
end
-- if #nEnemyHeroesInRange >= 4
-- then
-- return BOT_ACTION_DESIRE_HIGH, "F-Battle"
-- end
end
if
J
.
IsGoingOnSomeone
(
bot
)
then
if
J
.
IsValidHero
(
botTarget
)
and
J
.
IsInRange
(
botTarget
,
bot
,
nRadius
)
and
botTarget
:
IsChanneling
()
and
J
.
CanCastOnNonMagicImmune
(
botTarget
)
then
return
BOT_ACTION_DESIRE_HIGH
,
"F-Chase:"
..
J
.
Chat
.
GetNormName
(
botTarget
)
end
end
if
J
.
IsRetreating
(
bot
)
then
if
bot
:
WasRecentlyDamagedByAnyHero
(
1
.
5
)
and
#
nAlliedHeroesInRange
<
#
nEnemyHeroesInRange
then
return
BOT_ACTION_DESIRE_HIGH
,
'F-Retreat'
end
end
if
J
.
IsDefending
(
bot
)
then
if
#
hAllyList
<=
#
hEnemyList
and
#
hEnemyList
>=
3
then
return
BOT_ACTION_DESIRE_HIGH
,
"F-Defend"
end
end
end
function
X
.
ConsiderR
()
if
not
abilityR
:
IsFullyCastable
()
then
return
BOT_ACTION_DESIRE_NONE
,
nil
end
local
nSkillLV
=
abilityR
:
GetLevel
()
local
nCastRange
=
abilityR
:
GetCastRange
()
+
bonusRange
local
nCastPoint
=
abilityR
:
GetCastPoint
()
local
nManaCost
=
abilityR
:
GetManaCost
()
local
nMinThreshold
=
abilityR
:
GetSpecialValueInt
(
'hit_point_minimum_pct'
)
+
5
local
nAlliedHeroesInRange
=
bot
:
GetNearbyHeroes
(
nCastRange
,
false
,
BOT_MODE_NONE
)
local
nEnemyHeroesInRange
=
bot
:
GetNearbyHeroes
(
nCastRange
,
true
,
BOT_MODE_NONE
)
-- if nHP > nMinThreshold * 0.01 then return BOT_ACTION_DESIRE_NONE, nil end
if
nHP
>
0
.
4
then
return
BOT_ACTION_DESIRE_NONE
,
nil
end
local
npcStrongestEnemy
=
nil
local
npcStrongestEnemyHealth
=
0
for
_
,
npcEnemy
in
pairs
(
nEnemyHeroesInRange
)
do
if
J
.
IsValidHero
(
npcEnemy
)
and
J
.
CanCastOnNonMagicImmune
(
npcEnemy
)
and
J
.
CanCastOnTargetAdvanced
(
npcEnemy
)
and
J
.
GetHP
(
npcEnemy
)
>
npcStrongestEnemyHealth
then
npcStrongestEnemy
=
npcEnemy
npcStrongestEnemyHealth
=
J
.
GetHP
(
npcEnemy
)
end
end
local
npcStrongestAlly
=
nil
local
npcStrongestAllyHealth
=
0
if
J
.
IsInTeamFight
(
bot
,
1200
)
then
for
_
,
npcAlly
in
pairs
(
nAlliedHeroesInRange
)
do
if
J
.
IsValidHero
(
npcAlly
)
and
J
.
CanCastOnMagicImmune
(
npcAlly
)
and
J
.
GetHP
(
npcAlly
)
>
npcStrongestAllyHealth
and
npcAlly
~=
bot
then
npcStrongestAlly
=
npcAlly
npcStrongestAllyHealth
=
npcWeakestAlly
:
GetHealth
()
end
end
end
if
npcStrongestEnemy
~=
nil
and
npcStrongestAlly
~=
nil
then
if
npcStrongestEnemyHealth
>
npcStrongestAllyHealth
then
return
BOT_ACTION_DESIRE_HIGH
,
npcStrongestEnemy
,
'R-Swap:'
..
J
.
Chat
.
GetNormName
(
npcStrongestEnemy
)
else
return
BOT_ACTION_DESIRE_HIGH
,
npcStrongestAlly
,
'R-Swap:'
..
J
.
Chat
.
GetNormName
(
npcStrongestAlly
)
end
end
if
npcStrongestEnemy
~=
nil
and
npcStrongestAlly
==
nil
then
return
BOT_ACTION_DESIRE_HIGH
,
npcStrongestEnemy
,
'R-Swap:'
..
J
.
Chat
.
GetNormName
(
npcStrongestEnemy
)
end
if
npcStrongestEnemy
==
nil
and
npcStrongestAlly
~=
nil
then
return
BOT_ACTION_DESIRE_HIGH
,
npcStrongestAlly
,
'R-Swap:'
..
J
.
Chat
.
GetNormName
(
npcStrongestAlly
)
end
return
BOT_ACTION_DESIRE_NONE
,
nil
end
return
X
\ No newline at end of file
FunLib/aba_buff.lua
View file @
71e98103
...
...
@@ -134,6 +134,152 @@ Buff["hero_not_invisible"] = {
}
Buff
[
"dispellable_debuffs"
]
=
{
"modifier_cold_feet"
,
"modifier_arc_warden_flux"
,
"modifier_axe_battle_hunger"
,
"modifier_bane_enfeeble_effect"
,
"modifier_batrider_sticky_napalm"
,
"modifier_flamebreak_damage"
,
"modifier_beastmaster_axe_stack_counter"
,
"modifier_bounty_hunter_wind_walk_slow"
,
"modifier_bounty_hunter_track"
,
"modifier_brewmaster_cinder_brew"
,
"modifier_bristleback_viscous_nasal_goo"
,
"modifier_broodmother_spawn_spiderlings"
,
"modifier_chaos_knight_reality_rift_debuff"
,
"modifier_chen_penitence"
,
"modifier_crystal_maiden_crystal_nova"
,
"modifier_dark_seer_ion_shell"
,
"modifier_dark_willow_cursed_crown"
,
"modifier_dark_willow_debuff_fear"
,
"modifier_dazzle_poison_touch"
,
"modifier_death_prophet_spirit_siphon_fear"
,
"modifier_disruptor_thunderstrike_slow"
,
"modifier_dragonknight_breathefire_reduction"
,
"modifier_elder_titan_earth_splitter"
,
"modifier_enigma_malefice"
,
"modifier_enchantress_enchant_slow"
,
"modifier_faceless_void_time_dilation_slow"
,
"modifier_grimstroke_dark_artistry_slow"
,
"modifier_gyrocopter_call_down_slow"
,
"modifier_huskar_inner_fire_disarm"
,
"modifier_huskar_life_break_slow"
,
"modifier_invoker_cold_snap"
,
"modifier_invoker_chaos_meteor_burn"
,
"modifier_jakiro_dual_breath_slow"
,
"modifier_jakiro_dual_breath_burn"
,
"modifier_jakiro_liquid_fire_burn"
,
"modifier_jakiro_liquid_ice_debuff"
,
"modifier_keeper_of_the_light_blinding_light"
,
"modifier_kunkka_torrent_slow"
,
"modifier_life_stealer_open_wounds"
,
"modifier_lone_druid_savage_roar"
,
"modifier_magnataur_shockwave"
,
"modifier_naga_siren_rip_tide"
,
"modifier_night_stalker_void"
,
"modifier_ogre_magi_ignite"
,
"modifier_oracle_fortunes_end_purge"
,
"modifier_oracle_fates_edict"
,
"modifier_pangolier_luckyshot_disarm"
,
"modifier_phantom_assassin_stiflingdagger"
,
"modifier_phantom_lancer_spirit_lance"
,
"modifier_phoenix_icarus_dive_burn"
,
"modifier_phoenix_fire_spirit_burn"
,
"modifier_pugna_decrepify"
,
"modifier_queenofpain_shadow_strike"
,
-- "modifier_silencer_curse_of_the_silent",
"modifier_silencer_last_word"
,
"modifier_slardar_amplify_damage"
,
"modifier_templar_assassin_meld_armor"
,
"modifier_terrorblade_reflection_slow"
,
"modifier_tidehunter_gush"
,
"modifier_tidehunter_anchor_smash"
,
"modifier_shredder_whirling_death_debuff"
,
"modifier_tinker_laser_blind"
,
"modifier_treant_leech_seed"
,
"modifier_treant_overgrowth"
,
"modifier_troll_warlord_berserkers_rage_ensnare"
,
"modifier_troll_warlord_whirling_axes_slow"
,
"modifier_troll_warlord_whirling_axes_blind"
,
"modifier_abyssal_underlord_firestorm_burn"
,
"modifier_abyssal_underlord_pit_of_malice_ensare"
,
"modifier_ursa_earthshock"
,
"modifier_vengefulspirit_wave_of_terror"
,
"modifier_venomancer_venomous_gale"
,
"modifier_visage_grave_chill_debuff"
,
"modifier_warlock_fatal_bonds"
,
"modifier_warlock_shadow_word"
,
"modifier_dark_troll_warlord_ensnare"
,
"modifier_lone_druid_spirit_bear_entangle_effect"
,
"modifier_item_diffusal_blade_slow"
,
"modifier_orchid_malevolence_debuff"
,
"modifier_bloodthorn_debuff"
,
"modifier_rod_of_atos_debuff"
,
"modifier_gungir_debuff"
,
"modifier_item_medallion_of_courage_armor_reduction"
,
"modifier_item_solar_crest_armor_reduction"
,
"modifier_item_urn_damage"
,
"modifier_item_spirit_vessel_damage"
,
"modifier_item_veil_of_discord_debuff"
,
}
Buff
[
"dispellable_buffs"
]
=
{
"modifier_abaddon_aphotic_shield"
,
"modifier_bloodseeker_bloodrage"
,
"modifier_dark_seer_ion_shell"
,
"modifier_dark_seer_surge"
,
"modifier_earthshaker_enchant_totem"
,
"modifier_grimstroke_spirit_walk_buff"
,
"modifier_gyrocopter_rocket_barrage"
,
"modifier_invoker_alacrity"
,
"modifier_legion_commander_overwhelming_odds"
,
"modifier_legion_commander_press_the_attack"
,
"modifier_lich_frost_shield"
,
"modifier_magnataur_empower"
,
"modifier_mirana_leap_buff"
,
"modifier_monkey_king_quadruple_tap_bonuses"
,
"modifier_necrolyte_sadist_active"
,
"modifier_ogre_magi_bloodlust"
,
"modifier_omninight_guardian_angel"
,
"modifier_oracle_purifying_flames"
,
"modifier_pangolier_shield_crash_buff"
,
"modifier_phantom_assassin_phantom_strike"
,
"modifier_phantom_lancer_phantom_edge_agility"
,
"modifier_pugna_decrepify"
,
"modifier_slardar_sprint"
,
"modifier_spirit_breaker_bulldoze"
,
"modifier_storm_spirit_overload"
,
"modifier_storm_spirit_electric_rave"
,
"modifier_sven_warcry"
,
"modifier_treant_living_armor"
,
"modifier_ursa_fury_swipes"
,
"modifier_visage_grave_chill_buff"
,
"modifier_warlock_shadow_word"
,
"modifier_windrunner_windrun"
,
"modifier_item_ancient_janggo_active"
,
"modifier_item_forcestaff_active"
,
"modifier_ghost_state"
,
"modifier_item_glimmer_cape_fade"
,
"modifier_item_hurricane_pike_active"
,
"modifier_item_medallion_of_courage_armor_addition"
,
"modifier_item_urn_heal"
,
"modifier_item_solar_crest_armor_addition"
,
"modifier_item_ethereal_blade_ethereal"
,
"modifier_item_crimson_guard_extra"
,
"modifier_item_mask_of_madness_berserk"
,
"modifier_item_mjollnir_static"
,
"modifier_rune_arcane"
,
"modifier_rune_doubledamage"
,
"modifier_rune_haste"
,
"modifier_rune_regen"
,
}
return
Buff
-- dota2jmz@163.com QQ:2462331592..
\ No newline at end of file
FunLib/aba_item.lua
View file @
71e98103
...
...
@@ -329,6 +329,7 @@ Item['tEarlyItem'] = {
'item_tango'
,
'item_flask'
,
'item_infused_raindrop'
,
'item_branches'
,
-- 'item_magic_stick',
-- 'item_orb_of_venom',
'item_bracer'
,
...
...
@@ -338,8 +339,8 @@ Item['tEarlyItem'] = {
'item_soul_ring'
,
-- 'item_magic_wand',
-- 'item_ancient_janggo',
'item_refresher_shard'
,
'item_cheese'
,
--
'item_refresher_shard',
--
'item_cheese',
}
Item
[
'tEarlyBoots'
]
=
{
...
...
@@ -825,6 +826,7 @@ local tDefineItemRealName = {
[
'item_mid_outfit'
]
=
"item_power_treads"
,
[
'item_templar_assassin_outfit'
]
=
"item_power_treads"
,
[
'item_obsidian_destroyer_outfit'
]
=
"item_power_treads"
,
[
'item_ranged_carry_outfit'
]
=
"item_power_treads"
,
...
...
@@ -893,6 +895,7 @@ Item['item_mid_outfit'] = { 'item_tango', 'item_faerie_fire', 'item_double_b
Item
[
'item_templar_assassin_outfit'
]
=
{
'item_tango'
,
'item_faerie_fire'
,
'item_double_branches'
,
'item_wraith_band'
,
'item_flask'
,
'item_magic_stick'
,
'item_recipe_magic_wand'
,
'item_flask'
,
'item_power_treads_agi'
,
'item_blight_stone'
}
Item
[
'item_obsidian_destroyer_outfit'
]
=
{
'item_tango'
,
'item_crown'
,
'item_ring_of_health'
,
'item_void_stone'
,
'item_recipe_meteor_hammer'
,
'item_power_treads_int'
}
----------------------------------------------------------------------
...
...
@@ -1114,6 +1117,24 @@ function Item.IsItemInHero( sItemName )
if
sItemName
==
'item_ultimate_scepter_2'
then
return
(
bot
:
HasScepter
()
and
bot
:
FindItemSlot
(
'item_ultimate_scepter'
)
<
0
)
end
if
(
sItemName
==
'item_power_treads'
or
sItemName
==
'item_phase_boots'
)
and
(
Item
.
IsItemInHero
(
'item_travel_boots'
)
or
Item
.
IsItemInHero
(
'item_travel_boots_2'
)
)
then
return
true
end
if
sItemName
==
'item_power_treads'
and
Item
.
IsItemInHero
(
'item_boots_of_bearing'
)
then
return
true
end
if
sItemName
==
'item_tranquil_boots'
and
Item
.
IsItemInHero
(
'item_guardian_greaves'
)
then
return
true
end
local
nItemSolt
=
bot
:
FindItemSlot
(
sItemName
)
--加入信使背包会更好
...
...
FunLib/aba_role.lua
View file @
71e98103
...
...
@@ -1544,6 +1544,7 @@ X["bottle"] = {
X
[
"phase_boots"
]
=
{
[
"npc_dota_hero_abaddon"
]
=
1
,
[
"npc_dota_hero_night_stalker"
]
=
1
,
[
"npc_dota_hero_alchemist"
]
=
1
,
[
"npc_dota_hero_gyrocopter"
]
=
1
,
[
"npc_dota_hero_medusa"
]
=
1
,
...
...
@@ -1646,6 +1647,7 @@ end
X
[
'off'
]
=
{
'npc_dota_hero_abaddon'
,
'npc_dota_hero_night_stalker'
,
'npc_dota_hero_abyssal_underlord'
,
'npc_dota_hero_axe'
,
'npc_dota_hero_batrider'
,
...
...
@@ -1672,6 +1674,7 @@ X['off'] = {
'npc_dota_hero_venomancer'
,
'npc_dota_hero_windrunner'
,
'npc_dota_hero_primal_beast'
,
'npc_dota_hero_obsidian_destroyer'
,
}
X
[
'mid'
]
=
{
...
...
@@ -1712,6 +1715,7 @@ X['mid'] = {
X
[
'safe'
]
=
{
'npc_dota_hero_antimage'
,
'npc_dota_hero_night_stalker'
,
'npc_dota_hero_chaos_knight'
,
"npc_dota_hero_mars"
,
'npc_dota_hero_drow_ranger'
,
...
...
@@ -2151,6 +2155,8 @@ function X.IsABAHero()
local
sABAHeroIndex
=
{
[
"npc_dota_hero_antimage"
]
=
true
,
[
"npc_dota_hero_night_stalker"
]
=
true
,
[
"npc_dota_hero_obsidian_destroyer"
]
=
true
,
[
"npc_dota_hero_arc_warden"
]
=
true
,
[
"npc_dota_hero_bane"
]
=
true
,
[
"npc_dota_hero_bloodseeker"
]
=
true
,
...
...
@@ -2196,6 +2202,7 @@ function X.IsABAHero()
[
"npc_dota_hero_axe"
]
=
true
,
[
"npc_dota_hero_slardar"
]
=
true
,
[
"npc_dota_hero_legion_commander"
]
=
true
,
[
"npc_dota_hero_terrorblade"
]
=
true
,
[
"npc_dota_hero_tidehunter"
]
=
true
,
[
"npc_dota_hero_omniknight"
]
=
true
,
[
"npc_dota_hero_naga_siren"
]
=
true
,
...
...
FunLib/aba_site.lua
View file @
71e98103
...
...
@@ -505,16 +505,22 @@ end
local
tFarmerList
=
{
[
"npc_dota_hero_nevermore"
]
=
true
,
[
"npc_dota_hero_medusa"
]
=
true
,
[
"npc_dota_hero_razor"
]
=
true
,
[
"npc_dota_hero_luna"
]
=
true
,
[
"npc_dota_hero_sven"
]
=
true
,
[
"npc_dota_hero_antimage"
]
=
true
,
[
"npc_dota_hero_bloodseeker"
]
=
true
,
[
"npc_dota_hero_clinkz"
]
=
true
,
[
"npc_dota_hero_drow_ranger"
]
=
true
,
[
"npc_dota_hero_huskar"
]
=
true
,
[
"npc_dota_hero_luna"
]
=
true
,
[
"npc_dota_hero_medusa"
]
=
true
,
[
"npc_dota_hero_nevermore"
]
=
true
,
[
"npc_dota_hero_phantom_assassin"
]
=
true
,
[
"npc_dota_hero_phantom_lancer"
]
=
true
,
[
"npc_dota_hero_naga_siren"
]
=
true
,
[
"npc_dota_hero_razor"
]
=
true
,
[
"npc_dota_hero_slark"
]
=
true
,
[
"npc_dota_hero_sven"
]
=
true
,
[
"npc_dota_hero_templar_assassin"
]
=
true
,
[
"npc_dota_hero_terrorblade"
]
=
true
,
}
function
Site
.
IsSpecialFarmer
(
bot
)
...
...
@@ -526,25 +532,28 @@ end
local
tFarmHeroList
=
{
[
"npc_dota_hero_nevermore"
]
=
true
,
[
"npc_dota_hero_drow_ranger"
]
=
true
,
[
"npc_dota_hero_luna"
]
=
true
,
[
"npc_dota_hero_sven"
]
=
true
,
[
"npc_dota_hero_axe"
]
=
true
,
[
"npc_dota_hero_abaddon"
]
=
true
,
[
"npc_dota_hero_antimage"
]
=
true
,
[
"npc_dota_hero_arc_warden"
]
=
true
,
[
"npc_dota_hero_axe"
]
=
true
,
[
"npc_dota_hero_bloodseeker"
]
=
true
,
[
"npc_dota_hero_clinkz"
]
=
true
,
[
"npc_dota_hero_drow_ranger"
]
=
true
,
[
"npc_dota_hero_huskar"
]
=
true
,
[
"npc_dota_hero_luna"
]
=
true
,
[
"npc_dota_hero_juggernaut"
]
=
true
,
[
"npc_dota_hero_medusa"
]
=
true
,
[
"npc_dota_hero_razor"
]
=
true
,
[
"npc_dota_hero_naga_siren"
]
=
true
,
[
"npc_dota_hero_nevermore"
]
=
true
,
[
"npc_dota_hero_night_stalker"
]
=
true
,
[
"npc_dota_hero_phantom_assassin"
]
=
true
,
[
"npc_dota_hero_phantom_lancer"
]
=
true
,
[
"npc_dota_hero_naga_siren"
]
=
true
,
[
"npc_dota_hero_razor"
]
=
true
,
[
"npc_dota_hero_slark"
]
=
true
,
[
"npc_dota_hero_sven"
]
=
true
,
[
"npc_dota_hero_templar_assassin"
]
=
true
,
[
"npc_dota_hero_huskar"
]
=
true
,
[
"npc_dota_hero_clinkz"
]
=
true
,
[
"npc_dota_hero_juggernaut"
]
=
true
,
[
"npc_dota_hero_terrorblade"
]
=
true
,
[
"npc_dota_hero_tidehunter"
]
=
true
,
[
"npc_dota_hero_slark"
]
=
true
,
}
function
Site
.
IsShouldFarmHero
(
bot
)
...
...
@@ -787,6 +796,8 @@ Site.ConsiderFarmNeutralType["npc_dota_hero_viper"] = function() return 'maxHP'
Site
.
ConsiderFarmNeutralType
[
"npc_dota_hero_huskar"
]
=
function
()
return
'maxHP'
end
Site
.
ConsiderFarmNeutralType
[
"npc_dota_hero_terrorblade"
]
=
function
()
return
'maxHP'
end
Site
.
ConsiderFarmNeutralType
[
"npc_dota_hero_phantom_assassin"
]
=
function
()
local
bot
=
GetBot
()
...
...
@@ -877,6 +888,7 @@ function Site.FindFarmNeutralTarget( creepList )
if
Site
.
IsHaveItem
(
bot
,
"item_bfury"
)
or
Site
.
IsHaveItem
(
bot
,
"item_maelstrom"
)
or
Site
.
IsHaveItem
(
bot
,
"item_mjollnir"
)
or
Site
.
IsHaveItem
(
bot
,
"item_gungir"
)
or
Site
.
IsHaveItem
(
bot
,
"item_radiance"
)
then
targetCreep
=
Site
.
GetMaxHPCreep
(
creepList
)
...
...
@@ -1021,6 +1033,8 @@ function Site.IsTimeToFarm( bot )
return
true
end
if
bot
:
GetNetWorth
()
<
35000
then
return
true
end
return
false
end
...
...
@@ -1153,6 +1167,40 @@ Site.ConsiderIsTimeToFarm["npc_dota_hero_bloodseeker"] = function()
return
false
end
Site
.
ConsiderIsTimeToFarm
[
"npc_dota_hero_terrorblade"
]
=
function
()
local
bot
=
GetBot
()
local
botNetWorth
=
bot
:
GetNetWorth
()
if
DotaTime
()
>
9
*
60
and
(
bot
:
GetLevel
()
<
25
or
botNetWorth
<
20000
)
then
return
true
end
if
not
Site
.
IsHaveItem
(
bot
,
"item_black_king_bar"
)
and
botNetWorth
<
21000
then
if
Site
.
GetAroundAllyCount
(
bot
,
1100
)
<=
2
then
return
true
end
end
if
not
Site
.
IsHaveItem
(
bot
,
"item_satanic"
)
and
botNetWorth
<
25000
then
if
Site
.
GetAroundAllyCount
(
bot
,
1000
)
<=
1
then
return
true
end
end
return
false
end
Site
.
ConsiderIsTimeToFarm
[
"npc_dota_hero_bristleback"
]
=
function
()
local
bot
=
GetBot
()
...
...
@@ -1424,12 +1472,24 @@ Site.ConsiderIsTimeToFarm["npc_dota_hero_nevermore"] = function()
end
Site
.
ConsiderIsTimeToFarm
[
"npc_dota_hero_night_stalker"
]
=
function
()
return
Site
.
ConsiderIsTimeToFarm
[
"npc_dota_hero_bristleback"
]()
end
Site
.
ConsiderIsTimeToFarm
[
"npc_dota_hero_omniknight"
]
=
function
()
return
Site
.
ConsiderIsTimeToFarm
[
"npc_dota_hero_bristleback"
]()
end
Site
.
ConsiderIsTimeToFarm
[
"npc_dota_hero_obsidian_destroyer"
]
=
function
()
return
Site
.
ConsiderIsTimeToFarm
[
"npc_dota_hero_bristleback"
]()
end
Site
.
ConsiderIsTimeToFarm
[
"npc_dota_hero_ogre_magi"
]
=
function
()
return
Site
.
ConsiderIsTimeToFarm
[
"npc_dota_hero_bristleback"
]()
...
...
FunLib/aba_skill.lua
View file @
71e98103
...
...
@@ -58,12 +58,17 @@ X['sOnlyProjectileAbilityIndex'] = {
X
[
'sStunProjectileAbilityIndex'
]
=
{
[
"chaos_knight_chaos_bolt"
]
=
true
,
[
"skeleton_king_hellfire_blast"
]
=
true
,
[
"sven_storm_bolt"
]
=
true
,
[
"vengefulspirit_magic_missile"
]
=
true
,
[
"witch_doctor_paralyzing_cask"
]
=
true
,
[
"dragon_knight_dragon_tail"
]
=
true
,
[
"alchemist_unstable_concoction"
]
=
true
,
[
"brewmaster_earth_hurl_boulder"
]
=
true
,
[
"chaos_knight_chaos_bolt"
]
=
true
,
[
"dragon_knight_dragon_tail"
]
=
true
,
[
"gyrocopter_homing_missile"
]
=
true
,
[
"mud_golem_hurl_boulder"
]
=
true
,
[
"skeleton_king_hellfire_blast"
]
=
true
,
[
"sven_storm_bolt"
]
=
true
,
[
"tusk_snowball"
]
=
true
,
[
"vengefulspirit_magic_missile"
]
=
true
,
[
"witch_doctor_paralyzing_cask"
]
=
true
,
}
...
...
FunLib/jmz_func.lua
View file @
71e98103
...
...
@@ -2445,6 +2445,55 @@ function J.IsRealInvisible( bot )
end
function
J
.
ShouldDispelBuff
(
npcTarget
)
for
_
,
modifier
in
pairs
(
J
.
Buff
[
"dispellable_buffs"
]
)
do
if
npcTarget
:
HasModifier
(
modifier
)
then
return
true
end
end
return
false
end
function
J
.
ShouldDispelDebuff
(
npcTarget
)
if
npcTarget
:
IsSilenced
()
or
npcTarget
:
IsRooted
()
or
npcTarget
:
IsNightmared
()
then
return
true
end
for
_
,
modifier
in
pairs
(
J
.
Buff
[
"dispellable_debuffs"
]
)
do
if
npcTarget
:
HasModifier
(
modifier
)
then
return
true
end
end
return
false
end
function
J
.
ShouldDispelStrongDebuff
(
npcTarget
)
if
npcTarget
:
IsStunned
()
or
npcTarget
:
IsHexed
()
then
return
true
end
return
J
.
ShouldDispelDebuff
(
npcTarget
)
end
function
J
.
GetModifierTime
(
bot
,
sModifierName
)
...
...
ability_item_usage_generic.lua
View file @
71e98103
...
...
@@ -1512,8 +1512,11 @@ X.ConsiderItemDesire["item_cyclone"] = function( hItem )
then
if
botTarget
:
HasModifier
(
'modifier_teleporting'
)
or
botTarget
:
HasModifier
(
'modifier_abaddon_borrowed_time'
)
or
botTarget
:
HasModifier
(
"modifier_dazzle_shallow_grave"
)
or
botTarget
:
HasModifier
(
"modifier_oracle_false_promise_timer"
)
or
botTarget
:
HasModifier
(
"modifier_ursa_enrage"
)
or
botTarget
:
HasModifier
(
"modifier_item_satanic_unholy"
)
or
botTarget
:
HasModifier
(
"modifier_troll_warlord_battle_trance"
)
or
botTarget
:
IsChanneling
()
then
hEffectTarget
=
botTarget
...
...
@@ -3073,6 +3076,59 @@ X.ConsiderItemDesire["item_moon_shard"] = function( hItem )
end
X
.
ConsiderItemDesire
[
"item_meteor_hammer"
]
=
function
(
hItem
)
local
nCastRange
=
600
+
aetherRange
local
nRadius
=
400
local
sCastType
=
'ground'
local
nChannelTime
=
2
.
5
local
nDelayTime
=
nChannelTime
+
0
.
5
local
hEffectTarget
=
nil
local
sCastMotive
=
nil
local
nEnemyHeroesInRange
=
bot
:
GetNearbyHeroes
(
nCastRange
+
nRadius
,
true
,
BOT_MODE_NONE
)
if
J
.
IsGoingOnSomeone
(
bot
)
then
if
J
.
IsValidHero
(
botTarget
)
and
J
.
IsInRange
(
botTarget
,
bot
,
nCastRange
+
nRadius
)
and
botTarget
:
HasModifier
(
'modifier_obsidian_destroyer_astral_imprisonment_prison'
)
and
J
.
GetModifierTime
(
botTarget
,
'modifier_obsidian_destroyer_astral_imprisonment_prison'
)
<
nDelayTime
and
J
.
GetModifierTime
(
botTarget
,
'modifier_obsidian_destroyer_astral_imprisonment_prison'
)
>=
(
nDelayTime
-
0
.
5
)
then
local
hEffectTarget
=
J
.
GetCastLocation
(
bot
,
botTarget
,
nCastRange
,
nRadius
)
return
BOT_ACTION_DESIRE_HIGH
,
hEffectTarget
,
sCastType
,
sCastMotive
end
end
local
nTowerList
=
bot
:
GetNearbyTowers
(
990
,
true
)
local
nBarrackList
=
bot
:
GetNearbyBarracks
(
990
,
true
)
local
nEnemyAcient
=
GetAncient
(
GetOpposingTeam
()
)
local
hBuildingList
=
{
nTowerList
[
1
],
nBarrackList
[
1
],
nEnemyAcient
,
}
for
_
,
nBuilding
in
pairs
(
hBuildingList
)
do
if
J
.
IsValidBuilding
(
nBuilding
)
and
J
.
IsInRange
(
bot
,
nBuilding
,
nCastRange
+
nRadius
-
50
)
and
not
nBuilding
:
HasModifier
(
'modifier_fountain_glyph'
)
and
not
nBuilding
:
HasModifier
(
'modifier_invulnerable'
)
and
not
nBuilding
:
HasModifier
(
'modifier_backdoor_protection'
)
and
not
J
.
IsKeyWordUnit
(
"DOTA_Outpost"
,
nBuilding
)
and
#
nEnemyHeroesInRange
==
0
then
local
hEffectTarget
=
J
.
GetCastLocation
(
bot
,
nBuilding
,
nCastRange
,
nRadius
)
return
BOT_ACTION_DESIRE_HIGH
,
hEffectTarget
,
sCastType
,
sCastMotive
end
end
end
--死灵书
X
.
ConsiderItemDesire
[
"item_necronomicon"
]
=
function
(
hItem
)
...
...
@@ -4219,7 +4275,10 @@ X.ConsiderItemDesire["item_tpscroll"] = function( hItem )
or
(
bot
:
HasModifier
(
"modifier_item_armlet_unholy_strength"
)
)
or
(
bot
:
HasModifier
(
"modifier_kunkka_x_marks_the_spot"
)
)
or
(
bot
:
HasModifier
(
"modifier_sniper_assassinate"
)
)
or
(
bot
:
HasModifier
(
"modifier_disruptor_glimpse"
)
)
or
(
bot
:
HasModifier
(
"modifier_viper_nethertoxin"
)
)
or
(
bot
:
HasModifier
(
"modifier_disruptor_static_storm"
)
)
or
(
bot
:
HasModifier
(
"modifier_enigma_midnight_pulse_damage"
)
)
or
(
bot
:
HasModifier
(
"modifier_oracle_false_promise_timer"
)
and
J
.
GetModifierTime
(
bot
,
"modifier_oracle_false_promise_timer"
)
<=
3
.
2
)
or
(
bot
:
HasModifier
(
"modifier_jakiro_macropyre_burn"
)
and
J
.
GetModifierTime
(
bot
,
"modifier_jakiro_macropyre_burn"
)
>=
1
.
4
)
or
(
bot
:
HasModifier
(
"modifier_arc_warden_tempest_double"
)
and
bot
:
GetRemainingLifespan
()
<
3
.
3
)
...
...
@@ -5735,7 +5794,7 @@ local function UseGlyph()
if
GetGlyphCooldown
(
)
>
0
or
DotaTime
()
<
60
or
bot
~=
GetTeamMember
(
1
)
--
or bot ~= GetTeamMember( 1 )
then
return
end
...
...
hero_selection.lua
View file @
71e98103
...
...
@@ -174,6 +174,8 @@ local sUserKeyDir = Chat.GetUserKeyDir()
local
sHasDevelopmentHeroList
=
{
"npc_dota_hero_abaddon"
,
"npc_dota_hero_night_stalker"
,
"npc_dota_hero_obsidian_destroyer"
,
"npc_dota_hero_abyssal_underlord"
,
"npc_dota_hero_alchemist"
,
"npc_dota_hero_life_stealer"
,
...
...
@@ -234,6 +236,7 @@ local sHasDevelopmentHeroList = {
"npc_dota_hero_muerta"
,
"npc_dota_hero_visage"
,
'npc_dota_hero_venomancer'
,
"npc_dota_hero_terrorblade"
,
}
...
...
@@ -270,6 +273,7 @@ local sSecondList = {
"npc_dota_hero_bane"
,
"npc_dota_hero_abyssal_underlord"
,
"npc_dota_hero_visage"
,
"npc_dota_hero_terrorblade"
,
}
...
...
@@ -292,6 +296,7 @@ local sThirdList = {
"npc_dota_hero_axe"
,
"npc_dota_hero_slark"
,
"npc_dota_hero_juggernaut"
,
"npc_dota_hero_night_stalker"
,
}
local
sFourthList
=
{
...
...
@@ -322,6 +327,7 @@ local sFifthList = {
"npc_dota_hero_mirana"
,
"npc_dota_hero_life_stealer"
,
"npc_dota_hero_alchemist"
,
"npc_dota_hero_obsidian_destroyer"
,
}
---------------------------------------------------------
...
...
@@ -378,7 +384,7 @@ local sMageList = {
"npc_dota_hero_queenofpain"
,
"npc_dota_hero_disruptor"
,
'npc_dota_hero_venomancer'
,
"npc_dota_hero_obsidian_destroyer"
,
}
local
sCarryList
=
{
...
...
@@ -419,6 +425,9 @@ local sCarryList = {
"npc_dota_hero_naga_siren"
,
"npc_dota_hero_life_stealer"
,
"npc_dota_hero_muerta"
,
"npc_dota_hero_obsidian_destroyer"
,
"npc_dota_hero_terrorblade"
,
"npc_dota_hero_night_stalker"
,
}
...
...
@@ -464,6 +473,7 @@ local sMidList = {
"npc_dota_hero_viper"
,
"npc_dota_hero_muerta"
,
'npc_dota_hero_venomancer'
,
"npc_dota_hero_obsidian_destroyer"
,
}
...
...
item_purchase_generic.lua
View file @
71e98103
...
...
@@ -606,7 +606,7 @@ function ItemPurchaseThink()
--出售过度装备
if
currentTime
>
sell_time
+
0
.
5
and
(
bot
:
GetItemInSlot
(
6
)
~=
nil
or
bot
:
GetItemInSlot
(
7
)
~=
nil
or
bot
:
GetItemInSlot
(
8
)
~=
nil
)
and
(
bot
:
DistanceFromFountain
()
<=
100
or
bot
:
DistanceFromSecretShop
()
<=
100
)
and
(
bot
:
DistanceFromFountain
()
<=
100
or
bot
:
DistanceFromSecretShop
()
<=
100
or
GetGameMode
()
==
23
)
then
sell_time
=
currentTime
...
...
@@ -624,7 +624,10 @@ function ItemPurchaseThink()
--当有飞鞋时卖掉其他早期鞋子
if
currentTime
>
18
*
60
and
(
Item
.
HasItem
(
bot
,
"item_travel_boots"
)
or
Item
.
HasItem
(
bot
,
"item_travel_boots_2"
)
)
and
(
Item
.
HasItem
(
bot
,
"item_travel_boots"
)
or
Item
.
HasItem
(
bot
,
"item_travel_boots_2"
)
or
Item
.
HasItem
(
bot
,
"item_guardian_greaves"
)
or
Item
.
HasItem
(
bot
,
"item_boots_of_bearing"
)
)
then
for
i
=
1
,
#
Item
[
'tEarlyBoots'
]
do
...
...
mode_farm_generic.lua
View file @
71e98103
...
...
@@ -1142,6 +1142,11 @@ function X.CouldBlink(bot,nLocation)
local
maxBlinkDist
=
1199
;
local
blink
=
J
.
IsItemAvailable
(
"item_blink"
);
if
blink
==
nil
then
blink
=
J
.
IsItemAvailable
(
"item_overwhelming_blink"
)
end
if
blink
==
nil
then
blink
=
J
.
IsItemAvailable
(
"item_swift_blink"
)
end
if
blink
==
nil
then
blink
=
J
.
IsItemAvailable
(
"item_arcane_blink"
)
end
if
blink
==
nil
then
blink
=
J
.
IsItemAvailable
(
"item_fallen_sky"
)
end
if
botName
==
"npc_dota_hero_antimage"
then
blink
=
bot
:
GetAbilityByName
(
"antimage_blink"
);
...
...
@@ -1264,6 +1269,7 @@ function X.IsHighFarmer(bot)
or
botName
==
"npc_dota_hero_slark"
or
botName
==
"npc_dota_hero_naga_siren"
or
botName
==
"npc_dota_hero_legion_commander"
or
botName
==
"npc_dota_hero_obsidian_destroyer"
end
...
...
mode_laning_generic.lua
View file @
71e98103
...
...
@@ -39,6 +39,11 @@ function GetDesire()
return
0
.
228
end
if
botLV
<=
25
then
return
0
.
203
end
return
0
end
...
...
mode_team_roam_generic.lua
View file @
71e98103
...
...
@@ -1594,6 +1594,7 @@ function X.IsSpecialCarry(bot)
[
"npc_dota_hero_mirana"
]
=
true
,
[
"npc_dota_hero_naga_siren"
]
=
true
,
[
"npc_dota_hero_nevermore"
]
=
true
,
[
"npc_dota_hero_night_stalker"
]
=
true
,
[
"npc_dota_hero_ogre_magi"
]
=
true
,
[
"npc_dota_hero_omniknight"
]
=
true
,
[
"npc_dota_hero_phantom_assassin"
]
=
true
,
...
...
@@ -1607,8 +1608,11 @@ function X.IsSpecialCarry(bot)
[
"npc_dota_hero_sniper"
]
=
true
,
[
"npc_dota_hero_sven"
]
=
true
,
[
"npc_dota_hero_templar_assassin"
]
=
true
,
[
"npc_dota_hero_terrorblade"
]
=
true
,
[
"npc_dota_hero_tidehunter"
]
=
true
,
[
"npc_dota_hero_viper"
]
=
true
,
[
"npc_dota_hero_muerta"
]
=
true
,
[
"npc_dota_hero_obsidian_destroyer"
]
=
true
,
}
return
tSpecialCarryList
[
botName
]
==
true
...
...
@@ -1639,7 +1643,7 @@ function X.IsSpecialSupport(bot)
[
"npc_dota_hero_warlock"
]
=
true
,
[
"npc_dota_hero_windrunner"
]
=
true
,
[
"npc_dota_hero_witch_doctor"
]
=
true
,
[
"npc_dota_hero_zuus"
]
=
true
,
[
"npc_dota_hero_zuus"
]
=
true
,
[
"npc_dota_hero_abaddon"
]
=
true
,
}
...
...
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