CREEP = 0 -- Переменная
function GameMode:OnGameInProgress() -- Спавнер первого крипа
local waypoint = Entities:FindByName( nil, "wp_1") -- Куда идут крипы
local point = Entities:FindByName( nil, "spawner"):GetAbsOrigin() -- спавнер крипов
local unit1 = CreateUnitByName("npc_dota_creep_goodguys_melee1", point + RandomVector( RandomFloat( 0, 200 ) ), true, nil, nil, DOTA_TEAM_GOODGUYS) -- 1 крип
local unit2 = CreateUnitByName("npc_dota_creep_goodguys_melee2", point + RandomVector( RandomFloat( 0, 200 ) ), true, nil, nil, DOTA_TEAM_GOODGUYS) -- 2 крип
local unit3 = CreateUnitByName("npc_dota_creep_goodguys_melee3", point + RandomVector( RandomFloat( 0, 200 ) ), true, nil, nil, DOTA_TEAM_GOODGUYS) -- 3 крип
local unit4 = CreateUnitByName("npc_dota_creep_goodguys_ranged1", point + RandomVector( RandomFloat( 0, 200 ) ), true, nil, nil, DOTA_TEAM_GOODGUYS) -- 4 крип
unit1:SetInitialGoalEntity( waypoint ) -- Куда идет 1 крип
unit2:SetInitialGoalEntity( waypoint ) -- Куда идет 2 крип
unit3:SetInitialGoalEntity( waypoint ) -- Куда идет 3 крип
unit4:SetInitialGoalEntity( waypoint ) -- Куда идет 4 крип
end
function GameMode:OnEntityKilled(keys)
local waypoint = Entities:FindByName( nil, "wp_1")
local killedUnit = EntIndexToHScript( keys.entindex_killed )
local point = Entities:FindByName( nil, "spawner"):GetAbsOrigin()
if killedUnit:GetUnitName() == "npc_dota_creep_goodguys_melee1" then
CREEP = CREEP + 1
end
if killedUnit:GetUnitName() == "npc_dota_creep_goodguys_melee2" then
CREEP = CREEP + 1
end
if killedUnit:GetUnitName() == "npc_dota_creep_goodguys_melee3" then
CREEP = CREEP + 1
end
if killedUnit:GetUnitName() == "npc_dota_creep_goodguys_ranged1" then
CREEP = CREEP + 1
end
if CREEP == 4 or CREEP == 36 then
local unit5 = CreateUnitByName("npc_dota_creep_goodguys_melee4", point + RandomVector( RandomFloat( 0, 200 ) ), true, nil, nil, DOTA_TEAM_GOODGUYS)
local unit6 = CreateUnitByName("npc_dota_creep_goodguys_melee5", point + RandomVector( RandomFloat( 0, 200 ) ), true, nil, nil, DOTA_TEAM_GOODGUYS)
local unit7 = CreateUnitByName("npc_dota_creep_goodguys_ranged2", point + RandomVector( RandomFloat( 0, 200 ) ), true, nil, nil, DOTA_TEAM_GOODGUYS)
local unit8 = CreateUnitByName("npc_dota_creep_goodguys_flagbearer1", point + RandomVector( RandomFloat( 0, 200 ) ), true, nil, nil, DOTA_TEAM_GOODGUYS)
unit5:SetInitialGoalEntity( waypoint )
unit6:SetInitialGoalEntity( waypoint )
unit7:SetInitialGoalEntity( waypoint )
unit8:SetInitialGoalEntity( waypoint )
CREEP = 4
CREEP = CREEP + 1
end
if killedUnit:GetUnitName() == "npc_dota_creep_goodguys_melee4" then
CREEP = CREEP + 1
end
if killedUnit:GetUnitName() == "npc_dota_creep_goodguys_melee5" then
CREEP = CREEP + 1
end
if killedUnit:GetUnitName() == "npc_dota_creep_goodguys_ranged2" then
CREEP = CREEP + 1
end
if killedUnit:GetUnitName() == "npc_dota_creep_goodguys_flagbearer1" then
CREEP = CREEP + 1
end
if CREEP == 9 then
local unit9 = CreateUnitByName("npc_dota_creep_goodguys_melee6", point + RandomVector( RandomFloat( 0, 200 ) ), true, nil, nil, DOTA_TEAM_GOODGUYS)
local unit10 = CreateUnitByName("npc_dota_creep_goodguys_melee7", point + RandomVector( RandomFloat( 0, 200 ) ), true, nil, nil, DOTA_TEAM_GOODGUYS)
local unit11 = CreateUnitByName("npc_dota_creep_goodguys_ranged3", point + RandomVector( RandomFloat( 0, 200 ) ), true, nil, nil, DOTA_TEAM_GOODGUYS)
local unit12 = CreateUnitByName("npc_dota_creep_goodguys_melee8", point + RandomVector( RandomFloat( 0, 200 ) ), true, nil, nil, DOTA_TEAM_GOODGUYS)
local unit13 = CreateUnitByName("npc_dota_goodguys_siege1", point + RandomVector( RandomFloat( 0, 200 ) ), true, nil, nil, DOTA_TEAM_GOODGUYS)
unit9:SetInitialGoalEntity( waypoint )
unit10:SetInitialGoalEntity( waypoint )
unit11:SetInitialGoalEntity( waypoint )
unit12:SetInitialGoalEntity( waypoint )
unit13:SetInitialGoalEntity( waypoint )
CREEP = CREEP + 1
end
if killedUnit:GetUnitName() == "npc_dota_creep_goodguys_melee6" then
CREEP = CREEP + 1
end
if killedUnit:GetUnitName() == "npc_dota_creep_goodguys_melee7" then
CREEP = CREEP + 1
end
if killedUnit:GetUnitName() == "npc_dota_creep_goodguys_ranged3" then
CREEP = CREEP + 1
end
if killedUnit:GetUnitName() == "npc_dota_creep_goodguys_melee8" then
CREEP = CREEP + 1
end
if killedUnit:GetUnitName() == "npc_dota_goodguys_siege1" then
CREEP = CREEP + 1
end
if CREEP == 15 then
local unit14 = CreateUnitByName("npc_dota_creep_goodguys_melee9", point + RandomVector( RandomFloat( 0, 200 ) ), true, nil, nil, DOTA_TEAM_GOODGUYS)
local unit15 = CreateUnitByName("npc_dota_creep_goodguys_melee10", point + RandomVector( RandomFloat( 0, 200 ) ), true, nil, nil, DOTA_TEAM_GOODGUYS)
local unit16 = CreateUnitByName("npc_dota_creep_goodguys_ranged4", point + RandomVector( RandomFloat( 0, 200 ) ), true, nil, nil, DOTA_TEAM_GOODGUYS)
local unit17 = CreateUnitByName("npc_dota_creep_goodguys_flagbearer2", point + RandomVector( RandomFloat( 0, 200 ) ), true, nil, nil, DOTA_TEAM_GOODGUYS)
local unit18 = CreateUnitByName("npc_dota_goodguys_siege2", point + RandomVector( RandomFloat( 0, 200 ) ), true, nil, nil, DOTA_TEAM_GOODGUYS)
unit14:SetInitialGoalEntity( waypoint )
unit15:SetInitialGoalEntity( waypoint )
unit16:SetInitialGoalEntity( waypoint )
unit17:SetInitialGoalEntity( waypoint )
unit18:SetInitialGoalEntity( waypoint )
CREEP = CREEP + 1
end
if killedUnit:GetUnitName() == "npc_dota_creep_goodguys_melee9" then
CREEP = CREEP + 1
end
if killedUnit:GetUnitName() == "npc_dota_creep_goodguys_melee10" then
CREEP = CREEP + 1
end
if killedUnit:GetUnitName() == "npc_dota_creep_goodguys_ranged4" then
CREEP = CREEP + 1
end
if killedUnit:GetUnitName() == "npc_dota_creep_goodguys_flagbearer2" then
CREEP = CREEP + 1
end
if killedUnit:GetUnitName() == "npc_dota_goodguys_siege2" then
CREEP = CREEP + 1
end
if CREEP == 21 then
local unit19 = CreateUnitByName("npc_dota_creep_goodguys_melee11", point + RandomVector( RandomFloat( 0, 200 ) ), true, nil, nil, DOTA_TEAM_GOODGUYS)
local unit20 = CreateUnitByName("npc_dota_creep_goodguys_melee12", point + RandomVector( RandomFloat( 0, 200 ) ), true, nil, nil, DOTA_TEAM_GOODGUYS)
local unit21 = CreateUnitByName("npc_dota_creep_goodguys_melee13", point + RandomVector( RandomFloat( 0, 200 ) ), true, nil, nil, DOTA_TEAM_GOODGUYS)
local unit22 = CreateUnitByName("npc_dota_creep_goodguys_ranged5", point + RandomVector( RandomFloat( 0, 200 ) ), true, nil, nil, DOTA_TEAM_GOODGUYS)
unit19:SetInitialGoalEntity( waypoint )
unit20:SetInitialGoalEntity( waypoint )
unit21:SetInitialGoalEntity( waypoint )
unit22:SetInitialGoalEntity( waypoint )
CREEP = CREEP + 1
end
if killedUnit:GetUnitName() == "npc_dota_creep_goodguys_melee11" then
CREEP = CREEP + 1
end
if killedUnit:GetUnitName() == "npc_dota_creep_goodguys_melee12" then
CREEP = CREEP + 1
end
if killedUnit:GetUnitName() == "npc_dota_creep_goodguys_melee13" then
CREEP = CREEP + 1
end
if killedUnit:GetUnitName() == "npc_dota_creep_goodguys_ranged5" then
CREEP = CREEP + 1
end
if CREEP == 26 then
CREEP = CREEP + 10
end
end