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
49820c00
Commit
49820c00
authored
Apr 24, 2023
by
JoyJ
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixes
parent
ac0f0210
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
51 additions
and
32 deletions
+51
-32
BotLib/hero_centaur.lua
BotLib/hero_centaur.lua
+4
-4
FunLib/aba_item.lua
FunLib/aba_item.lua
+11
-11
FunLib/jmz_func.lua
FunLib/jmz_func.lua
+1
-1
ability_item_usage_generic.lua
ability_item_usage_generic.lua
+13
-10
item_purchase_generic.lua
item_purchase_generic.lua
+7
-0
mode_farm_generic.lua
mode_farm_generic.lua
+1
-0
mode_laning_generic.lua
mode_laning_generic.lua
+1
-0
rewrite_functions.lua
rewrite_functions.lua
+13
-6
No files found.
BotLib/hero_centaur.lua
View file @
49820c00
...
@@ -214,7 +214,7 @@ function X.ConsiderW()
...
@@ -214,7 +214,7 @@ function X.ConsiderW()
local
nDamage
=
abilityW
:
GetAbilityDamage
()
local
nDamage
=
abilityW
:
GetAbilityDamage
()
local
nCastPoint
=
abilityW
:
GetCastPoint
()
local
nCastPoint
=
abilityW
:
GetCastPoint
()
local
enemies
=
bot
:
GetNearbyHeroes
(
castRange
,
true
,
BOT_MODE_NONE
)
local
enemies
=
bot
:
GetNearbyHeroes
(
castRange
,
true
,
BOT_MODE_NONE
)
local
nRadius
=
300
local
nRadius
=
abilityW
:
GetVal
(
'radius'
)
if
aTarget
~=
nil
if
aTarget
~=
nil
and
aTarget
:
IsAlive
()
and
aTarget
:
IsAlive
()
...
@@ -234,16 +234,16 @@ function X.ConsiderW()
...
@@ -234,16 +234,16 @@ function X.ConsiderW()
if
(
J
.
IsPushing
(
bot
)
or
J
.
IsDefending
(
bot
)
or
J
.
IsLaning
(
bot
))
and
nHP
>
0
.
7
if
(
J
.
IsPushing
(
bot
)
or
J
.
IsDefending
(
bot
)
or
J
.
IsLaning
(
bot
))
and
nHP
>
0
.
7
then
then
local
creeps
=
bot
:
GetNearbyLaneCreeps
(
castRange
+
3
00
,
true
)
local
creeps
=
bot
:
GetNearbyLaneCreeps
(
castRange
+
6
00
,
true
)
local
maxHit
=
0
local
maxHit
=
0
local
maxHitCreep
=
nil
local
maxHitCreep
=
nil
for
creep
in
creeps
do
for
_
,
creep
in
pairs
(
creeps
)
do
local
hit
=
0
local
hit
=
0
local
kill
=
0
local
kill
=
0
for
cr
in
creeps
do
for
cr
in
creeps
do
if
cr
~=
creep
and
J
.
GetDistanceFromUnitToUnit
(
cr
,
creep
)
<
nRadius
then
if
cr
~=
creep
and
cr
:
GetDistanceToUnit
(
creep
)
<
nRadius
then
hit
=
hit
+
1
hit
=
hit
+
1
if
creep
:
GetHealth
()
<
nDamage
then
if
creep
:
GetHealth
()
<
nDamage
then
kill
=
kill
+
1
kill
=
kill
+
1
...
...
FunLib/aba_item.lua
View file @
49820c00
...
@@ -852,32 +852,32 @@ Item['item_obsidian_destroyer_outfit'] = { 'item_tango', 'item_crown', 'item_rin
...
@@ -852,32 +852,32 @@ Item['item_obsidian_destroyer_outfit'] = { 'item_tango', 'item_crown', 'item_rin
----------------------------------------------------------------------
----------------------------------------------------------------------
Item
[
'item_carry_alchemist_outfit'
]
=
{
'item_tango'
,
'item_
flask'
,
'item_
quelling_blade'
,
'item_double_branches'
,
'item_circlet'
,
'item_magic_stick'
,
'item_gauntlets'
,
'item_recipe_bracer'
,
'item_recipe_magic_wand'
,
'item_phase_boots'
}
Item
[
'item_carry_alchemist_outfit'
]
=
{
'item_tango'
,
'item_quelling_blade'
,
'item_double_branches'
,
'item_circlet'
,
'item_magic_stick'
,
'item_gauntlets'
,
'item_recipe_bracer'
,
'item_recipe_magic_wand'
,
'item_phase_boots'
}
Item
[
'item_ranged_carry_outfit'
]
=
{
'item_tango'
,
'item_
flask'
,
'item_
double_branches'
,
'item_slippers'
,
'item_circlet'
,
'item_magic_stick'
,
'item_recipe_wraith_band'
,
'item_flask'
,
'item_power_treads_agi'
,
'item_recipe_magic_wand'
,
'item_infused_raindrop'
}
Item
[
'item_ranged_carry_outfit'
]
=
{
'item_tango'
,
'item_double_branches'
,
'item_slippers'
,
'item_circlet'
,
'item_magic_stick'
,
'item_recipe_wraith_band'
,
'item_flask'
,
'item_power_treads_agi'
,
'item_recipe_magic_wand'
,
'item_infused_raindrop'
}
Item
[
'item_melee_carry_outfit'
]
=
{
'item_tango'
,
'item_
flask'
,
'item_
quelling_blade'
,
'item_double_branches'
,
'item_circlet'
,
'item_magic_stick'
,
'item_slippers'
,
'item_recipe_wraith_band'
,
'item_flask'
,
'item_recipe_magic_wand'
,
'item_power_treads_agi'
}
Item
[
'item_melee_carry_outfit'
]
=
{
'item_tango'
,
'item_quelling_blade'
,
'item_double_branches'
,
'item_circlet'
,
'item_magic_stick'
,
'item_slippers'
,
'item_recipe_wraith_band'
,
'item_flask'
,
'item_recipe_magic_wand'
,
'item_power_treads_agi'
}
Item
[
'item_phantom_assassin_outfit'
]
=
{
'item_tango'
,
'item_
flask'
,
'item_
quelling_blade'
,
'item_double_branches'
,
'item_circlet'
,
'item_magic_stick'
,
'item_slippers'
,
'item_recipe_wraith_band'
,
'item_flask'
,
'item_recipe_magic_wand'
,
'item_power_treads_agi'
,
'item_blight_stone'
}
Item
[
'item_phantom_assassin_outfit'
]
=
{
'item_tango'
,
'item_quelling_blade'
,
'item_double_branches'
,
'item_circlet'
,
'item_magic_stick'
,
'item_slippers'
,
'item_recipe_wraith_band'
,
'item_flask'
,
'item_recipe_magic_wand'
,
'item_power_treads_agi'
,
'item_blight_stone'
}
Item
[
'item_juggernaut_outfit'
]
=
{
'item_tango'
,
'item_
flask'
,
'item_
quelling_blade'
,
'item_double_branches'
,
'item_circlet'
,
'item_magic_stick'
,
'item_slippers'
,
'item_recipe_wraith_band'
,
'item_flask'
,
'item_recipe_magic_wand'
,
'item_phase_boots'
,
'item_wraith_band'
}
Item
[
'item_juggernaut_outfit'
]
=
{
'item_tango'
,
'item_quelling_blade'
,
'item_double_branches'
,
'item_circlet'
,
'item_magic_stick'
,
'item_slippers'
,
'item_recipe_wraith_band'
,
'item_flask'
,
'item_recipe_magic_wand'
,
'item_phase_boots'
,
'item_wraith_band'
}
Item
[
'item_huskar_outfit'
]
=
{
'item_tango'
,
'item_
flask'
,
'item_
double_branches'
,
'item_gauntlets'
,
'item_circlet'
,
'item_magic_stick'
,
'item_recipe_bracer'
,
'item_boots'
,
'item_bracer'
,
'item_recipe_magic_wand'
,
'item_flask'
,
'item_blades_of_attack'
,
'item_chainmail'
}
Item
[
'item_huskar_outfit'
]
=
{
'item_tango'
,
'item_double_branches'
,
'item_gauntlets'
,
'item_circlet'
,
'item_magic_stick'
,
'item_recipe_bracer'
,
'item_boots'
,
'item_bracer'
,
'item_recipe_magic_wand'
,
'item_flask'
,
'item_blades_of_attack'
,
'item_chainmail'
}
Item
[
'item_sven_outfit'
]
=
{
'item_tango'
,
'item_
flask'
,
'item_
quelling_blade'
,
'item_double_branches'
,
'item_circlet'
,
'item_magic_stick'
,
'item_gauntlets'
,
'item_recipe_bracer'
,
'item_flask'
,
'item_recipe_magic_wand'
,
'item_phase_boots'
}
Item
[
'item_sven_outfit'
]
=
{
'item_tango'
,
'item_quelling_blade'
,
'item_double_branches'
,
'item_circlet'
,
'item_magic_stick'
,
'item_gauntlets'
,
'item_recipe_bracer'
,
'item_flask'
,
'item_recipe_magic_wand'
,
'item_phase_boots'
}
Item
[
'item_bristleback_outfit'
]
=
{
'item_tango'
,
'item_
flask'
,
'item_
quelling_blade'
,
'item_double_branches'
,
'item_circlet'
,
'item_magic_stick'
,
'item_gauntlets'
,
'item_recipe_bracer'
,
'item_flask'
,
'item_recipe_magic_wand'
,
'item_power_treads_str'
}
Item
[
'item_bristleback_outfit'
]
=
{
'item_tango'
,
'item_quelling_blade'
,
'item_double_branches'
,
'item_circlet'
,
'item_magic_stick'
,
'item_gauntlets'
,
'item_recipe_bracer'
,
'item_flask'
,
'item_recipe_magic_wand'
,
'item_power_treads_str'
}
----------------------------------------------------------------------
----------------------------------------------------------------------
Item
[
'item_tank_outfit'
]
=
{
'item_tango'
,
'item_
flask'
,
'item_
quelling_blade'
,
'item_double_branches'
,
'item_circlet'
,
'item_magic_stick'
,
'item_gauntlets'
,
'item_recipe_bracer'
,
'item_flask'
,
'item_recipe_magic_wand'
,
'item_power_treads_str'
}
Item
[
'item_tank_outfit'
]
=
{
'item_tango'
,
'item_quelling_blade'
,
'item_double_branches'
,
'item_circlet'
,
'item_magic_stick'
,
'item_gauntlets'
,
'item_recipe_bracer'
,
'item_flask'
,
'item_recipe_magic_wand'
,
'item_power_treads_str'
}
Item
[
'item_tank_lina_outfit'
]
=
{
'item_tango'
,
'item_double_branches'
,
'item_circlet'
,
'item_mantle'
,
'item_magic_stick'
,
'item_recipe_null_talisman'
,
'item_flask'
,
'item_phase_boots'
,
'item_recipe_magic_wand'
}
Item
[
'item_tank_lina_outfit'
]
=
{
'item_tango'
,
'item_double_branches'
,
'item_circlet'
,
'item_mantle'
,
'item_magic_stick'
,
'item_recipe_null_talisman'
,
'item_flask'
,
'item_phase_boots'
,
'item_recipe_magic_wand'
}
Item
[
'item_dragon_knight_outfit'
]
=
{
'item_tango'
,
'item_
flask'
,
'item_
quelling_blade'
,
'item_double_branches'
,
'item_gauntlets'
,
'item_magic_stick'
,
'item_flask'
,
'item_recipe_magic_wand'
,
'item_gauntlets'
,
'item_power_treads_str'
,
'item_broken_soul_ring'
}
Item
[
'item_dragon_knight_outfit'
]
=
{
'item_tango'
,
'item_quelling_blade'
,
'item_double_branches'
,
'item_gauntlets'
,
'item_magic_stick'
,
'item_flask'
,
'item_recipe_magic_wand'
,
'item_gauntlets'
,
'item_power_treads_str'
,
'item_broken_soul_ring'
}
Item
[
'item_ogre_magi_outfit'
]
=
{
'item_tango'
,
'item_
flask'
,
'item_
quelling_blade'
,
'item_double_branches'
,
'item_circlet'
,
'item_magic_stick'
,
'item_mantle'
,
'item_recipe_null_talisman'
,
'item_flask'
,
'item_recipe_magic_wand'
,
'item_power_treads'
,
'item_hand_of_midas'
}
Item
[
'item_ogre_magi_outfit'
]
=
{
'item_tango'
,
'item_quelling_blade'
,
'item_double_branches'
,
'item_circlet'
,
'item_magic_stick'
,
'item_mantle'
,
'item_recipe_null_talisman'
,
'item_flask'
,
'item_recipe_magic_wand'
,
'item_power_treads'
,
'item_hand_of_midas'
}
--------------------------------------------------------------------------
--------------------------------------------------------------------------
...
...
FunLib/jmz_func.lua
View file @
49820c00
...
@@ -3465,7 +3465,7 @@ end
...
@@ -3465,7 +3465,7 @@ end
function
J
.
MergeGroup
(
...
)
function
J
.
MergeGroup
(
...
)
local
args
=
{
...
}
local
args
=
{
...
}
local
result
=
{}
local
result
=
{}
for
a
in
arg
do
for
_
,
a
in
pairs
(
args
)
do
table.insert
(
result
,
a
)
table.insert
(
result
,
a
)
end
end
return
result
return
result
...
...
ability_item_usage_generic.lua
View file @
49820c00
...
@@ -7,6 +7,7 @@
...
@@ -7,6 +7,7 @@
--- Link:http://steamcommunity.com/sharedfiles/filedetails/?id=1627071163
--- Link:http://steamcommunity.com/sharedfiles/filedetails/?id=1627071163
----------------------------------------------------------------------------------------------------
----------------------------------------------------------------------------------------------------
require
(
GetScriptDirectory
()
..
"/rewrite_functions"
)
local
X
=
{}
local
X
=
{}
local
bot
=
GetBot
()
local
bot
=
GetBot
()
...
@@ -248,10 +249,11 @@ end
...
@@ -248,10 +249,11 @@ end
function
X
.
EnemyCastResponse
(
hTable
)
function
X
.
EnemyCastResponse
(
hTable
)
local
pid
=
hTable
.
player_id
local
pid
=
hTable
.
player_id
local
unit
=
hTable
.
unit
local
unit
=
hTable
.
unit
local
ability
=
hTable
.
ability
:
GetName
()
local
ability
=
hTable
.
ability
local
abilityName
=
ability
:
GetName
()
local
loc
=
hTable
.
location
local
loc
=
hTable
.
location
if
ability
==
"jakiro_macropyre"
then
--烈焰焚身
if
ability
Name
==
"jakiro_macropyre"
then
--烈焰焚身
local
range
=
ability
:
GetVal
(
'cast_range'
)
local
range
=
ability
:
GetVal
(
'cast_range'
)
local
radius
=
ability
:
GetVal
(
'path_radius'
)
local
radius
=
ability
:
GetVal
(
'path_radius'
)
local
duration
=
ability
:
GetVal
(
'duration'
)
local
duration
=
ability
:
GetVal
(
'duration'
)
...
@@ -261,18 +263,18 @@ function X.EnemyCastResponse(hTable)
...
@@ -261,18 +263,18 @@ function X.EnemyCastResponse(hTable)
for
i
=
1
,
max
do
for
i
=
1
,
max
do
local
loc
x
=
J
.
GetVectorFromVectorToAngleWithDistance
(
loc
,
angle
,
radius
*
i
)
local
loc
=
J
.
GetVectorFromVectorToAngleWithDistance
(
loc
,
angle
,
radius
*
i
)
loc
.
z
=
radius
loc
.
z
=
radius
AddAvoidanceZone
(
loc
,
duration
)
AddAvoidanceZone
(
loc
,
duration
)
end
end
elseif
ability
==
"abyssal_underlord_firestorm"
then
--火焰风暴
elseif
ability
Name
==
"abyssal_underlord_firestorm"
then
--火焰风暴
local
radius
=
ability
:
GetVal
(
'radius'
)
local
radius
=
ability
:
GetVal
(
'radius'
)
local
duration
=
ability
:
GetVal
(
'wave_duration'
)
local
duration
=
ability
:
GetVal
(
'wave_duration'
)
loc
.
z
=
radius
loc
.
z
=
radius
AddAvoidanceZone
(
loc
,
duration
)
AddAvoidanceZone
(
loc
,
duration
)
elseif
ability
==
"lich_chain_frost"
then
--连环霜冻
elseif
ability
Name
==
"lich_chain_frost"
then
--连环霜冻
local
radius
=
ability
:
GetVal
(
'jump_range'
)
+
100
local
radius
=
ability
:
GetVal
(
'jump_range'
)
+
100
for
i
=
1
,
36
do
for
i
=
1
,
36
do
local
angle
=
10
*
i
local
angle
=
10
*
i
...
@@ -280,7 +282,7 @@ function X.EnemyCastResponse(hTable)
...
@@ -280,7 +282,7 @@ function X.EnemyCastResponse(hTable)
avLoc
.
z
=
radius
avLoc
.
z
=
radius
AddAvoidanceZone
(
avLoc
,
5
.
0
)
AddAvoidanceZone
(
avLoc
,
5
.
0
)
end
end
elseif
ability
==
"winter_wyvern_winters_curse"
then
--寒冬诅咒
elseif
ability
Name
==
"winter_wyvern_winters_curse"
then
--寒冬诅咒
local
radius
=
ability
:
GetVal
(
'radius'
)
local
radius
=
ability
:
GetVal
(
'radius'
)
local
duration
=
ability
:
GetVal
(
'duration'
)
local
duration
=
ability
:
GetVal
(
'duration'
)
loc
.
z
=
radius
loc
.
z
=
radius
...
@@ -297,7 +299,8 @@ function X.SetReplyHumanTime( tChat )
...
@@ -297,7 +299,8 @@ function X.SetReplyHumanTime( tChat )
J
.
Role
.
SetLastChatString
(
sChatString
)
J
.
Role
.
SetLastChatString
(
sChatString
)
end
end
if
string.sub
(
sChatString
,
1
,
2
)
==
"/"
then
print
(
tChat
)
if
string.sub
(
sChatString
,
1
,
2
)
==
"="
then
X
.
Commands
(
sChatString
,
nChatID
)
X
.
Commands
(
sChatString
,
nChatID
)
return
return
end
end
...
@@ -313,14 +316,14 @@ function X.SetReplyHumanTime( tChat )
...
@@ -313,14 +316,14 @@ function X.SetReplyHumanTime( tChat )
end
end
function
X
.
Commands
(
tChat
,
pid
)
function
X
.
Commands
(
tChat
,
pid
)
if
not
bot
:
GetPlayerID
()
==
J
.
Role
.
GetReplyMemberID
()
then
return
end
print
(
tChat
)
if
tChat
==
"
-
xy"
then
if
tChat
==
"
=
xy"
then
local
units
=
GetUnitList
(
UNIT_LIST_ALLIED_HEROES
)
local
units
=
GetUnitList
(
UNIT_LIST_ALLIED_HEROES
)
for
unit
in
units
do
for
unit
in
units
do
if
unit
:
IsHero
()
and
unit
:
IsAlive
()
if
unit
:
IsHero
()
and
unit
:
IsAlive
()
and
unit
:
GetPlayerID
()
==
pid
then
and
unit
:
GetPlayerID
()
==
pid
then
local
loc
=
unit
:
GetLocation
()
local
loc
=
unit
:
GetLocation
()
ActionImmediate_Chat
(
unit
:
GetUnitName
()
..
" : X="
..
tostring
(
loc
.
x
)
..
",Y="
..
tostring
(
loc
.
y
))
bot
:
ActionImmediate_Chat
(
unit
:
GetUnitName
()
..
" : X="
..
tostring
(
loc
.
x
)
..
",Y="
..
tostring
(
loc
.
y
))
end
end
end
end
end
end
...
...
item_purchase_generic.lua
View file @
49820c00
...
@@ -97,6 +97,13 @@ local function GeneralPurchase()
...
@@ -97,6 +97,13 @@ local function GeneralPurchase()
end
end
end
end
if
bot
:
GetAssignedLane
()
==
LANE_MID
and
not
bot
.
buyedFlask
and
GetItemStockCount
(
'item_flask'
)
>
0
then
if
bot
:
ActionImmediate_PurchaseItem
(
'item_flask'
)
==
PURCHASE_ITEM_SUCCESS
then
bot
.
buyedFlask
=
true
return
end
end
local
cost
=
itemCost
local
cost
=
itemCost
--使得飞鞋一次购买完成
--使得飞鞋一次购买完成
...
...
mode_farm_generic.lua
View file @
49820c00
...
@@ -565,6 +565,7 @@ function Think()
...
@@ -565,6 +565,7 @@ function Think()
local
farmTarget
=
J
.
Site
.
GetFarmLaneTarget
(
hLaneCreepList
);
local
farmTarget
=
J
.
Site
.
GetFarmLaneTarget
(
hLaneCreepList
);
local
nSearchRange
=
bot
:
GetAttackRange
()
+
180
local
nSearchRange
=
bot
:
GetAttackRange
()
+
180
if
nSearchRange
>
1600
then
nSearchRange
=
1600
end
if
nSearchRange
>
1600
then
nSearchRange
=
1600
end
if
nSearchRange
<
600
then
nSearchRange
=
600
end
local
nNeutrals
=
bot
:
GetNearbyNeutralCreeps
(
nSearchRange
);
local
nNeutrals
=
bot
:
GetNearbyNeutralCreeps
(
nSearchRange
);
if
farmTarget
~=
nil
and
#
nNeutrals
==
0
then
if
farmTarget
~=
nil
and
#
nNeutrals
==
0
then
...
...
mode_laning_generic.lua
View file @
49820c00
...
@@ -47,4 +47,5 @@ function GetDesire()
...
@@ -47,4 +47,5 @@ function GetDesire()
return
0
return
0
end
end
-- dota2jmz@163.com QQ:2462331592..
-- dota2jmz@163.com QQ:2462331592..
rewrite_functions.lua
View file @
49820c00
...
@@ -68,7 +68,7 @@ function CDOTA_Bot_Script.IsEnemy(unit)
...
@@ -68,7 +68,7 @@ function CDOTA_Bot_Script.IsEnemy(unit)
return
GetBot
():
GetTeam
()
~=
unit
:
GetTeam
()
return
GetBot
():
GetTeam
()
~=
unit
:
GetTeam
()
end
end
function
CDOTA_Bot_Script
.
GetDistanceToUnit
(
unit
,
unit2
)
function
CDOTA_Bot_Script
.
GetDistanceToUnit
(
unit
,
unit2
)
if
not
unit2
then
return
99999
end
if
not
unit2
or
not
unit2
:
CanBeSeen
()
then
return
99999
end
local
loc1
=
unit
:
GetLocation
()
local
loc1
=
unit
:
GetLocation
()
local
loc2
=
unit2
:
GetLocation
()
local
loc2
=
unit2
:
GetLocation
()
return
math.sqrt
((
loc1
.
x
-
loc2
.
x
)
*
(
loc1
.
x
-
loc2
.
x
)
+
(
loc1
.
y
-
loc2
.
y
)
*
(
loc1
.
y
-
loc2
.
y
))
return
math.sqrt
((
loc1
.
x
-
loc2
.
x
)
*
(
loc1
.
x
-
loc2
.
x
)
+
(
loc1
.
y
-
loc2
.
y
)
*
(
loc1
.
y
-
loc2
.
y
))
...
@@ -130,7 +130,7 @@ function CDOTA_Bot_Script.GetLocation(unit)
...
@@ -130,7 +130,7 @@ function CDOTA_Bot_Script.GetLocation(unit)
if
not
unit
:
CanBeSeen
()
then
if
not
unit
:
CanBeSeen
()
then
local
id
=
unit
:
GetPlayerID
()
local
id
=
unit
:
GetPlayerID
()
local
info
=
GetHeroLastSeenInfo
(
id
)
local
info
=
GetHeroLastSeenInfo
(
id
)
if
info
and
info
.
time_since_seen
<
2
.
0
then
if
info
and
info
.
time_since_seen
and
info
.
time_since_seen
<
2
.
0
then
return
info
.
location
return
info
.
location
end
end
end
end
...
@@ -275,7 +275,7 @@ end
...
@@ -275,7 +275,7 @@ end
local
gnh
=
CDOTA_Bot_Script
.
GetNearbyHeroes
local
gnh
=
CDOTA_Bot_Script
.
GetNearbyHeroes
CDOTA_Bot_Script
.
GetNearbyHeroes
=
function
(
u
,
nRadius
,
bEnemies
,
eBotMode
)
CDOTA_Bot_Script
.
GetNearbyHeroes
=
function
(
u
,
nRadius
,
bEnemies
,
eBotMode
)
if
not
u
:
CanBeSeen
()
then
return
{}
end
if
not
u
:
CanBeSeen
()
then
return
{}
end
if
nRadius
<=
1600
and
u
:
Is
Ally
()
then
return
gnh
(
u
,
nRadius
,
bEnemies
,
eBotMode
)
end
if
nRadius
<=
1600
and
u
:
Is
Bot
()
then
return
gnh
(
u
,
nRadius
,
bEnemies
,
eBotMode
)
end
local
list
local
list
if
bEnemies
then
if
bEnemies
then
list
=
GetUnitList
(
UNIT_LIST_ENEMY_HEROES
)
list
=
GetUnitList
(
UNIT_LIST_ENEMY_HEROES
)
...
@@ -292,7 +292,9 @@ end
...
@@ -292,7 +292,9 @@ end
local
gnc
=
CDOTA_Bot_Script
.
GetNearbyCreeps
local
gnc
=
CDOTA_Bot_Script
.
GetNearbyCreeps
CDOTA_Bot_Script
.
GetNearbyCreeps
=
function
(
u
,
nRadius
,
bEnemies
)
CDOTA_Bot_Script
.
GetNearbyCreeps
=
function
(
u
,
nRadius
,
bEnemies
)
if
not
u
:
CanBeSeen
()
then
return
{}
end
if
not
u
:
CanBeSeen
()
then
return
{}
end
if
nRadius
<=
1600
and
u
:
IsAlly
()
then
return
gnc
(
u
,
nRadius
,
bEnemies
)
end
if
nRadius
<=
1600
and
u
:
IsBot
()
then
return
gnc
(
u
,
nRadius
,
bEnemies
)
end
local
list
local
list
if
bEnemies
then
if
bEnemies
then
list
=
GetUnitList
(
UNIT_LIST_ENEMY_CREEPS
)
or
{}
list
=
GetUnitList
(
UNIT_LIST_ENEMY_CREEPS
)
or
{}
...
@@ -300,11 +302,16 @@ CDOTA_Bot_Script.GetNearbyCreeps = function(u,nRadius,bEnemies)
...
@@ -300,11 +302,16 @@ CDOTA_Bot_Script.GetNearbyCreeps = function(u,nRadius,bEnemies)
list
=
GetUnitList
(
UNIT_LIST_ALLIED_CREEPS
)
or
{}
list
=
GetUnitList
(
UNIT_LIST_ALLIED_CREEPS
)
or
{}
end
end
list
=
FilterTable
(
list
,
function
(
unit
)
list
=
FilterTable
(
list
,
function
(
unit
)
return
u
:
GetDistanceToUnit
(
unit
)
<=
nRadius
return
GetUnitToUnitDistance
(
u
,
unit
)
<=
nRadius
end
)
end
)
return
list
return
list
end
end
_G
.
Unit
=
CDOTA_Bot_Script
table
.
GetNearbyCreeps
=
CDOTA_Bot_Script
.
GetNearbyCreeps
--------------------------------
--------------------------------
--rewrite functions CDOTABaseAbility_BotScript
--rewrite functions CDOTABaseAbility_BotScript
--------------------------------
--------------------------------
\ No newline at end of file
print
(
"Rewrite complete"
)
\ No newline at end of file
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