Advertisement
warpdragon

Untitled

Apr 4th, 2017
113
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.57 KB | None | 0 0
  1. -- Required by components/index
  2.  
  3. if SpawnLaneCreeps == nil then
  4. DebugPrint ( '[lane_creeps/spawn] spawning lane creeps' )
  5. SpawnLaneCreeps = class({})
  6. end
  7.  
  8. local LaneSpawnInterval = 30.0
  9.  
  10. function SpawnLaneCreeps:Init ()
  11. DebugPrint ( '[lane_creeps/spawn] initialize' )
  12. SpawnLaneCreeps = self
  13. Timers:CreateTimer(Dynamic_Wrap(SpawnLaneCreeps, 'LaneCreepTimer'))
  14. end
  15.  
  16. function SpawnLaneCreeps:LaneCreepTimer ()
  17. print ('LaneCreepTimer')
  18. SpawnAirCreeps()
  19. SpawnFireCreeps()
  20. SpawnWaterCreeps()
  21. SpawnEarthCreeps()
  22. return LaneSpawnInterval
  23. end
  24.  
  25. function SpawnAirCreeps()
  26. local point = Entities:FindByName( nil, "point_cc_fire_spawn"):GetAbsOrigin()
  27. local point2 = Entities:FindByName( nil, "point_cc_fire"):GetAbsOrigin()
  28. local point3 = Entities:FindByName( nil, "point_9_oclock"):GetAbsOrigin()
  29. local units_to_spawn = 3
  30. for i=1,units_to_spawn do
  31. Timers:CreateTimer(function()
  32. local unit = CreateUnitByName("npc_dota_creep_air_melee", point+RandomVector(RandomInt(100,200)), true, nil, nil, DOTA_TEAM_GOODGUYS)
  33. ExecuteOrderFromTable({ UnitIndex = unit:GetEntityIndex(),
  34. OrderType = DOTA_UNIT_ORDER_ATTACK_MOVE,
  35. Position = point2, Queue = true})
  36. ExecuteOrderFromTable({ UnitIndex = unit:GetEntityIndex(),
  37. OrderType = DOTA_UNIT_ORDER_ATTACK_MOVE,
  38. Position = point3, Queue = true})
  39. end)
  40. end
  41. end
  42.  
  43. function SpawnFireCreeps()
  44.  
  45. end
  46.  
  47. function SpawnWaterCreeps()
  48.  
  49. end
  50.  
  51. function SpawnEarthCreeps()
  52.  
  53. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement