function GameMode:OnAllPlayersLoaded()
local two = CreateUnitByName("npc_bansha_boss", Vector(-3840,2688,160), true, nil, nil, DOTA_TEAM_BADGUYS )
for playerID = 0, (DOTA_MAX_PLAYERS-1) do
if PlayerResource:IsValidPlayerID(playerID) then
local hero = PlayerResource:GetSelectedHeroEntity(playerID)
Timers:CreateTimer(function()
local units = FindUnitsInRadius( two:GetTeam(), two:GetOrigin(), nil, 999999, DOTA_UNIT_TARGET_TEAM_ENEMY, DOTA_UNIT_TARGET_ALL, DOTA_UNIT_TARGET_FLAG_NONE, FIND_ANY_ORDER, false )
for _,unit in pairs(units) do
-- if unit:IsHero() == true then
local order =
{
UnitIndex = unit:entindex(),
OrderType = DOTA_UNIT_ORDER_ATTACK_TARGET,
TargetIndex = two:entindex()
}
ExecuteOrderFromTable(order)
unit:SetForceAttackTarget(two)
end
return nil
end)
end