Advertisement
Abnormal202

Untitled

Mar 25th, 2017
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 9.64 KB | None | 0 0
  1. function init()
  2. {
  3. level.opening_credits = true; //set true if you want to give me some credit for all this, as well as have a cool opening credits thingy. If you already have something like this, send me a message
  4.  
  5. level.move_on_x_axis_1 = false; //What axis the first (courtyard) door moves on. Only set ONE to true.
  6. level.move_on_y_axis_1 = false;
  7. level.move_on_z_axis_1 = true;
  8. level.door_1_distance = -124; //amount of units for the first door to move on the axis defined above. put a - before it if you want it to move in the opposite direction of the arrow in radiant.
  9. level.door_1_time = 2; //time in seconds for first door to move.
  10. level.move_on_x_axis_2 = false; //What axis the second (Pack-a-punch) door moves on. Only set ONE to true.
  11. level.move_on_y_axis_2 = true;
  12. level.move_on_z_axis_2 = false;
  13. level.door_2_distance = -145; //amount of units for the second door to move on the axis defined above. put a - before it if you want it to move in the opposite direction of the arrow in radiant.
  14. level.door_2_time = 2; //time in seconds for second door to move.
  15. level.move_on_x_axis_3 = true; //What axis the third (tunnel) door moves on. Only set ONE to true.
  16. level.move_on_y_axis_3 = false;
  17. level.move_on_z_axis_3 = false;
  18. level.door_3_distance = 85; //amount of units for the third door to move on the axis defined above. put a - before it if you want it to move in the opposite direction of the arrow in radiant.
  19. level.door_3_time = 2; //time in seconds for third door to move.
  20.  
  21. level.arena_zone_flag = "an_excellent_flag"; //flag to activate arena zone so zombies can spawn there and player doesn't die when he goes there.
  22. level.tunnel_zone_flag = "another_excellent_flag"; //flag to activate tunnel zone so zombies can spawn there and player doesn't die when he goes there.
  23.  
  24. level.brutus_spawn_wait_time_courtyard = 10; //time between brutus spawns in Courtyard
  25. level.brutus_spawn_wait_time_arena = 5; //time between brutus spawns in arena during infinite spawning
  26. level.brutus_spawn_wait_time_tunnel = 1; //time between brutus spawns in tunnel during infinite spawning
  27. level.zombie_arena_wait_time = 15; //time it takes in arena before zombies start spawning too
  28. level.after_zombie_arena_wait_time = 20; //time after the zombies start spawning in the arena before the arena is over.
  29.  
  30. level.soul_hintstring = "Press ^3[{+activate}]^7 to collect soul";
  31. level.soul_pedestal_hintstring = "Press ^3[{+activate}]^7 to place souls";
  32. level.item_hintstring = "Press ^3[{+activate}]^7 to pick up item";
  33. level.all_graves_collected_sound = "crumple";
  34. level.place_graves_hintstring = "Press ^3[{+activate}]^7 to place graves";
  35. level.end_game_message = "Thanks for Playing! You Have Escaped"; //What it says when you is da winner
  36.  
  37. level.gravestones = GetEntArray("gravestone","targetname");
  38. for( i=0;i<level.gravestones.size;i++ )
  39. {
  40. gravestone_trig = GetEnt(level.gravestones[i].target,"targetname");
  41. gravestone_trig thread nonohintstring();
  42. }
  43. level.gravestones_collected = 0;
  44. new_gravestone_trig = GetEnt("new_gravestone_trig","targetname");
  45. new_gravestone_trig thread nonohintstring();
  46. new_gravestones = GetEntArray("new_gravestone","targetname");
  47. for( i=0;i<new_gravestones.size;i++ )
  48. {
  49. new_gravestones[i] Hide();
  50. }
  51. if(level.opening_credits == true)
  52. {
  53. level thread opening_credits();
  54. }
  55. item();
  56. }
  57. function opening_credits()
  58. {
  59. wait(5);
  60. thread creat_simple_intro_hud("GULAG", 50, 70, 4, 5);
  61. wait(3);
  62. thread creat_simple_intro_hud("A Map By Psh", 50, 50, 2, 5);
  63. wait(2);
  64. thread creat_simple_intro_hud( "Scripting by Abnormal202", 50, 30, 2, 5 ); //if you had other scripters work on this, you could just say "easter egg by Abnormal202"
  65. }
  66. function creat_simple_intro_hud( text, align_x, align_y, font_scale, fade_time )
  67. {
  68. hud = NewHudElem();
  69. hud.foreground = true;
  70. hud.fontScale = font_scale;
  71. hud.sort = 1;
  72. hud.hidewheninmenu = false;
  73. hud.color = ( 0.541, 0, 0 ); //feel free to change the color of the words if you want. I have it set to blood red
  74. hud.alignX = "left";
  75. hud.alignY = "bottom";
  76. hud.horzAlign = "left";
  77. hud.vertAlign = "bottom";
  78. hud.x = align_x;
  79. hud.y = hud.y - align_y;
  80. hud.alpha = 1;
  81. hud SetText( text );
  82. wait( 8 );
  83. hud fadeOverTime( fade_time );
  84. hud.alpha = 0;
  85. wait( fade_time );
  86. hud Destroy();
  87. }
  88. function nonohintstring()
  89. {
  90. self Hide();
  91. }
  92. function item()
  93. {
  94. item = GetEnt("item","targetname");
  95. item_trig = GetEnt("item_trig","targetname");
  96. item_trig SetHintString(level.item_hintstring);
  97. item_trig waittill("trigger", player);
  98. item Delete();
  99. item_trig Delete();
  100. gravestones();
  101. }
  102. function gravestones()
  103. {
  104. level.gravestones = GetEntArray("gravestone","targetname");
  105. for( i=0;i<level.gravestones.size;i++ )
  106. {
  107. level.gravestones[i] thread gravestone_triggers();
  108. }
  109. }
  110. function gravestone_triggers()
  111. {
  112. gravestone_trig = GetEnt(self.target,"targetname");
  113. gravestone_trig Show();
  114. gravestone_trig waittill("trigger",player);
  115. self Delete();
  116. gravestone_trig Delete();
  117. level.gravestones_collected ++;
  118. //IPrintLnBold("collected " + level.gravestones_collected + " out of " + level.gravestones.size);
  119. if(level.gravestones_collected == level.gravestones.size)
  120. {
  121. PlaySoundAtPosition( level.all_graves_collected_sound, player.origin );
  122. gravestone_place_down();
  123. }
  124. }
  125. function gravestone_place_down()
  126. {
  127. trig = GetEnt("new_gravestone_trig","targetname");
  128. trig Show();
  129. trig SetHintString(level.place_graves_hintstring);
  130. trig waittill("trigger",player);
  131. trig Delete();
  132. new_gravestones = GetEntArray("new_gravestone","targetname");
  133. for( i=0;i<new_gravestones.size;i++ )
  134. {
  135. new_gravestones[i] Show();
  136. }
  137. level.door_1 = GetEnt("courtyard_door","targetname");
  138. if(level.move_on_x_axis_1 == true)
  139. level.door_1 MoveX(level.door_1_distance,level.door_1_time);
  140. if(level.move_on_y_axis_1 == true)
  141. level.door_1 MoveY(level.door_1_distance,level.door_1_time);
  142. if(level.move_on_z_axis_1 == true)
  143. level.door_1 MoveZ(level.door_1_distance,level.door_1_time);
  144. level flag::clear( "spawn_zombies" );
  145. spawnbrutus1();
  146. }
  147. function spawnbrutus1()
  148. {
  149. for( i=0;i<level.gravestones.size;i++ )
  150. {
  151. thread brutus::alternate_spawn_brutus();
  152. wait(level.brutus_spawn_wait_time_courtyard);
  153. }
  154. }
  155. function souls_collected()
  156. {
  157.  
  158. trig = GetEnt("soul_pedestal_trigger","targetname");
  159. trig SetHintString(level.soul_pedestal_hintstring);
  160. struct = struct::get("soul_pedestal_location","targetname");
  161. trig waittill("trigger",player);
  162. fxOrg = util::spawn_model( "tag_origin", struct.origin);
  163. struct Delete();
  164. PlayFxOnTag( SOUL_FX, fxOrg, "tag_origin");
  165. trig Delete();
  166. pap_door();
  167. }
  168. function pap_door()
  169. {
  170. level.door_2 = GetEnt("pap_door","targetname");
  171. if(level.move_on_x_axis_2 == true)
  172. level.door_2 MoveX(level.door_2_distance,level.door_2_time);
  173. if(level.move_on_y_axis_2 == true)
  174. level.door_2 MoveY(level.door_2_distance,level.door_2_time);
  175. if(level.move_on_z_axis_2 == true)
  176. level.door_2 MoveZ(level.door_2_distance,level.door_2_time);
  177. level flag::set( level.arena_zone_flag );
  178. arena_fight();
  179. }
  180. function arena_fight()
  181. {
  182. trig = GetEnt("need_all_players_trigger","targetname");
  183. trig waittill("trigger",player);
  184. trig Delete();
  185. if(level.move_on_x_axis_2 == true)
  186. level.door_2 MoveX(-level.door_2_distance,level.door_2_time);
  187. if(level.move_on_y_axis_2 == true)
  188. level.door_2 MoveY(-level.door_2_distance,level.door_2_time);
  189. if(level.move_on_z_axis_2 == true)
  190. level.door_2 MoveZ(-level.door_2_distance,level.door_2_time);
  191. wait(level.door_2_time);
  192. //IPrintLnBold("let the fighting begin");
  193. level flag::clear( "spawn_zombies" );
  194. level thread brutus_spawn_in_arena();
  195. level thread zombies_spawn_too();
  196. level.using_zombie_powerups = false;
  197.  
  198.  
  199. }
  200. function brutus_spawn_in_arena()
  201. {
  202. brutus_spawners = struct::get_array("brutus_arena_spawn","targetname");
  203. level endon("no_mo_brutus");
  204. while(1)
  205. {
  206. rand = RandomIntRange( 0, brutus_spawners.size );
  207. brutus_spawners[rand] thread brutus::arena_spawn_brutus();
  208. //IPrintLnBold(rand);
  209. wait(level.brutus_spawn_wait_time_arena);
  210. }
  211. }
  212. function zombies_spawn_too()
  213. {
  214. wait(level.zombie_arena_wait_time);
  215. level flag::set( "spawn_zombies" );
  216. //IPrintLnBold("zombies enter the ring");
  217. wait(level.after_zombie_arena_wait_time);
  218. level notify("no_mo_brutus");
  219. //IPrintLnBold("stop spawning the Bruti");
  220. struct = struct::get("max_ammo_spawnpoint","targetname");
  221. level.using_zombie_powerups = true;
  222. thread zm_powerups::specific_powerup_drop( "full_ammo", struct.origin);
  223. level.door_3 = GetEnt("door_3","targetname");
  224. if(level.move_on_x_axis_3 == true)
  225. level.door_3 MoveX(level.door_3_distance,level.door_3_time);
  226. if(level.move_on_y_axis_3 == true)
  227. level.door_3 MoveY(level.door_3_distance,level.door_3_time);
  228. if(level.move_on_z_axis_3 == true)
  229. level.door_3 MoveZ(level.door_3_distance,level.door_3_time);
  230. level flag::set( level.tunnel_zone_flag );
  231. level.using_zombie_powerups = false;
  232. foreach(player in level.players)
  233. {
  234. player thread tunnel_fight();
  235. }
  236. endgame();
  237. }
  238. function tunnel_fight()
  239. {
  240. trigs = GetEntArray("tunnel_trig","targetname");
  241. while(1)
  242. {
  243. for(i=0;i<trigs.size;i++)
  244. {
  245.  
  246. if(self IsTouching(trigs[i]))
  247. {
  248. //IPrintLnBold("get Triggered");
  249. trigs[i] thread spawn_dat_boi();
  250.  
  251. }
  252.  
  253. }
  254. wait(level.brutus_spawn_wait_time_tunnel);
  255. }
  256. }
  257. function spawn_dat_boi()
  258. {
  259. struct = struct::get(self.target,"targetname");
  260. if(IsDefined(struct))
  261. //IPrintLnBold("struct is defined");
  262. struct thread brutus::arena_spawn_brutus();
  263. }
  264. function endgame()
  265. {
  266. trig = GetEnt("end_trigger","targetname");
  267. trig waittill("trigger",player);
  268. level.all_players_near_end = true;
  269. end_it_now();
  270.  
  271. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement