function GameMode:_OnEntityKilled( keys )
-- The Unit that was Killed
local killedUnit = EntIndexToHScript( keys.entindex_killed )
-- The Killing entity
local killerEntity = nil
local count = HeroList:GetHeroCount()
if keys.entindex_attacker ~= nil then
killerEntity = EntIndexToHScript( keys.entindex_attacker )
end
if killedUnit:IsRealHero() then
EmitGlobalSound("scp.scp_death")
local allisdead, i = true, 0
while i < HeroList:GetHeroCount() and allisdead do
if HeroList:GetHero(i):GetTeamNumber() == 2 and HeroList:GetHero(i):IsAlive() then
allisdead = false
end
i = i + 1
end
if allisdead then
GameRules:SetSafeToLeave( true )
GameRules:SetGameWinner( killerEntity:GetTeam() )
end
--PlayerResource:GetTeamKills
if SHOW_KILLS_ON_TOPBAR then
GameRules:GetGameModeEntity():SetTopBarTeamValue ( DOTA_TEAM_BADGUYS, GetTeamHeroKills(DOTA_TEAM_BADGUYS) )
GameRules:GetGameModeEntity():SetTopBarTeamValue ( DOTA_TEAM_GOODGUYS, GetTeamHeroKills(DOTA_TEAM_GOODGUYS) )
end
end
end