Advertisement
I_GRIN_I

Untitled

Jun 29th, 2019
162
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 164.13 KB | None | 0 0
  1. LinkLuaModifier("modifier_charges", "modifiers/modifier_charges", LUA_MODIFIER_MOTION_NONE)
  2.  
  3. LinkLuaModifier("modifier_shapeshift_speed_lua", "/modifiers/modifier_shapeshift_speed_lua.lua", LUA_MODIFIER_MOTION_NONE)
  4. LinkLuaModifier("modifier_chen_buff1", "/modifiers/modifier_chen_buff1.lua", LUA_MODIFIER_MOTION_NONE)
  5. LinkLuaModifier("modifier_demon_lord_buff", "/modifiers/modifier_demon_lord_buff.lua", LUA_MODIFIER_MOTION_NONE)
  6. LinkLuaModifier("modifier_lich_lord_debuff", "/modifiers/modifier_lich_lord_debuff.lua", LUA_MODIFIER_MOTION_NONE)
  7. LinkLuaModifier("modifier_necro_lord_debuff", "/modifiers/modifier_necro_lord_debuff.lua", LUA_MODIFIER_MOTION_NONE)
  8.  
  9. LinkLuaModifier("modifier_special_effect_contest", "/modifiers/special/modifier_special_effect_contest.lua", LUA_MODIFIER_MOTION_NONE)
  10. LinkLuaModifier("modifier_special_effect_donator", "/modifiers/special/modifier_special_effect_donator.lua", LUA_MODIFIER_MOTION_NONE)
  11. LinkLuaModifier("modifier_special_effect_legendary", "/modifiers/special/modifier_special_effect_legendary.lua", LUA_MODIFIER_MOTION_NONE)
  12. LinkLuaModifier("modifier_special_effect_divine", "/modifiers/special/modifier_special_effect_divine.lua", LUA_MODIFIER_MOTION_NONE)
  13. LinkLuaModifier("modifier_special_effect_mark", "/modifiers/special/modifier_special_effect_mark.lua", LUA_MODIFIER_MOTION_NONE)
  14. LinkLuaModifier("modifier_turbomode_bonus", "/modifiers/special/modifier_turbomode_bonus.lua", LUA_MODIFIER_MOTION_NONE)
  15. LinkLuaModifier("modifier_your_armor", "/modifiers/special/modifier_your_armor.lua", LUA_MODIFIER_MOTION_NONE)
  16.  
  17. if Spawn == nil then
  18.     _G.Spawn = class({})
  19. end
  20.  
  21. chicken_ticket_drop = false
  22. final_boss = false
  23.  
  24. GameRules.DIFFICULTY = 0    
  25. GameRules.EndGame = 0
  26.  
  27. GameRules.DemonMode = 0
  28. GameRules.ZombieMode = 0
  29. GameRules.ChaosMode  = 0
  30. GameRules.LichMode = 0
  31. GameRules.NecroMode = 0
  32.  
  33. GameRules.MegaMode = 0
  34. GameRules.RoshanUpgrade = 0
  35.  
  36. GameRules.Number_of_cursed = 0
  37. GameRules.Maraphon_Round = 0
  38.  
  39. GameRules.drop_chance = 50
  40.  
  41. GameRules.neutral_respawn = 60
  42. GameRules.boss_respawn = 300
  43. GameRules.line_boss_interval = 600
  44.  
  45. if GetMapName() == "roshdef_turbo" then
  46.     GameRules.neutral_respawn = GameRules.neutral_respawn/2
  47.     GameRules.boss_respawn = GameRules.boss_respawn/2
  48.     GameRules.line_boss_interval = GameRules.line_boss_interval/2
  49. end
  50.  
  51. neutral_creeps = {
  52.     ["item_banana"] = {"npc_dota_spider_1","npc_dota_spider_2","npc_dota_spider_3","npc_dota_spider_4","npc_dota_radiant_forest_1","npc_dota_radiant_forest_2","npc_dota_radiant_forest_3","npc_dota_radiant_forest_4",},
  53.     ["item_fish1"] = {"npc_dota_naga_1","npc_dota_naga_2","npc_dota_naga_3","npc_dota_naga_4","npc_dota_naga_5","npc_dota_naga_6","npc_dota_naga_7","npc_dota_naga_8",},
  54. --  ["item_fish2"] = {"npc_dota_slark2","npc_dota_slardar2","npc_dota_naga2","npc_dota_tide2"},
  55.     ["item_meat"] = {"npc_dota_alliance_1","npc_dota_alliance_2","npc_dota_alliance_3","npc_dota_alliance_4","npc_dota_alliance_5","npc_dota_alliance_6","npc_dota_alliance_7","npc_dota_alliance_8",},
  56.     ["item_life_essence"] = {"npc_dota_dire_forest_1","npc_dota_dire_forest_01","npc_dota_dire_forest_2","npc_dota_dire_forest_3","npc_dota_dire_forest_4","npc_dota_dire_forest_5"},
  57.     ["item_fire_essence"] = {"npc_dota_elemental_1","npc_dota_elemental_1_1"},
  58.     ["item_water_essence"] = {"npc_dota_elemental_2","npc_dota_elemental_2_1"},
  59.     ["item_air_essence"] = {"npc_dota_elemental_3","npc_dota_elemental_3_1"},
  60.     ["item_earth_essence"] = {"npc_dota_elemental_4","npc_dota_elemental_4_1"},
  61. }
  62.  
  63.    
  64. GameRules.upgradedata = {}
  65.     GameRules.upgradedata["type01"] = {dmg = 2, armor = 0.5 , hp = 40}
  66.     GameRules.upgradedata["type02"] = {dmg = 5, armor = 0.5 , hp = 60}
  67.     GameRules.upgradedata["type03"] = {dmg = 5, armor = 1 , hp = 100}
  68.     GameRules.upgradedata["type04"] = {dmg = 1, armor = 0.1 , hp = 10}
  69.     GameRules.upgradedata["type05"] = {dmg = 1, armor = 0.1 , hp = 10}
  70.     GameRules.upgradedata["type06"] = {dmg = 1, armor = 0.1 , hp = 10}
  71.     GameRules.upgradedata["type07"] = {dmg = 1, armor = 0.1 , hp = 10}
  72.     GameRules.upgradedata["type08"] = {dmg = 20, armor = 2 , hp = 200}
  73.     GameRules.upgradedata["type09"] = {dmg = 1, armor = 0.1 , hp = 10}
  74.     GameRules.upgradedata["type10"] = {dmg = 1, armor = 0.1 , hp = 10}
  75.     GameRules.upgradedata["type11"] = {dmg = 1, armor = 0.1 , hp = 10}
  76.     GameRules.upgradedata["type12"] = {dmg = 1, armor = 0.1 , hp = 10}
  77.     GameRules.upgradedata["type13"] = {dmg = 1, armor = 0.1 , hp = 10}
  78.     GameRules.upgradedata["type14"] = {dmg = 1, armor = 0.1 , hp = 10}
  79.     GameRules.upgradedata["type15"] = {dmg = 1, armor = 0.1 , hp = 10}
  80.     GameRules.upgradedata["type16"] = {dmg = 1, armor = 0.1 , hp = 10}
  81.     GameRules.upgradedata["type17"] = {dmg = 1, armor = 0.1 , hp = 10}
  82.     GameRules.upgradedata["type18"] = {dmg = 1, armor = 0.1 , hp = 10}
  83.     GameRules.upgradedata["type19"] = {dmg = 1, armor = 0.1 , hp = 10}
  84.     GameRules.upgradedata["type20"] = {dmg = 1, armor = 0.1 , hp = 10}
  85.      
  86.  
  87. function Spawn:Upgrade1(unit,inc)  
  88.    
  89. --[[    local upgrade_time=GameRules:GetDOTATime(false,false)/10
  90.                 unit:SetBaseDamageMin(unit:GetBaseDamageMin() + GameRules.upgradedata[UnitType].dmg*upgrade_time)
  91.                 unit:SetBaseDamageMax(unit:GetBaseDamageMax() + GameRules.upgradedata[UnitType].dmg*upgrade_time)              
  92.                 unit:SetPhysicalArmorBaseValue(unit:GetPhysicalArmorBaseValue() + GameRules.upgradedata[UnitType].armor*upgrade_time)
  93.                 unit:SetBaseMaxHealth(unit:GetBaseMaxHealth() + GameRules.upgradedata[UnitType].hp*upgrade_time)
  94. ]]
  95. local upgrade_mult=1.25
  96.                 unit:SetBaseDamageMin(unit:GetBaseDamageMin()*upgrade_mult)
  97.                 unit:SetBaseDamageMax(unit:GetBaseDamageMax()*upgrade_mult)            
  98.                 unit:SetPhysicalArmorBaseValue(unit:GetPhysicalArmorBaseValue()*upgrade_mult)
  99.                 unit:SetBaseMaxHealth(unit:GetBaseMaxHealth()*upgrade_mult)
  100.  
  101. end
  102.  
  103. function Spawn:Upgrade2(unit, inc) 
  104. --  Timers:CreateTimer(0.01, function()            
  105.         local upgrade_mult = 1 + 0.25*inc
  106.         local maxhp = unit:GetMaxHealth()*upgrade_mult
  107.                 unit:SetBaseDamageMin(unit:GetBaseDamageMin()*upgrade_mult)
  108.                 unit:SetBaseDamageMax(unit:GetBaseDamageMax()*upgrade_mult)            
  109.                 unit:SetPhysicalArmorBaseValue(unit:GetPhysicalArmorBaseValue()*upgrade_mult)
  110.                 unit:SetBaseMaxHealth(maxhp)
  111.                 unit:SetMaxHealth(maxhp)   
  112.                 unit:SetHealth(maxhp)
  113. --  end)
  114. end
  115.  
  116. function Spawn:Upgrade3(unit, multiplier)  
  117.     Timers:CreateTimer(0.03, function()            
  118.            
  119.         local upgrade_mult= multiplier
  120.         local maxhp = unit:GetMaxHealth()*upgrade_mult
  121.         if maxhp < 1 then maxhp = 1 end
  122.        
  123.         unit:SetBaseDamageMin(unit:GetBaseDamageMin()*upgrade_mult)
  124.         unit:SetBaseDamageMax(unit:GetBaseDamageMax()*upgrade_mult)            
  125.         unit:SetPhysicalArmorBaseValue(unit:GetPhysicalArmorBaseValue()*upgrade_mult)
  126.         unit:SetBaseMaxHealth(maxhp)
  127.         unit:SetMaxHealth(maxhp)   
  128.         unit:SetHealth(maxhp)
  129.     end)
  130. end
  131.  
  132. function Spawn:Upgrade4(unit, multiplier, armor)   
  133.     Timers:CreateTimer(0.02, function()            
  134.            
  135.         local upgrade_mult= multiplier
  136.         local maxhp = unit:GetMaxHealth()*upgrade_mult
  137.         if maxhp < 1 then maxhp = 1 end
  138.        
  139.         unit:SetBaseDamageMin(unit:GetBaseDamageMin()*upgrade_mult)
  140.         unit:SetBaseDamageMax(unit:GetBaseDamageMax()*upgrade_mult)            
  141.         unit:SetPhysicalArmorBaseValue(armor)
  142.         unit:SetBaseMaxHealth(maxhp)
  143.         unit:SetMaxHealth(maxhp)   
  144.         unit:SetHealth(maxhp)
  145.     end)
  146. end
  147.    
  148. power_mult = 1
  149. power_mult1 = 1
  150.  
  151. function Respoint (keys )
  152.     Timers:CreateTimer(0.01,function()           
  153.  
  154.         local caster = keys.caster  --пробиваем IP усопшего
  155.         caster.respoint = caster:GetAbsOrigin() -- определяем точку спавна
  156.         caster.fw = caster:GetForwardVector()
  157.         end)
  158. end
  159.  
  160. function Upgrader(keys)
  161.  
  162.     local caster= keys.caster
  163. --  local caster_position = caster:GetAbsOrigin()
  164.     local position = caster.respoint
  165.     local name = caster:GetUnitName()
  166.     local team = caster:GetTeam()
  167.     local unit
  168.     local respawn_time = GameRules.neutral_respawn
  169.     local gold
  170.    
  171.     Timers:CreateTimer(respawn_time,function() 
  172.         unit = CreateUnitByName(name, position + RandomVector( RandomFloat( 0, 50)), true, nil, nil, team)
  173.         gold = unit:GetMinimumGoldBounty()*power_mult
  174.         if gold >= 50000 then
  175.             gold = 50000
  176.         end
  177.         unit:SetMaximumGoldBounty(gold)            
  178.         unit:SetMinimumGoldBounty(gold)
  179.  
  180.         unit:SetForwardVector(caster.fw)
  181.         unit:SetBaseDamageMin(unit:GetBaseDamageMin()*power_mult)
  182.         unit:SetBaseDamageMax(unit:GetBaseDamageMax()*power_mult)              
  183.         unit:SetPhysicalArmorBaseValue(unit:GetPhysicalArmorBaseValue()*power_mult1)
  184.     end)
  185.    
  186. --              unit:SetBaseMaxHealth(unit:GetBaseMaxHealth()*power_mult)
  187.     power_mult = power_mult * 2
  188.     power_mult1 = power_mult1 + 1
  189. end
  190.  
  191.  
  192. function SetGoldMultiplier(unit , multiplier)
  193.    
  194.     unit:SetMaximumGoldBounty(unit:GetMaximumGoldBounty()*multiplier)              
  195.     unit:SetMinimumGoldBounty(unit:GetMinimumGoldBounty()*multiplier)
  196.  
  197. end
  198.  
  199. function respawn_strong(keys)  
  200.  
  201.     local caster= keys.caster
  202. --  local caster_position = caster:GetAbsOrigin()
  203.     local position = caster.respoint
  204.     local name = caster:GetUnitName()
  205.     local team = caster:GetTeam()
  206.     local respawn_time = GameRules.neutral_respawn
  207.  
  208.    
  209.    
  210.     if name == "npc_dota_elemental_1" then  if RandomInt(1,2)== 1 then name = "npc_dota_elemental_1_1" end
  211.     elseif name == "npc_dota_elemental_1_1" then  name = "npc_dota_elemental_1"
  212.     elseif name == "npc_dota_elemental_2" then if RandomInt(1,2)== 1 then name = "npc_dota_elemental_2_1" end
  213.     elseif name == "npc_dota_elemental_2_1" then  name = "npc_dota_elemental_2"
  214.     elseif name == "npc_dota_elemental_3" then if RandomInt(1,2)== 1 then name = "npc_dota_elemental_3_1" end
  215.     elseif name == "npc_dota_elemental_3_1" then  name = "npc_dota_elemental_3"
  216.     elseif name == "npc_dota_elemental_4" then if RandomInt(1,2)== 1 then name = "npc_dota_elemental_4_1" end
  217.     elseif name == "npc_dota_elemental_4_1" then  name = "npc_dota_elemental_4"
  218.     end
  219.  
  220.    
  221.    
  222.     Timers:CreateTimer(respawn_time,function() 
  223.     local unit = CreateUnitByName(name, position + RandomVector( RandomFloat( 0, 50)), true, nil, nil, team)
  224.     unit:SetForwardVector(caster.fw)
  225.         if name == "npc_dota_roshan2" and GameRules.MegaMode == 1 then
  226.             Spawn:Upgrade2(unit,400)
  227.             unit:SetPhysicalArmorBaseValue(75)
  228.         end
  229.     end)
  230.  
  231. end
  232.    
  233. function SpawnGhost( keys )
  234.     local caster = keys.caster 
  235.     local caster_position = caster:GetAbsOrigin()
  236.     local unit = CreateUnitByName( "npc_ghost"  , caster_position + RandomVector( RandomFloat( 0, 50 ) ), true, nil, nil, DOTA_TEAM_BADGUYS )
  237.  
  238.     -- Destroy trees around the caster and target
  239.  
  240. end
  241.    
  242. function SpawnZombie1( keys )
  243. if not keys.target:IsAlive() then
  244.     local caster = keys.target 
  245.     local caster_position = caster:GetAbsOrigin()
  246.     if caster:GetUnitName() == "npc_dota_mad_chicken" or caster:GetUnitName() == "npc_dota_secret_chicken" then
  247.         return
  248.     end
  249.     local unit = CreateUnitByName( "npc_dota_zombie1"  , caster_position + RandomVector( RandomFloat( 0, 50 ) ), true, nil, nil, DOTA_TEAM_BADGUYS )
  250.     if GameRules.ZombieMode == 1 then
  251.         unit:SetBaseDamageMin(unit:GetBaseDamageMin()*1.5)
  252.         unit:SetBaseDamageMax(unit:GetBaseDamageMax()*1.5)             
  253.         unit:SetPhysicalArmorBaseValue(unit:GetPhysicalArmorBaseValue()*1.5)
  254.         unit:SetMaxHealth(unit:GetMaxHealth()*1.5)
  255.         unit:SetHealth(unit:GetMaxHealth())
  256.     end
  257.  
  258.     -- Destroy trees around the caster and target
  259. end
  260. end
  261.    
  262. function SpawnZombie2( keys )
  263. if not keys.target:IsAlive() then
  264.     local caster = keys.target 
  265.     local caster_position = caster:GetAbsOrigin()
  266.     if caster:GetUnitName() == "npc_dota_mad_chicken" or caster:GetUnitName() == "npc_dota_secret_chicken" then
  267.         return
  268.     end
  269.     local unit = CreateUnitByName( "npc_dota_zombie2"  , caster_position + RandomVector( RandomFloat( 0, 50 ) ), true, nil, nil, DOTA_TEAM_BADGUYS )
  270.     if GameRules.ZombieMode == 1 then
  271.         unit:SetBaseDamageMin(unit:GetBaseDamageMin()*1.5)
  272.         unit:SetBaseDamageMax(unit:GetBaseDamageMax()*1.5)             
  273.         unit:SetPhysicalArmorBaseValue(unit:GetPhysicalArmorBaseValue()*1.5)
  274.         unit:SetMaxHealth(unit:GetMaxHealth()*1.5)
  275.         unit:SetHealth(unit:GetMaxHealth())
  276.     end
  277.     -- Destroy trees around the caster and target
  278. end
  279. end
  280.  
  281. function SpawnZombie3( keys )
  282. if not keys.target:IsAlive() then
  283.     local caster = keys.target 
  284.     local caster_position = caster:GetAbsOrigin()
  285.     if caster:GetUnitName() == "npc_dota_mad_chicken" or caster:GetUnitName() == "npc_dota_secret_chicken" then
  286.         return
  287.     end
  288.     local unit = CreateUnitByName( "npc_dota_zombie3"  , caster_position + RandomVector( RandomFloat( 0, 50 ) ), true, nil, nil, DOTA_TEAM_BADGUYS )
  289.     if GameRules.ZombieMode == 1 then
  290.         unit:SetBaseDamageMin(unit:GetBaseDamageMin()*1.5)
  291.         unit:SetBaseDamageMax(unit:GetBaseDamageMax()*1.5)             
  292.         unit:SetPhysicalArmorBaseValue(unit:GetPhysicalArmorBaseValue()*1.5)
  293.         unit:SetMaxHealth(unit:GetMaxHealth()*1.5)
  294.         unit:SetHealth(unit:GetMaxHealth())
  295.     end
  296.  
  297.     -- Destroy trees around the caster and target
  298. end
  299. end
  300.  
  301. function Respawn (keys )
  302.     local caster= keys.caster
  303.     local caster_position = caster:GetAbsOrigin()
  304.     local name = caster:GetUnitName()
  305.     local team = caster:GetTeam()
  306.     local respawn_time = GameRules.neutral_respawn
  307.  
  308.  
  309.     Timers:CreateTimer(respawn_time,function() 
  310.         local unit = CreateUnitByName(name, caster_position + RandomVector( RandomFloat( 0, 50)), true, nil, nil, team)
  311.     end)
  312. end
  313.    
  314. function Boss_Respawn (keys )
  315.     local caster= keys.caster
  316. --  local caster_position = caster:GetAbsOrigin()
  317.     local position = caster.respoint
  318.     local name = caster:GetUnitName()
  319.     local team = caster:GetTeam()
  320.     local respawn_time = GameRules.boss_respawn
  321.  
  322.    
  323.     if name == "npc_dota_boss_fire_1" then name = "npc_dota_boss_fire_2"
  324.     elseif name == "npc_dota_boss_fire_2" then name = "npc_dota_boss_fire_3"
  325.     elseif name == "npc_dota_boss_vampire_1" then name = "npc_dota_boss_vampire_2"
  326.     elseif name == "npc_dota_boss_vampire_2" then name = "npc_dota_boss_vampire_3"
  327.     elseif name == "npc_dota_boss_forest_1" then name = "npc_dota_boss_forest_2"
  328.     elseif name == "npc_dota_boss_forest_2" then name = "npc_dota_boss_forest_3"
  329.     elseif name == "npc_dota_boss_water_1" then name = "npc_dota_boss_water_2"
  330.     elseif name == "npc_dota_boss_water_2" then name = "npc_dota_boss_water_3"
  331.     elseif name == "npc_dota_boss_wind_1" then name = "npc_dota_boss_wind_2"
  332.     elseif name == "npc_dota_boss_wind_2" then name = "npc_dota_boss_wind_3"
  333.     elseif name == "npc_dota_spider_boss_1" then name = "npc_dota_spider_boss_2"
  334.     elseif name == "npc_dota_spider_boss_2" then name = "npc_dota_spider_boss_3"
  335.     elseif name == "npc_dota_alliance_boss_1" then name = "npc_dota_alliance_boss_2"
  336.     elseif name == "npc_dota_alliance_boss_2" then name = "npc_dota_alliance_boss_3"
  337.     elseif name == "npc_dota_naga_boss_1" then name = "npc_dota_naga_boss_2"
  338.     elseif name == "npc_dota_naga_boss_2" then name = "npc_dota_naga_boss_3"
  339.     end
  340.  
  341.     Timers:CreateTimer(respawn_time,function() 
  342.     local unit = CreateUnitByName(name, position + RandomVector( RandomFloat( 0, 50)), true, nil, nil, team)
  343.     unit:SetForwardVector(caster.fw)
  344.     end)
  345. end
  346.    
  347. function reincarnate(keys )
  348.     local caster= keys.caster
  349.     local caster_position = caster:GetAbsOrigin()
  350.     local name = caster:GetUnitName()
  351.     local team = caster:GetTeam()
  352. --  if team == "DOTA_TEAM_BADGUYS" then team = "DOTA_TEAM_GOODGUYS"
  353. --      elseif team == "DOTA_TEAM_GOODGUYS" then team = "DOTA_TEAM_BADGUYS"
  354. --  end
  355.     local unit = CreateUnitByName(name, caster_position + RandomVector( RandomFloat( 0, 50)), true, nil, nil, DOTA_TEAM_GOODGUYS)
  356.    
  357. end
  358.  
  359. function GiveGoldPlayers( sum )
  360.     for i=0 ,4 do
  361.         if PlayerResource:IsValidPlayer(i) then
  362.             PlayerResource:ModifyGold(i, sum, true, 0)
  363.         end
  364.     end
  365. end
  366.  
  367. function Roshan_Soul_activate( keys )
  368.  
  369.     Spawn:NeutralSpawner1()
  370.     GameRules.RoshanUpgrade = 1
  371.  
  372. end
  373.  
  374. function MegaMode_activate()
  375.         Spawn:MegaMode()
  376.  
  377. end
  378.    
  379. function CreatureLevelUp( keys )
  380.     local caster = keys.caster 
  381.     local name= caster:GetUnitName()
  382.     local game_time=GameRules:GetDOTATime(false,false)
  383.     caster:CreatureLevelUp(game_time)
  384.     Say(nil,"GameTime =" .. game_time, false)
  385. end    
  386.  
  387. function Spawn:On_Difficult_Chosen( event )
  388.     local difficulty = event.difficulty
  389.  
  390.         GameRules.DIFFICULTY = difficulty
  391.        
  392.         local allCreatures = Entities:FindAllByClassname('npc_dota_creature')
  393.         for i = 1, #allCreatures, 1 do
  394.             local creature = allCreatures[i]
  395.             local team = creature:GetTeam()
  396.            
  397.             if team ~= DOTA_TEAM_BADGUYS then
  398.                 if difficulty == 1 then Spawn:Upgrade2(creature,1)
  399.                 elseif  difficulty == 2 then Spawn:Upgrade2(creature,3)
  400.                 end
  401.             end
  402.         end
  403. end
  404.  
  405. function Spawn:InitGameMode()
  406.     -- Register Panorama Listeners
  407.     CustomGameEventManager:RegisterListener('On_Difficult_Chosen',Dynamic_Wrap(Spawn, 'On_Difficult_Chosen'))
  408.  
  409.     ListenToGameEvent("npc_spawned",Dynamic_Wrap( Spawn, 'OnNPCSpawned' ), self )
  410.     ListenToGameEvent('entity_killed', Dynamic_Wrap(Spawn, 'OnEntityKilled'), self)
  411.     print("Make buildings vulnerable")
  412.     local allBuildings = Entities:FindAllByClassname('npc_dota_building')
  413.     for i = 1, #allBuildings, 1 do
  414.         local building = allBuildings[i]
  415.         if building:HasModifier('modifier_invulnerable') then
  416.             building:RemoveModifierByName('modifier_invulnerable')
  417.             building:AddNewModifier(building, nil, "modifier_tower_truesight_aura", {})
  418.         end
  419.         if GetMapName() == "roshdef_turbo" then
  420.             SetGoldMultiplier(building , 2)
  421.         end
  422.     end
  423.    
  424.     if GetMapName() == "roshdef_turbo" then
  425.         local allCreatures = Entities:FindAllByClassname('npc_dota_creature')
  426.         for i = 1, #allCreatures, 1 do
  427.             local creature = allCreatures[i]
  428.             if creature:GetTeam() ~= DOTA_TEAM_GOODGUYS then
  429.                 SetGoldMultiplier(creature , 2)
  430.                 Spawn:Upgrade3(creature, 0.75)
  431.             end
  432.         end
  433.     end
  434. --  local spectre = Entities:FindByModel(nil,"models/heroes/spectre/spectre.vmdl")
  435. --  if spectre then spectre:SetTeam(DOTA_TEAM_BADGUYS) end
  436.  
  437. end
  438.  
  439. function Spawn:OnEntityKilled( keys )
  440.     local killedUnit = EntIndexToHScript( keys.entindex_killed )
  441. --  local killerUnit = EntIndexToHScript( keys.entindex_attacker )
  442.     local name = killedUnit:GetUnitName()
  443.     local team = killedUnit:GetTeam()
  444.  
  445.     if name == "npc_dota_thinker" or name == "npc_dota_dummy" then
  446.         return
  447.     end
  448.    
  449.     if RollPercentage(25) and team == DOTA_TEAM_GOODGUYS and GameRules.MegaMode == 1 then
  450.         DropItemWithTimer(killedUnit, "item_soul_vessel", 10)
  451.  
  452.     end
  453.  
  454.     if RollPercentage(GameRules.drop_chance) then
  455.         for key,value in pairs(neutral_creeps) do
  456. --          print("key = "..key)
  457.             for _,creep in pairs (value) do
  458.                 if creep == name then
  459.                     DropItemWithTimer(killedUnit, key, 60)
  460.                 end
  461.             end
  462.         end
  463.     end
  464.  
  465.     if chicken_ticket_drop == false then
  466.         if RollPercentage(1) then
  467.             print ("------------------------vse 4iki - puki !--------------------------------")
  468.             local point = killedUnit:GetAbsOrigin()
  469.             local newItem = CreateItem( "item_chicken_game_ticket", nil, nil )
  470.             local drop = CreateItemOnPositionSync( point, newItem )
  471.  
  472.             chicken_ticket_drop = true
  473.         end
  474.     end
  475.    
  476.     if not name == "npc_dota_mad_chicken" or not name == "npc_dota_secret_chicken" then
  477.         if      GameRules.ChaosMode == 1 then  Spawn:ChaosTrigger(killedUnit)
  478.         elseif  GameRules.ZombieMode == 1 then Spawn:ZombieTrigger(killedUnit)
  479.         end
  480.     end
  481.  
  482.  
  483.  
  484.     if  name == "npc_dota_abomination_boss"     then    GiveGoldPlayers(250)
  485.         elseif name == "npc_dota_golem_boss"    then    GiveGoldPlayers(375)
  486.         elseif name == "npc_dota_dead_witch"    then    GiveGoldPlayers(500)
  487.         elseif name == "npc_dota_necronomicon_warrior_boss"     then    GiveGoldPlayers(1000)
  488.         elseif name == "npc_dota_necronomicon_archer_boss"  then    GiveGoldPlayers(1000)
  489.         elseif name == "npc_dota_nyx_boss"      then    GiveGoldPlayers(3500)
  490.         elseif name == "npc_dota_doom_boss"     then    GiveGoldPlayers(5000)
  491.         elseif name == "npc_dota_bloodseeker_boss"  then    GiveGoldPlayers(7500)
  492.         elseif name == "npc_dota_sans"          then       
  493.             GiveGoldPlayers(10000)
  494.         elseif name == "npc_phantasm_1"         then    GiveGoldPlayers(15000)
  495.     end
  496.  
  497. --[[   
  498.     if RollPercentage(1) then
  499.         local unit_name = "npc_dota_halloween_pumpkin"
  500.         local unit_fw = killedUnit:GetForwardVector()
  501.         local position = killedUnit:GetAbsOrigin()       
  502.         local unit = CreateUnitByName(unit_name, position , true, nil, nil, DOTA_TEAM_NEUTRALS)
  503.         unit:SetForwardVector(unit_fw)
  504.         unit:AddNewModifier(unit, nil, "modifier_kill", { duration = 10 })
  505.    
  506.     end
  507. ]] 
  508.     if name == "npc_dota_secret_tree1"  or name == "npc_dota_secret_tree2" or name == "npc_dota_secret_tree3" or name == "npc_dota_halloween_treant" then
  509.         local point = killedUnit:GetAbsOrigin()
  510.         local newItem = CreateItem( "item_secret_branch", nil, nil )
  511.         local drop = CreateItemOnPositionSync( point, newItem )
  512.     elseif name == "npc_dota_secret_box"    then
  513.         local point = killedUnit:GetAbsOrigin()
  514.         local newItem = CreateItem( "item_candy", nil, nil )
  515.         local drop = CreateItemOnPositionSync( point, newItem )
  516.     elseif name == "npc_dota_gold_mine" then
  517.         local point = killedUnit:GetAbsOrigin()
  518.         local newItem = CreateItem( "item_kirk", nil, nil )
  519. --      local newItem = CreateItem( "item_puck_essence", nil, nil )
  520.         local drop = CreateItemOnPositionSync( point, newItem )
  521.     end
  522.     if name == "npc_dota_dflag_guard1" then
  523.         local point = Entities:FindByName( nil, "flag1point"):GetAbsOrigin() -- Записываем в переменную 'point' координаты нашего спавнера 'spawnerino'
  524.         local flag = Entities:FindByName( nil, "flag1")
  525.         CreateUnitByName( "npc_dota_nflag_guard1"  , point + RandomVector( RandomFloat( 0, 50 ) ), true, nil, nil, DOTA_TEAM_GOODGUYS )
  526.         flag:SetTeam(DOTA_TEAM_GOODGUYS)
  527.    
  528.     elseif name == "npc_dota_nflag_guard1" then
  529.         local point = Entities:FindByName( nil, "flag1point"):GetAbsOrigin() -- Записываем в переменную 'point' координаты нашего спавнера 'spawnerino'
  530.         local flag = Entities:FindByName( nil, "flag1")
  531.         CreateUnitByName( "npc_dota_dflag_guard1"  , point + RandomVector( RandomFloat( 0, 50 ) ), true, nil, nil, DOTA_TEAM_BADGUYS )
  532.         flag:SetTeam(DOTA_TEAM_BADGUYS)
  533.    
  534.     elseif name == "npc_dota_dflag_guard2" then
  535.         local point = Entities:FindByName( nil, "flag2point"):GetAbsOrigin() -- Записываем в переменную 'point' координаты нашего спавнера 'spawnerino'
  536.         local flag = Entities:FindByName( nil, "flag2")
  537.         CreateUnitByName( "npc_dota_nflag_guard2" , point + RandomVector( RandomFloat( 0, 50 ) ), true, nil, nil, DOTA_TEAM_GOODGUYS )
  538.         flag:SetTeam(DOTA_TEAM_GOODGUYS)
  539.    
  540.     elseif name == "npc_dota_nflag_guard2" then
  541.         local point = Entities:FindByName( nil, "flag2point"):GetAbsOrigin() -- Записываем в переменную 'point' координаты нашего спавнера 'spawnerino'
  542.         local flag = Entities:FindByName( nil, "flag2")
  543.         CreateUnitByName( "npc_dota_dflag_guard2"  , point + RandomVector( RandomFloat( 0, 50 ) ), true, nil, nil, DOTA_TEAM_BADGUYS )
  544.         flag:SetTeam(DOTA_TEAM_BADGUYS)
  545.     end
  546.    
  547.     if name== "npc_dota_dbase1" then
  548.         local point1 = Entities:FindByName( nil, "dmpoint1"):GetAbsOrigin() -- Записываем в переменную 'point' координаты нашего спавнера 'spawnerino'
  549.         local waypoint = Entities:FindByName( nil, "d_waypoint11") -- Записываем в переменную 'waypoint' координаты первого бокса way1
  550.         --local return_time = 30 -- Записываем в переменную значение '10'
  551.         Timers:CreateTimer(1, function()  -- Создаем таймер, который запустится через 15 секунд после начала матча и запустит следующую функцию
  552.         self.DireSpawner= 1
  553.         Spawn:DireSpawner2()   
  554.                        
  555.             local unit = CreateUnitByName( "npc_dota_papich" , point1 + RandomVector( RandomFloat( 0, 200 ) ), true, nil, nil, DOTA_TEAM_BADGUYS ) --[[ Создаем юнита 'example_unit_', в конце к названию добавится 1,2,3,4 или 5, в зависимости от раунда, и в итоге получатся наши example_unit_1, example_unit_2 и т.д. Юнит появится в векторе point + RandomVector (RandomFloat( 0, 200 ) ) - point - наша переменная, а рандомный вектор добавляется для того, чтобы мобы не появлялись в одной точке и не застревали. Мобы будут за силы света. ]]
  556.             unit:SetInitialGoalEntity( waypoint ) -- Посылаем мобов на наш way1, координаты которого мы записали в переменную 'waypoint'
  557.                
  558.         end)
  559.  
  560.         _G.choose_boss_timers = {}
  561.         chooseMode = true
  562.         Spawn:PrintChoseModeMessage()
  563.  
  564.     end
  565.         if name== "npc_dota_dbase2" then
  566.         SendToConsole("stopsound") 
  567.         local point1 = killedUnit:GetAbsOrigin() -- Записываем в переменную 'point' координаты нашего спавнера 'spawnerino'
  568.         local waypoint = Entities:FindByName( nil, "d_waypoint1") -- Записываем в переменную 'waypoint' координаты первого бокса way1
  569.         Timers:CreateTimer(1, function() EmitGlobalSound("roshan_def.jojo") end)       
  570.        
  571.         Spawn:PrintFalseEndgameMessage()
  572.         --local return_time = 30 -- Записываем в переменную значение '10'
  573.         Timers:CreateTimer(45, function()  -- Создаем таймер, который запустится через 15 секунд после начала матча и запустит следующую функцию
  574.        
  575.        
  576.             if GameRules.ZombieMode == 1 then name = "npc_dota_zombie_lord"
  577.             elseif GameRules.ChaosMode == 1 then name = "npc_dota_chaos_lord"
  578.             elseif GameRules.DemonMode == 1 then name = "npc_dota_demon_lord"
  579.             EmitGlobalSound("terrorblade_spawn")
  580.             elseif GameRules.LichMode == 1 then name = "npc_dota_lich_lord"
  581.             elseif GameRules.NecroMode == 1 then name = "npc_dota_necro_lord"
  582.             elseif GameRules.NecroMode == 0 then name = "npc_dota_necro_lord"
  583.  
  584.             end
  585.            
  586.             local unit = CreateUnitByName( name , point1 + RandomVector( RandomFloat( 0, 200 ) ), true, nil, nil, DOTA_TEAM_BADGUYS ) --[[ Создаем юнита 'example_unit_', в конце к названию добавится 1,2,3,4 или 5, в зависимости от раунда, и в итоге получатся наши example_unit_1, example_unit_2 и т.д. Юнит появится в векторе point + RandomVector (RandomFloat( 0, 200 ) ) - point - наша переменная, а рандомный вектор добавляется для того, чтобы мобы не появлялись в одной точке и не застревали. Мобы будут за силы света. ]]
  587.             unit:SetInitialGoalEntity( waypoint ) -- Посылаем мобов на наш way1, координаты которого мы записали в переменную 'waypoint'
  588.        
  589.        
  590.         end)
  591.     end
  592.  
  593.     if name == "npc_dota_papich" then
  594.         EmitGlobalSound("Music_Frostivus.WK_killed")
  595.     elseif name=="npc_dota_terrboss" then
  596.         SendToConsole("stopsound") 
  597.         Timers:CreateTimer(1, function() EmitGlobalSound("roshan_def.portal2") end)            
  598.         GameRules.EndGame = 1
  599.         Spawn:PrintEndgameMessage1()
  600.         Timers:CreateTimer(90, function() GameRules:SetGameWinner(DOTA_TEAM_GOODGUYS) end)     
  601.     elseif name=="npc_dota_zombie_lord" then
  602.         SendToConsole("stopsound") 
  603.         Timers:CreateTimer(1, function() EmitGlobalSound("roshan_def.portal2") end)    
  604.         GameRules.EndGame = 1
  605.         Spawn:PrintEndgameMessage1()
  606.         Timers:CreateTimer(90, function() GameRules:SetGameWinner(DOTA_TEAM_GOODGUYS) end)     
  607.     elseif name=="npc_dota_chaos_lord" then
  608.         SendToConsole("stopsound") 
  609.         Timers:CreateTimer(1, function() EmitGlobalSound("roshan_def.portal2") end)    
  610.         GameRules.EndGame = 1
  611.         Spawn:PrintEndgameMessage1()
  612.         Timers:CreateTimer(90, function() GameRules:SetGameWinner(DOTA_TEAM_GOODGUYS) end)     
  613.     elseif name=="npc_dota_demon_lord" then
  614.         SendToConsole("stopsound") 
  615.         Timers:CreateTimer(1, function() EmitGlobalSound("roshan_def.portal2") end)    
  616.         GameRules.EndGame = 1
  617.         Spawn:PrintEndgameMessage1()
  618.         Timers:CreateTimer(90, function() GameRules:SetGameWinner(DOTA_TEAM_GOODGUYS) end)     
  619.     elseif name=="npc_dota_lich_lord" then
  620.         SendToConsole("stopsound") 
  621.         Timers:CreateTimer(1, function() EmitGlobalSound("roshan_def.portal2") end)    
  622.         GameRules.EndGame = 1
  623.         Spawn:PrintEndgameMessage1()
  624.         Timers:CreateTimer(90, function() GameRules:SetGameWinner(DOTA_TEAM_GOODGUYS) end)     
  625.     elseif name=="npc_dota_necro_lord" then
  626.         SendToConsole("stopsound") 
  627.         Timers:CreateTimer(1, function() EmitGlobalSound("roshan_def.portal2") end)    
  628.         GameRules.EndGame = 1
  629.         Spawn:PrintEndgameMessage1()
  630.         Timers:CreateTimer(90, function() GameRules:SetGameWinner(DOTA_TEAM_GOODGUYS) end)     
  631.     elseif name=="npc_dota_roshan1" then
  632.         SendToConsole("stopsound")
  633.         if GameRules.MegaMode == 1 then
  634.             Timers:CreateTimer(1, function() EmitGlobalSound("padal_sneg") end)    
  635.             Spawn:PrintEndgameMessage3()
  636.             Timers:CreateTimer(90, function() GameRules:SetGameWinner(DOTA_TEAM_BADGUYS) end)
  637.         else
  638.             Timers:CreateTimer(1, function() EmitGlobalSound("kira_theme") end)    
  639.             Spawn:PrintEndgameMessage2()
  640.             Timers:CreateTimer(15, function() GameRules:SetGameWinner(DOTA_TEAM_BADGUYS) end)      
  641.         end
  642.        
  643.         GameRules.EndGame = 1
  644.     end
  645.    
  646.     if name == "npc_dota_rock" then
  647.         self.golem=1
  648.     elseif  name == "npc_dota_ursa3" then
  649.         self.wolf=1
  650.         local child_name = "npc_dota_wolf_child"
  651.         local child_fw = killedUnit:GetForwardVector()
  652.         local position = killedUnit:GetAbsOrigin()
  653.         Timers:CreateTimer(2, function()
  654.         local unit = CreateUnitByName(child_name, position , true, nil, nil, DOTA_TEAM_GOODGUYS)
  655.         unit:SetForwardVector(child_fw) end)
  656.         GameRules:SendCustomMessage("#Game_notification_wolf_announce",0,0)
  657.     elseif  name == "npc_dota_spider_boss_1" then
  658.         self.ursa=1
  659.         local child_name = "npc_dota_ursa_child"
  660.         local child_fw = killedUnit:GetForwardVector()
  661.         local position = killedUnit:GetAbsOrigin()
  662.         Timers:CreateTimer(2, function()
  663.         local unit = CreateUnitByName(child_name, position , true, nil, nil, DOTA_TEAM_GOODGUYS)
  664.         unit:SetForwardVector(child_fw) end)
  665.        
  666.         GameRules:SendCustomMessage("#Game_notification_ursa_announce",0,0)
  667.     elseif  name == "npc_dota_boss_forest_1" then
  668.         self.satyr=1
  669.         local child_name = "npc_dota_satyr_child"
  670.         local child_fw = killedUnit:GetForwardVector()
  671.         local position = killedUnit:GetAbsOrigin()
  672.         Timers:CreateTimer(2, function()
  673.         local unit = CreateUnitByName(child_name, position , true, nil, nil, DOTA_TEAM_GOODGUYS)
  674.         unit:SetForwardVector(child_fw) end)
  675.         GameRules:SendCustomMessage("#Game_notification_satyr_announce",0,0)   
  676.     elseif  name == "npc_dota_naga_boss_1" then
  677.         self.ogre=1
  678.         local child_name = "npc_dota_ogre_child"
  679.         local child_fw = killedUnit:GetForwardVector()
  680.         local position = killedUnit:GetAbsOrigin()
  681.         Timers:CreateTimer(2, function()
  682.         local unit = CreateUnitByName(child_name, position , true, nil, nil, DOTA_TEAM_GOODGUYS)
  683.         unit:SetForwardVector(child_fw) end)
  684.         GameRules:SendCustomMessage("#Game_notification_ogre_announce",0,0)
  685.     elseif  name == "npc_dota_boss_wind_1" then
  686.         self.centaur=1
  687.         local child_name = "npc_dota_centaur_child"
  688.         local child_fw = killedUnit:GetForwardVector()
  689.         local position = killedUnit:GetAbsOrigin()
  690.         Timers:CreateTimer(2, function()
  691.         local unit = CreateUnitByName(child_name, position , true, nil, nil, DOTA_TEAM_GOODGUYS)
  692.         unit:SetForwardVector(child_fw) end)
  693.         GameRules:SendCustomMessage("#Game_notification_centaur_announce",0,0) 
  694.     elseif  name == "npc_dota_boss_vampire_1" then
  695.         self.dragon=1
  696.         local child_name = "npc_dota_dragon_child"
  697.         local child_fw = killedUnit:GetForwardVector()
  698.         local position = killedUnit:GetAbsOrigin()
  699.         Timers:CreateTimer(2, function()
  700.         local unit = CreateUnitByName(child_name, position , true, nil, nil, DOTA_TEAM_GOODGUYS)
  701.         unit:SetForwardVector(child_fw) end)
  702.         GameRules:SendCustomMessage("#Game_notification_dragon_announce",0,0)  
  703.     elseif  name == "npc_dota_boss_water_1" then
  704.         self.golem=2
  705.         local child_name = "npc_dota_golem_child"
  706.         local child_fw = killedUnit:GetForwardVector()
  707.         local position = killedUnit:GetAbsOrigin()
  708.         Timers:CreateTimer(2, function()
  709.         local unit = CreateUnitByName(child_name, position , true, nil, nil, DOTA_TEAM_GOODGUYS)
  710.         unit:SetForwardVector(child_fw) end)
  711.         GameRules:SendCustomMessage("#Game_notification_golem_announce",0,0)   
  712.     elseif  name == "npc_dota_boss_fire_1" then
  713.         self.kobold=1
  714.         local child_name = "npc_dota_kobold_child"
  715.         local child_fw = killedUnit:GetForwardVector()
  716.         local position = killedUnit:GetAbsOrigin()
  717.         Timers:CreateTimer(2, function()
  718.         local unit = CreateUnitByName(child_name, position , true, nil, nil, DOTA_TEAM_GOODGUYS)
  719.         unit:SetForwardVector(child_fw) end)
  720.         GameRules:SendCustomMessage("#Game_notification_kobold_announce",0,0)  
  721.     elseif  name == "npc_dota_alliance_boss_1" then
  722.         self.troll=1
  723.         local child_name = "npc_dota_troll_child"
  724.         local child_fw = killedUnit:GetForwardVector()
  725.         local position = killedUnit:GetAbsOrigin()
  726.         Timers:CreateTimer(2, function()
  727.         local unit = CreateUnitByName(child_name, position , true, nil, nil, DOTA_TEAM_GOODGUYS)
  728.         unit:SetForwardVector(child_fw) end)       
  729.        
  730.         GameRules:SendCustomMessage("#Game_notification_troll_announce",0,0)   
  731.     end
  732.    
  733.     if name == "npc_cursed_warrior" then
  734.         GameRules.Number_of_cursed = GameRules.Number_of_cursed - 1
  735.         print("Number_of_cursed="..GameRules.Number_of_cursed)
  736.         if GameRules.Number_of_cursed == 0 then
  737.             SendToConsole("stopsound")
  738.         end
  739.     end
  740.    
  741.    
  742. end
  743.  
  744. function Spawn:ChaosTrigger(killedUnit)
  745.     local trigger_chance = 35
  746.     local damage = 100 + killedUnit:GetMaxHealth()*0.2
  747.     local point = killedUnit:GetAbsOrigin()
  748.     local damage_radius = 250
  749. --  local particle = "particles/units/heroes/hero_nevermore/nevermore_shadowraze.vpcf"
  750.     local particle = "particles/econ/items/shadow_fiend/sf_fire_arcana/sf_fire_arcana_shadowraze.vpcf"
  751.    
  752.     if RandomInt(1,99)<= trigger_chance and killedUnit:GetTeam() ~= DOTA_TEAM_GOODGUYS then
  753.         local particleIndex = ParticleManager:CreateParticle(particle, PATTACH_ABSORIGIN, killedUnit)
  754.         local units = FindUnitsInRadius(killedUnit:GetTeam(), point, nil, damage_radius, DOTA_UNIT_TARGET_TEAM_ENEMY,
  755.                                             DOTA_UNIT_TARGET_HERO + DOTA_UNIT_TARGET_BASIC, 0, 0, false)
  756.         for k, unit in ipairs(units) do
  757.             local damage_table = {
  758.                                     attacker = killedUnit,
  759.                                     victim = unit,
  760.                                     ability = nil,
  761.                                     damage_type = DAMAGE_TYPE_PURE,
  762.                                     damage = damage
  763.                                 }
  764.             ApplyDamage(damage_table)
  765.         end
  766.         EmitSoundOnLocationWithCaster(point, "Hero_Nevermore.Shadowraze" ,killedUnit)
  767.         --EmitSoundOnLocationForAllies( point, "Hero_Nevermore.Shadowraze", units )
  768.     end
  769. end
  770.  
  771. function Spawn:ZombieTrigger(killedUnit)
  772.     local trigger_chance = 35
  773.     local point = killedUnit:GetAbsOrigin()
  774.     local hp = 35
  775.     local dmg = 50
  776.     local armor = 100
  777.     local bounty = 10
  778.     local experience = 10
  779.  
  780.  
  781.     local name = "npc_dota_template_zombie"
  782.     local team = killedUnit:GetTeam()
  783.     if RandomInt(1,100)<= trigger_chance and killedUnit:GetTeam() ~= DOTA_TEAM_GOODGUYS then
  784.         local unit
  785.         Timers:CreateTimer(3,function()
  786.             unit = CreateUnitByName(name, point + RandomVector( RandomFloat( 0, 50)), true, nil, nil, team)
  787.             unit:SetMaxHealth(killedUnit:GetMaxHealth()*hp/100+1)
  788.             unit:SetBaseMaxHealth(killedUnit:GetMaxHealth()*hp/100+1)
  789.             unit:SetHealth(killedUnit:GetMaxHealth()*hp/100+1)
  790.             unit:SetBaseDamageMin(killedUnit:GetBaseDamageMin()*dmg/100)
  791.             unit:SetBaseDamageMax(killedUnit:GetBaseDamageMax()*dmg/100)               
  792.             unit:SetPhysicalArmorBaseValue(killedUnit:GetPhysicalArmorBaseValue()*armor/100)
  793.             unit:SetMaximumGoldBounty(killedUnit:GetMaximumGoldBounty()*bounty/100)            
  794.             unit:SetMinimumGoldBounty(killedUnit:GetMinimumGoldBounty()*bounty/100)
  795.             unit:SetDeathXP(killedUnit:GetDeathXP()*experience/100)
  796.         end)
  797.     end
  798. end
  799. function Spawn:PrintEndgameMessage1()
  800.  
  801.     Timers:CreateTimer(5, function() GameRules:SendCustomMessage("<font color='#DBA901'><br>Game will end in 85 seconds</font>",0,0) end)
  802.     Timers:CreateTimer(10, function() GameRules:SendCustomMessage("#Game_notification_end_game_message",0,0) end)
  803.  
  804.     --Send stats
  805.     Timers:CreateTimer(87, function() GameRules:SendCustomMessage("<font color='#DBA901'>3</font>",0,0) end)
  806.     Timers:CreateTimer(88, function() GameRules:SendCustomMessage("<font color='#DBA901'>2</font>",0,0) end)
  807.     Timers:CreateTimer(89, function() GameRules:SendCustomMessage("<font color='#DBA901'>1...</font>",0,0) end)
  808. end
  809.  
  810. function Spawn:PrintEndgameMessage2()
  811.  
  812.     Timers:CreateTimer(5, function() GameRules:SendCustomMessage("<font color='#DBA901'><br>Game will end in 15 seconds</font>",0,0) end)
  813.     Timers:CreateTimer(10, function() GameRules:SendCustomMessage("#Game_notification_end_game_message",0,0) end)
  814.  
  815.     --Send stats
  816.     Timers:CreateTimer(12, function() GameRules:SendCustomMessage("<font color='#DBA901'>3</font>",0,0) end)
  817.     Timers:CreateTimer(13, function() GameRules:SendCustomMessage("<font color='#DBA901'>2</font>",0,0) end)
  818.     Timers:CreateTimer(14, function() GameRules:SendCustomMessage("<font color='#DBA901'>1...</font>",0,0) end)
  819. end
  820.  
  821. function Spawn:PrintEndgameMessage3()
  822.  
  823.     Timers:CreateTimer(5, function() GameRules:SendCustomMessage("<font color='#DBA901'><br>Game will end in 85 seconds</font>",0,0) end)
  824.     Timers:CreateTimer(10, function() GameRules:SendCustomMessage("#Game_notification_end_game_message",0,0) end)
  825.  
  826.     --Send stats
  827.     Timers:CreateTimer(87, function() GameRules:SendCustomMessage("<font color='#DBA901'>3</font>",0,0) end)
  828.     Timers:CreateTimer(88, function() GameRules:SendCustomMessage("<font color='#DBA901'>2</font>",0,0) end)
  829.     Timers:CreateTimer(89, function() GameRules:SendCustomMessage("<font color='#DBA901'>1...</font>",0,0) end)
  830. end
  831.  
  832. function Spawn:PrintFalseEndgameMessage()
  833.  
  834.     Timers:CreateTimer(5, function() GameRules:SendCustomMessage("<font color='#DBA901'><br>Conragulations !Game will end in 40 seconds</font>",0,0) end)
  835.     Timers:CreateTimer(10, function() GameRules:SendCustomMessage("#Game_notification_end_game_message",0,0) end)
  836.  
  837.     --Send stats
  838.     Timers:CreateTimer(42, function() GameRules:SendCustomMessage("<font color='#DBA901'>3</font>",0,0) end)
  839.     Timers:CreateTimer(43, function() GameRules:SendCustomMessage("<font color='#DBA901'>2</font>",0,0) end)
  840.     Timers:CreateTimer(44, function() GameRules:SendCustomMessage("<font color='#DBA901'>1...</font>",0,0) end)
  841.     Timers:CreateTimer(45, function() GameRules:SendCustomMessage("<font color='#DBA901'>Yes. I lie :) </font>",0,0) end)
  842.    
  843. end
  844.  
  845. chooseMode = false
  846.  
  847. function Spawn:PrintChoseModeMessage()
  848.     if not chooseMode then
  849.         return
  850.     else
  851.         chooseMode = false
  852.     end
  853.     GameRules:SendCustomMessage("#Game_notification_chose_boss_mode_message",0,0)
  854.     for index = 0,5 do
  855.         local player = PlayerResource:GetPlayer(index)
  856.         if player and GameRules:PlayerHasCustomGameHostPrivileges(player) and IsServer() then
  857.             CustomGameEventManager:Send_ServerToPlayer( player, "choose_boss_start", {} )
  858.             print("index = "..index)
  859.         end
  860.     end
  861.    
  862.     Timers:CreateTimer(60, function()      
  863.         if final_boss == false and IsServer() then
  864.             Timers:CreateTimer(1, function() GameRules:SendCustomMessage("<font color='#DBA901'>3</font>",0,0) end)
  865.             Timers:CreateTimer(2, function() GameRules:SendCustomMessage("<font color='#DBA901'>2</font>",0,0) end)
  866.             Timers:CreateTimer(3, function() GameRules:SendCustomMessage("<font color='#DBA901'>1...</font>",0,0) end)
  867.  
  868.             final_boss = true
  869.             CustomGameEventManager:Send_ServerToPlayer( GetListenServerHost(), "choose_boss_end", {} )
  870.             Timers:CreateTimer(3, function()
  871.                 local int = math.random(1,5)
  872.                 if      int <= 1 then   Spawn:ZombieMode()
  873.                 elseif int <= 2 then    Spawn:ChaosMode()
  874.                 elseif int <= 3 then    Spawn:DemonMode()
  875.                 elseif int <= 4 then    Spawn:LichMode()
  876.                 elseif int <= 5 then    Spawn:NecroMode()
  877.                 elseif int ~= 5 then    Spawn:NecroMode()
  878.                 end
  879.             end)
  880.         end
  881.     end)
  882.  
  883. end
  884.  
  885. function Spawn:ZombieMode()
  886.  
  887.     GameRules:SendCustomMessage("#Game_notification_zombie_mode_message1",0,0)
  888.     GameRules:SendCustomMessage("#Game_notification_zombie_mode_message2",0,0)
  889.     EmitGlobalSound("undying_undying_big_attack_10")
  890.     GameRules.ZombieMode = 1
  891.    
  892. end
  893.  
  894. function Spawn:ChaosMode()
  895.  
  896.     GameRules:SendCustomMessage("#Game_notification_chaos_mode_message1",0,0)
  897.     GameRules:SendCustomMessage("#Game_notification_chaos_mode_message2",0,0)
  898.     EmitGlobalSound("nevermore_nev_arc_level_07")
  899.     GameRules.ChaosMode = 1
  900.    
  901. end
  902.  
  903. function Spawn:DemonMode()
  904.  
  905.     GameRules:SendCustomMessage("#Game_notification_demon_mode_message1",0,0)
  906.     GameRules:SendCustomMessage("#Game_notification_demon_mode_message2",0,0)
  907.     EmitGlobalSound("terrorblade_terr_levelup_06") 
  908.     GameRules.DemonMode = 1
  909.    
  910. end
  911.  
  912. function Spawn:LichMode()
  913.  
  914.     GameRules:SendCustomMessage("#Game_notification_lich_mode_message1",0,0)
  915.     GameRules:SendCustomMessage("#Game_notification_lich_mode_message2",0,0)
  916.     EmitGlobalSound("lich_lich_ability_chain_06")
  917.     GameRules.LichMode = 1
  918.    
  919. end
  920.  
  921. function Spawn:NecroMode()
  922.  
  923.     GameRules:SendCustomMessage("#Game_notification_necro_mode_message1",0,0)
  924.     GameRules:SendCustomMessage("#Game_notification_necro_mode_message2",0,0)
  925.     EmitGlobalSound("necrolyte_necr_spawn_03")
  926.     GameRules.NecroMode = 1
  927.    
  928. end
  929.  
  930. function Spawn:MegaMode()
  931. --  local roshan = Entities:FindByModel(nil,"models/creeps/roshan/roshan.vmdl")
  932. --  while roshan:GetUnitName()~="npc_dota_roshan1" do
  933. --      roshan = Entities:FindByModel(roshan,"models/creeps/roshan/roshan.vmdl")
  934. --  end
  935.     local unit = Entities:FindByName( nil, "roshan")
  936.     if unit ~= nil then Spawn:Upgrade4(unit, 100, 200)   end
  937.    
  938. --  Spawn:Upgrade2(unit,400)
  939.     for i=1,3 do
  940.         local unit = Entities:FindByName( nil, "roshan_guard"..i)
  941.         if unit ~= nil then Spawn:Upgrade4(unit, 100, 100) end
  942.     end
  943.     Spawn:SetSameTeam()
  944.     Spawn:MegaNeutralSpawner()
  945.     GameRules.MegaMode = 1
  946.    
  947. end
  948.  
  949. function Spawn:OnNPCSpawned(keys)
  950.  
  951.     --if centaur_const==1 then Say(nil,"Spawn:OnNPCSpawned works !!!"  , false) end
  952.     --Say(nil,"Spawn:OnNPCSpawned works !!!"  , false)
  953.     local npc = EntIndexToHScript(keys.entindex)
  954.     local name = npc:GetUnitName()
  955.     local team = npc:GetTeam()
  956.    
  957.     if GetMapName() == "roshdef_turbo" then
  958.         if (team ~= DOTA_TEAM_GOODGUYS and not npc:IsRealHero() ) then
  959.             SetGoldMultiplier(npc , 2)
  960.             Spawn:Upgrade3(npc, 0.75)
  961.         end
  962.     end
  963.    
  964.     local ability = npc:FindAbilityByName("set_color")
  965.     if ability then ability:SetLevel(1) end
  966.  
  967.     if team ~= DOTA_TEAM_GOODGUYS then
  968.         npc:AddNewModifier(npc, nil, "modifier_invulnerable", {duration = 0.1})
  969.     else
  970.         npc:AddNewModifier(npc, nil, "modifier_bloodseeker_thirst", nil)   
  971.     end
  972. --  npc:AddNewModifier(npc, nil, "modifier_special_effect_contest", {})
  973. --  npc:AddNewModifier(npc, nil, "modifier_special_effect_donator", {})
  974.  
  975.     if (team ~= DOTA_TEAM_GOODGUYS and GameRules.DIFFICULTY == 1 and not npc:IsRealHero() ) then    Spawn:Upgrade2(npc,1)
  976.         elseif (team ~= DOTA_TEAM_GOODGUYS and GameRules.DIFFICULTY == 2 and not npc:IsRealHero()) then     Spawn:Upgrade2(npc,3)
  977.     end
  978.  
  979.     if (team == DOTA_TEAM_BADGUYS and GameRules.DemonMode == 1) then    npc:AddNewModifier(npc, nil, "modifier_demon_lord_buff", {})
  980.     end
  981.     if (team == DOTA_TEAM_GOODGUYS and GameRules.LichMode == 1) then    npc:AddNewModifier(npc, nil, "modifier_lich_lord_debuff", {})
  982.     end
  983.     if (team == DOTA_TEAM_GOODGUYS and GameRules.NecroMode == 1) then   npc:AddNewModifier(npc, nil, "modifier_necro_lord_debuff", {})
  984.     end
  985. --npc:AddNewModifier(npc, nil, "modifier_demon_lord_buff", {})
  986. --npc:AddNewModifier(npc, nil, "modifier_insane", {})
  987.    
  988.     if npc:IsRealHero() and npc.FirstSpawned == nil then --
  989.             npc.FirstSpawned = true
  990.             local ability = npc:FindAbilityByName("no_speed_limit")
  991.             if ability then ability:SetLevel(1) end
  992.            
  993.             if name ~= "npc_dota_hero_wisp" then
  994.                 --npc:AddAbility("penguin_sledding_ride")
  995.                 local ability = npc:FindAbilityByName("penguin_sledding_ride")
  996.                 if ability then ability:SetLevel(1) end
  997.             end
  998.            
  999.             npc:AddNewModifier(npc, nil, "modifier_your_armor", {})
  1000.             if GetMapName() == "roshdef_turbo" then
  1001.                 Timers:CreateTimer(0.1, function()
  1002.                     npc:AddNewModifier(npc, nil, "modifier_turbomode_bonus", {})
  1003.                 end)
  1004.             end        
  1005. --[[   
  1006.             for i=1,75 do
  1007.                 npc:HeroLevelUp(true)
  1008.             end
  1009. ]]                         
  1010.             if name=="npc_dota_hero_centaur"
  1011.                 then local ability = npc:FindAbilityByName("inherit_centaur_buff")
  1012.                 ability:SetLevel(1)
  1013.                 self.centaur_buff=1
  1014.             elseif name=="npc_dota_hero_leshrac"
  1015.                 then local ability = npc:FindAbilityByName("inherit_leshrac_buff")
  1016.                 ability:SetLevel(1)
  1017.                 self.leshrac_buff=1
  1018.             elseif name=="npc_dota_hero_riki"
  1019.                 then local ability = npc:FindAbilityByName("inherit_riki_buff")
  1020.                 ability:SetLevel(1)
  1021.                 self.riki_buff=1
  1022.             elseif name=="npc_dota_hero_lycan"
  1023.                 then local ability = npc:FindAbilityByName("inherit_lycan_buff")
  1024.                 ability:SetLevel(1)
  1025.                 self.lycan_buff=1
  1026.             elseif name=="npc_dota_hero_ursa"
  1027.                 then local ability = npc:FindAbilityByName("inherit_ursa_buff")
  1028.                 ability:SetLevel(1)
  1029.                 self.ursa_buff=1
  1030.             elseif name=="npc_dota_hero_lone_druid"
  1031.                 then local ability = npc:FindAbilityByName("inherit_druid_buff")
  1032.                 ability:SetLevel(1)
  1033.                 self.druid_buff=1
  1034.             elseif name=="npc_dota_hero_jakiro"
  1035.                 then local ability = npc:FindAbilityByName("inherit_jakiro_buff")
  1036.                 ability:SetLevel(1)
  1037.                 self.jakiro_buff=1
  1038.             elseif name=="npc_dota_hero_winter_wyvern"
  1039.                 then local ability = npc:FindAbilityByName("inherit_wyvern_buff")
  1040.                 ability:SetLevel(1)
  1041.                 self.wyvern_buff=1                 
  1042.             elseif name=="npc_dota_hero_ogre_magi"
  1043.                 then local ability = npc:FindAbilityByName("inherit_ogre_buff")
  1044.                 ability:SetLevel(1)
  1045.                 self.ogre_buff=1
  1046.             elseif name=="npc_dota_hero_tiny"
  1047.                 then local ability = npc:FindAbilityByName("inherit_tiny_buff")
  1048.                 ability:SetLevel(1)
  1049.                 self.tiny_buff=1
  1050.             elseif name=="npc_dota_hero_troll_warlord"
  1051.                 then local ability = npc:FindAbilityByName("inherit_troll_buff")
  1052.                 ability:SetLevel(1)
  1053.                 self.troll_buff=1
  1054.             elseif name=="npc_dota_hero_huskar"
  1055.                 then local ability = npc:FindAbilityByName("inherit_huskar_buff")
  1056.                 ability:SetLevel(1)
  1057.                 self.huskar_buff=1
  1058.             elseif name=="npc_dota_hero_meepo"
  1059.                 then local ability = npc:FindAbilityByName("inherit_meepo_buff")               
  1060.                 ability:SetLevel(1)
  1061.                 self.meepo_buff=1
  1062.             elseif name=="npc_dota_hero_pangolier"
  1063.                 then local ability = npc:FindAbilityByName("pangolier_greed")              
  1064.                 ability:SetLevel(1)
  1065.             elseif name=="npc_dota_hero_beastmaster"
  1066.                 then local ability = npc:FindAbilityByName("inherit_beastmaster_buff")             
  1067.                 ability:SetLevel(1)
  1068.                 self.beastmaster_buff=1
  1069.             elseif name=="npc_dota_hero_chen"
  1070.                 then local ability = npc:FindAbilityByName("inherit_chen_buff")                
  1071.                 ability:SetLevel(1)
  1072.                 self.chen_buff=1
  1073.             elseif name=="npc_dota_hero_life_stealer"
  1074.                 then local ability = npc:FindAbilityByName("renegade_backtrack")               
  1075.                 ability:SetLevel(1)
  1076.             elseif name=="npc_dota_hero_omniknight"
  1077.                 then local ability = npc:FindAbilityByName("spartacus_call_of_allies")             
  1078.                 ability:SetLevel(1)
  1079.             elseif name=="npc_dota_hero_phantom_assassin"
  1080.                 then local ability = npc:FindAbilityByName("imba_phantom_assassin_triple_blow")                
  1081.                 ability:SetLevel(1)
  1082.             elseif name=="npc_dota_hero_drow_ranger"
  1083.                 then local ability = npc:FindAbilityByName("drow_ranger_trueshot")             
  1084.                 ability:SetLevel(1)
  1085.             elseif name=="npc_dota_hero_sven"
  1086.                 then local ability = npc:FindAbilityByName("sven_thirsty_blade")               
  1087.                 ability:SetLevel(1)
  1088.             elseif name=="npc_dota_hero_undying"
  1089.                 then local ability = npc:FindAbilityByName("zombie_king_zombie_spawn")             
  1090.                 ability:SetLevel(1)
  1091.             elseif name=="npc_dota_hero_dark_seer"
  1092.                 then local ability = npc:FindAbilityByName("earthshaker_aftershock")               
  1093.                 ability:SetLevel(1)
  1094.             elseif name=="npc_dota_hero_mars"
  1095.                 then local ability = npc:FindAbilityByName("mars_friend")              
  1096.                 ability:SetLevel(1)
  1097.             elseif name=="npc_dota_hero_pudge"
  1098.                 then local ability = npc:FindAbilityByName("meatboy_more_meat")                
  1099.                 ability:SetLevel(1)
  1100.                 npc:SetRenderColor(255, 0, 0)
  1101.             elseif name=="npc_dota_hero_dark_willow"
  1102.                 then local ability = npc:FindAbilityByName("dark_willow_bramble_maze")             
  1103.                 ability:SetLevel(1)
  1104.             elseif name=="npc_dota_hero_faceless_void"
  1105.                 then local ability = npc:FindAbilityByName("faceless_void_time_walk")              
  1106.                 ability:SetLevel(1)
  1107.             elseif name=="npc_dota_hero_alchemist"
  1108.                 then local ability = npc:FindAbilityByName("alchemist_bounty")             
  1109.                 ability:SetLevel(1)
  1110.             elseif name=="npc_dota_hero_sniper"
  1111.                 then local ability = npc:FindAbilityByName("sniper_land_mines")                
  1112.                 ability:SetLevel(1)
  1113.             elseif name=="npc_dota_hero_phoenix"
  1114.                 then local ability = npc:FindAbilityByName("phoenix_fire_soul")                
  1115.                 ability:SetLevel(1)
  1116.             elseif name=="npc_dota_hero_arc_warden"
  1117.                 then local ability = npc:FindAbilityByName("customability_energy_system")              
  1118.                 ability:SetLevel(1)
  1119.             elseif name=="npc_dota_hero_puck"
  1120.                 then local ability = npc:FindAbilityByName("greevil_lord_create_worker")               
  1121.                 ability:SetLevel(1)
  1122.             elseif name=="npc_dota_hero_wisp"
  1123.                 then local ability = npc:FindAbilityByName("wisp_powerup_dmg")             
  1124.                 ability:SetLevel(1)
  1125.                 local ability = npc:FindAbilityByName("wisp_powerup_armor")                
  1126.                 ability:SetLevel(1)
  1127.                 local ability = npc:FindAbilityByName("wisp_powerup_hp")               
  1128.                 ability:SetLevel(1)
  1129.                 local ability = npc:FindAbilityByName("wisp_powerup_as")               
  1130.                 ability:SetLevel(1)
  1131.                 local ability = npc:FindAbilityByName("wisp_powerup_ms")               
  1132.                 ability:SetLevel(1)
  1133.                 local ability = npc:FindAbilityByName("wisp_infest")               
  1134.                 ability:SetLevel(1)
  1135.                 local ability = npc:FindAbilityByName("wisp_consume")              
  1136.                 ability:SetLevel(1)
  1137.                                
  1138.             elseif name=="npc_dota_hero_treant" then
  1139.                  local ability = npc:FindAbilityByName("roshan_spell_block")               
  1140.                     ability:SetLevel(1)
  1141.                    
  1142.                     local children = npc:GetChildren()
  1143.                     for k,child in pairs(children) do
  1144.                         if child:GetClassname() == "dota_item_wearable" then
  1145.                             child:RemoveSelf()
  1146.                         end
  1147.                     end
  1148.                        
  1149.         end
  1150.     end
  1151.        
  1152.     --Say(nil,npc:GetUnitName()  , false)
  1153.     if npc:GetTeam()== DOTA_TEAM_GOODGUYS then
  1154.         if (name == "npc_dota_troll_child" or name == "npc_dota_troll_junior" or name == "npc_dota_troll_adult" or name == "npc_dota_troll_veteran" or name == "npc_dota_troll_myth" or
  1155. name == "npc_dota_roshan_troll" or name == "npc_dota_troll1" or name == "npc_dota_troll2" or name == "npc_dota_troll3" or name == "npc_dota_troll4")and self.troll_buff==1 then
  1156.             local ability = npc:FindAbilityByName("troll_buff")
  1157.             ability:ApplyDataDrivenModifier(npc, npc, "modifier_troll_buff", {})
  1158.             npc:AddNewModifier(nil, nil, "modifier_shapeshift_speed_lua", {})
  1159.         elseif (name == "npc_dota_centaur_child" or name == "npc_dota_centaur_junior" or name == "npc_dota_centaur_adult" or name == "npc_dota_centaur_veteran" or name == "npc_dota_centaur_myth" or
  1160. name == "npc_dota_roshan_centaur" or name == "npc_dota_centaur1" or name == "npc_dota_centaur2") and self.centaur_buff==1 then
  1161.             local ability = npc:FindAbilityByName("centaur_buff")
  1162.             ability:ApplyDataDrivenModifier(npc, npc, "modifier_centaur_buff", {})
  1163.             npc:AddNewModifier(nil, nil, "modifier_shapeshift_speed_lua", {})
  1164.         elseif (name == "npc_dota_centaur_child" or name == "npc_dota_centaur_junior" or name == "npc_dota_centaur_adult" or name == "npc_dota_centaur_veteran" or name == "npc_dota_centaur_myth" or
  1165. name == "npc_dota_roshan_centaur" or name == "npc_dota_centaur1" or name == "npc_dota_centaur2") and self.leshrac_buff==1 then
  1166.             local ability = npc:FindAbilityByName("leshrac_buff")
  1167.             ability:ApplyDataDrivenModifier(npc, npc, "modifier_leshrac_buff", {})
  1168.         elseif (name == "npc_dota_satyr_child" or name == "npc_dota_satyr_junior" or name == "npc_dota_satyr_adult" or name == "npc_dota_satyr_veteran" or name == "npc_dota_satyr_myth" or
  1169. name == "npc_dota_roshan_satyr" or name == "npc_dota_satyr1" or name == "npc_dota_satyr2" or name == "npc_dota_satyr3" ) and self.riki_buff==1 then
  1170.             local ability = npc:FindAbilityByName("riki_buff")
  1171.             ability:ApplyDataDrivenModifier(npc, npc, "modifier_riki_buff", {})
  1172.         elseif (name == "npc_dota_troll_child" or name == "npc_dota_troll_junior" or name == "npc_dota_troll_adult" or name == "npc_dota_troll_veteran" or name == "npc_dota_troll_myth" or
  1173. name == "npc_dota_roshan_troll" or name == "npc_dota_troll1" or name == "npc_dota_troll2" or name == "npc_dota_troll3" or name == "npc_dota_troll4") and self.huskar_buff==1 then
  1174.             local ability = npc:FindAbilityByName("huskar_buff")
  1175.             ability:ApplyDataDrivenModifier(npc, npc, "modifier_huskar_buff", {})
  1176.             npc:AddNewModifier(nil, nil, "modifier_shapeshift_speed_lua", {})
  1177.         elseif (name == "npc_dota_dragon_child" or name == "npc_dota_dragon_junior" or name == "npc_dota_dragon_adult" or name == "npc_dota_dragon_veteran" or name == "npc_dota_dragon_myth" or
  1178. name == "npc_dota_roshan_dragon" or name == "npc_dota_dragon1" or name == "npc_dota_dragon2") and self.wyvern_buff==1 then
  1179.             local ability = npc:FindAbilityByName("wyvern_buff")
  1180.             ability:ApplyDataDrivenModifier(npc, npc, "modifier_wyvern_buff", {})
  1181.             npc:AddNewModifier(nil, nil, "modifier_shapeshift_speed_lua", {})
  1182.         elseif (name == "npc_dota_dragon_child" or name == "npc_dota_dragon_junior" or name == "npc_dota_dragon_adult" or name == "npc_dota_dragon_veteran" or name == "npc_dota_dragon_myth" or
  1183. name == "npc_dota_roshan_dragon" or name == "npc_dota_dragon1" or name == "npc_dota_dragon2") and self.jakiro_buff==1 then
  1184.             local ability = npc:FindAbilityByName("jakiro_buff")
  1185.             ability:ApplyDataDrivenModifier(npc, npc, "modifier_jakiro_buff", {})
  1186.         elseif (name == "npc_dota_ursa_child" or name == "npc_dota_ursa_junior" or name == "npc_dota_ursa_adult" or name == "npc_dota_ursa_veteran" or name == "npc_dota_ursa_myth" or
  1187. name == "npc_dota_roshan_ursa" or name == "npc_dota_ursa1" or name == "npc_dota_ursa2") and self.ursa_buff==1 then
  1188.             local ability = npc:FindAbilityByName("ursa_buff")
  1189.             ability:ApplyDataDrivenModifier(npc, npc, "modifier_ursa_buff", {})
  1190.             npc:AddNewModifier(nil, nil, "modifier_shapeshift_speed_lua", {})
  1191.         elseif (name == "npc_dota_ursa_child" or name == "npc_dota_ursa_junior" or name == "npc_dota_ursa_adult" or name == "npc_dota_ursa_veteran" or name == "npc_dota_ursa_myth" or
  1192. name == "npc_dota_roshan_ursa" or name == "npc_dota_ursa1" or name == "npc_dota_ursa2") and self.druid_buff==1 then
  1193.             local ability = npc:FindAbilityByName("druid_buff")
  1194.             ability:ApplyDataDrivenModifier(npc, npc, "modifier_druid_buff", {})
  1195.         elseif (name == "npc_dota_ogre_child" or name == "npc_dota_ogre_junior" or name == "npc_dota_ogre_adult" or name == "npc_dota_ogre_veteran" or name == "npc_dota_ogre_myth" or
  1196. name == "npc_dota_roshan_ogre" or name == "npc_dota_ogre1" or name == "npc_dota_ogre2") and self.ogre_buff==1 then
  1197.             local ability = npc:FindAbilityByName("ogre_buff")
  1198.             ability:ApplyDataDrivenModifier(npc, npc, "modifier_ogre_buff", {})
  1199.             npc:AddNewModifier(nil, nil, "modifier_shapeshift_speed_lua", {})
  1200.         elseif (name == "npc_dota_golem_child" or name == "npc_dota_golem_junior" or name == "npc_dota_golem_adult" or name == "npc_dota_golem_veteran" or name == "npc_dota_golem_myth" or
  1201. name == "npc_dota_roshan_golem" or name == "npc_dota_golem1" or name == "npc_dota_golem2" or name == "npc_dota_golem3" or name == "npc_dota_golem4") and self.tiny_buff==1 then
  1202.             local ability = npc:FindAbilityByName("tiny_buff")
  1203.             ability:ApplyDataDrivenModifier(npc, npc, "modifier_tiny_buff", {})
  1204.             npc:AddNewModifier(nil, nil, "modifier_shapeshift_speed_lua", {})
  1205.         elseif (name == "npc_dota_wolf_child" or name == "npc_dota_wolf_junior" or name == "npc_dota_wolf_adult" or name == "npc_dota_wolf_veteran" or name == "npc_dota_wolf_myth" or
  1206. name == "npc_dota_roshan_wolf" or name == "npc_dota_wolf1" or name == "npc_dota_wolf2") and self.lycan_buff==1 then
  1207.             local ability = npc:FindAbilityByName("lycan_buff")
  1208.             ability:ApplyDataDrivenModifier(npc, npc, "modifier_lycan_buff", {})
  1209.         elseif (name == "npc_dota_kobold_child" or name == "npc_dota_kobold_junior" or name == "npc_dota_kobold_adult" or name == "npc_dota_kobold_veteran" or name == "npc_dota_kobold_myth" or
  1210. name == "npc_dota_roshan_kobold" or name == "npc_dota_kobold1" or name == "npc_dota_kobold2" or name == "npc_dota_kobold3" or name == "npc_dota_kobold4") and self.meepo_buff==1 then
  1211.             local ability = npc:FindAbilityByName("meepo_buff")
  1212.             ability:ApplyDataDrivenModifier(npc, npc, "modifier_meepo_buff", {})
  1213.        
  1214.         end
  1215.     end
  1216.    
  1217.     if (name == "npc_dota_troll1" or name == "npc_dota_troll2" or name == "npc_dota_troll3" or name == "npc_dota_troll4"
  1218.     or name == "npc_dota_roshan_troll" or name == "npc_dota_roshan_centaur" or name == "npc_dota_roshan_satyr" or name == "npc_dota_roshan_dragon"
  1219.     or name == "npc_dota_roshan_ursa" or name == "npc_dota_roshan_ogre" or name == "npc_dota_roshan_golem" or name == "npc_dota_roshan_wolf"  or name == "npc_dota_roshan_kobold"
  1220.     or name == "npc_dota_centaur1" or name == "npc_dota_centaur2"
  1221.     or name == "npc_dota_satyr1" or name == "npc_dota_satyr2" or name == "npc_dota_satyr3"  
  1222.     or name == "npc_dota_dragon1" or name == "npc_dota_dragon2"
  1223.     or name == "npc_dota_ursa1" or name == "npc_dota_ursa2"
  1224.     or name == "npc_dota_ogre1" or name == "npc_dota_ogre2"
  1225.     or name == "npc_dota_golem1" or name == "npc_dota_golem2" or name == "npc_dota_golem3" or name == "npc_dota_golem4"
  1226.     or name == "npc_dota_wolf1" or name == "npc_dota_wolf2"
  1227.     or name == "npc_dota_kobold_child" or name == "npc_dota_kobold_junior" or name == "npc_dota_kobold_adult" or name == "npc_dota_kobold_veteran" or name == "npc_dota_kobold_myth"
  1228.     or name == "npc_dota_wolf_child" or name == "npc_dota_wolf_junior" or name == "npc_dota_wolf_adult" or name == "npc_dota_wolf_veteran" or name == "npc_dota_wolf_myth"
  1229.     or name == "npc_dota_golem_child" or name == "npc_dota_golem_junior" or name == "npc_dota_golem_adult" or name == "npc_dota_golem_veteran" or name == "npc_dota_golem_myth"
  1230.     or name == "npc_dota_ogre_child" or name == "npc_dota_ogre_junior" or name == "npc_dota_ogre_adult" or name == "npc_dota_ogre_veteran" or name == "npc_dota_ogre_myth"
  1231.     or name == "npc_dota_ursa_child" or name == "npc_dota_ursa_junior" or name == "npc_dota_ursa_adult" or name == "npc_dota_ursa_veteran" or name == "npc_dota_ursa_myth"
  1232.     or name == "npc_dota_dragon_child" or name == "npc_dota_dragon_junior" or name == "npc_dota_dragon_adult" or name == "npc_dota_dragon_veteran" or name == "npc_dota_dragon_myth"
  1233.     or name == "npc_dota_troll_child" or name == "npc_dota_troll_junior" or name == "npc_dota_troll_adult" or name == "npc_dota_troll_veteran" or name == "npc_dota_troll_myth"
  1234.     or name == "npc_dota_satyr_child" or name == "npc_dota_satyr_junior" or name == "npc_dota_satyr_adult" or name == "npc_dota_satyr_veteran" or name == "npc_dota_satyr_myth"
  1235.     or name == "npc_dota_centaur_child" or name == "npc_dota_centaur_junior" or name == "npc_dota_centaur_adult" or name == "npc_dota_centaur_veteran" or name == "npc_dota_centaur_myth"
  1236.     or name == "npc_dota_kobold1" or name == "npc_dota_kobold2" or name == "npc_dota_kobold3" or name == "npc_dota_kobold4") and self.beastmaster_buff==1 then
  1237.         local ability = npc:FindAbilityByName("beastmaster_buff")
  1238.         ability:ApplyDataDrivenModifier(npc, npc, "modifier_beastmaster_buff", {})
  1239.     end
  1240.    
  1241.     if (name == "npc_dota_troll1" or name == "npc_dota_troll2" or name == "npc_dota_troll3" or name == "npc_dota_troll4"
  1242.     or name == "npc_dota_roshan_troll" or name == "npc_dota_roshan_centaur" or name == "npc_dota_roshan_satyr" or name == "npc_dota_roshan_dragon"
  1243.     or name == "npc_dota_roshan_ursa" or name == "npc_dota_roshan_ogre" or name == "npc_dota_roshan_golem" or name == "npc_dota_roshan_wolf"  or name == "npc_dota_roshan_kobold"
  1244.     or name == "npc_dota_centaur1" or name == "npc_dota_centaur2"
  1245.     or name == "npc_dota_satyr1" or name == "npc_dota_satyr2" or name == "npc_dota_satyr3"  
  1246.     or name == "npc_dota_dragon1" or name == "npc_dota_dragon2"
  1247.     or name == "npc_dota_ursa1" or name == "npc_dota_ursa2"
  1248.     or name == "npc_dota_ogre1" or name == "npc_dota_ogre2"
  1249.     or name == "npc_dota_golem1" or name == "npc_dota_golem2" or name == "npc_dota_golem3" or name == "npc_dota_golem4"
  1250.     or name == "npc_dota_wolf1" or name == "npc_dota_wolf2"
  1251.     or name == "npc_dota_kobold_child" or name == "npc_dota_kobold_junior" or name == "npc_dota_kobold_adult" or name == "npc_dota_kobold_veteran" or name == "npc_dota_kobold_myth"
  1252.     or name == "npc_dota_wolf_child" or name == "npc_dota_wolf_junior" or name == "npc_dota_wolf_adult" or name == "npc_dota_wolf_veteran" or name == "npc_dota_wolf_myth"
  1253.     or name == "npc_dota_golem_child" or name == "npc_dota_golem_junior" or name == "npc_dota_golem_adult" or name == "npc_dota_golem_veteran" or name == "npc_dota_golem_myth"
  1254.     or name == "npc_dota_ogre_child" or name == "npc_dota_ogre_junior" or name == "npc_dota_ogre_adult" or name == "npc_dota_ogre_veteran" or name == "npc_dota_ogre_myth"
  1255.     or name == "npc_dota_ursa_child" or name == "npc_dota_ursa_junior" or name == "npc_dota_ursa_adult" or name == "npc_dota_ursa_veteran" or name == "npc_dota_ursa_myth"
  1256.     or name == "npc_dota_dragon_child" or name == "npc_dota_dragon_junior" or name == "npc_dota_dragon_adult" or name == "npc_dota_dragon_veteran" or name == "npc_dota_dragon_myth"
  1257.     or name == "npc_dota_troll_child" or name == "npc_dota_troll_junior" or name == "npc_dota_troll_adult" or name == "npc_dota_troll_veteran" or name == "npc_dota_troll_myth"
  1258.     or name == "npc_dota_satyr_child" or name == "npc_dota_satyr_junior" or name == "npc_dota_satyr_adult" or name == "npc_dota_satyr_veteran" or name == "npc_dota_satyr_myth"
  1259.     or name == "npc_dota_centaur_child" or name == "npc_dota_centaur_junior" or name == "npc_dota_centaur_adult" or name == "npc_dota_centaur_veteran" or name == "npc_dota_centaur_myth"
  1260.     or name == "npc_dota_kobold1" or name == "npc_dota_kobold2" or name == "npc_dota_kobold3" or name == "npc_dota_kobold4") and self.chen_buff==1 then
  1261.         local ability = npc:FindAbilityByName("chen_buff")
  1262.         ability:ApplyDataDrivenModifier(npc, npc, "modifier_chen_buff", {})
  1263.         npc:AddNewModifier(npc, nil, "modifier_chen_buff1", {})
  1264.     end
  1265.    
  1266.     if name == "npc_dota_papich" then
  1267.         EmitGlobalSound("roshan_def.reincarnate")              
  1268.         end
  1269. end
  1270. function Spawn:OnGameRulesStateChange()
  1271.     local newState = GameRules:State_Get()
  1272.         if newState == DOTA_GAMERULES_STATE_PRE_GAME then
  1273.             Spawn:SecretTreeSpawn()
  1274.             Spawn:SecretBoxSpawn()
  1275.     --      Spawn:DireTideTreeSpawner()
  1276.             --Spawn:BoxSpawner()
  1277.         end    
  1278.         if newState == DOTA_GAMERULES_STATE_GAME_IN_PROGRESS then
  1279.             EmitGlobalSound("narod_pognali")
  1280. --          EmitGlobalSound("shadow_demon_shadow_demon_ability_shadow_poison_01")          
  1281.             Spawn:DireSpawner1()
  1282.             Spawn:NeutralSpawner()
  1283. --          Spawn:NeutralSpawnerEvent()
  1284.             Spawn:DireBossSpawner()
  1285.             --Spawn:BoxSpawner()
  1286.             Spawn:SetWDToHost()        
  1287.         end
  1288. end
  1289.  
  1290. function Spawn:SecretBoxSpawn() -- Функция начнет выполняться, когда начнется матч( на часах будет 00:00 ).
  1291.     print("that work !!!")
  1292.     local k = math.random(1,5)
  1293.     print("k= "..k)
  1294.     local point = Entities:FindByName( nil, "secret_chest_"..k):GetAbsOrigin() -- Записываем в переменную 'point' координаты нашего спавнера 'spawnerino'
  1295.     if point then print("point available !!!") end
  1296.     local unit = CreateUnitByName( "npc_dota_secret_box" , point, true, nil, nil, DOTA_TEAM_NEUTRALS )
  1297.  end
  1298. function Spawn:SecretTreeSpawn() -- Функция начнет выполняться, когда начнется матч( на часах будет 00:00 ).
  1299.         for i=1,7 do
  1300.             local trees = Entities:FindAllByName("secret_tree_"..i)
  1301.             local length = #trees
  1302.             print("length = "..length)
  1303.             if length == 0 then
  1304.                 print("secret_tree_"..i.." not detected !")
  1305.             else
  1306.                 local tree = trees[RandomInt(1,length)]
  1307.                 local point = tree:GetAbsOrigin() -- Записываем в переменную 'point' координаты нашего спавнера 'spawnerino'
  1308.                 local unit = CreateUnitByName( "npc_dota_secret_tree1" , point, true, nil, nil, DOTA_TEAM_NEUTRALS )               
  1309.                 local ability = unit:FindAbilityByName("set_color")
  1310.                 if ability then ability:SetLevel(1) end
  1311.             end
  1312.         end    
  1313.         for i=8,11 do
  1314.             local trees = Entities:FindAllByName("secret_tree_"..i)
  1315.             local length = #trees
  1316.             print("length = "..length)
  1317.             if length == 0 then
  1318.                 print("secret_tree_"..i.." not detected !")
  1319.             else
  1320.                 local tree = trees[RandomInt(1,length)]
  1321.                 local point = tree:GetAbsOrigin() -- Записываем в переменную 'point' координаты нашего спавнера 'spawnerino'
  1322.                 local unit = CreateUnitByName( "npc_dota_secret_tree2" , point, true, nil, nil, DOTA_TEAM_NEUTRALS )               
  1323.             end
  1324.         end    
  1325.  end
  1326.  function Spawn:DireTideTreeSpawner() -- Функция начнет выполняться, когда начнется матч( на часах будет 00:00 ).
  1327.         for i=3,11 do
  1328.             for k=1,5 do
  1329.                 local point = Entities:FindByName( nil, "secret_tree_"..i.."_"..k):GetAbsOrigin() -- Записываем в переменную 'point' координаты нашего спавнера 'spawnerino'
  1330.                 local unit = CreateUnitByName( "npc_dota_halloween_treant" , point, true, nil, nil, DOTA_TEAM_BADGUYS )
  1331.             end
  1332.         end
  1333.        
  1334.  end
  1335.  
  1336. function Spawn:DireSpawner1() -- Функция начнет выполняться, когда начнется матч( на часах будет 00:00 ).
  1337.       local point = Entities:FindByName( nil, "dmpoint1"):GetAbsOrigin() -- Записываем в переменную 'point' координаты нашего спавнера 'spawnerino'
  1338.       local point1 = Entities:FindByName( nil, "drpoint1"):GetAbsOrigin() -- Записываем в переменную 'point' координаты нашего спавнера 'spawnerino'
  1339.       local waypoint = Entities:FindByName( nil, "d_waypoint11") -- Записываем в переменную 'waypoint' координаты первого бокса way1
  1340.       local return_time = 30 -- Записываем в переменную значение '10'
  1341.       Timers:CreateTimer(20, function()  -- Создаем таймер, который запустится через 15 секунд после начала матча и запустит следующую функцию
  1342.        
  1343.        
  1344.          
  1345.          for i=1, 4 do -- Произведет нижние действия столько раз, сколько указано в ROUND_UNITS. То есть в нашем случае создаст 2 юнита.
  1346.               local unit = CreateUnitByName( "npc_dota_dire1" , point + RandomVector( RandomFloat( 0, 200 ) ), true, nil, nil, DOTA_TEAM_BADGUYS ) --[[ Создаем юнита 'example_unit_', в конце к названию добавится 1,2,3,4 или 5, в зависимости от раунда, и в итоге получатся наши example_unit_1, example_unit_2 и т.д. Юнит появится в векторе point + RandomVector (RandomFloat( 0, 200 ) ) - point - наша переменная, а рандомный вектор добавляется для того, чтобы мобы не появлялись в одной точке и не застревали. Мобы будут за силы света. ]]
  1347.          unit:SetInitialGoalEntity( waypoint ) -- Посылаем мобов на наш way1, координаты которого мы записали в переменную 'waypoint'
  1348.          end
  1349.          if GameRules:GetDOTATime(false,false)>300 then
  1350.             local unit = CreateUnitByName( "npc_dota_dire2", point + RandomVector( RandomFloat( 0, 200 ) ), true, nil, nil, DOTA_TEAM_BADGUYS ) --[[ Создаем юнита 'example_unit_', в конце к названию добавится 1,2,3,4 или 5, в зависимости от раунда, и в итоге получатся наши example_unit_1, example_unit_2 и т.д. Юнит появится в векторе point + RandomVector (RandomFloat( 0, 200 ) ) - point - наша переменная, а рандомный вектор добавляется для того, чтобы мобы не появлялись в одной точке и не застревали. Мобы будут за силы света. ]]
  1351.          unit:SetInitialGoalEntity( waypoint ) -- Посылаем мобов на наш way1, координаты которого мы записали в переменную 'waypoint'
  1352.          end
  1353.          if GameRules:GetDOTATime(false,false)>900 then
  1354.                 local unit = CreateUnitByName( "npc_dota_dire3" , point + RandomVector( RandomFloat( 0, 200 ) ), true, nil, nil, DOTA_TEAM_BADGUYS ) --[[ Создаем юнита 'example_unit_', в конце к названию добавится 1,2,3,4 или 5, в зависимости от раунда, и в итоге получатся наши example_unit_1, example_unit_2 и т.д. Юнит появится в векторе point + RandomVector (RandomFloat( 0, 200 ) ) - point - наша переменная, а рандомный вектор добавляется для того, чтобы мобы не появлялись в одной точке и не застревали. Мобы будут за силы света. ]]
  1355.                 unit:SetInitialGoalEntity( waypoint ) -- Посылаем мобов на наш way1, координаты которого мы записали в переменную 'waypoint'
  1356.  
  1357.         end
  1358.          if GameRules:GetDOTATime(false,false)>1500 then
  1359.             if RandomInt(1,100)>50 then
  1360.                 local unit = CreateUnitByName( "npc_dota_dire4_1" , point + RandomVector( RandomFloat( 0, 200 ) ), true, nil, nil, DOTA_TEAM_BADGUYS ) --[[ Создаем юнита 'example_unit_', в конце к названию добавится 1,2,3,4 или 5, в зависимости от раунда, и в итоге получатся наши example_unit_1, example_unit_2 и т.д. Юнит появится в векторе point + RandomVector (RandomFloat( 0, 200 ) ) - point - наша переменная, а рандомный вектор добавляется для того, чтобы мобы не появлялись в одной точке и не застревали. Мобы будут за силы света. ]]
  1361.                 unit:SetInitialGoalEntity( waypoint ) -- Посылаем мобов на наш way1, координаты которого мы записали в переменную 'waypoint'
  1362.             else
  1363.                 local unit = CreateUnitByName( "npc_dota_dire4_2" , point + RandomVector( RandomFloat( 0, 200 ) ), true, nil, nil, DOTA_TEAM_BADGUYS ) --[[ Создаем юнита 'example_unit_', в конце к названию добавится 1,2,3,4 или 5, в зависимости от раунда, и в итоге получатся наши example_unit_1, example_unit_2 и т.д. Юнит появится в векторе point + RandomVector (RandomFloat( 0, 200 ) ) - point - наша переменная, а рандомный вектор добавляется для того, чтобы мобы не появлялись в одной точке и не застревали. Мобы будут за силы света. ]]
  1364.                 unit:SetInitialGoalEntity( waypoint ) -- Посылаем мобов на наш way1, координаты которого мы записали в переменную 'waypoint'
  1365.             end
  1366.         end
  1367.        
  1368.         if GameRules:GetDOTATime(false,false)>2100 then
  1369.        
  1370.             if RandomInt(1,100)>50 then
  1371.                 local unit = CreateUnitByName( "npc_dota_dire5_1" , point + RandomVector( RandomFloat( 0, 200 ) ), true, nil, nil, DOTA_TEAM_BADGUYS ) --[[ Создаем юнита 'example_unit_', в конце к названию добавится 1,2,3,4 или 5, в зависимости от раунда, и в итоге получатся наши example_unit_1, example_unit_2 и т.д. Юнит появится в векторе point + RandomVector (RandomFloat( 0, 200 ) ) - point - наша переменная, а рандомный вектор добавляется для того, чтобы мобы не появлялись в одной точке и не застревали. Мобы будут за силы света. ]]
  1372.                 unit:SetInitialGoalEntity( waypoint ) -- Посылаем мобов на наш way1, координаты которого мы записали в переменную 'waypoint'
  1373.             elseif RandomInt(1,100)<101 then
  1374.                 local unit = CreateUnitByName( "npc_dota_dire5_2", point + RandomVector( RandomFloat( 0, 200 ) ), true, nil, nil, DOTA_TEAM_BADGUYS ) --[[ Создаем юнита 'example_unit_', в конце к названию добавится 1,2,3,4 или 5, в зависимости от раунда, и в итоге получатся наши example_unit_1, example_unit_2 и т.д. Юнит появится в векторе point + RandomVector (RandomFloat( 0, 200 ) ) - point - наша переменная, а рандомный вектор добавляется для того, чтобы мобы не появлялись в одной точке и не застревали. Мобы будут за силы света. ]]
  1375.                 unit:SetInitialGoalEntity( waypoint ) -- Посылаем мобов на наш way1, координаты которого мы записали в переменную 'waypoint'
  1376.             end
  1377.         end
  1378.  
  1379.          for j=1,1 do
  1380.             local unit = CreateUnitByName( "npc_dota_direr1", point1 + RandomVector( RandomFloat( 0, 200 ) ), true, nil, nil, DOTA_TEAM_BADGUYS ) --[[ Создаем юнита 'example_unit_', в конце к названию добавится 1,2,3,4 или 5, в зависимости от раунда, и в итоге получатся наши example_unit_1, example_unit_2 и т.д. Юнит появится в векторе point + RandomVector (RandomFloat( 0, 200 ) ) - point - наша переменная, а рандомный вектор добавляется для того, чтобы мобы не появлялись в одной точке и не застревали. Мобы будут за силы света. ]]
  1381.          unit:SetInitialGoalEntity( waypoint ) -- Посылаем мобов на наш way1, координаты которого мы записали в переменную 'waypoint'
  1382.          end
  1383.          
  1384.          if GameRules:GetDOTATime(false,false)>600 then
  1385.             local unit = CreateUnitByName( "npc_dota_direr2" , point1 + RandomVector( RandomFloat( 0, 200 ) ), true, nil, nil, DOTA_TEAM_BADGUYS ) --[[ Создаем юнита 'example_unit_', в конце к названию добавится 1,2,3,4 или 5, в зависимости от раунда, и в итоге получатся наши example_unit_1, example_unit_2 и т.д. Юнит появится в векторе point + RandomVector (RandomFloat( 0, 200 ) ) - point - наша переменная, а рандомный вектор добавляется для того, чтобы мобы не появлялись в одной точке и не застревали. Мобы будут за силы света. ]]
  1386.          unit:SetInitialGoalEntity( waypoint ) -- Посылаем мобов на наш way1, координаты которого мы записали в переменную 'waypoint'
  1387.          end
  1388.          if GameRules:GetDOTATime(false,false)>1200 then
  1389.             if RandomInt(1,100)>67 then
  1390.                 local unit = CreateUnitByName( "npc_dota_direr3_1" , point1 + RandomVector( RandomFloat( 0, 200 ) ), true, nil, nil, DOTA_TEAM_BADGUYS ) --[[ Создаем юнита 'example_unit_', в конце к названию добавится 1,2,3,4 или 5, в зависимости от раунда, и в итоге получатся наши example_unit_1, example_unit_2 и т.д. Юнит появится в векторе point + RandomVector (RandomFloat( 0, 200 ) ) - point - наша переменная, а рандомный вектор добавляется для того, чтобы мобы не появлялись в одной точке и не застревали. Мобы будут за силы света. ]]
  1391.                 unit:SetInitialGoalEntity( waypoint ) -- Посылаем мобов на наш way1, координаты которого мы записали в переменную 'waypoint'
  1392.             elseif RandomInt(1,100)>50 then
  1393.                 local unit = CreateUnitByName( "npc_dota_direr3_2" , point1 + RandomVector( RandomFloat( 0, 200 ) ), true, nil, nil, DOTA_TEAM_BADGUYS ) --[[ Создаем юнита 'example_unit_', в конце к названию добавится 1,2,3,4 или 5, в зависимости от раунда, и в итоге получатся наши example_unit_1, example_unit_2 и т.д. Юнит появится в векторе point + RandomVector (RandomFloat( 0, 200 ) ) - point - наша переменная, а рандомный вектор добавляется для того, чтобы мобы не появлялись в одной точке и не застревали. Мобы будут за силы света. ]]
  1394.                 unit:SetInitialGoalEntity( waypoint ) -- Посылаем мобов на наш way1, координаты которого мы записали в переменную 'waypoint'
  1395.             elseif RandomInt(1,100)<101 then
  1396.                 local unit = CreateUnitByName( "npc_dota_direr3_3", point1 + RandomVector( RandomFloat( 0, 200 ) ), true, nil, nil, DOTA_TEAM_BADGUYS ) --[[ Создаем юнита 'example_unit_', в конце к названию добавится 1,2,3,4 или 5, в зависимости от раунда, и в итоге получатся наши example_unit_1, example_unit_2 и т.д. Юнит появится в векторе point + RandomVector (RandomFloat( 0, 200 ) ) - point - наша переменная, а рандомный вектор добавляется для того, чтобы мобы не появлялись в одной точке и не застревали. Мобы будут за силы света. ]]
  1397.                 unit:SetInitialGoalEntity( waypoint ) -- Посылаем мобов на наш way1, координаты которого мы записали в переменную 'waypoint'
  1398.             end
  1399.          end
  1400.          
  1401.          if GameRules:GetDOTATime(false,false)>2100 then
  1402.        
  1403.            
  1404.                 local unit = CreateUnitByName( "npc_dota_direr4" , point + RandomVector( RandomFloat( 0, 200 ) ), true, nil, nil, DOTA_TEAM_BADGUYS ) --[[ Создаем юнита 'example_unit_', в конце к названию добавится 1,2,3,4 или 5, в зависимости от раунда, и в итоге получатся наши example_unit_1, example_unit_2 и т.д. Юнит появится в векторе point + RandomVector (RandomFloat( 0, 200 ) ) - point - наша переменная, а рандомный вектор добавляется для того, чтобы мобы не появлялись в одной точке и не застревали. Мобы будут за силы света. ]]
  1405.                 unit:SetInitialGoalEntity( waypoint ) -- Посылаем мобов на наш way1, координаты которого мы записали в переменную 'waypoint'
  1406.        
  1407.         end
  1408.           if self.DireSpawner~= 1  then return return_time  end-- Возвращаем таймеру время, через которое он должен снова сработать. Когда пройдет последний раунд таймер получит значение 'nil' и выключится.
  1409.       end)
  1410. end
  1411. function Spawn:DireSpawner2() -- Функция начнет выполняться, когда начнется матч( на часах будет 00:00 ).
  1412.       local point = Entities:FindByName( nil, "dmpoint2"):GetAbsOrigin() -- Записываем в переменную 'point' координаты нашего спавнера 'spawnerino'
  1413.       local point1 = Entities:FindByName( nil, "drpoint2"):GetAbsOrigin() -- Записываем в переменную 'point' координаты нашего спавнера 'spawnerino'
  1414.       local waypoint = Entities:FindByName( nil, "d_waypoint1") -- Записываем в переменную 'waypoint' координаты первого бокса way1
  1415.       local return_time = 30 -- Записываем в переменную значение '10'
  1416.       Timers:CreateTimer(10, function()  -- Создаем таймер, который запустится через 15 секунд после начала матча и запустит следующую функцию
  1417. --      if GameRules.EndGame ~= 1 then
  1418.            
  1419.              
  1420.              for i=1, 4 do -- Произведет нижние действия столько раз, сколько указано в ROUND_UNITS. То есть в нашем случае создаст 2 юнита.
  1421.                 local unit = CreateUnitByName( "npc_dota_dire" .. 1, point + RandomVector( RandomFloat( 0, 200 ) ), true, nil, nil, DOTA_TEAM_BADGUYS ) --[[ Создаем юнита 'example_unit_', в конце к названию добавится 1,2,3,4 или 5, в зависимости от раунда, и в итоге получатся наши example_unit_1, example_unit_2 и т.д. Юнит появится в векторе point + RandomVector (RandomFloat( 0, 200 ) ) - point - наша переменная, а рандомный вектор добавляется для того, чтобы мобы не появлялись в одной точке и не застревали. Мобы будут за силы света. ]]
  1422.                 unit:SetInitialGoalEntity( waypoint ) -- Посылаем мобов на наш way1, координаты которого мы записали в переменную 'waypoint'
  1423.              end
  1424.              
  1425.                 local unit = CreateUnitByName( "npc_dota_dire" .. 2, point + RandomVector( RandomFloat( 0, 200 ) ), true, nil, nil, DOTA_TEAM_BADGUYS ) --[[ Создаем юнита 'example_unit_', в конце к названию добавится 1,2,3,4 или 5, в зависимости от раунда, и в итоге получатся наши example_unit_1, example_unit_2 и т.д. Юнит появится в векторе point + RandomVector (RandomFloat( 0, 200 ) ) - point - наша переменная, а рандомный вектор добавляется для того, чтобы мобы не появлялись в одной точке и не застревали. Мобы будут за силы света. ]]
  1426.              unit:SetInitialGoalEntity( waypoint ) -- Посылаем мобов на наш way1, координаты которого мы записали в переменную 'waypoint'
  1427.              
  1428.              
  1429.                 local unit = CreateUnitByName( "npc_dota_dire" .. 3, point + RandomVector( RandomFloat( 0, 200 ) ), true, nil, nil, DOTA_TEAM_BADGUYS ) --[[ Создаем юнита 'example_unit_', в конце к названию добавится 1,2,3,4 или 5, в зависимости от раунда, и в итоге получатся наши example_unit_1, example_unit_2 и т.д. Юнит появится в векторе point + RandomVector (RandomFloat( 0, 200 ) ) - point - наша переменная, а рандомный вектор добавляется для того, чтобы мобы не появлялись в одной точке и не застревали. Мобы будут за силы света. ]]
  1430.              unit:SetInitialGoalEntity( waypoint ) -- Посылаем мобов на наш way1, координаты которого мы записали в переменную 'waypoint'
  1431.              
  1432.            
  1433.                 if RandomInt(1,100)>50 then
  1434.                     local unit = CreateUnitByName( "npc_dota_dire4_1" , point + RandomVector( RandomFloat( 0, 200 ) ), true, nil, nil, DOTA_TEAM_BADGUYS ) --[[ Создаем юнита 'example_unit_', в конце к названию добавится 1,2,3,4 или 5, в зависимости от раунда, и в итоге получатся наши example_unit_1, example_unit_2 и т.д. Юнит появится в векторе point + RandomVector (RandomFloat( 0, 200 ) ) - point - наша переменная, а рандомный вектор добавляется для того, чтобы мобы не появлялись в одной точке и не застревали. Мобы будут за силы света. ]]
  1435.                     unit:SetInitialGoalEntity( waypoint ) -- Посылаем мобов на наш way1, координаты которого мы записали в переменную 'waypoint'
  1436.                 else
  1437.                     local unit = CreateUnitByName( "npc_dota_dire4_2", point + RandomVector( RandomFloat( 0, 200 ) ), true, nil, nil, DOTA_TEAM_BADGUYS ) --[[ Создаем юнита 'example_unit_', в конце к названию добавится 1,2,3,4 или 5, в зависимости от раунда, и в итоге получатся наши example_unit_1, example_unit_2 и т.д. Юнит появится в векторе point + RandomVector (RandomFloat( 0, 200 ) ) - point - наша переменная, а рандомный вектор добавляется для того, чтобы мобы не появлялись в одной точке и не застревали. Мобы будут за силы света. ]]
  1438.                     unit:SetInitialGoalEntity( waypoint ) -- Посылаем мобов на наш way1, координаты которого мы записали в переменную 'waypoint'
  1439.                 end
  1440.            
  1441.                 if RandomInt(1,100)>50 then
  1442.                     local unit = CreateUnitByName( "npc_dota_dire5_1" , point + RandomVector( RandomFloat( 0, 200 ) ), true, nil, nil, DOTA_TEAM_BADGUYS ) --[[ Создаем юнита 'example_unit_', в конце к названию добавится 1,2,3,4 или 5, в зависимости от раунда, и в итоге получатся наши example_unit_1, example_unit_2 и т.д. Юнит появится в векторе point + RandomVector (RandomFloat( 0, 200 ) ) - point - наша переменная, а рандомный вектор добавляется для того, чтобы мобы не появлялись в одной точке и не застревали. Мобы будут за силы света. ]]
  1443.                     unit:SetInitialGoalEntity( waypoint ) -- Посылаем мобов на наш way1, координаты которого мы записали в переменную 'waypoint'
  1444.                 elseif RandomInt(1,100)<101 then
  1445.                     local unit = CreateUnitByName( "npc_dota_dire5_2", point + RandomVector( RandomFloat( 0, 200 ) ), true, nil, nil, DOTA_TEAM_BADGUYS ) --[[ Создаем юнита 'example_unit_', в конце к названию добавится 1,2,3,4 или 5, в зависимости от раунда, и в итоге получатся наши example_unit_1, example_unit_2 и т.д. Юнит появится в векторе point + RandomVector (RandomFloat( 0, 200 ) ) - point - наша переменная, а рандомный вектор добавляется для того, чтобы мобы не появлялись в одной точке и не застревали. Мобы будут за силы света. ]]
  1446.                     unit:SetInitialGoalEntity( waypoint ) -- Посылаем мобов на наш way1, координаты которого мы записали в переменную 'waypoint'
  1447.                 end
  1448.  
  1449.             if GameRules.NecroMode == 1     then     unit = CreateUnitByName( "npc_dota_necro_spawn", point1 + RandomVector( RandomFloat( 0, 200 ) ), true, nil, nil, DOTA_TEAM_BADGUYS )
  1450.                                             else     unit = CreateUnitByName( "npc_dota_direr1", point1 + RandomVector( RandomFloat( 0, 200 ) ), true, nil, nil, DOTA_TEAM_BADGUYS ) --[[ Создаем юнита 'example_unit_', в конце к названию добавится 1,2,3,4 или 5, в зависимости от раунда, и в итоге получатся наши example_unit_1, example_unit_2 и т.д. Юнит появится в векторе point + RandomVector (RandomFloat( 0, 200 ) ) - point - наша переменная, а рандомный вектор добавляется для того, чтобы мобы не появлялись в одной точке и не застревали. Мобы будут за силы света. ]]
  1451.             end
  1452.              unit:SetInitialGoalEntity( waypoint ) -- Посылаем мобов на наш way1, координаты которого мы записали в переменную 'waypoint'
  1453.              
  1454.              
  1455.             if GameRules.LichMode == 1  then     unit = CreateUnitByName( "npc_dota_lich_spawn", point1 + RandomVector( RandomFloat( 0, 200 ) ), true, nil, nil, DOTA_TEAM_BADGUYS )
  1456.                                         else     unit = CreateUnitByName( "npc_dota_direr2", point1 + RandomVector( RandomFloat( 0, 200 ) ), true, nil, nil, DOTA_TEAM_BADGUYS ) --[[ Создаем юнита 'example_unit_', в конце к названию добавится 1,2,3,4 или 5, в зависимости от раунда, и в итоге получатся наши example_unit_1, example_unit_2 и т.д. Юнит появится в векторе point + RandomVector (RandomFloat( 0, 200 ) ) - point - наша переменная, а рандомный вектор добавляется для того, чтобы мобы не появлялись в одной точке и не застревали. Мобы будут за силы света. ]]
  1457.             end unit:SetInitialGoalEntity( waypoint ) -- Посылаем мобов на наш way1, координаты которого мы записали в переменную 'waypoint'
  1458.            
  1459.              
  1460.                 if RandomInt(1,100)>67 then
  1461.                     local unit = CreateUnitByName( "npc_dota_direr3_1" , point1 + RandomVector( RandomFloat( 0, 200 ) ), true, nil, nil, DOTA_TEAM_BADGUYS ) --[[ Создаем юнита 'example_unit_', в конце к названию добавится 1,2,3,4 или 5, в зависимости от раунда, и в итоге получатся наши example_unit_1, example_unit_2 и т.д. Юнит появится в векторе point + RandomVector (RandomFloat( 0, 200 ) ) - point - наша переменная, а рандомный вектор добавляется для того, чтобы мобы не появлялись в одной точке и не застревали. Мобы будут за силы света. ]]
  1462.                     unit:SetInitialGoalEntity( waypoint ) -- Посылаем мобов на наш way1, координаты которого мы записали в переменную 'waypoint'
  1463.                 elseif RandomInt(1,100)>50 then
  1464.                     local unit = CreateUnitByName( "npc_dota_direr3_2" , point1 + RandomVector( RandomFloat( 0, 200 ) ), true, nil, nil, DOTA_TEAM_BADGUYS ) --[[ Создаем юнита 'example_unit_', в конце к названию добавится 1,2,3,4 или 5, в зависимости от раунда, и в итоге получатся наши example_unit_1, example_unit_2 и т.д. Юнит появится в векторе point + RandomVector (RandomFloat( 0, 200 ) ) - point - наша переменная, а рандомный вектор добавляется для того, чтобы мобы не появлялись в одной точке и не застревали. Мобы будут за силы света. ]]
  1465.                     unit:SetInitialGoalEntity( waypoint ) -- Посылаем мобов на наш way1, координаты которого мы записали в переменную 'waypoint'
  1466.                 elseif RandomInt(1,100)<101 then
  1467.                     local unit = CreateUnitByName( "npc_dota_direr3_3" , point1 + RandomVector( RandomFloat( 0, 200 ) ), true, nil, nil, DOTA_TEAM_BADGUYS ) --[[ Создаем юнита 'example_unit_', в конце к названию добавится 1,2,3,4 или 5, в зависимости от раунда, и в итоге получатся наши example_unit_1, example_unit_2 и т.д. Юнит появится в векторе point + RandomVector (RandomFloat( 0, 200 ) ) - point - наша переменная, а рандомный вектор добавляется для того, чтобы мобы не появлялись в одной точке и не застревали. Мобы будут за силы света. ]]
  1468.                     unit:SetInitialGoalEntity( waypoint ) -- Посылаем мобов на наш way1, координаты которого мы записали в переменную 'waypoint'
  1469.                 end
  1470.                 local unit = CreateUnitByName( "npc_dota_direr4", point1 + RandomVector( RandomFloat( 0, 200 ) ), true, nil, nil, DOTA_TEAM_BADGUYS ) --[[ Создаем юнита 'example_unit_', в конце к названию добавится 1,2,3,4 или 5, в зависимости от раунда, и в итоге получатся наши example_unit_1, example_unit_2 и т.д. Юнит появится в векторе point + RandomVector (RandomFloat( 0, 200 ) ) - point - наша переменная, а рандомный вектор добавляется для того, чтобы мобы не появлялись в одной точке и не застревали. Мобы будут за силы света. ]]
  1471.              unit:SetInitialGoalEntity( waypoint )
  1472.              
  1473.              if GameRules.ChaosMode == 1 then
  1474.                 if RandomInt(1,100)<26 then
  1475.                     local unit = CreateUnitByName( "npc_dota_chaos_minion" , point1 + RandomVector( RandomFloat( 0, 200 ) ), true, nil, nil, DOTA_TEAM_BADGUYS ) --[[ Создаем юнита 'example_unit_', в конце к названию добавится 1,2,3,4 или 5, в зависимости от раунда, и в итоге получатся наши example_unit_1, example_unit_2 и т.д. Юнит появится в векторе point + RandomVector (RandomFloat( 0, 200 ) ) - point - наша переменная, а рандомный вектор добавляется для того, чтобы мобы не появлялись в одной точке и не застревали. Мобы будут за силы света. ]]
  1476.                     unit:SetInitialGoalEntity( waypoint ) -- Посылаем мобов на наш way1, координаты которого мы записали в переменную 'waypoint'          
  1477.                 end
  1478.              end
  1479.              
  1480.              if GameRules.DemonMode == 1 then
  1481.                 if RandomInt(1,100)<26 then
  1482.                     local unit = CreateUnitByName( "npc_dota_demon_splitter" , point1 + RandomVector( RandomFloat( 0, 200 ) ), true, nil, nil, DOTA_TEAM_BADGUYS ) --[[ Создаем юнита 'example_unit_', в конце к названию добавится 1,2,3,4 или 5, в зависимости от раунда, и в итоге получатся наши example_unit_1, example_unit_2 и т.д. Юнит появится в векторе point + RandomVector (RandomFloat( 0, 200 ) ) - point - наша переменная, а рандомный вектор добавляется для того, чтобы мобы не появлялись в одной точке и не застревали. Мобы будут за силы света. ]]
  1483.                     unit:SetInitialGoalEntity( waypoint ) -- Посылаем мобов на наш way1, координаты которого мы записали в переменную 'waypoint'          
  1484.                 end
  1485.              end
  1486. --      end
  1487.           if GameRules.EndGame ~= 1 then return return_time end -- Возвращаем таймеру время, через которое он должен снова сработать. Когда пройдет последний раунд таймер получит значение 'nil' и выключится.
  1488.       end)
  1489. end
  1490.  
  1491. function Spawn:NeutralSpawner() -- Функция начнет выполняться, когда начнется матч( на часах будет 00:00 ).
  1492.       local point = Entities:FindByName( nil, "nmpoint"):GetAbsOrigin() -- Записываем в переменную 'point' координаты нашего спавнера 'spawnerino'
  1493.       local point1 = Entities:FindByName( nil, "nrpoint"):GetAbsOrigin() -- Записываем в переменную 'point' координаты нашего спавнера 'spawnerino'
  1494.       local waypoint = Entities:FindByName( nil, "n_waypoint1") -- Записываем в переменную 'waypoint' координаты первого бокса way1
  1495.       local dire_point = Entities:FindByName( nil, "n_waypoint19"):GetAbsOrigin()
  1496.       local return_time = 30 -- Записываем в переменную значение '10'
  1497.       Timers:CreateTimer(20, function()  -- Создаем таймер, который запустится через 15 секунд после начала матча и запустит следующую функцию
  1498.        
  1499.         if GameRules.RoshanUpgrade ~= 1 and GameRules.MegaMode ~= 1  then
  1500.          
  1501.              for i=1, 4 do -- Произведет нижние действия столько раз, сколько указано в ROUND_UNITS. То есть в нашем случае создаст 2 юнита.
  1502.                  local unit
  1503.                  if RandomInt(1,100)>20 then  unit = CreateUnitByName( "npc_dota_kobold2", point + RandomVector( RandomFloat( 0, 200 ) ), true, nil, nil, DOTA_TEAM_GOODGUYS )
  1504.                 else  unit = CreateUnitByName( "npc_dota_kobold3", point + RandomVector( RandomFloat( 0, 200 ) ), true, nil, nil, DOTA_TEAM_GOODGUYS )
  1505.                 end
  1506.                 --unit:MoveToPositionAggressive(Entities:FindByName( nil, "n_waypoint10"):GetAbsOrigin())
  1507.                 Spawn:AttackMove( unit, dire_point )
  1508.                 --unit:SetInitialGoalEntity( waypoint ) -- Посылаем мобов на наш way1, координаты которого мы записали в переменную 'waypoint'
  1509.              end
  1510.              if (self.golem==2)  then
  1511.                 local unit
  1512.                 if RandomInt(1,100)>20 then  unit = CreateUnitByName( "npc_dota_golem3", point + RandomVector( RandomFloat( 0, 200 ) ), true, nil, nil, DOTA_TEAM_GOODGUYS )
  1513.                 else unit = CreateUnitByName( "npc_dota_golem4", point + RandomVector( RandomFloat( 0, 200 ) ), true, nil, nil, DOTA_TEAM_GOODGUYS )
  1514.                 end
  1515.                 Spawn:AttackMove( unit, dire_point )
  1516. --              unit:SetInitialGoalEntity( waypoint ) -- Посылаем мобов на наш way1, координаты которого мы записали в переменную 'waypoint'
  1517.              elseif (self.golem==1)  then
  1518.                 local unit
  1519.                 if RandomInt(1,100)>20 then  unit = CreateUnitByName( "npc_dota_golem1", point + RandomVector( RandomFloat( 0, 200 ) ), true, nil, nil, DOTA_TEAM_GOODGUYS )
  1520.                 else  unit = CreateUnitByName( "npc_dota_golem2", point + RandomVector( RandomFloat( 0, 200 ) ), true, nil, nil, DOTA_TEAM_GOODGUYS )
  1521.                 end
  1522.                 Spawn:AttackMove( unit, dire_point )
  1523. --              unit:SetInitialGoalEntity( waypoint ) -- Посылаем мобов на наш way1, координаты которого мы записали в переменную 'waypoint'
  1524.  
  1525.              end
  1526.              if self.ursa==1 then
  1527.                 local unit
  1528.                 if RandomInt(1,100)>20 then  unit = CreateUnitByName( "npc_dota_ursa1", point + RandomVector( RandomFloat( 0, 200 ) ), true, nil, nil, DOTA_TEAM_GOODGUYS )
  1529.                 else  unit = CreateUnitByName( "npc_dota_ursa2", point + RandomVector( RandomFloat( 0, 200 ) ), true, nil, nil, DOTA_TEAM_GOODGUYS )
  1530.                 end        
  1531.                 Spawn:AttackMove( unit, dire_point )
  1532. --              unit:SetInitialGoalEntity( waypoint ) -- Посылаем мобов на наш way1, координаты которого мы записали в переменную 'waypoint'
  1533.              end
  1534.              if self.ogre==1 then
  1535.                
  1536.                 if RandomInt(1,100)>20 then  unit = CreateUnitByName( "npc_dota_ogre1", point + RandomVector( RandomFloat( 0, 200 ) ), true, nil, nil, DOTA_TEAM_GOODGUYS )
  1537.                 else  unit = CreateUnitByName( "npc_dota_ogre2", point + RandomVector( RandomFloat( 0, 200 ) ), true, nil, nil, DOTA_TEAM_GOODGUYS )
  1538.                 end        
  1539.                 Spawn:AttackMove( unit, dire_point )
  1540. --              unit:SetInitialGoalEntity( waypoint ) -- Посылаем мобов на наш way1, координаты которого мы записали в переменную 'waypoint'
  1541.              end
  1542.              if self.DireSpawner~=1 then
  1543.                 local unit
  1544.                 if RandomInt(1,100)>20 then  unit = CreateUnitByName( "npc_dota_troll1", point + RandomVector( RandomFloat( 0, 200 ) ), true, nil, nil, DOTA_TEAM_GOODGUYS )
  1545.                 else  unit = CreateUnitByName( "npc_dota_troll2", point + RandomVector( RandomFloat( 0, 200 ) ), true, nil, nil, DOTA_TEAM_GOODGUYS )
  1546.                 end
  1547.                            
  1548.                 Spawn:AttackMove( unit, dire_point )
  1549. --              unit:SetInitialGoalEntity( waypoint ) -- Посылаем мобов на наш way1, координаты которого мы записали в переменную 'waypoint'
  1550.              elseif self.DireSpawner==1 then
  1551.                 local unit
  1552.                 if RandomInt(1,100)>20 then  unit = CreateUnitByName( "npc_dota_troll3", point + RandomVector( RandomFloat( 0, 200 ) ), true, nil, nil, DOTA_TEAM_GOODGUYS )
  1553.                 else  unit = CreateUnitByName( "npc_dota_troll4", point + RandomVector( RandomFloat( 0, 200 ) ), true, nil, nil, DOTA_TEAM_GOODGUYS )
  1554.                 end
  1555.                 Spawn:AttackMove( unit, dire_point )
  1556. --               unit:SetInitialGoalEntity( waypoint ) -- Посылаем мобов на наш way1, координаты которого мы записали в переменную 'waypoint'
  1557.              end
  1558.              
  1559.              if self.wolf==1 then
  1560.                 local unit
  1561.                 if RandomInt(1,100)>20 then  unit = CreateUnitByName( "npc_dota_wolf1", point + RandomVector( RandomFloat( 0, 200 ) ), true, nil, nil, DOTA_TEAM_GOODGUYS )
  1562.                 else  unit = CreateUnitByName( "npc_dota_wolf2", point + RandomVector( RandomFloat( 0, 200 ) ), true, nil, nil, DOTA_TEAM_GOODGUYS )
  1563.                 end        
  1564.                 Spawn:AttackMove( unit, dire_point )
  1565. --              unit:SetInitialGoalEntity( waypoint ) -- Посылаем мобов на наш way1, координаты которого мы записали в переменную 'waypoint'
  1566.              end
  1567.              if self.satyr==1 then
  1568.                 local unit
  1569.                 if RandomInt(1,100)>20 then  unit = CreateUnitByName( "npc_dota_satyr2", point + RandomVector( RandomFloat( 0, 200 ) ), true, nil, nil, DOTA_TEAM_GOODGUYS )
  1570.                 else  unit = CreateUnitByName( "npc_dota_satyr3", point + RandomVector( RandomFloat( 0, 200 ) ), true, nil, nil, DOTA_TEAM_GOODGUYS )
  1571.                 end
  1572.                 Spawn:AttackMove( unit, dire_point )
  1573. --           unit:SetInitialGoalEntity( waypoint ) -- Посылаем мобов на наш way1, координаты которого мы записали в переменную 'waypoint'
  1574.              end
  1575.              if self.dragon==1 then
  1576.                 local unit
  1577.                 if RandomInt(1,100)>20 then  unit = CreateUnitByName( "npc_dota_dragon1", point + RandomVector( RandomFloat( 0, 200 ) ), true, nil, nil, DOTA_TEAM_GOODGUYS )
  1578.                 else  unit = CreateUnitByName( "npc_dota_dragon2", point + RandomVector( RandomFloat( 0, 200 ) ), true, nil, nil, DOTA_TEAM_GOODGUYS )
  1579.                 end
  1580.                 Spawn:AttackMove( unit, dire_point )
  1581. --              unit:SetInitialGoalEntity( waypoint ) -- Посылаем мобов на наш way1, координаты которого мы записали в переменную 'waypoint'
  1582.              end
  1583.              if self.centaur==1 then
  1584.                 local unit
  1585.                 if RandomInt(1,100)>20 then  unit = CreateUnitByName( "npc_dota_centaur1", point + RandomVector( RandomFloat( 0, 200 ) ), true, nil, nil, DOTA_TEAM_GOODGUYS )
  1586.                 else  unit = CreateUnitByName( "npc_dota_centaur2", point + RandomVector( RandomFloat( 0, 200 ) ), true, nil, nil, DOTA_TEAM_GOODGUYS )
  1587.                 end          
  1588.                 Spawn:AttackMove( unit, dire_point )
  1589. --          unit:SetInitialGoalEntity( waypoint ) -- Посылаем мобов на наш way1, координаты которого мы записали в переменную 'waypoint'
  1590.              end
  1591.         end
  1592.          if GameRules.RoshanUpgrade ~= 1 and GameRules.MegaMode ~= 1 then return return_time end
  1593.          
  1594.         end)
  1595. end
  1596.  
  1597.  
  1598. function Spawn:NeutralSpawnerEvent() -- Функция начнет выполняться, когда начнется матч( на часах будет 00:00 ).
  1599.       local point = Entities:FindByName( nil, "nmpoint"):GetAbsOrigin() -- Записываем в переменную 'point' координаты нашего спавнера 'spawnerino'
  1600.       local point1 = Entities:FindByName( nil, "nrpoint"):GetAbsOrigin() -- Записываем в переменную 'point' координаты нашего спавнера 'spawnerino'
  1601.       local waypoint = Entities:FindByName( nil, "n_waypoint1") -- Записываем в переменную 'waypoint' координаты первого бокса way1
  1602.       local dire_point = Entities:FindByName( nil, "n_waypoint19"):GetAbsOrigin()
  1603.       local return_time = 30 -- Записываем в переменную значение '10'
  1604.       local wave_number = 0
  1605.       Timers:CreateTimer(20, function()  -- Создаем таймер, который запустится через 15 секунд после начала матча и запустит следующую функцию
  1606.        
  1607.         if GameRules.MegaMode == 0 and GameRules.EndGame == 0 then
  1608.              for i=1, 3 do -- Произведет нижние действия столько раз, сколько указано в ROUND_UNITS. То есть в нашем случае создаст 2 юнита.
  1609.                 local unit = CreateUnitByName( "npc_dota_kobold3", point + RandomVector( RandomFloat( 0, 200 ) ), true, nil, nil, DOTA_TEAM_GOODGUYS )
  1610.                 Spawn:Upgrade4(unit, 10+0.05*wave_number, 10+wave_number*0.25)
  1611.                 Spawn:AttackMove( unit, dire_point )
  1612.              end
  1613.              
  1614.             local unit = CreateUnitByName( "npc_dota_satyr3", point1 + RandomVector( RandomFloat( 0, 200 ) ), true, nil, nil, DOTA_TEAM_GOODGUYS )
  1615.                 Spawn:Upgrade4(unit, 10+0.05*wave_number, 10+wave_number*0.25)
  1616.             Spawn:AttackMove( unit, dire_point )
  1617.  
  1618.        
  1619.              if GameRules:GetDOTATime(false,false)>300 then
  1620.                 local unit = CreateUnitByName( "npc_dota_wolf2", point + RandomVector( RandomFloat( 0, 200 ) ), true, nil, nil, DOTA_TEAM_GOODGUYS )
  1621.                 Spawn:Upgrade4(unit, 10+0.05*wave_number, 10+wave_number*0.25)
  1622.                 Spawn:AttackMove( unit, dire_point )
  1623.              end        
  1624.  
  1625.              if GameRules:GetDOTATime(false,false)>600 then
  1626.                 local unit = CreateUnitByName( "npc_dota_ursa2", point + RandomVector( RandomFloat( 0, 200 ) ), true, nil, nil, DOTA_TEAM_GOODGUYS )
  1627.                 Spawn:Upgrade4(unit, 10+0.05*wave_number, 10+wave_number*0.25)
  1628.                 Spawn:AttackMove( unit, dire_point )
  1629.              end        
  1630.  
  1631.              if GameRules:GetDOTATime(false,false)>900 then
  1632.                 local unit = CreateUnitByName( "npc_dota_golem4", point + RandomVector( RandomFloat( 0, 200 ) ), true, nil, nil, DOTA_TEAM_GOODGUYS )
  1633.                 Spawn:Upgrade4(unit, 10+0.05*wave_number, 10+wave_number*0.25)
  1634.                 Spawn:AttackMove( unit, dire_point )
  1635.              end
  1636.              
  1637.              if GameRules:GetDOTATime(false,false)>1200 then
  1638.                 local unit = CreateUnitByName( "npc_dota_troll4", point1 + RandomVector( RandomFloat( 0, 200 ) ), true, nil, nil, DOTA_TEAM_GOODGUYS )
  1639.                 Spawn:Upgrade4(unit, 10+0.05*wave_number, 15+wave_number*0.25)
  1640.                 Spawn:AttackMove( unit, dire_point )
  1641.              end        
  1642.  
  1643.              if GameRules:GetDOTATime(false,false)>1500 then
  1644.                 local unit = CreateUnitByName( "npc_dota_ogre2", point + RandomVector( RandomFloat( 0, 200 ) ), true, nil, nil, DOTA_TEAM_GOODGUYS )
  1645.                 Spawn:Upgrade4(unit, 10+0.05*wave_number, 15+wave_number*0.25)
  1646.                 Spawn:AttackMove( unit, dire_point )
  1647.              end
  1648.              
  1649.              if GameRules:GetDOTATime(false,false)>1800 then
  1650.                 local unit = CreateUnitByName( "npc_dota_centaur2", point + RandomVector( RandomFloat( 0, 200 ) ), true, nil, nil, DOTA_TEAM_GOODGUYS )
  1651.                 Spawn:Upgrade4(unit, 10+0.05*wave_number, 25+wave_number*0.5)
  1652.                 Spawn:AttackMove( unit, dire_point )
  1653.              end        
  1654.  
  1655.              if GameRules:GetDOTATime(false,false)>2100 then
  1656.                 local unit = CreateUnitByName( "npc_dota_dragon2", point1 + RandomVector( RandomFloat( 0, 200 ) ), true, nil, nil, DOTA_TEAM_GOODGUYS )
  1657.                 Spawn:Upgrade4(unit, 10+0.05*wave_number, 25+wave_number*0.5)
  1658.                 Spawn:AttackMove( unit, dire_point )
  1659.              end  
  1660.              
  1661.             wave_number = wave_number + 1
  1662.  
  1663.         end
  1664.         return return_time
  1665.          
  1666.         end)
  1667. end
  1668.  
  1669.  
  1670. function Spawn:MegaNeutralSpawner() -- Функция начнет выполняться, когда начнется матч( на часах будет 00:00 ).
  1671.       local point = Entities:FindByName( nil, "nmpoint"):GetAbsOrigin() -- Записываем в переменную 'point' координаты нашего спавнера 'spawnerino'
  1672.       local point1 = Entities:FindByName( nil, "nrpoint"):GetAbsOrigin() -- Записываем в переменную 'point' координаты нашего спавнера 'spawnerino'
  1673.       local waypoint = Entities:FindByName( nil, "n_waypoint1") -- Записываем в переменную 'waypoint' координаты первого бокса way1
  1674.       local dire_point = Entities:FindByName( nil, "n_waypoint19"):GetAbsOrigin()
  1675.       local return_time = 30 -- Записываем в переменную значение '10'
  1676.       Timers:CreateTimer(0, function()  -- Создаем таймер, который запустится через 15 секунд после начала матча и запустит следующую функцию
  1677.        
  1678.         if GameRules.EndGame ~= 1 then
  1679.          
  1680.             for i=1, 4 do -- Произведет нижние действия столько раз, сколько указано в ROUND_UNITS. То есть в нашем случае создаст 2 юнита.
  1681.                 local unit = CreateUnitByName( "npc_dota_kobold3", point + RandomVector( RandomFloat( 0, 200 ) ), true, nil, nil, DOTA_TEAM_GOODGUYS )
  1682.                   Spawn:AttackMove( unit, dire_point )
  1683.                   Spawn:Upgrade2(unit,100)
  1684.                   unit:SetPhysicalArmorBaseValue(25)
  1685.             end        
  1686.        
  1687.             local unit = CreateUnitByName( "npc_dota_golem4", point + RandomVector( RandomFloat( 0, 200 ) ), true, nil, nil, DOTA_TEAM_GOODGUYS )      
  1688.                   Spawn:AttackMove( unit, dire_point )
  1689.                   Spawn:Upgrade2(unit,100)
  1690.                   unit:SetPhysicalArmorBaseValue(75)
  1691.  
  1692.          
  1693.             local unit = CreateUnitByName( "npc_dota_ursa2", point + RandomVector( RandomFloat( 0, 200 ) ), true, nil, nil, DOTA_TEAM_GOODGUYS )
  1694.                   Spawn:AttackMove( unit, dire_point )
  1695.                   Spawn:Upgrade2(unit,100)
  1696.                   unit:SetPhysicalArmorBaseValue(50)
  1697.        
  1698.             local unit = CreateUnitByName( "npc_dota_ogre2", point + RandomVector( RandomFloat( 0, 200 ) ), true, nil, nil, DOTA_TEAM_GOODGUYS )
  1699.                   Spawn:AttackMove( unit, dire_point )
  1700.                   Spawn:Upgrade2(unit,100)
  1701.                   unit:SetPhysicalArmorBaseValue(75)
  1702.        
  1703.             local unit = CreateUnitByName( "npc_dota_troll4", point + RandomVector( RandomFloat( 0, 200 ) ), true, nil, nil, DOTA_TEAM_GOODGUYS )          
  1704.                   Spawn:AttackMove( unit, dire_point )
  1705.                   Spawn:Upgrade2(unit,100)
  1706.                   unit:SetPhysicalArmorBaseValue(25)
  1707.          
  1708.          
  1709.             local unit = CreateUnitByName( "npc_dota_wolf2", point + RandomVector( RandomFloat( 0, 200 ) ), true, nil, nil, DOTA_TEAM_GOODGUYS )
  1710.                   Spawn:AttackMove( unit, dire_point )
  1711.                   Spawn:Upgrade2(unit,100)
  1712.                   unit:SetPhysicalArmorBaseValue(50)
  1713.  
  1714.             local unit = CreateUnitByName( "npc_dota_satyr3", point + RandomVector( RandomFloat( 0, 200 ) ), true, nil, nil, DOTA_TEAM_GOODGUYS )
  1715.                   Spawn:AttackMove( unit, dire_point )
  1716.                   Spawn:Upgrade2(unit,100)
  1717.                   unit:SetPhysicalArmorBaseValue(50)
  1718.  
  1719.             local unit = CreateUnitByName( "npc_dota_dragon2", point + RandomVector( RandomFloat( 0, 200 ) ), true, nil, nil, DOTA_TEAM_GOODGUYS )
  1720.                   Spawn:AttackMove( unit, dire_point )
  1721.                   Spawn:Upgrade2(unit,100)
  1722.                   unit:SetPhysicalArmorBaseValue(100)
  1723.  
  1724.             local unit = CreateUnitByName( "npc_dota_centaur2", point + RandomVector( RandomFloat( 0, 200 ) ), true, nil, nil, DOTA_TEAM_GOODGUYS )
  1725.                   Spawn:AttackMove( unit, dire_point )
  1726.                   Spawn:Upgrade2(unit,100)
  1727.                   unit:SetPhysicalArmorBaseValue(100)
  1728.         end
  1729.        
  1730.          if GameRules.EndGame ~= 1 then return return_time end
  1731.          
  1732.         end)
  1733. end
  1734.  
  1735. function Spawn:NeutralSpawner1() -- Функция начнет выполняться, когда начнется матч( на часах будет 00:00 ).
  1736.       local point = Entities:FindByName( nil, "nmpoint"):GetAbsOrigin() -- Записываем в переменную 'point' координаты нашего спавнера 'spawnerino'
  1737.       local point1 = Entities:FindByName( nil, "nrpoint"):GetAbsOrigin() -- Записываем в переменную 'point' координаты нашего спавнера 'spawnerino'
  1738.       local waypoint = Entities:FindByName( nil, "n_waypoint1") -- Записываем в переменную 'waypoint' координаты первого бокса way1
  1739.       local return_time = 30 -- Записываем в переменную значение '10'
  1740.       Timers:CreateTimer(0, function()  -- Создаем таймер, который запустится через 15 секунд после начала матча и запустит следующую функцию
  1741.        
  1742.        if GameRules.MegaMode ~= 1 then
  1743.          
  1744.          for i=1, 4 do -- Произведет нижние действия столько раз, сколько указано в ROUND_UNITS. То есть в нашем случае создаст 2 юнита.
  1745.              local unit
  1746.              if RandomInt(1,100)<5 then  unit = CreateUnitByName( "npc_dota_roshan3", point + RandomVector( RandomFloat( 0, 200 ) ), true, nil, nil, DOTA_TEAM_GOODGUYS )
  1747.             else  unit = CreateUnitByName( "npc_dota_roshan_kobold", point + RandomVector( RandomFloat( 0, 200 ) ), true, nil, nil, DOTA_TEAM_GOODGUYS )
  1748.             end        
  1749.             unit:SetInitialGoalEntity( waypoint ) -- Посылаем мобов на наш way1, координаты которого мы записали в переменную 'waypoint'
  1750.          end
  1751.          if (self.golem==1)  then
  1752.             local unit
  1753.             if RandomInt(1,100)<5 then  unit = CreateUnitByName( "npc_dota_roshan3", point + RandomVector( RandomFloat( 0, 200 ) ), true, nil, nil, DOTA_TEAM_GOODGUYS )
  1754.             else unit = CreateUnitByName( "npc_dota_roshan_golem", point + RandomVector( RandomFloat( 0, 200 ) ), true, nil, nil, DOTA_TEAM_GOODGUYS )
  1755.             end
  1756.             unit:SetInitialGoalEntity( waypoint ) -- Посылаем мобов на наш way1, координаты которого мы записали в переменную 'waypoint'
  1757.        
  1758.          end
  1759.          if self.ursa==1 then
  1760.             local unit
  1761.             if RandomInt(1,100)<5 then  unit = CreateUnitByName( "npc_dota_roshan3", point + RandomVector( RandomFloat( 0, 200 ) ), true, nil, nil, DOTA_TEAM_GOODGUYS )
  1762.             else  unit = CreateUnitByName( "npc_dota_roshan_ursa", point + RandomVector( RandomFloat( 0, 200 ) ), true, nil, nil, DOTA_TEAM_GOODGUYS )
  1763.             end        
  1764.             unit:SetInitialGoalEntity( waypoint ) -- Посылаем мобов на наш way1, координаты которого мы записали в переменную 'waypoint'
  1765.          end
  1766.          if self.ogre==1 then
  1767.             local unit
  1768.             if RandomInt(1,100)<5 then  unit = CreateUnitByName( "npc_dota_roshan3", point + RandomVector( RandomFloat( 0, 200 ) ), true, nil, nil, DOTA_TEAM_GOODGUYS )
  1769.             else  unit = CreateUnitByName( "npc_dota_roshan_ogre", point + RandomVector( RandomFloat( 0, 200 ) ), true, nil, nil, DOTA_TEAM_GOODGUYS )
  1770.             end         unit:SetInitialGoalEntity( waypoint ) -- Посылаем мобов на наш way1, координаты которого мы записали в переменную 'waypoint'
  1771.          end
  1772.          
  1773.             local unit
  1774.             if RandomInt(1,100)<5 then  unit = CreateUnitByName( "npc_dota_roshan3", point + RandomVector( RandomFloat( 0, 200 ) ), true, nil, nil, DOTA_TEAM_GOODGUYS )
  1775.             else  unit = CreateUnitByName( "npc_dota_roshan_troll", point + RandomVector( RandomFloat( 0, 200 ) ), true, nil, nil, DOTA_TEAM_GOODGUYS )
  1776.             end
  1777.                        
  1778.             unit:SetInitialGoalEntity( waypoint ) -- Посылаем мобов на наш way1, координаты которого мы записали в переменную 'waypoint'
  1779.          
  1780.          
  1781.          if self.wolf==1 then
  1782.             local unit
  1783.             if RandomInt(1,100)<5 then  unit = CreateUnitByName( "npc_dota_roshan3", point + RandomVector( RandomFloat( 0, 200 ) ), true, nil, nil, DOTA_TEAM_GOODGUYS )
  1784.             else  unit = CreateUnitByName( "npc_dota_roshan_wolf", point + RandomVector( RandomFloat( 0, 200 ) ), true, nil, nil, DOTA_TEAM_GOODGUYS )
  1785.             end        
  1786.             unit:SetInitialGoalEntity( waypoint ) -- Посылаем мобов на наш way1, координаты которого мы записали в переменную 'waypoint'
  1787.          end
  1788.          if self.satyr==1 then
  1789.             local unit
  1790.             if RandomInt(1,100)<5 then  unit = CreateUnitByName( "npc_dota_roshan3", point + RandomVector( RandomFloat( 0, 200 ) ), true, nil, nil, DOTA_TEAM_GOODGUYS )
  1791.             else  unit = CreateUnitByName( "npc_dota_roshan_satyr", point + RandomVector( RandomFloat( 0, 200 ) ), true, nil, nil, DOTA_TEAM_GOODGUYS )
  1792.             end
  1793.          unit:SetInitialGoalEntity( waypoint ) -- Посылаем мобов на наш way1, координаты которого мы записали в переменную 'waypoint'
  1794.          end
  1795.          if self.dragon==1 then
  1796.             local unit
  1797.             if RandomInt(1,100)<5 then  unit = CreateUnitByName( "npc_dota_roshan3", point + RandomVector( RandomFloat( 0, 200 ) ), true, nil, nil, DOTA_TEAM_GOODGUYS )
  1798.             else  unit = CreateUnitByName( "npc_dota_roshan_dragon", point + RandomVector( RandomFloat( 0, 200 ) ), true, nil, nil, DOTA_TEAM_GOODGUYS )
  1799.             end
  1800.             unit:SetInitialGoalEntity( waypoint ) -- Посылаем мобов на наш way1, координаты которого мы записали в переменную 'waypoint'
  1801.          end
  1802.          if self.centaur==1 then
  1803.             local unit
  1804.             if RandomInt(1,100)<5 then  unit = CreateUnitByName( "npc_dota_roshan3", point + RandomVector( RandomFloat( 0, 200 ) ), true, nil, nil, DOTA_TEAM_GOODGUYS )
  1805.             else  unit = CreateUnitByName( "npc_dota_roshan_centaur", point + RandomVector( RandomFloat( 0, 200 ) ), true, nil, nil, DOTA_TEAM_GOODGUYS )
  1806.             end          
  1807.         unit:SetInitialGoalEntity( waypoint ) -- Посылаем мобов на наш way1, координаты которого мы записали в переменную 'waypoint'
  1808.          end
  1809.        end
  1810.          return  return_time
  1811.         end)
  1812. end
  1813.  
  1814. function Spawn:DireBossSpawner() -- Функция начнет выполняться, когда начнется матч( на часах будет 00:00 ).
  1815.       local point = Entities:FindByName( nil, "dmpoint2"):GetAbsOrigin() -- Записываем в переменную 'point' координаты нашего спавнера 'spawnerino'
  1816.       local point1 = Entities:FindByName( nil, "drpoint2"):GetAbsOrigin() -- Записываем в переменную 'point' координаты нашего спавнера 'spawnerino'
  1817.       local waypoint = Entities:FindByName( nil, "d_waypoint1") -- Записываем в переменную 'waypoint' координаты первого бокса way1
  1818.       local return_time = 30 -- Записываем в переменную значение '10'
  1819.       local spawn_interval = 600
  1820.       if GetMapName() == "roshdef_turbo" then
  1821.         spawn_interval = 300
  1822.       end
  1823.       Timers:CreateTimer(10, function()  -- Создаем таймер, который запустится через 15 секунд после начала матча и запустит следующую функцию
  1824.        
  1825.        
  1826.          
  1827.          Timers:CreateTimer(spawn_interval, function()
  1828.             EmitGlobalSound("roshan_def.boss")
  1829.             GameRules:SendCustomMessage("#Game_notification_boss_spawn_abomination",0,0)         
  1830.             local unit = CreateUnitByName( "npc_dota_abomination_boss" , point + RandomVector( RandomFloat( 0, 200 ) ), true, nil, nil, DOTA_TEAM_BADGUYS ) --[[ Создаем юнита 'example_unit_', в конце к названию добавится 1,2,3,4 или 5, в зависимости от раунда, и в итоге получатся наши example_unit_1, example_unit_2 и т.д. Юнит появится в векторе point + RandomVector (RandomFloat( 0, 200 ) ) - point - наша переменная, а рандомный вектор добавляется для того, чтобы мобы не появлялись в одной точке и не застревали. Мобы будут за силы света. ]]
  1831.             unit:SetInitialGoalEntity( waypoint ) -- Посылаем мобов на наш way1, координаты которого мы записали в переменную 'waypoint'
  1832.          end)
  1833.          Timers:CreateTimer(spawn_interval*2, function()
  1834.             EmitGlobalSound("roshan_def.boss")
  1835.             GameRules:SendCustomMessage("#Game_notification_boss_spawn_fire_golem",0,0)      
  1836.             local unit = CreateUnitByName( "npc_dota_golem_boss" , point + RandomVector( RandomFloat( 0, 200 ) ), true, nil, nil, DOTA_TEAM_BADGUYS ) --[[ Создаем юнита 'example_unit_', в конце к названию добавится 1,2,3,4 или 5, в зависимости от раунда, и в итоге получатся наши example_unit_1, example_unit_2 и т.д. Юнит появится в векторе point + RandomVector (RandomFloat( 0, 200 ) ) - point - наша переменная, а рандомный вектор добавляется для того, чтобы мобы не появлялись в одной точке и не застревали. Мобы будут за силы света. ]]
  1837.             unit:SetInitialGoalEntity( waypoint ) -- Посылаем мобов на наш way1, координаты которого мы записали в переменную 'waypoint'
  1838.          end)
  1839.          Timers:CreateTimer(spawn_interval*3, function()
  1840.             EmitGlobalSound("roshan_def.boss")
  1841.             GameRules:SendCustomMessage("#Game_notification_boss_spawn_witch",0,0)       
  1842.             local unit = CreateUnitByName( "npc_dota_dead_witch" , point + RandomVector( RandomFloat( 0, 200 ) ), true, nil, nil, DOTA_TEAM_BADGUYS ) --[[ Создаем юнита 'example_unit_', в конце к названию добавится 1,2,3,4 или 5, в зависимости от раунда, и в итоге получатся наши example_unit_1, example_unit_2 и т.д. Юнит появится в векторе point + RandomVector (RandomFloat( 0, 200 ) ) - point - наша переменная, а рандомный вектор добавляется для того, чтобы мобы не появлялись в одной точке и не застревали. Мобы будут за силы света. ]]
  1843.             unit:SetInitialGoalEntity( waypoint ) -- Посылаем мобов на наш way1, координаты которого мы записали в переменную 'waypoint'
  1844.  
  1845.             local unit = CreateUnitByName( "forest_dota_dead_ghost" , point1 + RandomVector( RandomFloat( 0, 200 ) ), true, nil, nil, DOTA_TEAM_BADGUYS ) --[[ Создаем юнита 'example_unit_', в конце к названию добавится 1,2,3,4 или 5, в зависимости от раунда, и в итоге получатся наши example_unit_1, example_unit_2 и т.д. Юнит появится в векторе point + RandomVector (RandomFloat( 0, 200 ) ) - point - наша переменная, а рандомный вектор добавляется для того, чтобы мобы не появлялись в одной точке и не застревали. Мобы будут за силы света. ]]
  1846.             unit:SetInitialGoalEntity( waypoint ) -- Посылаем мобов на наш way1, координаты которого мы записали в переменную 'waypoint'
  1847.  
  1848.             local unit = CreateUnitByName( "forest_dota_dead_ghost" , point1 + RandomVector( RandomFloat( 0, 200 ) ), true, nil, nil, DOTA_TEAM_BADGUYS ) --[[ Создаем юнита 'example_unit_', в конце к названию добавится 1,2,3,4 или 5, в зависимости от раунда, и в итоге получатся наши example_unit_1, example_unit_2 и т.д. Юнит появится в векторе point + RandomVector (RandomFloat( 0, 200 ) ) - point - наша переменная, а рандомный вектор добавляется для того, чтобы мобы не появлялись в одной точке и не застревали. Мобы будут за силы света. ]]
  1849.             unit:SetInitialGoalEntity( waypoint ) -- Посылаем мобов на наш way1, координаты которого мы записали в переменную 'waypoint'
  1850.  
  1851.         end)
  1852.          Timers:CreateTimer(spawn_interval*4, function()
  1853.             EmitGlobalSound("roshan_def.boss")
  1854.             GameRules:SendCustomMessage("#Game_notification_boss_spawn_necronomicon",0,0)        
  1855.             local unit = CreateUnitByName( "npc_dota_necronomicon_warrior_boss" , point + RandomVector( RandomFloat( 0, 200 ) ), true, nil, nil, DOTA_TEAM_BADGUYS ) --[[ Создаем юнита 'example_unit_', в конце к названию добавится 1,2,3,4 или 5, в зависимости от раунда, и в итоге получатся наши example_unit_1, example_unit_2 и т.д. Юнит появится в векторе point + RandomVector (RandomFloat( 0, 200 ) ) - point - наша переменная, а рандомный вектор добавляется для того, чтобы мобы не появлялись в одной точке и не застревали. Мобы будут за силы света. ]]
  1856.             unit:SetInitialGoalEntity( waypoint ) -- Посылаем мобов на наш way1, координаты которого мы записали в переменную 'waypoint'
  1857.  
  1858.             local unit = CreateUnitByName( "npc_dota_necronomicon_archer_boss" , point1 + RandomVector( RandomFloat( 0, 200 ) ), true, nil, nil, DOTA_TEAM_BADGUYS ) --[[ Создаем юнита 'example_unit_', в конце к названию добавится 1,2,3,4 или 5, в зависимости от раунда, и в итоге получатся наши example_unit_1, example_unit_2 и т.д. Юнит появится в векторе point + RandomVector (RandomFloat( 0, 200 ) ) - point - наша переменная, а рандомный вектор добавляется для того, чтобы мобы не появлялись в одной точке и не застревали. Мобы будут за силы света. ]]
  1859.             unit:SetInitialGoalEntity( waypoint ) -- Посылаем мобов на наш way1, координаты которого мы записали в переменную 'waypoint'
  1860.  
  1861.         end)
  1862.          Timers:CreateTimer(spawn_interval*5, function()
  1863.             EmitGlobalSound("roshan_def.boss")
  1864.             GameRules:SendCustomMessage("#Game_notification_boss_spawn_nyx",0,0)         
  1865.             local unit = CreateUnitByName( "npc_dota_nyx_boss" , point + RandomVector( RandomFloat( 0, 200 ) ), true, nil, nil, DOTA_TEAM_BADGUYS ) --[[ Создаем юнита 'example_unit_', в конце к названию добавится 1,2,3,4 или 5, в зависимости от раунда, и в итоге получатся наши example_unit_1, example_unit_2 и т.д. Юнит появится в векторе point + RandomVector (RandomFloat( 0, 200 ) ) - point - наша переменная, а рандомный вектор добавляется для того, чтобы мобы не появлялись в одной точке и не застревали. Мобы будут за силы света. ]]
  1866.             unit:SetInitialGoalEntity( waypoint ) -- Посылаем мобов на наш way1, координаты которого мы записали в переменную 'waypoint'
  1867.          end)
  1868.          Timers:CreateTimer(spawn_interval*6, function()
  1869.             EmitGlobalSound("roshan_def.boss")
  1870.             GameRules:SendCustomMessage("#Game_notification_boss_spawn_doom",0,0)
  1871.          
  1872.             local unit = CreateUnitByName( "npc_dota_doom_boss" , point + RandomVector( RandomFloat( 0, 200 ) ), true, nil, nil, DOTA_TEAM_BADGUYS ) --[[ Создаем юнита 'example_unit_', в конце к названию добавится 1,2,3,4 или 5, в зависимости от раунда, и в итоге получатся наши example_unit_1, example_unit_2 и т.д. Юнит появится в векторе point + RandomVector (RandomFloat( 0, 200 ) ) - point - наша переменная, а рандомный вектор добавляется для того, чтобы мобы не появлялись в одной точке и не застревали. Мобы будут за силы света. ]]
  1873.             unit:SetInitialGoalEntity( waypoint ) -- Посылаем мобов на наш way1, координаты которого мы записали в переменную 'waypoint'
  1874.  
  1875.             local unit = CreateUnitByName( "npc_dota_doom_minion" , point1 + RandomVector( RandomFloat( 0, 200 ) ), true, nil, nil, DOTA_TEAM_BADGUYS ) --[[ Создаем юнита 'example_unit_', в конце к названию добавится 1,2,3,4 или 5, в зависимости от раунда, и в итоге получатся наши example_unit_1, example_unit_2 и т.д. Юнит появится в векторе point + RandomVector (RandomFloat( 0, 200 ) ) - point - наша переменная, а рандомный вектор добавляется для того, чтобы мобы не появлялись в одной точке и не застревали. Мобы будут за силы света. ]]
  1876.             unit:SetInitialGoalEntity( waypoint ) -- Посылаем мобов на наш way1, координаты которого мы записали в переменную 'waypoint'
  1877.  
  1878.             local unit = CreateUnitByName( "npc_dota_doom_minion" , point1 + RandomVector( RandomFloat( 0, 200 ) ), true, nil, nil, DOTA_TEAM_BADGUYS ) --[[ Создаем юнита 'example_unit_', в конце к названию добавится 1,2,3,4 или 5, в зависимости от раунда, и в итоге получатся наши example_unit_1, example_unit_2 и т.д. Юнит появится в векторе point + RandomVector (RandomFloat( 0, 200 ) ) - point - наша переменная, а рандомный вектор добавляется для того, чтобы мобы не появлялись в одной точке и не застревали. Мобы будут за силы света. ]]
  1879.             unit:SetInitialGoalEntity( waypoint ) -- Посылаем мобов на наш way1, координаты которого мы записали в переменную 'waypoint'
  1880.  
  1881.             local unit = CreateUnitByName( "npc_dota_doom_minion" , point1 + RandomVector( RandomFloat( 0, 200 ) ), true, nil, nil, DOTA_TEAM_BADGUYS ) --[[ Создаем юнита 'example_unit_', в конце к названию добавится 1,2,3,4 или 5, в зависимости от раунда, и в итоге получатся наши example_unit_1, example_unit_2 и т.д. Юнит появится в векторе point + RandomVector (RandomFloat( 0, 200 ) ) - point - наша переменная, а рандомный вектор добавляется для того, чтобы мобы не появлялись в одной точке и не застревали. Мобы будут за силы света. ]]
  1882.             unit:SetInitialGoalEntity( waypoint ) -- Посылаем мобов на наш way1, координаты которого мы записали в переменную 'waypoint'
  1883.  
  1884.         end)
  1885.          Timers:CreateTimer(spawn_interval*7, function()
  1886.             EmitGlobalSound("roshan_def.boss")
  1887.             GameRules:SendCustomMessage("#Game_notification_boss_spawn_seeker",0,0)      
  1888.             local unit = CreateUnitByName( "npc_dota_bloodseeker_boss" , point + RandomVector( RandomFloat( 0, 200 ) ), true, nil, nil, DOTA_TEAM_BADGUYS ) --[[ Создаем юнита 'example_unit_', в конце к названию добавится 1,2,3,4 или 5, в зависимости от раунда, и в итоге получатся наши example_unit_1, example_unit_2 и т.д. Юнит появится в векторе point + RandomVector (RandomFloat( 0, 200 ) ) - point - наша переменная, а рандомный вектор добавляется для того, чтобы мобы не появлялись в одной точке и не застревали. Мобы будут за силы света. ]]
  1889.             unit:SetInitialGoalEntity( waypoint ) -- Посылаем мобов на наш way1, координаты которого мы записали в переменную 'waypoint'
  1890.          end)
  1891.          Timers:CreateTimer(spawn_interval*8, function()
  1892.         --  EmitGlobalSound("roshan_def.boss")
  1893.         --  GameRules:SendCustomMessage("#Game_notification_boss_spawn_never",0,0)       
  1894.             local unit = CreateUnitByName( "npc_dota_sans" , point + RandomVector( RandomFloat( 0, 200 ) ), true, nil, nil, DOTA_TEAM_BADGUYS ) --[[ Создаем юнита 'example_unit_', в конце к названию добавится 1,2,3,4 или 5, в зависимости от раунда, и в итоге получатся наши example_unit_1, example_unit_2 и т.д. Юнит появится в векторе point + RandomVector (RandomFloat( 0, 200 ) ) - point - наша переменная, а рандомный вектор добавляется для того, чтобы мобы не появлялись в одной точке и не застревали. Мобы будут за силы света. ]]
  1895.             unit:SetInitialGoalEntity( waypoint ) -- Посылаем мобов на наш way1, координаты которого мы записали в переменную 'waypoint'
  1896.          end)
  1897.          Timers:CreateTimer(spawn_interval*9, function()
  1898.             EmitGlobalSound("roshan_def.boss")
  1899.             GameRules:SendCustomMessage("#Game_notification_boss_spawn_spectre",0,0)         
  1900.             local unit = CreateUnitByName( "npc_phantasm_1" , point + RandomVector( RandomFloat( 0, 200 ) ), true, nil, nil, DOTA_TEAM_BADGUYS ) --[[ Создаем юнита 'example_unit_', в конце к названию добавится 1,2,3,4 или 5, в зависимости от раунда, и в итоге получатся наши example_unit_1, example_unit_2 и т.д. Юнит появится в векторе point + RandomVector (RandomFloat( 0, 200 ) ) - point - наша переменная, а рандомный вектор добавляется для того, чтобы мобы не появлялись в одной точке и не застревали. Мобы будут за силы света. ]]
  1901.             unit:SetInitialGoalEntity( waypoint ) -- Посылаем мобов на наш way1, координаты которого мы записали в переменную 'waypoint'
  1902.          end)
  1903.          Timers:CreateTimer(spawn_interval*10, function()
  1904.             EmitGlobalSound("roshan_def.boss")
  1905.             GameRules:SendCustomMessage("#Game_notification_boss_spawn_cursed_warriors",0,0)         
  1906.             GameRules.Number_of_cursed = 12
  1907.             Timers:CreateTimer(1, function()
  1908.                 if GameRules.Number_of_cursed ~= 0 then
  1909.                     EmitGlobalSound("Sandopolis")
  1910.                     return 145 -- repeat time
  1911.                 end
  1912.             end
  1913.             )
  1914.             for i=1,12 do
  1915.                 local unit = CreateUnitByName( "npc_cursed_warrior" , point + RandomVector( RandomFloat( 0, 200 ) ), true, nil, nil, DOTA_TEAM_BADGUYS ) --[[ Создаем юнита 'example_unit_', в конце к названию добавится 1,2,3,4 или 5, в зависимости от раунда, и в итоге получатся наши example_unit_1, example_unit_2 и т.д. Юнит появится в векторе point + RandomVector (RandomFloat( 0, 200 ) ) - point - наша переменная, а рандомный вектор добавляется для того, чтобы мобы не появлялись в одной точке и не застревали. Мобы будут за силы света. ]]
  1916.                 unit:SetInitialGoalEntity( waypoint )
  1917.             end
  1918.          end)
  1919.  
  1920.  Timers:CreateTimer(spawn_interval*11, function()
  1921.         EmitGlobalSound("roshan_def.boss")
  1922.         GameRules:SendCustomMessage("#Game_notification_boss_maraphon",0,0)      
  1923.  
  1924.              Timers:CreateTimer(10, function()
  1925.                 local unit = CreateUnitByName( "npc_dota_abomination_boss" , point + RandomVector( RandomFloat( 0, 200 ) ), true, nil, nil, DOTA_TEAM_BADGUYS ) --[[ Создаем юнита 'example_unit_', в конце к названию добавится 1,2,3,4 или 5, в зависимости от раунда, и в итоге получатся наши example_unit_1, example_unit_2 и т.д. Юнит появится в векторе point + RandomVector (RandomFloat( 0, 200 ) ) - point - наша переменная, а рандомный вектор добавляется для того, чтобы мобы не появлялись в одной точке и не застревали. Мобы будут за силы света. ]]
  1926.                 unit:SetInitialGoalEntity( waypoint ) -- Посылаем мобов на наш way1, координаты которого мы записали в переменную 'waypoint'
  1927.              end)
  1928.              Timers:CreateTimer(20, function()
  1929.                 local unit = CreateUnitByName( "npc_dota_golem_boss" , point + RandomVector( RandomFloat( 0, 200 ) ), true, nil, nil, DOTA_TEAM_BADGUYS ) --[[ Создаем юнита 'example_unit_', в конце к названию добавится 1,2,3,4 или 5, в зависимости от раунда, и в итоге получатся наши example_unit_1, example_unit_2 и т.д. Юнит появится в векторе point + RandomVector (RandomFloat( 0, 200 ) ) - point - наша переменная, а рандомный вектор добавляется для того, чтобы мобы не появлялись в одной точке и не застревали. Мобы будут за силы света. ]]
  1930.                 unit:SetInitialGoalEntity( waypoint ) -- Посылаем мобов на наш way1, координаты которого мы записали в переменную 'waypoint'
  1931.              end)
  1932.              Timers:CreateTimer(30, function()
  1933.                 local unit = CreateUnitByName( "npc_dota_dead_witch" , point + RandomVector( RandomFloat( 0, 200 ) ), true, nil, nil, DOTA_TEAM_BADGUYS ) --[[ Создаем юнита 'example_unit_', в конце к названию добавится 1,2,3,4 или 5, в зависимости от раунда, и в итоге получатся наши example_unit_1, example_unit_2 и т.д. Юнит появится в векторе point + RandomVector (RandomFloat( 0, 200 ) ) - point - наша переменная, а рандомный вектор добавляется для того, чтобы мобы не появлялись в одной точке и не застревали. Мобы будут за силы света. ]]
  1934.                 unit:SetInitialGoalEntity( waypoint ) -- Посылаем мобов на наш way1, координаты которого мы записали в переменную 'waypoint'
  1935.      
  1936.                 local unit = CreateUnitByName( "forest_dota_dead_ghost" , point1 + RandomVector( RandomFloat( 0, 200 ) ), true, nil, nil, DOTA_TEAM_BADGUYS ) --[[ Создаем юнита 'example_unit_', в конце к названию добавится 1,2,3,4 или 5, в зависимости от раунда, и в итоге получатся наши example_unit_1, example_unit_2 и т.д. Юнит появится в векторе point + RandomVector (RandomFloat( 0, 200 ) ) - point - наша переменная, а рандомный вектор добавляется для того, чтобы мобы не появлялись в одной точке и не застревали. Мобы будут за силы света. ]]
  1937.                 unit:SetInitialGoalEntity( waypoint ) -- Посылаем мобов на наш way1, координаты которого мы записали в переменную 'waypoint'
  1938.  
  1939.                 local unit = CreateUnitByName( "forest_dota_dead_ghost" , point1 + RandomVector( RandomFloat( 0, 200 ) ), true, nil, nil, DOTA_TEAM_BADGUYS ) --[[ Создаем юнита 'example_unit_', в конце к названию добавится 1,2,3,4 или 5, в зависимости от раунда, и в итоге получатся наши example_unit_1, example_unit_2 и т.д. Юнит появится в векторе point + RandomVector (RandomFloat( 0, 200 ) ) - point - наша переменная, а рандомный вектор добавляется для того, чтобы мобы не появлялись в одной точке и не застревали. Мобы будут за силы света. ]]
  1940.                 unit:SetInitialGoalEntity( waypoint ) -- Посылаем мобов на наш way1, координаты которого мы записали в переменную 'waypoint'
  1941.  
  1942.             end)
  1943.              Timers:CreateTimer(40, function()
  1944.                 local unit = CreateUnitByName( "npc_dota_necronomicon_warrior_boss" , point + RandomVector( RandomFloat( 0, 200 ) ), true, nil, nil, DOTA_TEAM_BADGUYS ) --[[ Создаем юнита 'example_unit_', в конце к названию добавится 1,2,3,4 или 5, в зависимости от раунда, и в итоге получатся наши example_unit_1, example_unit_2 и т.д. Юнит появится в векторе point + RandomVector (RandomFloat( 0, 200 ) ) - point - наша переменная, а рандомный вектор добавляется для того, чтобы мобы не появлялись в одной точке и не застревали. Мобы будут за силы света. ]]
  1945.                 unit:SetInitialGoalEntity( waypoint ) -- Посылаем мобов на наш way1, координаты которого мы записали в переменную 'waypoint'
  1946.      
  1947.                 local unit = CreateUnitByName( "npc_dota_necronomicon_archer_boss" , point1 + RandomVector( RandomFloat( 0, 200 ) ), true, nil, nil, DOTA_TEAM_BADGUYS ) --[[ Создаем юнита 'example_unit_', в конце к названию добавится 1,2,3,4 или 5, в зависимости от раунда, и в итоге получатся наши example_unit_1, example_unit_2 и т.д. Юнит появится в векторе point + RandomVector (RandomFloat( 0, 200 ) ) - point - наша переменная, а рандомный вектор добавляется для того, чтобы мобы не появлялись в одной точке и не застревали. Мобы будут за силы света. ]]
  1948.                 unit:SetInitialGoalEntity( waypoint ) -- Посылаем мобов на наш way1, координаты которого мы записали в переменную 'waypoint'
  1949.  
  1950.             end)
  1951.              Timers:CreateTimer(50, function()
  1952.                 local unit = CreateUnitByName( "npc_dota_nyx_boss" , point + RandomVector( RandomFloat( 0, 200 ) ), true, nil, nil, DOTA_TEAM_BADGUYS ) --[[ Создаем юнита 'example_unit_', в конце к названию добавится 1,2,3,4 или 5, в зависимости от раунда, и в итоге получатся наши example_unit_1, example_unit_2 и т.д. Юнит появится в векторе point + RandomVector (RandomFloat( 0, 200 ) ) - point - наша переменная, а рандомный вектор добавляется для того, чтобы мобы не появлялись в одной точке и не застревали. Мобы будут за силы света. ]]
  1953.                 unit:SetInitialGoalEntity( waypoint ) -- Посылаем мобов на наш way1, координаты которого мы записали в переменную 'waypoint'
  1954.              end)
  1955.              Timers:CreateTimer(60, function()
  1956.              
  1957.                 local unit = CreateUnitByName( "npc_dota_doom_boss" , point + RandomVector( RandomFloat( 0, 200 ) ), true, nil, nil, DOTA_TEAM_BADGUYS ) --[[ Создаем юнита 'example_unit_', в конце к названию добавится 1,2,3,4 или 5, в зависимости от раунда, и в итоге получатся наши example_unit_1, example_unit_2 и т.д. Юнит появится в векторе point + RandomVector (RandomFloat( 0, 200 ) ) - point - наша переменная, а рандомный вектор добавляется для того, чтобы мобы не появлялись в одной точке и не застревали. Мобы будут за силы света. ]]
  1958.                 unit:SetInitialGoalEntity( waypoint ) -- Посылаем мобов на наш way1, координаты которого мы записали в переменную 'waypoint'
  1959.      
  1960.                 local unit = CreateUnitByName( "npc_dota_doom_minion" , point1 + RandomVector( RandomFloat( 0, 200 ) ), true, nil, nil, DOTA_TEAM_BADGUYS ) --[[ Создаем юнита 'example_unit_', в конце к названию добавится 1,2,3,4 или 5, в зависимости от раунда, и в итоге получатся наши example_unit_1, example_unit_2 и т.д. Юнит появится в векторе point + RandomVector (RandomFloat( 0, 200 ) ) - point - наша переменная, а рандомный вектор добавляется для того, чтобы мобы не появлялись в одной точке и не застревали. Мобы будут за силы света. ]]
  1961.                 unit:SetInitialGoalEntity( waypoint ) -- Посылаем мобов на наш way1, координаты которого мы записали в переменную 'waypoint'
  1962.  
  1963.                 local unit = CreateUnitByName( "npc_dota_doom_minion" , point1 + RandomVector( RandomFloat( 0, 200 ) ), true, nil, nil, DOTA_TEAM_BADGUYS ) --[[ Создаем юнита 'example_unit_', в конце к названию добавится 1,2,3,4 или 5, в зависимости от раунда, и в итоге получатся наши example_unit_1, example_unit_2 и т.д. Юнит появится в векторе point + RandomVector (RandomFloat( 0, 200 ) ) - point - наша переменная, а рандомный вектор добавляется для того, чтобы мобы не появлялись в одной точке и не застревали. Мобы будут за силы света. ]]
  1964.                 unit:SetInitialGoalEntity( waypoint ) -- Посылаем мобов на наш way1, координаты которого мы записали в переменную 'waypoint'
  1965.  
  1966.                 local unit = CreateUnitByName( "npc_dota_doom_minion" , point1 + RandomVector( RandomFloat( 0, 200 ) ), true, nil, nil, DOTA_TEAM_BADGUYS ) --[[ Создаем юнита 'example_unit_', в конце к названию добавится 1,2,3,4 или 5, в зависимости от раунда, и в итоге получатся наши example_unit_1, example_unit_2 и т.д. Юнит появится в векторе point + RandomVector (RandomFloat( 0, 200 ) ) - point - наша переменная, а рандомный вектор добавляется для того, чтобы мобы не появлялись в одной точке и не застревали. Мобы будут за силы света. ]]
  1967.                 unit:SetInitialGoalEntity( waypoint ) -- Посылаем мобов на наш way1, координаты которого мы записали в переменную 'waypoint'
  1968.      
  1969.             end)
  1970.              Timers:CreateTimer(70, function()
  1971.                 local unit = CreateUnitByName( "npc_dota_bloodseeker_boss" , point + RandomVector( RandomFloat( 0, 200 ) ), true, nil, nil, DOTA_TEAM_BADGUYS ) --[[ Создаем юнита 'example_unit_', в конце к названию добавится 1,2,3,4 или 5, в зависимости от раунда, и в итоге получатся наши example_unit_1, example_unit_2 и т.д. Юнит появится в векторе point + RandomVector (RandomFloat( 0, 200 ) ) - point - наша переменная, а рандомный вектор добавляется для того, чтобы мобы не появлялись в одной точке и не застревали. Мобы будут за силы света. ]]
  1972.                 unit:SetInitialGoalEntity( waypoint ) -- Посылаем мобов на наш way1, координаты которого мы записали в переменную 'waypoint'
  1973.              end)
  1974.              Timers:CreateTimer(80, function()
  1975.                 local unit = CreateUnitByName( "npc_dota_sans" , point + RandomVector( RandomFloat( 0, 200 ) ), true, nil, nil, DOTA_TEAM_BADGUYS ) --[[ Создаем юнита 'example_unit_', в конце к названию добавится 1,2,3,4 или 5, в зависимости от раунда, и в итоге получатся наши example_unit_1, example_unit_2 и т.д. Юнит появится в векторе point + RandomVector (RandomFloat( 0, 200 ) ) - point - наша переменная, а рандомный вектор добавляется для того, чтобы мобы не появлялись в одной точке и не застревали. Мобы будут за силы света. ]]
  1976.                 unit:SetInitialGoalEntity( waypoint ) -- Посылаем мобов на наш way1, координаты которого мы записали в переменную 'waypoint'
  1977.              end)
  1978.              Timers:CreateTimer(90, function()
  1979.                 local unit = CreateUnitByName( "npc_phantasm_1" , point + RandomVector( RandomFloat( 0, 200 ) ), true, nil, nil, DOTA_TEAM_BADGUYS ) --[[ Создаем юнита 'example_unit_', в конце к названию добавится 1,2,3,4 или 5, в зависимости от раунда, и в итоге получатся наши example_unit_1, example_unit_2 и т.д. Юнит появится в векторе point + RandomVector (RandomFloat( 0, 200 ) ) - point - наша переменная, а рандомный вектор добавляется для того, чтобы мобы не появлялись в одной точке и не застревали. Мобы будут за силы света. ]]
  1980.                 unit:SetInitialGoalEntity( waypoint ) -- Посылаем мобов на наш way1, координаты которого мы записали в переменную 'waypoint'
  1981.              end)
  1982.         end)
  1983.       end)
  1984.  Timers:CreateTimer(spawn_interval*12, function()  Spawn:InfiniteMaraphon() end)
  1985.    
  1986. end
  1987.  
  1988. function Spawn:InfiniteMaraphon()
  1989.     local point = Entities:FindByName( nil, "dmpoint2"):GetAbsOrigin() -- Записываем в переменную 'point' координаты нашего спавнера 'spawnerino'
  1990.     local point1 = Entities:FindByName( nil, "drpoint2"):GetAbsOrigin() -- Записываем в переменную 'point' координаты нашего спавнера 'spawnerino'
  1991.     local waypoint = Entities:FindByName( nil, "d_waypoint1") -- Записываем в переменную 'waypoint' координаты первого бокса way1
  1992.  
  1993.     Timers:CreateTimer(1, function()
  1994.         EmitGlobalSound("SatanBal")
  1995.         return 213 -- repeat time
  1996.    
  1997.     end)
  1998.          
  1999.     Timers:CreateTimer(1, function()GameRules:SendCustomMessage("#Game_notification_infinite_maraphon",0,0) end)
  2000.  
  2001.     Timers:CreateTimer(1, function()
  2002.         EmitGlobalSound("roshan_def.boss")
  2003.         local int = math.random(1,7)
  2004.        
  2005.             if int == 1 then
  2006.                 GameRules:SendCustomMessage("#Game_notification_boss_spawn_abomination",0,0)         
  2007.                 local unit = CreateUnitByName( "npc_dota_abomination_boss" , point + RandomVector( RandomFloat( 0, 200 ) ), true, nil, nil, DOTA_TEAM_BADGUYS ) --[[ Создаем юнита 'example_unit_', в конце к названию добавится 1,2,3,4 или 5, в зависимости от раунда, и в итоге получатся наши example_unit_1, example_unit_2 и т.д. Юнит появится в векторе point + RandomVector (RandomFloat( 0, 200 ) ) - point - наша переменная, а рандомный вектор добавляется для того, чтобы мобы не появлялись в одной точке и не застревали. Мобы будут за силы света. ]]
  2008.                 unit:SetInitialGoalEntity( waypoint ) -- Посылаем мобов на наш way1, координаты которого мы записали в переменную 'waypoint'
  2009.                 Spawn:Upgrade2(unit,500)
  2010.                 Spawn:Upgrade2(unit,GameRules.Maraphon_Round/2.5)
  2011.                 unit:SetPhysicalArmorBaseValue(175)
  2012.             elseif int == 2 then
  2013.                 GameRules:SendCustomMessage("#Game_notification_boss_spawn_fire_golem",0,0)      
  2014.                 local unit = CreateUnitByName( "npc_dota_golem_boss" , point + RandomVector( RandomFloat( 0, 200 ) ), true, nil, nil, DOTA_TEAM_BADGUYS ) --[[ Создаем юнита 'example_unit_', в конце к названию добавится 1,2,3,4 или 5, в зависимости от раунда, и в итоге получатся наши example_unit_1, example_unit_2 и т.д. Юнит появится в векторе point + RandomVector (RandomFloat( 0, 200 ) ) - point - наша переменная, а рандомный вектор добавляется для того, чтобы мобы не появлялись в одной точке и не застревали. Мобы будут за силы света. ]]
  2015.                 unit:SetInitialGoalEntity( waypoint ) -- Посылаем мобов на наш way1, координаты которого мы записали в переменную 'waypoint'
  2016.                 Spawn:Upgrade2(unit,400)
  2017.                 Spawn:Upgrade2(unit,GameRules.Maraphon_Round/2.5)
  2018.                 unit:SetPhysicalArmorBaseValue(175)
  2019.             elseif int == 3 then
  2020.                 GameRules:SendCustomMessage("#Game_notification_boss_spawn_necronomicon",0,0)        
  2021.                 local unit = CreateUnitByName( "npc_dota_necronomicon_warrior_boss" , point + RandomVector( RandomFloat( 0, 200 ) ), true, nil, nil, DOTA_TEAM_BADGUYS ) --[[ Создаем юнита 'example_unit_', в конце к названию добавится 1,2,3,4 или 5, в зависимости от раунда, и в итоге получатся наши example_unit_1, example_unit_2 и т.д. Юнит появится в векторе point + RandomVector (RandomFloat( 0, 200 ) ) - point - наша переменная, а рандомный вектор добавляется для того, чтобы мобы не появлялись в одной точке и не застревали. Мобы будут за силы света. ]]
  2022.                 unit:SetInitialGoalEntity( waypoint ) -- Посылаем мобов на наш way1, координаты которого мы записали в переменную 'waypoint'
  2023.                 Spawn:Upgrade2(unit,200)
  2024.                 Spawn:Upgrade2(unit,GameRules.Maraphon_Round/2.5)
  2025.                 unit:SetPhysicalArmorBaseValue(175)
  2026.      
  2027.                 local unit = CreateUnitByName( "npc_dota_necronomicon_archer_boss" , point1 + RandomVector( RandomFloat( 0, 200 ) ), true, nil, nil, DOTA_TEAM_BADGUYS ) --[[ Создаем юнита 'example_unit_', в конце к названию добавится 1,2,3,4 или 5, в зависимости от раунда, и в итоге получатся наши example_unit_1, example_unit_2 и т.д. Юнит появится в векторе point + RandomVector (RandomFloat( 0, 200 ) ) - point - наша переменная, а рандомный вектор добавляется для того, чтобы мобы не появлялись в одной точке и не застревали. Мобы будут за силы света. ]]
  2028.                 unit:SetInitialGoalEntity( waypoint ) -- Посылаем мобов на наш way1, координаты которого мы записали в переменную 'waypoint'
  2029.                 Spawn:Upgrade2(unit,200)
  2030.                 Spawn:Upgrade2(unit,GameRules.Maraphon_Round/2.5)
  2031.                 unit:SetPhysicalArmorBaseValue(150)
  2032.  
  2033.             elseif int == 4 then
  2034.                 GameRules:SendCustomMessage("#Game_notification_boss_spawn_nyx",0,0)         
  2035.                 local unit = CreateUnitByName( "npc_dota_nyx_boss" , point + RandomVector( RandomFloat( 0, 200 ) ), true, nil, nil, DOTA_TEAM_BADGUYS ) --[[ Создаем юнита 'example_unit_', в конце к названию добавится 1,2,3,4 или 5, в зависимости от раунда, и в итоге получатся наши example_unit_1, example_unit_2 и т.д. Юнит появится в векторе point + RandomVector (RandomFloat( 0, 200 ) ) - point - наша переменная, а рандомный вектор добавляется для того, чтобы мобы не появлялись в одной точке и не застревали. Мобы будут за силы света. ]]
  2036.                 unit:SetInitialGoalEntity( waypoint ) -- Посылаем мобов на наш way1, координаты которого мы записали в переменную 'waypoint'
  2037.                 Spawn:Upgrade2(unit,60)
  2038.                 Spawn:Upgrade2(unit,GameRules.Maraphon_Round/2.5)
  2039.                 unit:SetPhysicalArmorBaseValue(175)
  2040.             elseif int == 5 then
  2041.                 GameRules:SendCustomMessage("#Game_notification_boss_spawn_doom",0,0)        
  2042.              
  2043.                 local unit = CreateUnitByName( "npc_dota_doom_boss" , point + RandomVector( RandomFloat( 0, 200 ) ), true, nil, nil, DOTA_TEAM_BADGUYS ) --[[ Создаем юнита 'example_unit_', в конце к названию добавится 1,2,3,4 или 5, в зависимости от раунда, и в итоге получатся наши example_unit_1, example_unit_2 и т.д. Юнит появится в векторе point + RandomVector (RandomFloat( 0, 200 ) ) - point - наша переменная, а рандомный вектор добавляется для того, чтобы мобы не появлялись в одной точке и не застревали. Мобы будут за силы света. ]]
  2044.                 unit:SetInitialGoalEntity( waypoint ) -- Посылаем мобов на наш way1, координаты которого мы записали в переменную 'waypoint'
  2045.                 Spawn:Upgrade2(unit,40)
  2046.                 Spawn:Upgrade2(unit,GameRules.Maraphon_Round/2.5)
  2047.                 unit:SetPhysicalArmorBaseValue(175)
  2048.      
  2049.                 local unit = CreateUnitByName( "npc_dota_doom_minion" , point1 + RandomVector( RandomFloat( 0, 200 ) ), true, nil, nil, DOTA_TEAM_BADGUYS ) --[[ Создаем юнита 'example_unit_', в конце к названию добавится 1,2,3,4 или 5, в зависимости от раунда, и в итоге получатся наши example_unit_1, example_unit_2 и т.д. Юнит появится в векторе point + RandomVector (RandomFloat( 0, 200 ) ) - point - наша переменная, а рандомный вектор добавляется для того, чтобы мобы не появлялись в одной точке и не застревали. Мобы будут за силы света. ]]
  2050.                 unit:SetInitialGoalEntity( waypoint ) -- Посылаем мобов на наш way1, координаты которого мы записали в переменную 'waypoint'
  2051.                 Spawn:Upgrade2(unit,40)
  2052.                 Spawn:Upgrade2(unit,GameRules.Maraphon_Round/2.5)
  2053.                 unit:SetPhysicalArmorBaseValue(125)
  2054.  
  2055.                 local unit = CreateUnitByName( "npc_dota_doom_minion" , point1 + RandomVector( RandomFloat( 0, 200 ) ), true, nil, nil, DOTA_TEAM_BADGUYS ) --[[ Создаем юнита 'example_unit_', в конце к названию добавится 1,2,3,4 или 5, в зависимости от раунда, и в итоге получатся наши example_unit_1, example_unit_2 и т.д. Юнит появится в векторе point + RandomVector (RandomFloat( 0, 200 ) ) - point - наша переменная, а рандомный вектор добавляется для того, чтобы мобы не появлялись в одной точке и не застревали. Мобы будут за силы света. ]]
  2056.                 unit:SetInitialGoalEntity( waypoint ) -- Посылаем мобов на наш way1, координаты которого мы записали в переменную 'waypoint'
  2057.                 Spawn:Upgrade2(unit,40)
  2058.                 Spawn:Upgrade2(unit,GameRules.Maraphon_Round/2.5)
  2059.                 unit:SetPhysicalArmorBaseValue(125)
  2060.  
  2061.                 local unit = CreateUnitByName( "npc_dota_doom_minion" , point1 + RandomVector( RandomFloat( 0, 200 ) ), true, nil, nil, DOTA_TEAM_BADGUYS ) --[[ Создаем юнита 'example_unit_', в конце к названию добавится 1,2,3,4 или 5, в зависимости от раунда, и в итоге получатся наши example_unit_1, example_unit_2 и т.д. Юнит появится в векторе point + RandomVector (RandomFloat( 0, 200 ) ) - point - наша переменная, а рандомный вектор добавляется для того, чтобы мобы не появлялись в одной точке и не застревали. Мобы будут за силы света. ]]
  2062.                 unit:SetInitialGoalEntity( waypoint ) -- Посылаем мобов на наш way1, координаты которого мы записали в переменную 'waypoint'
  2063.                 Spawn:Upgrade2(unit,40)
  2064.                 Spawn:Upgrade2(unit,GameRules.Maraphon_Round/2.5)
  2065.                 unit:SetPhysicalArmorBaseValue(125)
  2066.      
  2067.             elseif int == 6 then
  2068.                 GameRules:SendCustomMessage("#Game_notification_boss_spawn_seeker",0,0)      
  2069.                 local unit = CreateUnitByName( "npc_dota_bloodseeker_boss" , point + RandomVector( RandomFloat( 0, 200 ) ), true, nil, nil, DOTA_TEAM_BADGUYS ) --[[ Создаем юнита 'example_unit_', в конце к названию добавится 1,2,3,4 или 5, в зависимости от раунда, и в итоге получатся наши example_unit_1, example_unit_2 и т.д. Юнит появится в векторе point + RandomVector (RandomFloat( 0, 200 ) ) - point - наша переменная, а рандомный вектор добавляется для того, чтобы мобы не появлялись в одной точке и не застревали. Мобы будут за силы света. ]]
  2070.                 unit:SetInitialGoalEntity( waypoint ) -- Посылаем мобов на наш way1, координаты которого мы записали в переменную 'waypoint'
  2071.                 Spawn:Upgrade2(unit,16)
  2072.                 Spawn:Upgrade2(unit,GameRules.Maraphon_Round/2.5)
  2073.                 unit:SetPhysicalArmorBaseValue(175)
  2074.             elseif int == 7 then
  2075.                 GameRules:SendCustomMessage("#Game_notification_boss_spawn_spectre",0,0)         
  2076.                 local unit = CreateUnitByName( "npc_phantasm_1" , point + RandomVector( RandomFloat( 0, 200 ) ), true, nil, nil, DOTA_TEAM_BADGUYS ) --[[ Создаем юнита 'example_unit_', в конце к названию добавится 1,2,3,4 или 5, в зависимости от раунда, и в итоге получатся наши example_unit_1, example_unit_2 и т.д. Юнит появится в векторе point + RandomVector (RandomFloat( 0, 200 ) ) - point - наша переменная, а рандомный вектор добавляется для того, чтобы мобы не появлялись в одной точке и не застревали. Мобы будут за силы света. ]]
  2077.                 unit:SetInitialGoalEntity( waypoint ) -- Посылаем мобов на наш way1, координаты которого мы записали в переменную 'waypoint'
  2078.                 Spawn:Upgrade2(unit,8)
  2079.                 Spawn:Upgrade2(unit,GameRules.Maraphon_Round/2.5)
  2080.                 unit:SetPhysicalArmorBaseValue(175)
  2081.                
  2082.             end
  2083.              
  2084.             GameRules.Maraphon_Round = GameRules.Maraphon_Round + 1
  2085.         return 60
  2086.     end
  2087. )
  2088. end
  2089.  
  2090. function Spawn:SetSameTeam()
  2091.     local team = DOTA_TEAM_BADGUYS
  2092.  
  2093.     GameRules:SetCustomGameTeamMaxPlayers( team, PlayerResource:GetPlayerCount() )
  2094.  
  2095.     for i=0,4 do
  2096.         local hero = PlayerResource:GetSelectedHeroEntity(i)
  2097.         if hero then
  2098.             hero:SetTeam(team)
  2099.             PlayerResource:SetCustomTeamAssignment(i,team)
  2100.         end
  2101.     end
  2102.     --GameRules:SetCustomGameTeamMaxPlayers( DOTA_TEAM_GOODGUYS, 0 )
  2103.  
  2104.  
  2105. end
  2106.  
  2107. function Spawn:SetWDToHost()
  2108.     local wd_dire = Entities:FindByName(nil, "wd_dire")
  2109.     if wd_dire then
  2110.         local host = PlayerResource:GetPlayer(0)
  2111.         wd_dire:SetOwner(host)
  2112.         wd_dire:SetControllableByPlayer(0, false)
  2113.     end
  2114.    
  2115.     local wd_radiant = Entities:FindByName(nil, "wd_radiant")
  2116.     if wd_radiant then
  2117.         local host = PlayerResource:GetPlayer(0)
  2118.         wd_radiant:SetOwner(host)
  2119.         wd_radiant:SetControllableByPlayer(0, false)
  2120.     end
  2121. end
  2122.  
  2123. function Spawn:AttackMove ( unit, point )
  2124.     print("that shit work !!!")
  2125.     Timers:CreateTimer(0.1, function()
  2126.         ExecuteOrderFromTable({
  2127.             UnitIndex = unit:entindex(),
  2128.             OrderType = DOTA_UNIT_ORDER_ATTACK_MOVE,
  2129.             Position = point,
  2130.             Queue = false,
  2131.         })
  2132.     end)
  2133. end
  2134.  
  2135. CustomGameEventManager:RegisterListener( "choose_boss_chose", function( a, keyee )
  2136.     print( a, keyee )
  2137.  
  2138.     local boss = keyee.bossname
  2139.     if final_boss == true then
  2140.         return
  2141.     end
  2142.     final_boss = true  
  2143.    
  2144.     print(final_boss)
  2145.     if boss == "zombie" then
  2146.         Spawn:ZombieMode()
  2147.     elseif boss == "chaos" then
  2148.         Spawn:ChaosMode()
  2149.     elseif boss == "demon" then
  2150.         Spawn:DemonMode()
  2151.     elseif boss == "lich" then
  2152.         Spawn:LichMode()
  2153.     elseif boss == "necro" then
  2154.         Spawn:NecroMode()
  2155.     end
  2156. end )
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement