Guest User

Untitled

a guest
Nov 15th, 2019
83
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #using scripts\codescripts\struct;
  2.  
  3. #using scripts\shared\array_shared;
  4. #using scripts\shared\callbacks_shared;
  5. #using scripts\shared\clientfield_shared;
  6. #using scripts\shared\compass;
  7. #using scripts\shared\exploder_shared;
  8. #using scripts\shared\flag_shared;
  9. #using scripts\shared\laststand_shared;
  10. #using scripts\shared\math_shared;
  11. #using scripts\shared\scene_shared;
  12. #using scripts\shared\util_shared;
  13.  
  14. #insert scripts\shared\shared.gsh;
  15. #insert scripts\shared\version.gsh;
  16.  
  17. #insert scripts\zm\_zm_utility.gsh;
  18.  
  19. #using scripts\zm\_load;
  20. #using scripts\zm\_zm;
  21. #using scripts\zm\_zm_audio;
  22. #using scripts\zm\_zm_powerups;
  23. #using scripts\zm\_zm_utility;
  24. #using scripts\zm\_zm_weapons;
  25. #using scripts\zm\_zm_zonemgr;
  26.  
  27. #using scripts\shared\ai\zombie_utility;
  28.  
  29. //Perks
  30. #using scripts\zm\_zm_pack_a_punch;
  31. #using scripts\zm\_zm_pack_a_punch_util;
  32. #using scripts\zm\_zm_perk_additionalprimaryweapon;
  33. #using scripts\zm\_zm_perk_doubletap2;
  34. #using scripts\zm\_zm_perk_deadshot;
  35. #using scripts\zm\_zm_perk_juggernaut;
  36. #using scripts\zm\_zm_perk_quick_revive;
  37. #using scripts\zm\_zm_perk_sleight_of_hand;
  38. #using scripts\zm\_zm_perk_staminup;
  39. #using scripts\zm\_zm_perk_electric_cherry;
  40. #using scripts\zm\_zm_perk_widows_wine;
  41. #using scripts\zm\_zm_perk_vulture_aid;
  42. #using scripts\zm\_zm_perk_whoswho;
  43. #using scripts\zm\_zm_perk_tombstone;
  44. #using scripts\zm\_zm_perk_phdflopper;
  45. #using scripts\zm\_zm_perk_random;
  46.  
  47. //Powerups
  48. #using scripts\zm\_zm_powerup_double_points;
  49. #using scripts\zm\_zm_powerup_carpenter;
  50. #using scripts\zm\_zm_powerup_fire_sale;
  51. #using scripts\zm\_zm_powerup_free_perk;
  52. #using scripts\zm\_zm_powerup_full_ammo;
  53. #using scripts\zm\_zm_powerup_insta_kill;
  54. #using scripts\zm\_zm_powerup_nuke;
  55. //#using scripts\zm\_zm_powerup_weapon_minigun;
  56.  
  57. //Traps
  58. #using scripts\zm\_zm_trap_electric;
  59.  
  60. //Custom usings
  61. #using scripts\zm\_zm_score;
  62. #using scripts\zm\_zm_weapons;
  63. #using scripts\shared\laststand_shared;
  64.  
  65. #using scripts\zm\zm_usermap;
  66.  
  67. #define CRAFTING_DONE "zm_mc_craft_done"
  68.  
  69. //*****************************************************************************
  70. // MAIN
  71. //*****************************************************************************
  72.  
  73. function main()
  74. {
  75. zm_usermap::main();
  76.  
  77. //Points
  78. level.player_starting_points = 50000;
  79.  
  80. level._zombie_custom_add_weapons =&custom_add_weapons;
  81.  
  82. //Setup the levels Zombie Zone Volumes
  83. level.zones = [];
  84. level.zone_manager_init_func =&usermap_test_zone_init;
  85. init_zones[0] = "start_zone";
  86. level thread zm_zonemgr::manage_zones( init_zones );
  87.  
  88. level.pathdist_type = PATHDIST_ORIGINAL;
  89.  
  90. //Scripts
  91. thread buy_a_house_init();
  92. thread craft_stone_sword_init();
  93. thread credit();
  94.  
  95. //Perks
  96. level thread new_perk_model( "vending_revive", "specialty_quickrevive" );
  97. level thread new_perk_model( "vending_doubletap", "specialty_doubletap2" );
  98. level thread new_perk_model( "vending_electriccherry", "specialty_electriccherry" );
  99. level thread new_perk_model( "vending_jugg", "specialty_armorvest" );
  100. level thread new_perk_model( "vending_sleight", "specialty_fastreload" );
  101. level thread new_perk_model( "vending_widowswine", "specialty_widowswine" );
  102. }
  103.  
  104. function usermap_test_zone_init()
  105. {
  106. level flag::init( "always_on" );
  107. level flag::set( "always_on" );
  108. }
  109.  
  110. function custom_add_weapons()
  111. {
  112. zm_weapons::load_weapon_spec_from_table("gamedata/weapons/zm/zm_levelcommon_weapons.csv", 1);
  113. }
  114.  
  115. function credit()
  116. {
  117. level flag::wait_till( "initial_blackscreen_passed" );
  118. wait 3;
  119. thread better_print ("^2Minecraft Zombies!", 0, 0, 3, 3 );
  120. wait 5;
  121. thread better_print ("^1Brought to you by ^2Logical Edits,^4IceGrenade,^3Symbo & ^1Clix", 0, 0, 2, 3 );
  122. while(1)
  123. {
  124. iPrintLn("How are you still alive?");
  125. wait 600;
  126. }
  127. }
  128.  
  129. function better_print( text, align_x, align_y, font_scale, fade_time )
  130. {
  131. hud = NewHudElem();
  132. hud.foreground = true;
  133. hud.fontScale = font_scale;
  134. hud.sort = 1;
  135. hud.hidewheninmenu = false;
  136. hud.alignX = "center";
  137. hud.alignY = "middle";
  138. hud.horzAlign = "center";
  139. hud.vertAlign = "middle";
  140. hud.x = align_x;
  141. hud.y = hud.y - align_y;
  142. hud.alpha = 1;
  143. hud SetText( text );
  144. wait( 2 );
  145. hud fadeOverTime( fade_time );
  146. hud.alpha = 0;
  147. wait( fade_time );
  148. hud Destroy();
  149. }
  150.  
  151. function new_perk_model( radiant_machine, str_name )
  152. {
  153. level._no_vending_machine_auto_collision = true;
  154. level flag::wait_till( "all_players_connected" );
  155. perk_machine_model = GetEnt( radiant_machine, "targetname" );
  156. perk_machine_model SetModel( "tag_origin" );
  157. perk_machine_model MoveZ( -1000, .05 );
  158. }
  159.  
  160. function buy_a_house_init()
  161. {
  162. //triggers
  163. house1trigger = GetEnt("house_trigger_1", "targetname");
  164. house2trigger = GetEnt("house_trigger_2", "targetname");
  165. house3trigger = GetEnt("house_trigger_3", "targetname");
  166. house4trigger = GetEnt("house_trigger_4", "targetname");
  167. house5trigger = GetEnt("house_trigger_5", "targetname");
  168.  
  169. wall1trigger = GetEnt("wall_trigger_1", "targetname");
  170. wall2trigger = GetEnt("wall_trigger_2", "targetname");
  171. wall3trigger = GetEnt("wall_trigger_3", "targetname");
  172. wall4trigger = GetEnt("wall_trigger_4", "targetname");
  173. wall5trigger = GetEnt("wall_trigger_5", "targetname");
  174.  
  175. level.currentHouse = undefined;
  176. level.activation_order_level = 1;
  177.  
  178. //make each house lever work
  179. house1trigger thread trigger_object(GetEntArray("mc_dirt_house", "targetname"),1500,1);
  180. house2trigger thread trigger_object(GetEntArray("mc_cozy_house", "targetname"),2500,2);
  181. house3trigger thread trigger_object(GetEntArray("mc_bunker_house", "targetname"),5000,3);
  182. house4trigger thread trigger_object(GetEntArray("mc_fort_house", "targetname"),7500,4);
  183. house5trigger thread trigger_object(GetEntArray("mc_castle_house", "targetname"),10000,5);
  184.  
  185. wall1trigger thread trigger_object(GetEntArray("wall_front_left", "targetname"),1500,0);
  186. wall2trigger thread trigger_object(GetEntArray("wall_front_right", "targetname"),1500,0);
  187. wall3trigger thread trigger_object(GetEntArray("wall_left", "targetname"),2000,0);
  188. wall4trigger thread trigger_object(GetEntArray("wall_right", "targetname"),2000,0);
  189. wall5trigger thread trigger_object(GetEntArray("wall_back", "targetname"),3000,0);
  190.  
  191. }
  192.  
  193. function trigger_object(house,lever_cost,activation_order)
  194. {
  195. foreach(part in house)
  196. {
  197. part MoveZ(-1200,0.05);
  198. part DisconnectPaths();
  199. }
  200.  
  201. self SetCursorHint("HINT_NOICON");
  202. self SetHintString("You cannot Upgrade this house yet!");
  203. while(1)
  204. {
  205. if(level.activation_order_level == activation_order || activation_order == 0)
  206. break;
  207. wait 2;
  208. }
  209. if(activation_order != 0)
  210. self SetHintString("Hold ^3^1&&1^3 ^7to purchase House Upgrade");
  211. else
  212. self SetHintString("Hold ^3^1&&1^3 ^7to purchase Wall Upgrade");
  213.  
  214. while(1)
  215. {
  216. self waittill("trigger", player);
  217. if(player.score < lever_cost)
  218. {
  219. self SetHintString("You don't have enough Money!");
  220. wait 1.5;
  221. continue;
  222. }
  223. player zm_score::minus_to_player_score(lever_cost);
  224.  
  225. if(activation_order != 0)
  226. {
  227. self SetHintString("This House has been Upgraded!");
  228. //remove old house
  229. if(isDefined(level.currentHouse))
  230. {
  231. foreach(part in level.currentHouse)
  232. {
  233. part MoveZ(-1200,0.1);
  234. wait 0.1;
  235. part Delete();
  236. part DisconnectPaths();
  237. }
  238. }
  239.  
  240. level.activation_order_level +=1;
  241. level.currentHouse = house;
  242. thread teleportplayers();
  243. }
  244. else
  245. self SetHintString("This Wall has been Upgraded!");
  246.  
  247. break;
  248. }
  249. pathNodes = [];
  250. //move part up
  251. foreach(part in house)
  252. {
  253. part MoveZ(1200,3);
  254. if(part.script_string =="node")
  255. pathNodes[pathNodes.Length] = part;
  256. }
  257. foreach(node in pathNodes)
  258. {
  259. node = SpawnPathNode( cover_left, node.origin, angles )
  260. }
  261. foreach(part in house)
  262. {
  263. part DisconnectPaths();
  264. part ConnectPaths();
  265. }
  266. wait 3.1;
  267. lever = GetEnt(self.target, "targetname");
  268. lever RotateTo((0, 0, 135), 1, 0.5);
  269. PlaySoundAtPosition("zm_mc_house_pistons", (0,0,0));
  270. }
  271.  
  272. function teleportplayers()
  273. {
  274. node = (-160,-352,32);
  275. tptrig = GetEnt("mc_tele_players", "targetname");
  276. foreach(player in GetPlayers())
  277. {
  278. player SetOrigin(node);
  279. node += (100,0,0);
  280. wait 0.05;
  281.  
  282. if(player IsTouching(tptrig))
  283. {
  284. player SetOrigin(node);
  285. node += (100,0,0);
  286. wait 0.05;
  287. }
  288. }
  289. }
  290.  
  291. function craft_stone_sword_init()
  292. {
  293. level.has_stone_stick = 0;
  294. level.has_stone = 0;
  295. //stick triggers
  296. sticktrigger = GetEntArray("stick_trigger", "targetname");
  297. stonetrigger = GetEntArray("stone_trigger", "targetname");
  298.  
  299. level.stonecrafttrigger = GetEnt("stone_craft_trigger", "targetname");
  300. level.stonecrafttrigger SetHintString("You require more Materials!");
  301. level.stonecrafttrigger SetCursorHint("HINT_NOICON");
  302.  
  303. level.stonecraftsword = GetEnt("stone_craft_sword", "targetname");
  304. level.stonecraftsword Hide();
  305.  
  306. for( i=0; i < sticktrigger.size; i++ )
  307. {
  308. sticktrigger[i] thread pick_up_stone_stick();
  309. wait 0.05;
  310. break;
  311. }
  312.  
  313. for( i=0; i < stonetrigger.size; i++)
  314. {
  315. stonetrigger[i] thread pick_up_stone();
  316. wait 0.05;
  317. break;
  318. }
  319. }
  320.  
  321. function pick_up_stone_stick()
  322. {
  323. self waittill("trigger", player);
  324. model = GetEnt(self.target, "targetname");
  325. model Delete();
  326. self Delete();
  327. level.has_stone_stick++;
  328. thread check_stone_sword();
  329. }
  330.  
  331. function pick_up_stone()
  332. {
  333. self waittill("trigger", player);
  334. model = GetEnt(self.target, "targetname");
  335. model Delete();
  336. self Delete();
  337. level.has_stone++;
  338. thread check_stone_sword();
  339. }
  340.  
  341. function check_stone_sword()
  342. {
  343. if(level.has_stone_stick >= 1 && level.has_stone >= 2)
  344. {
  345. level.stonecrafttrigger SetHintString("Hold ^3^1&&1^3 ^7to craft Stone Sword");
  346. level.stonecrafttrigger waittill("trigger", player);
  347. level.stonecrafttrigger PlaySoundOnTag(CRAFTING_DONE, "tag_origin");
  348. level.stonecrafttrigger Delete();
  349. level.stonecraftsword Show();
  350.  
  351. level notify("stone_sword_crafted");
  352.  
  353. wait 1;
  354.  
  355. level.stonecraftsword = Spawn("trigger_radius_use", level.stonecraftsword.origin, 0, 40, 80);
  356.  
  357. while(1)
  358. {
  359. level.stonecraftsword SetHintString("Hold ^3^1&&1^3 ^7to buy Stone Sword");
  360. level.stonecraftsword waittill("trigger", player);
  361. if(player.score < 1000)
  362. {
  363. self SetHintString("You don't have enough Money!");
  364. wait 1.5;
  365. continue;
  366. }
  367. player zm_score::minus_to_player_score(1000);
  368.  
  369. if ( player laststand::player_is_in_laststand() || IS_TRUE( player.intermission ) )
  370. continue;
  371.  
  372. player zm_weapons::weapon_give( getWeapon("mc_sword_stone"), 0, 0, 1, 1 );
  373.  
  374. }
  375.  
  376. wait 0.05;
  377. break;
  378.  
  379. }
  380. }
RAW Paste Data