Abnormal202

Untitled

Mar 26th, 2017
44
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 15.47 KB | None | 0 0
  1. function boss_fight()
  2. {
  3. level.zombies_dead = 0;
  4. exit_door = GetEnt( "exit_door", "targetname");
  5. boss_door_trigger = GetEnt( "boss_door_trigger", "targetname");
  6. boss_door = GetEnt( "boss_door", "targetname");
  7. boss_door_trigger SetHintString( "Activate Lockdown First");
  8.  
  9. trig = GetEnt( "boss_fight_trigger", "targetname");
  10. trig SetHintString( "Press and Hold ^3[{+activate}]^7 to begin lockdown [recommend all players in room]");
  11. trig waittill( "trigger", player);
  12. IPrintLnBold( "Lockdown Started" );
  13. thread play_2D_sound( "colossus");
  14. boss_door_trigger Delete();
  15. trig Delete();
  16.  
  17. spawners = GetEntArray( "boss_spawner", "targetname" );
  18. for(i = 0; i < spawners.size; i++)
  19. {
  20. spawners[i] thread spawnzombies();
  21.  
  22. }
  23. }
  24. function spawnzombies()
  25. {
  26. zombie = zombie_utility::spawn_zombie( self );
  27. zombie thread isdead();
  28. wait(1);
  29. zombie_1 = zombie_utility::spawn_zombie( self );
  30. zombie_1 thread isdead();
  31. wait(1);
  32. zombie_2 = zombie_utility::spawn_zombie( self );
  33. zombie_2 thread isdead();
  34. wait(1);
  35. zombie_3 = zombie_utility::spawn_zombie( self );
  36. zombie_3 thread isdead();
  37. wait(1);
  38. zombie_4 = zombie_utility::spawn_zombie( self );
  39. zombie_4 thread isdead();
  40. wait(1);
  41. zombie_5 = zombie_utility::spawn_zombie( self );
  42. zombie_5 thread isdead();
  43. wait(20);
  44. zombie_6 = zombie_utility::spawn_zombie( self );
  45. zombie_6 thread isdead();
  46. wait(1);
  47. zombie_7 = zombie_utility::spawn_zombie( self );
  48. zombie_7 thread isdead();
  49. wait(1);
  50. zombie_8 = zombie_utility::spawn_zombie( self );
  51. zombie_8 thread isdead();
  52. wait(1);
  53. zombie_9 = zombie_utility::spawn_zombie( self );
  54. zombie_9 thread isdead();
  55. wait(1);
  56. zombie_10 = zombie_utility::spawn_zombie( self );
  57. zombie_10 thread isdead();
  58. wait(1);
  59. zombie_11 = zombie_utility::spawn_zombie( self );
  60. zombie_11 thread isdead();
  61. wait(1);
  62. zombie_12 = zombie_utility::spawn_zombie( self );
  63. zombie_12 thread isdead();
  64. wait(1);
  65. zombie_13 = zombie_utility::spawn_zombie( self );
  66. zombie_13 thread isdead();
  67. wait(20);
  68. zombie_14 = zombie_utility::spawn_zombie( self );
  69. zombie_14 thread isdead();
  70. wait(1);
  71. zombie_15 = zombie_utility::spawn_zombie( self );
  72. zombie_15 thread isdead();
  73. wait(1);
  74. zombie_16 = zombie_utility::spawn_zombie( self );
  75. zombie_16 thread isdead();
  76. wait(1);
  77. zombie_17 = zombie_utility::spawn_zombie( self );
  78. zombie_17 thread isdead();
  79. wait(1);
  80. zombie_18 = zombie_utility::spawn_zombie( self );
  81. zombie_18 thread isdead();
  82. wait(1);
  83. zombie_19 = zombie_utility::spawn_zombie( self );
  84. zombie_19 thread isdead();
  85. wait(1);
  86. zombie_20 = zombie_utility::spawn_zombie( self );
  87. zombie_20 thread isdead();
  88. wait(1);
  89. zombie_21 = zombie_utility::spawn_zombie( self );
  90. zombie_21 thread isdead();
  91. wait(1);
  92. }
  93. function isdead()
  94. {
  95. self waittill("death");
  96. level.zombies_dead ++;
  97. if(level.zombies_dead == 66)
  98. {
  99. boss_fight_end();
  100. }
  101. }
  102. function boss_fight_end()
  103. {
  104. thread objectives( "Complete the Pack-A-Punch Ritual COMPLETE", true);
  105. boss_door = GetEnt( "boss_door", "targetname");
  106. exit_door = GetEnt( "boss_exit", "targetname");
  107. cliff_door = GetEnt( "cliff_door", "targetname");
  108. IPrintLnBold("Lockdown Complete");
  109. exit_door MoveZ(-300, 3);
  110. boss_door MoveZ(-300, 3);
  111. cliff_door MoveZ(-300, 3);
  112. level flag::set( "zone_14-15-5" );
  113. jolt = GetEnt( "jolt_2", "targetname");
  114. Earthquake( 0.30, 3, jolt.origin, 1000 );
  115. wait(3);
  116. cliff_door Delete();
  117. boss_door Delete();
  118. exit_door Delete();
  119. wait(4);
  120. thread objectives( "Align the Four Cannons", false);
  121. }
  122. function easter_egg()
  123. {
  124.  
  125. //IPrintLnBold("System Lockdown Override Complete");
  126. //door = GetEntArray("easter_egg_door","targetname");
  127. //for(i=0;i<door.size;i++)
  128. //{
  129. // door[i] Delete();
  130. //}
  131. //level flag::set( "zone_15-17" );
  132. level.cannon_move_degrees = 5;
  133. level.cannons_done = 0;
  134. thread cannon_1();
  135. thread cannon_2();
  136. thread cannon_3();
  137. thread cannon_4();
  138.  
  139. }
  140. function isdone()
  141. {
  142. if(level.cannons_done == 4)
  143. {
  144. IPrintLnBold("System Lockdown Override Complete");
  145. thread objectives( "Align the Four Cannons COMPLETE", true);
  146. door = GetEntArray("easter_egg_door","targetname");
  147. for(i=0;i<door.size;i++)
  148. {
  149. door[i] Delete();
  150. }
  151. level flag::set( "zone_15-17" );
  152. wait(7);
  153. thread objectives( "Power the Cannons", false);
  154. thread easter_egg();
  155. }
  156. }
  157. function cannon_1()
  158. {
  159. platform = GetEnt( "platform_1","targetname");
  160. start = platform.origin;
  161. cannon = GetEnt( "cannon_1","targetname");
  162. trig = GetEnt( "ee_trigger_1","targetname");
  163. trig TriggerEnable( true);
  164. trig waittill("trigger", player);
  165. player_off_trig = true;
  166. angles = 0;
  167.  
  168. cannon endon("cannon_done");
  169. while(1)
  170. {
  171. if( player IsTouching(trig))
  172. {
  173. if(player_off_trig == true)
  174. cannon thread spawnzombie();
  175. platform MoveTo(start - (0,0,4), 1);
  176. player_off_trig = false;
  177. //platform thread platform_sound();
  178. platform playloopsound ("elevator_loop");
  179. cannon RotateYaw(level.cannon_move_degrees, 1);
  180. angles += level.cannon_move_degrees;
  181. wait(1);
  182. //IPrintLnBold(cannon.angles);
  183. if(angles == 180)
  184. {
  185. level.cannons_done ++;
  186. if(level.cannons_done == 1)
  187. {
  188. IPrintLnBold("1 out of 4 Complete");
  189. }
  190. else if(level.cannons_done == 2)
  191. {
  192. IPrintLnBold("2 out of 4 Complete");
  193. }
  194. else if(level.cannons_done == 3)
  195. {
  196. IPrintLnBold("3 out of 4 Complete");
  197. }
  198. platform MoveTo(start, 1);
  199. zm_powerups::specific_powerup_drop( "empty_bottle", start + (0,0,40));
  200. thread isdone();
  201. cannon notify("cannon_done");
  202. }
  203. }
  204. else
  205. {
  206.  
  207. platform MoveTo(start, 1);
  208. //platform thread platform_sound();
  209. if(player_off_trig == false)
  210. {
  211. platform stoploopsound( 0.2 );
  212. wait(3);
  213. player_off_trig = true;
  214. }
  215. if(player_off_trig == true)
  216. {
  217. cannon notify("off_platform");
  218. platform playloopsound ("elevator_loop");
  219. cannon RotateYaw(-level.cannon_move_degrees, 1);
  220. angles -= level.cannon_move_degrees;
  221. wait(1);
  222. if(angles == 0)
  223. {
  224. platform stoploopsound( 0.2 );
  225. cannon_1();
  226. }
  227. }
  228. wait(0.05);
  229. }
  230. }
  231. }
  232. function spawnzombie()
  233. {
  234. spawner = GetEnt( "special_spawner", "targetname" );
  235. zombie_utility::spawn_zombie( spawner);
  236. wait(0.5);
  237. zombie_utility::spawn_zombie( spawner);
  238. wait(0.5);
  239. zombie_utility::spawn_zombie( spawner);
  240. wait(0.5);
  241. zombie_utility::spawn_zombie( spawner);
  242. wait(0.5);
  243. zombie_utility::spawn_zombie( spawner);
  244. self endon("cannon_done");
  245. self endon("off_platform");
  246. while(1)
  247. {
  248. if(level.remainingzw < 15)
  249. zombie_utility::spawn_zombie( spawner);
  250. wait(1);
  251. }
  252. }
  253. function cannon_2()
  254. {
  255. platform = GetEnt( "platform_2","targetname");
  256. start = platform.origin;
  257. cannon = GetEnt( "cannon_2","targetname");
  258. trig = GetEnt( "ee_trigger_2","targetname");
  259. trig TriggerEnable( true);
  260. trig waittill("trigger", player);
  261. player_off_trig = true;
  262. angles = 0;
  263.  
  264. cannon endon("cannon_done");
  265. while(1)
  266. {
  267. if( player IsTouching(trig))
  268. {
  269. if(player_off_trig == true)
  270. cannon thread spawnzombie();
  271. platform MoveTo(start - (0,0,4), 1);
  272. player_off_trig = false;
  273. //platform thread platform_sound();
  274. platform playloopsound ("elevator_loop");
  275. cannon RotateYaw(level.cannon_move_degrees, 1);
  276. angles += level.cannon_move_degrees;
  277. wait(1);
  278. //IPrintLnBold(cannon.angles);
  279. if(angles == 180)
  280. {
  281. level.cannons_done ++;
  282. if(level.cannons_done == 1)
  283. {
  284. IPrintLnBold("1 out of 4 Complete");
  285. }
  286. else if(level.cannons_done == 2)
  287. {
  288. IPrintLnBold("2 out of 4 Complete");
  289. }
  290. else if(level.cannons_done == 3)
  291. {
  292. IPrintLnBold("3 out of 4 Complete");
  293. }
  294. platform MoveTo(start, 1);
  295. zm_powerups::specific_powerup_drop( "empty_bottle", start + (0,0,40));
  296. thread isdone();
  297. cannon notify("cannon_done");
  298. }
  299. }
  300. else
  301. {
  302.  
  303. platform MoveTo(start, 1);
  304. //platform thread platform_sound();
  305. if(player_off_trig == false)
  306. {
  307. platform stoploopsound( 0.2 );
  308. wait(3);
  309. player_off_trig = true;
  310. }
  311. if(player_off_trig == true)
  312. {
  313. cannon notify("off_platform");
  314. platform playloopsound ("elevator_loop");
  315. cannon RotateYaw(-level.cannon_move_degrees, 1);
  316. angles -= level.cannon_move_degrees;
  317. wait(1);
  318. if(angles == 0)
  319. {
  320. platform stoploopsound( 0.2 );
  321. cannon_2();
  322. }
  323. }
  324. wait(0.05);
  325. }
  326. }
  327. }
  328. function cannon_3()
  329. {
  330. platform = GetEnt( "platform_3","targetname");
  331. start = platform.origin;
  332. cannon = GetEnt( "cannon_3","targetname");
  333. trig = GetEnt( "ee_trigger_3","targetname");
  334. trig TriggerEnable( true);
  335. trig waittill("trigger", player);
  336. player_off_trig = true;
  337. angles = 0;
  338.  
  339. cannon endon("cannon_done");
  340. while(1)
  341. {
  342. if( player IsTouching(trig))
  343. {
  344. if(player_off_trig == true)
  345. cannon thread spawnzombie();
  346. platform MoveTo(start - (0,0,4), 1);
  347. player_off_trig = false;
  348. //platform thread platform_sound();
  349. platform playloopsound ("elevator_loop");
  350. cannon RotateYaw(level.cannon_move_degrees, 1);
  351. angles += level.cannon_move_degrees;
  352. wait(1);
  353. //IPrintLnBold(cannon.angles);
  354. if(angles == 180)
  355. {
  356. level.cannons_done ++;
  357. if(level.cannons_done == 1)
  358. {
  359. IPrintLnBold("1 out of 4 Complete");
  360. }
  361. else if(level.cannons_done == 2)
  362. {
  363. IPrintLnBold("2 out of 4 Complete");
  364. }
  365. else if(level.cannons_done == 3)
  366. {
  367. IPrintLnBold("3 out of 4 Complete");
  368. }
  369. platform MoveTo(start, 1);
  370. zm_powerups::specific_powerup_drop( "empty_bottle", start + (0,0,40));
  371. thread isdone();
  372. cannon notify("cannon_done");
  373. }
  374. }
  375. else
  376. {
  377.  
  378. platform MoveTo(start, 1);
  379. //platform thread platform_sound();
  380. if(player_off_trig == false)
  381. {
  382. platform stoploopsound( 0.2 );
  383. wait(3);
  384. player_off_trig = true;
  385. }
  386. if(player_off_trig == true)
  387. {
  388. cannon notify("off_platform");
  389. platform playloopsound ("elevator_loop");
  390. cannon RotateYaw(-level.cannon_move_degrees, 1);
  391. angles -= level.cannon_move_degrees;
  392. wait(1);
  393. if(angles == 0)
  394. {
  395. platform stoploopsound( 0.2 );
  396. cannon_3();
  397. }
  398. }
  399. wait(0.05);
  400. }
  401. }
  402. }
  403. function cannon_4()
  404. {
  405. platform = GetEnt( "platform_4","targetname");
  406. start = platform.origin;
  407. cannon = GetEnt( "cannon_4","targetname");
  408. trig = GetEnt( "ee_trigger_4","targetname");
  409. trig TriggerEnable( true);
  410. trig waittill("trigger", player);
  411. player_off_trig = true;
  412. angles = 0;
  413.  
  414. cannon endon("cannon_done");
  415. while(1)
  416. {
  417. if( player IsTouching(trig))
  418. {
  419. if(player_off_trig == true)
  420. cannon thread spawnzombie();
  421. platform MoveTo(start - (0,0,4), 1);
  422. player_off_trig = false;
  423. //platform thread platform_sound();
  424. platform playloopsound ("elevator_loop");
  425. cannon RotateYaw(level.cannon_move_degrees, 1);
  426. angles += level.cannon_move_degrees;
  427. wait(1);
  428. //IPrintLnBold(cannon.angles);
  429. if(angles == 180)
  430. {
  431. level.cannons_done ++;
  432. if(level.cannons_done == 1)
  433. {
  434. IPrintLnBold("1 out of 4 Complete");
  435. }
  436. else if(level.cannons_done == 2)
  437. {
  438. IPrintLnBold("2 out of 4 Complete");
  439. }
  440. else if(level.cannons_done == 3)
  441. {
  442. IPrintLnBold("3 out of 4 Complete");
  443. }
  444. platform MoveTo(start, 1);
  445. zm_powerups::specific_powerup_drop( "empty_bottle", start + (0,0,40));
  446. thread isdone();
  447. cannon notify("cannon_done");
  448. }
  449. }
  450. else
  451. {
  452.  
  453. platform MoveTo(start, 1);
  454. //platform thread platform_sound();
  455. if(player_off_trig == false)
  456. {
  457. platform stoploopsound( 0.2 );
  458. wait(3);
  459. player_off_trig = true;
  460. }
  461. if(player_off_trig == true)
  462. {
  463. cannon notify("off_platform");
  464. platform playloopsound ("elevator_loop");
  465. cannon RotateYaw(-level.cannon_move_degrees, 1);
  466. angles -= level.cannon_move_degrees;
  467. wait(1);
  468. if(angles == 0)
  469. {
  470. platform stoploopsound( 0.2 );
  471. cannon_4();
  472. }
  473. }
  474. wait(0.05);
  475. }
  476. }
  477. }
  478. function cannon_fire()
  479. {
  480. thread play_2D_sound("cannon_fire");
  481. zombies = zombie_utility::get_round_enemy_array();
  482. if ( isdefined( zombies ) )
  483. {
  484. array::run_all( zombies, &Kill );
  485. }
  486. level flag::clear( "spawn_zombies" );
  487. wait(4);
  488. foreach(player in level.players)
  489. {
  490. player SetFlashBanged( true, 0.8 );
  491. Earthquake( 0.22, 5, player.origin, 200 );
  492. }
  493. level notify("after_easter_egg");
  494.  
  495. //time to Delete Stuff
  496. grow_souls = GetEntArray("grow_soul","targetname");
  497. for(i=0;i<grow_souls.size;i++)
  498. {
  499. grow_souls[i] Delete();
  500. }
  501. after_easter_egg = GetEntArray("after_easter_egg","targetname");
  502. for(i=0;i<after_easter_egg.size;i++)
  503. {
  504. after_easter_egg[i] Delete();
  505. }
  506. new_sand = GetEntArray("new_sand","targetname");
  507. for(i=0;i<new_sand.size;i++)
  508. {
  509. new_sand[i] MoveZ(640,1);
  510. }
  511. trig = GetEnt("cutscene_trig","targetname");
  512. level flag::set( "zone_17-18" );
  513. trig waittill("trigger",player);
  514. trig Delete();
  515. cutscene();
  516. }
  517. function cutscene()
  518. {
  519. zone18 = GetEnt("zone18","targetname");
  520. peeps_moved = 0;
  521. struct1 = struct::get("cutscene_struct1","targetname");
  522. struct2 = struct::get("cutscene_struct2","targetname");
  523. struct3 = struct::get("cutscene_struct3","targetname");
  524. struct4 = struct::get("cutscene_struct4","targetname");
  525. after_struct1 = struct::get("after_struct1","targetname");
  526. after_struct2 = struct::get("after_struct2","targetname");
  527. after_struct3 = struct::get("after_struct3","targetname");
  528. after_struct4 = struct::get("after_struct4","targetname");
  529. level notify("cutscene");
  530. foreach(player in level.players)
  531. {
  532. player DisableWeapons();
  533. player SetClientUIVisibilityFlag( "hud_visible", 0 );
  534. player DontInterpolate();
  535. peeps_moved ++;
  536. if(peeps_moved == 1)
  537. player SetOrigin( struct1.origin);
  538. player SetPlayerAngles( struct1.angles );
  539. if(peeps_moved == 2)
  540. player SetOrigin( struct2.origin);
  541. player SetPlayerAngles( struct2.angles );
  542. if(peeps_moved == 3)
  543. player SetOrigin( struct3.origin);
  544. player SetPlayerAngles( struct3.angles );
  545. if(peeps_moved == 4)
  546. player SetOrigin( struct4.origin);
  547. player SetPlayerAngles( struct4.angles );
  548. player FreezeControls( true );
  549. }
  550. VideoStart("sandstorm_cutscene");
  551. thread play_2D_sound("cutscene");
  552. wait( 64 );
  553. VideoStop("sandstorm_cutscene");
  554. peeps_moved_back = 0;
  555. foreach(player in level.players)
  556. {
  557. player EnableWeapons();
  558. player SetClientUIVisibilityFlag( "hud_visible", 1 );
  559. player DontInterpolate();
  560. peeps_moved_back ++;
  561. if(peeps_moved_back == 1)
  562. player SetOrigin( after_struct1.origin);
  563. player SetPlayerAngles( after_struct1.angles );
  564. if(peeps_moved_back == 2)
  565. player SetOrigin( after_struct2.origin);
  566. player SetPlayerAngles( after_struct2.angles );
  567. if(peeps_moved_back == 3)
  568. player SetOrigin( after_struct3.origin);
  569. player SetPlayerAngles( after_struct3.angles );
  570. if(peeps_moved_back == 4)
  571. player SetOrigin( after_struct4.origin);
  572. player SetPlayerAngles( after_struct4.angles );
  573. player FreezeControls( false );
  574. }
  575. level flag::set( "zone_13-8" );
  576. level flag::set( "zone_13-9" );
  577. thread zombiesleft_hud("Undead to Slay You:");
  578. wait(1);
  579. zone18 Delete();
  580. thread objectives( "Power the Cannons COMPLETE", true);
  581. special_spawner = GetEnt("special_spawner","targetname");
  582. wait(7);
  583. thread objectives( "DIE", false);
  584. thread play_2D_sound("heros_theme");
  585. level endon("intermission");
  586. while(1)
  587. {
  588. special_spawner thread goodbye_cruel_world();
  589. wait(1);
  590. }
  591. }
  592. function goodbye_cruel_world()
  593. {
  594. zombie = zombie_utility::spawn_zombie( self );
  595. }
Add Comment
Please, Sign In to add comment