1. package Movement
  2. function noStuckCond()returns boolean
  3. if ( not ( GetOwningPlayer(GetEnteringUnit()) != Player(0) ) )
  4. return false
  5. if ( not ( GetOwningPlayer(GetEnteringUnit()) != Player(1) ) )
  6. return false
  7. if ( not ( GetOwningPlayer(GetEnteringUnit()) != Player(2) ) )
  8. return false
  9. if ( not ( GetOwningPlayer(GetEnteringUnit()) != Player(3) ) )
  10. return false
  11. if ( not ( GetOwningPlayer(GetEnteringUnit()) != Player(4) ) )
  12. return false
  13. if ( not ( GetOwningPlayer(GetEnteringUnit()) != Player(5) ) )
  14. return false
  15. if ( not ( GetOwningPlayer(GetEnteringUnit()) != Player(6) ) )
  16. return false
  17. if ( not ( GetOwningPlayer(GetEnteringUnit()) != Player(7) ) )
  18. return false
  19. if ( not ( GetOwningPlayer(GetEnteringUnit()) != Player(8) ) )
  20. return false
  21. if ( not ( GetOwningPlayer(GetEnteringUnit()) != Player(9) ) )
  22. return false
  23. if ( not ( GetOwningPlayer(GetEnteringUnit()) != Player(10) ) )
  24. return false
  25. if ( not ( GetOwningPlayer(GetEnteringUnit()) != Player(11) ) )
  26. return false
  27. if ( not ( GetOwningPlayer(GetEnteringUnit()) != Player(PLAYER_NEUTRAL_PASSIVE) ) )
  28. return false
  29. return true
  30. function noStuckAction()
  31. for unit enemy from GetUnitsInRectOfPlayer(gg_rct_Cop_Move_Spawn, Player(PLAYER_NEUTRAL_AGGRESSIVE))
  32. enemy.issuePointOrder("attack", gg_rct_Attack_Move_Hostile_Reinforcements_Arrive.randomPoint())
  33. init
  34. trigger t = CreateTrigger( )
  35. TriggerRegisterEnterRectSimple( t, gg_rct_Helicopter_Arrives )
  36. TriggerRegisterEnterRectSimple( t, gg_rct_Cop_Move_Spawn )
  37. TriggerAddCondition( t, Condition( function noStuckCond ) )
  38. TriggerAddAction( t, function noStuckAction )
  39. package Respawn
  40. import HashMap
  41. import ClosureTimers
  42. HashMap<int,int> idList = new HashMap<int,int>()
  43. function respawn()
  44. int id1 = GetDyingUnit().getTypeId()
  45. unit dead = GetDyingUnit()
  46. if idList.has(id1)
  47. doAfter(7, () -> begin
  48. createUnit(Player(8), idList.get(id1), dead.getPos(), angle(0))
  49. end)
  50. init
  51. idList.put('h00L', 'n002')
  52. idList.put('h019', 'n00H')
  53. idList.put('hhes', 'n00T')
  54. idList.put('z002', 'n003')
  55. idList.put('z005', 'n000')
  56. idList.put('z000', 'n000')
  57. idList.put('z001', 'u00A')
  58. idList.put('hpea', 'n000')
  59. idList.put('hrif', 'n003')
  60. idList.put('hfoo', 'n002')
  61. trigger t= CreateTrigger()
  62. t.registerAnyUnitEvent(EVENT_PLAYER_UNIT_DEATH)
  63. t.addAction(function respawn)
  64. package Spawn
  65. import ClosureTimers
  66. boolean secondSpawn = false
  67. function startSpawn ()
  68. //doAfter(200, ()-> begin
  69. doPeriodically(10, (CallbackPeriodic cb) -> begin
  70. DisplayTimedTextToForce( GetPlayersAll(), 15.00, "--Wave 1--" )
  71. for int i = 0 to 10
  72. createUnit(Player(11),'n002',gg_rct_Graveyard_Spawns_and_move.randomPoint(), angle(0))
  73. for int i = 0 to 10
  74. createUnit(Player(10),'u000',gg_rct_Graveyard_Spawns_and_move.randomPoint(), angle(0))
  75. for int i = 0 to 10
  76. createUnit(Player(9),'n003',gg_rct_Graveyard_Spawns_and_move.randomPoint(), angle(0))
  77. for int i = 0 to 10
  78. createUnit(Player(8),'u002',gg_rct_Graveyard_Spawns_and_move.randomPoint(), angle(0))
  79. createUnit(Player(8),'u003',gg_rct_Graveyard_Spawns_and_move.randomPoint(), angle(0))
  80. for int i = 0 to 10
  81. createUnit(Player(8),'u004',gg_rct_Graveyard_Spawns_and_move.randomPoint(), angle(0))
  82. end)
  83. init
  84. getTimer().start( 0.010, function startSpawn )
  85. package AntiStuck
  86. import ClosureTimers
  87. function noStuckCond() returns boolean
  88. if ( not ( GetOwningPlayer(GetEnteringUnit()) != Player(0) ) )
  89. return false
  90. if ( not ( GetOwningPlayer(GetEnteringUnit()) != Player(1) ) )
  91. return false
  92. if ( not ( GetOwningPlayer(GetEnteringUnit()) != Player(2) ) )
  93. return false
  94. if ( not ( GetOwningPlayer(GetEnteringUnit()) != Player(3) ) )
  95. return false
  96. if ( not ( GetOwningPlayer(GetEnteringUnit()) != Player(4) ) )
  97. return false
  98. if ( not ( GetOwningPlayer(GetEnteringUnit()) != Player(5) ) )
  99. return false
  100. if ( not ( GetOwningPlayer(GetEnteringUnit()) != Player(6) ) )
  101. return false
  102. if ( not ( GetOwningPlayer(GetEnteringUnit()) != Player(7) ) )
  103. return false
  104. if ( not ( GetOwningPlayer(GetEnteringUnit()) != Player(PLAYER_NEUTRAL_AGGRESSIVE) ) )
  105. return false
  106. if ( not ( GetOwningPlayer(GetEnteringUnit()) != Player(PLAYER_NEUTRAL_PASSIVE) ) )
  107. return false
  108. return true
  109. function noStuckAction()
  110. doAfter(1, () -> begin
  111. GetEnteringUnit().issuePointOrder("attack", GroupPickRandomUnit(GetUnitsOfPlayerAll(ForcePickRandomPlayer(GetPlayersEnemies(Player(10))))).getPos())
  112. end)
  113. function callBack()
  114. for unit enemy from GetUnitsOfPlayerAll(Player(10))
  115. enemy.issuePointOrder("attack", GroupPickRandomUnit(GetUnitsOfPlayerAll(ForcePickRandomPlayer(GetPlayersEnemies(Player(10))))).getPos())
  116. for unit enemy from GetUnitsOfPlayerAll(Player(8))
  117. enemy.issuePointOrder("attack", GroupPickRandomUnit(GetUnitsOfPlayerAll(ForcePickRandomPlayer(GetPlayersEnemies(Player(8))))).getPos())
  118. for unit enemy from GetUnitsOfPlayerAll(Player(9))
  119. enemy.issuePointOrder("attack", GroupPickRandomUnit(GetUnitsOfPlayerAll(ForcePickRandomPlayer(GetPlayersEnemies(Player(9))))).getPos())
  120. for unit enemy from GetUnitsOfPlayerAll(Player(11))
  121. enemy.issuePointOrder("attack", GroupPickRandomUnit(GetUnitsOfPlayerAll(ForcePickRandomPlayer(GetPlayersEnemies(Player(11))))).getPos())
  122. init
  123. /*
  124. trigger s = CreateTrigger( )
  125. TriggerRegisterEnterRectSimple( s, GetPlayableMapRect() )
  126. TriggerRegisterTimerEventPeriodic( s, 35.00 )
  127. TriggerAddAction( s, function callBack )
  128. trigger t = CreateTrigger( )
  129. TriggerRegisterEnterRectSimple( t, GetPlayableMapRect() )
  130. TriggerAddCondition( t, Condition( function noStuckCond ) )
  131. TriggerAddAction( t, function noStuckAction ) */
  132. package MedicKit
  133. function diseaseCond() returns boolean
  134. if ( not ( GetUnitTypeId(GetEnteringUnit()) == 'z000' ) or not ( GetUnitTypeId(GetEnteringUnit()) == 'H016' ) or not ( GetUnitTypeId(GetEnteringUnit()) == 'H017' ) )
  135. return false
  136. return true
  137. function diseaseAction()
  138. GetEnteringUnit().addEffect("war3mapImported\\FirstAidBackpack_ByEpsilon.mdx", "chest")
  139. function diseaseLoopAction()
  140. for unit enemy from GetUnitsOfPlayerAndTypeId(Player(PLAYER_NEUTRAL_AGGRESSIVE), 'z000')
  141. enemy.addEffect("war3mapImported\\FirstAidBackpack_ByEpsilon.mdx", "chest")
  142. init
  143. //===========================================================================
  144. trigger diseased = CreateTrigger( )
  145. TriggerRegisterEnterRectSimple( diseased, GetPlayableMapRect() )
  146. TriggerAddCondition( diseased, Condition( function diseaseCond ) )
  147. TriggerAddAction( diseased, function diseaseAction )
  148. trigger diseaseOnce = CreateTrigger()
  149. TriggerRegisterTimerEventSingle( diseaseOnce, 5 )
  150. TriggerAddAction( diseaseOnce, function diseaseLoopAction )
  151. package GameInit
  152. import ClosureTimers
  153. function start ()
  154. SetPlayerAllianceStateBJ( Player(PLAYER_NEUTRAL_AGGRESSIVE), Player(0), bj_ALLIANCE_ALLIED_VISION )
  155. SetPlayerAllianceStateBJ( Player(PLAYER_NEUTRAL_AGGRESSIVE), Player(1), bj_ALLIANCE_ALLIED_VISION )
  156. SetPlayerAllianceStateBJ( Player(PLAYER_NEUTRAL_AGGRESSIVE), Player(2), bj_ALLIANCE_ALLIED_VISION )
  157. SetPlayerAllianceStateBJ( Player(PLAYER_NEUTRAL_AGGRESSIVE), Player(3), bj_ALLIANCE_ALLIED_VISION )
  158. SetPlayerAllianceStateBJ( Player(PLAYER_NEUTRAL_AGGRESSIVE), Player(4), bj_ALLIANCE_ALLIED_VISION )
  159. SetPlayerAllianceStateBJ( Player(PLAYER_NEUTRAL_AGGRESSIVE), Player(5), bj_ALLIANCE_ALLIED_VISION )
  160. SetPlayerAllianceStateBJ( Player(PLAYER_NEUTRAL_AGGRESSIVE), Player(6), bj_ALLIANCE_ALLIED_VISION )
  161. SetPlayerAllianceStateBJ( Player(PLAYER_NEUTRAL_AGGRESSIVE), Player(7), bj_ALLIANCE_ALLIED_VISION )
  162. doAfter(2, () -> begin
  163. createItem('kymn', GetPlayableMapRect().randomPoint())
  164. createItem('hbth', GetPlayableMapRect().randomPoint())
  165. createItem('wild', GetPlayableMapRect().randomPoint())
  166. createItem('wild', GetPlayableMapRect().randomPoint())
  167. createItem('wild', GetPlayableMapRect().randomPoint())
  168. end)
  169. doAfter(5, () -> begin
  170. createItem('ches', gg_rct_Radio_Spawns.randomPoint())
  171. createItem('tsct', gg_rct_Generator_Spawns.randomPoint())
  172. createItem('hval', GetPlayableMapRect().randomPoint())
  173. end)
  174. doAfter(1500, () -> begin
  175. for unit enemy from GetUnitsOfPlayerAndTypeId(Player(PLAYER_NEUTRAL_AGGRESSIVE), 'hrif')
  176. enemy.issuePointOrder("attack", gg_rct_Attack_Move_Hostile_Reinforcements_Arrive.randomPoint())
  177. for unit enemy from GetUnitsOfPlayerAndTypeId(Player(PLAYER_NEUTRAL_AGGRESSIVE), 'hfoo')
  178. enemy.issuePointOrder("attack", gg_rct_Attack_Move_Hostile_Reinforcements_Arrive.randomPoint())
  179. for unit enemy from GetUnitsOfPlayerAndTypeId(Player(PLAYER_NEUTRAL_AGGRESSIVE), 'h019')
  180. enemy.issuePointOrder("attack", gg_rct_Attack_Move_Hostile_Reinforcements_Arrive.randomPoint())
  181. end)
  182. doAfter(6.5, () -> begin
  183. SetPlayerAllianceStateBJ( Player(PLAYER_NEUTRAL_AGGRESSIVE), Player(8), bj_ALLIANCE_UNALLIED )
  184. SetPlayerAllianceStateBJ( Player(PLAYER_NEUTRAL_AGGRESSIVE), Player(9), bj_ALLIANCE_UNALLIED )
  185. SetPlayerAllianceStateBJ( Player(PLAYER_NEUTRAL_AGGRESSIVE), Player(10), bj_ALLIANCE_UNALLIED )
  186. SetPlayerAllianceStateBJ( Player(PLAYER_NEUTRAL_AGGRESSIVE), Player(11), bj_ALLIANCE_UNALLIED )
  187. SetPlayerAllianceStateBJ( Player(11), Player(PLAYER_NEUTRAL_AGGRESSIVE), bj_ALLIANCE_UNALLIED )
  188. SetPlayerAllianceStateBJ( Player(10), Player(PLAYER_NEUTRAL_AGGRESSIVE), bj_ALLIANCE_UNALLIED )
  189. SetPlayerAllianceStateBJ( Player(9), Player(PLAYER_NEUTRAL_AGGRESSIVE), bj_ALLIANCE_UNALLIED )
  190. SetPlayerAllianceStateBJ( Player(8), Player(PLAYER_NEUTRAL_AGGRESSIVE), bj_ALLIANCE_UNALLIED )
  191. SetPlayerAllianceStateBJ( Player(0), Player(PLAYER_NEUTRAL_AGGRESSIVE), bj_ALLIANCE_ALLIED_VISION )
  192. SetPlayerAllianceStateBJ( Player(1), Player(PLAYER_NEUTRAL_AGGRESSIVE), bj_ALLIANCE_ALLIED_VISION )
  193. SetPlayerAllianceStateBJ( Player(2), Player(PLAYER_NEUTRAL_AGGRESSIVE), bj_ALLIANCE_ALLIED_VISION )
  194. SetPlayerAllianceStateBJ( Player(3), Player(PLAYER_NEUTRAL_AGGRESSIVE), bj_ALLIANCE_ALLIED_VISION )
  195. SetPlayerAllianceStateBJ( Player(4), Player(PLAYER_NEUTRAL_AGGRESSIVE), bj_ALLIANCE_ALLIED_VISION )
  196. SetPlayerAllianceStateBJ( Player(5), Player(PLAYER_NEUTRAL_AGGRESSIVE), bj_ALLIANCE_ALLIED_VISION )
  197. SetPlayerAllianceStateBJ( Player(6), Player(PLAYER_NEUTRAL_AGGRESSIVE), bj_ALLIANCE_ALLIED_VISION )
  198. SetPlayerAllianceStateBJ( Player(7), Player(PLAYER_NEUTRAL_AGGRESSIVE), bj_ALLIANCE_ALLIED_VISION )
  199. end)
  200. doPeriodically(19, (CallbackPeriodic cb) -> begin
  201. gg_unit_n007_0031.issuePointOrder("move", gg_rct_Upper_Move.randomPoint())
  202. gg_unit_n007_0042.issuePointOrder("move", gg_rct_City_farm_move.randomPoint())
  203. gg_unit_o000_0035.issuePointOrder("move", gg_rct_Forest_move.randomPoint())
  204. gg_unit_o000_0041.issuePointOrder("move", gg_rct_City_farm_move.randomPoint())
  205. gg_unit_o000_0037.issuePointOrder("move", gg_rct_Upper_Move.randomPoint())
  206. gg_unit_h00H_0028.issuePointOrder("move", gg_rct_Forest_move.randomPoint())
  207. gg_unit_h00H_0029.issuePointOrder("move", gg_rct_City_farm_move.randomPoint())
  208. end)
  209. doPeriodically(19, (CallbackPeriodic cb) -> begin
  210. createItem('gold', GetPlayableMapRect().randomPoint())
  211. createItem('gold', GetPlayableMapRect().randomPoint())
  212. createItem('lmbr', GetPlayableMapRect().randomPoint())
  213. end)
  214. print("|cffFF9421[100%] |r- Initializing Zombie Defense")
  215. init
  216. print("|cffFF9421[0%] |r- Initializing Zombie Defense")
  217. getTimer().start( 0.010, function start )

goto line:
Compare with:
text copy window edit this code post new code