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
cda235f7
Commit
cda235f7
authored
Apr 03, 2023
by
JoyJ
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add venomancer and 7.32 stuff
parent
462df243
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
111 additions
and
26 deletions
+111
-26
FunLib/jmz_func.lua
FunLib/jmz_func.lua
+111
-26
No files found.
FunLib/jmz_func.lua
View file @
cda235f7
...
@@ -152,7 +152,22 @@ function J.CanNotUseAbility( bot )
...
@@ -152,7 +152,22 @@ function J.CanNotUseAbility( bot )
end
end
function
J
.
CanNotUseAbilityIgnoreStun
(
bot
)
return
not
bot
:
IsAlive
()
or
(
bot
==
GetBot
()
and
bot
:
NumQueuedActions
()
>
0
)
or
bot
:
IsInvulnerable
()
or
bot
:
IsCastingAbility
()
or
bot
:
IsUsingAbility
()
or
bot
:
IsChanneling
()
or
bot
:
IsSilenced
()
or
bot
:
IsStunned
()
or
bot
:
IsHexed
()
or
bot
:
IsNightmared
()
or
bot
:
HasModifier
(
"modifier_doom_bringer_doom"
)
or
bot
:
HasModifier
(
'modifier_item_forcestaff_active'
)
end
--友军生物数量
--友军生物数量
function
J
.
GetUnitAllyCountAroundEnemyTarget
(
target
,
nRadius
)
function
J
.
GetUnitAllyCountAroundEnemyTarget
(
target
,
nRadius
)
...
@@ -712,12 +727,6 @@ function J.CanCastOnTargetAdvanced( npcTarget )
...
@@ -712,12 +727,6 @@ function J.CanCastOnTargetAdvanced( npcTarget )
if
npcTarget
:
GetUnitName
()
==
'npc_dota_hero_antimage'
--and npcTarget:IsBot()
if
npcTarget
:
GetUnitName
()
==
'npc_dota_hero_antimage'
--and npcTarget:IsBot()
then
then
if
npcTarget
:
HasModifier
(
"modifier_antimage_spell_shield"
)
and
J
.
GetModifierTime
(
npcTarget
,
"modifier_antimage_spell_shield"
)
>
0
.
27
then
return
false
end
if
npcTarget
:
IsSilenced
()
if
npcTarget
:
IsSilenced
()
or
npcTarget
:
IsStunned
()
or
npcTarget
:
IsStunned
()
or
npcTarget
:
IsHexed
()
or
npcTarget
:
IsHexed
()
...
@@ -725,26 +734,14 @@ function J.CanCastOnTargetAdvanced( npcTarget )
...
@@ -725,26 +734,14 @@ function J.CanCastOnTargetAdvanced( npcTarget )
or
npcTarget
:
IsChanneling
()
or
npcTarget
:
IsChanneling
()
or
J
.
IsTaunted
(
npcTarget
)
or
J
.
IsTaunted
(
npcTarget
)
or
npcTarget
:
GetMana
()
<
45
or
npcTarget
:
GetMana
()
<
45
or
(
npcTarget
:
HasModifier
(
"modifier_antimage_spell_shield"
)
and
J
.
GetModifierTime
(
npcTarget
,
"modifier_antimage_spell_shield"
)
<
0
.
27
)
then
then
if
not
npcTarget
:
HasModifier
(
"modifier_item_sphere_target"
)
return
J
.
CanCastUnitSpellOnTarget
(
npcTarget
,
0
.
27
)
and
not
npcTarget
:
HasModifier
(
"modifier_item_lotus_orb_active"
)
and
not
npcTarget
:
HasModifier
(
"modifier_item_aeon_disk_buff"
)
and
(
not
npcTarget
:
HasModifier
(
"modifier_dazzle_shallow_grave"
)
or
npcTarget
:
GetHealth
()
>
300
)
then
return
true
end
end
end
return
false
return
false
end
end
return
not
npcTarget
:
HasModifier
(
"modifier_item_sphere_target"
)
return
J
.
CanCastUnitSpellOnTarget
(
npcTarget
,
0
.
27
)
and
not
npcTarget
:
HasModifier
(
"modifier_antimage_spell_shield"
)
and
not
npcTarget
:
HasModifier
(
"modifier_item_lotus_orb_active"
)
and
not
npcTarget
:
HasModifier
(
"modifier_item_aeon_disk_buff"
)
and
(
not
npcTarget
:
HasModifier
(
"modifier_dazzle_shallow_grave"
)
or
npcTarget
:
GetHealth
()
>
300
)
end
end
...
@@ -757,12 +754,16 @@ function J.CanCastUnitSpellOnTarget( npcTarget, nDelay )
...
@@ -757,12 +754,16 @@ function J.CanCastUnitSpellOnTarget( npcTarget, nDelay )
if
npcTarget
:
HasModifier
(
modifier
)
if
npcTarget
:
HasModifier
(
modifier
)
and
J
.
GetModifierTime
(
npcTarget
,
modifier
)
>=
nDelay
and
J
.
GetModifierTime
(
npcTarget
,
modifier
)
>=
nDelay
then
then
return
false
if
modifier
==
"modifier_dazzle_shallow_grave"
then
if
npcTarget
:
GetHealth
()
<=
300
then
return
false
end
else
return
false
end
end
end
end
end
return
true
return
true
end
end
...
@@ -830,10 +831,25 @@ function J.WillMagicKillTarget( bot, npcTarget, dmg, nDelay )
...
@@ -830,10 +831,25 @@ function J.WillMagicKillTarget( bot, npcTarget, dmg, nDelay )
end
end
end
end
if
npcTarget
:
GetUnitName
()
==
"npc_dota_hero_bristleback"
if
npcTarget
:
GetUnitName
()
==
"npc_dota_hero_mars"
then
and
not
npcTarget
:
IsFacingLocation
(
bot
:
GetLocation
(),
120
)
if
not
npcTarget
:
IsFacingLocation
(
bot
:
GetLocation
(),
110
)
then
EstDamage
=
EstDamage
*
0
.
3
elseif
not
npcTarget
:
IsFacingLocation
(
bot
:
GetLocation
(),
60
)
then
EstDamage
=
EstDamage
*
0
.
65
end
end
if
npcTarget
:
GetUnitName
()
==
"npc_dota_hero_spectre"
then
then
EstDamage
=
EstDamage
*
0
.
7
EstDamage
=
EstDamage
*
0
.
25
end
if
npcTarget
:
GetUnitName
()
==
"npc_dota_hero_bristleback"
then
if
not
npcTarget
:
IsFacingLocation
(
bot
:
GetLocation
(),
145
)
then
EstDamage
=
EstDamage
*
0
.
6
elseif
not
npcTarget
:
IsFacingLocation
(
bot
:
GetLocation
(),
125
)
then
EstDamage
=
EstDamage
*
0
.
8
end
end
end
if
npcTarget
:
HasModifier
(
"modifier_kunkka_ghost_ship_damage_delay"
)
if
npcTarget
:
HasModifier
(
"modifier_kunkka_ghost_ship_damage_delay"
)
...
@@ -848,6 +864,49 @@ function J.WillMagicKillTarget( bot, npcTarget, dmg, nDelay )
...
@@ -848,6 +864,49 @@ function J.WillMagicKillTarget( bot, npcTarget, dmg, nDelay )
if
buffTime
>=
nDelay
then
EstDamage
=
0
end
if
buffTime
>=
nDelay
then
EstDamage
=
0
end
end
end
--7.32
if
npcTarget
:
HasModifier
(
"modifier_lich_frost_shield"
)
then
local
buffTime
=
J
.
GetModifierTime
(
npcTarget
,
"modifier_lich_frost_shield"
)
if
buffTime
>=
nDelay
then
EstDamage
=
EstDamage
*
0
.
4
end
end
if
npcTarget
:
HasModifier
(
"modifier_nyx_assassin_burrow"
)
then
local
buffTime
=
J
.
GetModifierTime
(
npcTarget
,
"modifier_nyx_assassin_burrow"
)
if
buffTime
>=
nDelay
then
EstDamage
=
EstDamage
*
0
.
6
end
end
if
npcTarget
:
HasModifier
(
"modifier_legion_commander_duel"
)
and
npcTarget
:
HasScepter
()
then
local
buffTime
=
J
.
GetModifierTime
(
npcTarget
,
"modifier_legion_commander_duel"
)
if
buffTime
>=
nDelay
then
EstDamage
=
EstDamage
*
0
.
5
end
end
if
npcTarget
:
HasModifier
(
"modifier_ogre_magi_smash_buff"
)
then
local
buffTime
=
J
.
GetModifierTime
(
npcTarget
,
"modifier_ogre_magi_smash_buff"
)
if
buffTime
>=
nDelay
then
EstDamage
=
EstDamage
*
0
.
15
end
end
if
npcTarget
:
HasModifier
(
"modifier_ursa_enrage"
)
then
local
buffTime
=
J
.
GetModifierTime
(
npcTarget
,
"modifier_ursa_enrage"
)
if
buffTime
>=
nDelay
then
EstDamage
=
EstDamage
*
0
.
2
end
end
if
npcTarget
:
HasModifier
(
"modifier_vengefulspirit_nether_swap_damage_reduction"
)
then
local
buffTime
=
J
.
GetModifierTime
(
npcTarget
,
"modifier_vengefulspirit_nether_swap_damage_reduction"
)
if
buffTime
>=
nDelay
then
EstDamage
=
EstDamage
*
0
.
5
end
end
if
npcTarget
:
HasModifier
(
"modifier_item_wraith_pact_death_aura"
)
then
local
buffTime
=
J
.
GetModifierTime
(
npcTarget
,
"modifier_item_wraith_pact_death_aura"
)
if
buffTime
>=
nDelay
then
EstDamage
=
EstDamage
*
0
.
7
end
end
local
nRealDamage
=
npcTarget
:
GetActualIncomingDamage
(
EstDamage
,
nDamageType
)
local
nRealDamage
=
npcTarget
:
GetActualIncomingDamage
(
EstDamage
,
nDamageType
)
return
nRealDamage
>=
npcTarget
:
GetHealth
()
--, nRealDamage
return
nRealDamage
>=
npcTarget
:
GetHealth
()
--, nRealDamage
...
@@ -906,6 +965,32 @@ function J.HasForbiddenModifier( npcTarget )
...
@@ -906,6 +965,32 @@ function J.HasForbiddenModifier( npcTarget )
return
false
return
false
end
end
function
J
.
GetBonusCastRange
(
bot
)
local
bonusRange
=
0
local
itemAether
=
J
.
IsItemAvailable
(
"item_aether_lens"
)
local
itemOctarine
=
J
.
IsItemAvailable
(
"item_octarine_core"
)
if
(
itemAether
~=
nil
or
itemOctarine
~=
nil
)
then
bonusRange
=
bonusRange
+
225
end
local
itemOptic
=
J
.
IsItemAvailable
(
"item_keen_optic"
)
if
itemOptic
~=
nil
then
bonusRange
=
bonusRange
+
75
end
local
itemVizier
=
J
.
IsItemAvailable
(
"item_eye_of_the_vizier"
)
if
itemVizier
~=
nil
then
bonusRange
=
bonusRange
+
125
end
local
itemPsychic
=
J
.
IsItemAvailable
(
"item_psychic_headband"
)
if
itemPsychic
~=
nil
then
bonusRange
=
bonusRange
+
100
end
local
itemSeerStone
=
J
.
IsItemAvailable
(
"item_seer_stone"
)
if
itemSeerStone
~=
nil
then
bonusRange
=
bonusRange
+
350
end
local
itemTelescope
=
J
.
IsItemAvailable
(
"item_spy_gadget"
)
if
(
itemTelescope
~=
nil
or
bot
:
HasModifier
(
'modifier_item_spy_gadget'
)
)
then
bonusRange
=
bonusRange
+
100
end
return
bonusRange
end
function
J
.
ShouldEscape
(
bot
)
function
J
.
ShouldEscape
(
bot
)
...
...
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