Commit feb4bae4 authored by JoyJ's avatar JoyJ

reserve regen for mid

parent 4fc4703e
...@@ -133,6 +133,7 @@ local nContinueKillCount = 0 ...@@ -133,6 +133,7 @@ local nContinueKillCount = 0
local nReplyHumanCount = 0 local nReplyHumanCount = 0
local nMaxReplyCount = RandomInt( 5, 9 ) local nMaxReplyCount = RandomInt( 5, 9 )
local bInstallChatCallbackDone = false local bInstallChatCallbackDone = false
local bInstallCastCallbackDone = false
local nReplyHumanTime = nil local nReplyHumanTime = nil
local sHumanString = nil local sHumanString = nil
local bAllChat = false local bAllChat = false
...@@ -155,6 +156,15 @@ function X.SetTalkMessage() ...@@ -155,6 +156,15 @@ function X.SetTalkMessage()
InstallChatCallback( function( tChat ) X.SetReplyHumanTime( tChat ) end ) InstallChatCallback( function( tChat ) X.SetReplyHumanTime( tChat ) end )
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 if sHumanString ~= nil
and nReplyHumanTime ~= nil and nReplyHumanTime ~= nil
and DotaTime() > nReplyHumanTime + nTalkDelay and DotaTime() > nReplyHumanTime + nTalkDelay
...@@ -235,7 +245,17 @@ function X.SetTalkMessage() ...@@ -235,7 +245,17 @@ function X.SetTalkMessage()
end 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 ) function X.SetReplyHumanTime( tChat )
local sChatString = tChat.string local sChatString = tChat.string
...@@ -245,7 +265,11 @@ function X.SetReplyHumanTime( tChat ) ...@@ -245,7 +265,11 @@ function X.SetReplyHumanTime( tChat )
then then
J.Role.SetLastChatString( sChatString ) J.Role.SetLastChatString( sChatString )
end end
if string.sub(sChatString,1,2) == "/" then
X.Commands(sChatString, nChatID)
return
end
if not IsPlayerBot( nChatID ) if not IsPlayerBot( nChatID )
and ( tChat.team_only or J.Role.IsEnemyMemberID( nChatID ) ) and ( tChat.team_only or J.Role.IsEnemyMemberID( nChatID ) )
then then
...@@ -257,6 +281,19 @@ function X.SetReplyHumanTime( tChat ) ...@@ -257,6 +281,19 @@ function X.SetReplyHumanTime( tChat )
end 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() local function BuybackUsageComplement()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment