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
feb4bae4
Commit
feb4bae4
authored
Apr 23, 2023
by
JoyJ
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
reserve regen for mid
parent
4fc4703e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
38 additions
and
1 deletion
+38
-1
ability_item_usage_generic.lua
ability_item_usage_generic.lua
+38
-1
No files found.
ability_item_usage_generic.lua
View file @
feb4bae4
...
...
@@ -133,6 +133,7 @@ local nContinueKillCount = 0
local
nReplyHumanCount
=
0
local
nMaxReplyCount
=
RandomInt
(
5
,
9
)
local
bInstallChatCallbackDone
=
false
local
bInstallCastCallbackDone
=
false
local
nReplyHumanTime
=
nil
local
sHumanString
=
nil
local
bAllChat
=
false
...
...
@@ -155,6 +156,15 @@ function X.SetTalkMessage()
InstallChatCallback
(
function
(
tChat
)
X
.
SetReplyHumanTime
(
tChat
)
end
)
end
if
not
bInstallCastCallbackDone
then
bInstallCastCallbackDone
=
true
local
team
=
GetTeamPlayers
(
GetOpposingTeam
())
for
_
,
id
in
pairs
(
team
)
do
InstallCastCallback
(
id
,
X
.
EnemyCastResponse
)
end
end
if
sHumanString
~=
nil
and
nReplyHumanTime
~=
nil
and
DotaTime
()
>
nReplyHumanTime
+
nTalkDelay
...
...
@@ -235,7 +245,17 @@ function X.SetTalkMessage()
end
function
X
.
EnemyCastResponse
(
hTable
)
local
pid
=
hTable
.
player_id
local
unit
=
hTable
.
unit
local
ability
=
hTable
.
ability
:
GetName
()
local
loc
=
hTable
.
location
end
function
X
.
SetReplyHumanTime
(
tChat
)
local
sChatString
=
tChat
.
string
...
...
@@ -245,7 +265,11 @@ function X.SetReplyHumanTime( tChat )
then
J
.
Role
.
SetLastChatString
(
sChatString
)
end
if
string.sub
(
sChatString
,
1
,
2
)
==
"/"
then
X
.
Commands
(
sChatString
,
nChatID
)
return
end
if
not
IsPlayerBot
(
nChatID
)
and
(
tChat
.
team_only
or
J
.
Role
.
IsEnemyMemberID
(
nChatID
)
)
then
...
...
@@ -257,6 +281,19 @@ function X.SetReplyHumanTime( tChat )
end
function
X
.
Commands
(
tChat
,
pid
)
if
not
bot
:
GetPlayerID
()
==
J
.
Role
.
GetReplyMemberID
()
then
return
end
if
tChat
==
"-xy"
then
local
units
=
GetUnitList
(
UNIT_LIST_ALLIED_HEROES
)
for
unit
in
units
do
if
unit
:
IsHero
()
and
unit
:
IsAlive
()
and
unit
:
GetPlayerID
()
==
pid
then
local
loc
=
unit
:
GetLocation
()
ActionImmediate_Chat
(
unit
:
GetUnitName
()
..
" : X="
..
tostring
(
loc
.
x
)
..
",Y="
..
tostring
(
loc
.
y
))
end
end
end
end
local
function
BuybackUsageComplement
()
...
...
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