SHOW:
|
|
- or go back to the newest paste.
| 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 credit(); | |
| 93 | ||
| 94 | - | //Perks |
| 94 | + | |
| 95 | - | level thread new_perk_model( "vending_revive", "specialty_quickrevive" ); |
| 95 | + | |
| 96 | - | level thread new_perk_model( "vending_doubletap", "specialty_doubletap2" ); |
| 96 | + | |
| 97 | - | level thread new_perk_model( "vending_electriccherry", "specialty_electriccherry" ); |
| 97 | + | |
| 98 | - | level thread new_perk_model( "vending_jugg", "specialty_armorvest" ); |
| 98 | + | |
| 99 | - | level thread new_perk_model( "vending_sleight", "specialty_fastreload" ); |
| 99 | + | |
| 100 | - | level thread new_perk_model( "vending_widowswine", "specialty_widowswine" ); |
| 100 | + | |
| 101 | ||
| 102 | function custom_add_weapons() | |
| 103 | {
| |
| 104 | zm_weapons::load_weapon_spec_from_table("gamedata/weapons/zm/zm_levelcommon_weapons.csv", 1);
| |
| 105 | } | |
| 106 | ||
| 107 | function credit() | |
| 108 | {
| |
| 109 | level flag::wait_till( "initial_blackscreen_passed" ); | |
| 110 | wait 3; | |
| 111 | thread better_print ("^2Minecraft Zombies!", 0, 0, 3, 3 );
| |
| 112 | wait 5; | |
| 113 | thread better_print ("^1Brought to you by ^2Logical Edits, ^4IceGrenade, ^3Symbo & ^1Clix", 0, 0, 2, 3 );
| |
| 114 | while(1) | |
| 115 | {
| |
| 116 | iPrintLn("How are you still alive?");
| |
| 117 | wait 600; | |
| 118 | } | |
| 119 | } | |
| 120 | ||
| 121 | function better_print( text, align_x, align_y, font_scale, fade_time ) | |
| 122 | {
| |
| 123 | hud = NewHudElem(); | |
| 124 | hud.foreground = true; | |
| 125 | hud.fontScale = font_scale; | |
| 126 | hud.sort = 1; | |
| 127 | hud.hidewheninmenu = false; | |
| 128 | hud.alignX = "center"; | |
| 129 | hud.alignY = "middle"; | |
| 130 | hud.horzAlign = "center"; | |
| 131 | hud.vertAlign = "middle"; | |
| 132 | hud.x = align_x; | |
| 133 | hud.y = hud.y - align_y; | |
| 134 | hud.alpha = 1; | |
| 135 | hud SetText( text ); | |
| 136 | wait( 2 ); | |
| 137 | hud fadeOverTime( fade_time ); | |
| 138 | hud.alpha = 0; | |
| 139 | wait( fade_time ); | |
| 140 | hud Destroy(); | |
| 141 | } | |
| 142 | ||
| 143 | function buy_a_house_init() | |
| 144 | {
| |
| 145 | //triggers | |
| 146 | house1trigger = GetEnt("house_trigger_1", "targetname");
| |
| 147 | house2trigger = GetEnt("house_trigger_2", "targetname");
| |
| 148 | house3trigger = GetEnt("house_trigger_3", "targetname");
| |
| 149 | house4trigger = GetEnt("house_trigger_4", "targetname");
| |
| 150 | - | function new_perk_model( radiant_machine, str_name ) |
| 150 | + | |
| 151 | ||
| 152 | - | level._no_vending_machine_auto_collision = true; |
| 152 | + | |
| 153 | - | level flag::wait_till( "all_players_connected" ); |
| 153 | + | |
| 154 | - | perk_machine_model = GetEnt( radiant_machine, "targetname" ); |
| 154 | + | |
| 155 | - | perk_machine_model SetModel( "tag_origin" ); |
| 155 | + | |
| 156 | - | perk_machine_model MoveZ( -1000, .05 ); |
| 156 | + | |
| 157 | ||
| 158 | level.currentHouse = undefined; | |
| 159 | level.activation_order_level = 1; | |
| 160 | ||
| 161 | //make each house lever work | |
| 162 | house1trigger thread trigger_object(GetEntArray("mc_dirt_house", "targetname"),1500,1);
| |
| 163 | house2trigger thread trigger_object(GetEntArray("mc_cozy_house", "targetname"),2500,2);
| |
| 164 | house3trigger thread trigger_object(GetEntArray("mc_bunker_house", "targetname"),5000,3);
| |
| 165 | house4trigger thread trigger_object(GetEntArray("mc_fort_house", "targetname"),7500,4);
| |
| 166 | house5trigger thread trigger_object(GetEntArray("mc_castle_house", "targetname"),10000,5);
| |
| 167 | ||
| 168 | wall1trigger thread trigger_object(GetEntArray("wall_front_left", "targetname"),1500,0);
| |
| 169 | wall2trigger thread trigger_object(GetEntArray("wall_front_right", "targetname"),1500,0);
| |
| 170 | wall3trigger thread trigger_object(GetEntArray("wall_left", "targetname"),2000,0);
| |
| 171 | wall4trigger thread trigger_object(GetEntArray("wall_right", "targetname"),2000,0);
| |
| 172 | wall5trigger thread trigger_object(GetEntArray("wall_back", "targetname"),3000,0);
| |
| 173 | ||
| 174 | } | |
| 175 | ||
| 176 | function trigger_object(house,lever_cost,activation_order) | |
| 177 | {
| |
| 178 | foreach(part in house) | |
| 179 | {
| |
| 180 | part MoveZ(-1200,0.05); | |
| 181 | //part DisconnectPaths(); | |
| 182 | } | |
| 183 | ||
| 184 | self SetCursorHint("HINT_NOICON");
| |
| 185 | self SetHintString("You cannot Upgrade this house yet!");
| |
| 186 | while(1) | |
| 187 | {
| |
| 188 | if(level.activation_order_level == activation_order || activation_order == 0) | |
| 189 | break; | |
| 190 | wait 2; | |
| 191 | } | |
| 192 | if(activation_order != 0) | |
| 193 | self SetHintString("Hold ^3^1&&1^3 ^7to purchase House Upgrade");
| |
| 194 | else | |
| 195 | self SetHintString("Hold ^3^1&&1^3 ^7to purchase Wall Upgrade");
| |
| 196 | ||
| 197 | while(1) | |
| 198 | {
| |
| 199 | self waittill("trigger", player);
| |
| 200 | if(player.score < lever_cost) | |
| 201 | {
| |
| 202 | self SetHintString("You don't have enough Money!");
| |
| 203 | wait 1.5; | |
| 204 | continue; | |
| 205 | } | |
| 206 | player zm_score::minus_to_player_score(lever_cost); | |
| 207 | ||
| 208 | if(activation_order != 0) | |
| 209 | {
| |
| 210 | self SetHintString("This House has been Upgraded!");
| |
| 211 | //remove old house | |
| 212 | if(isDefined(level.currentHouse)) | |
| 213 | {
| |
| 214 | foreach(part in level.currentHouse) | |
| 215 | {
| |
| 216 | part MoveZ(-1200,0.1); | |
| 217 | wait 0.1; | |
| 218 | part Delete(); | |
| 219 | //part DisconnectPaths(); | |
| 220 | } | |
| 221 | } | |
| 222 | ||
| 223 | level.activation_order_level +=1; | |
| 224 | level.currentHouse = house; | |
| 225 | thread teleportplayers(); | |
| 226 | } | |
| 227 | else | |
| 228 | self SetHintString("This Wall has been Upgraded!");
| |
| 229 | ||
| 230 | break; | |
| 231 | } | |
| 232 | //pathNodes = []; | |
| 233 | //move part up | |
| 234 | foreach(part in house) | |
| 235 | {
| |
| 236 | part MoveZ(1200,3); | |
| 237 | //if(part.script_string =="node") | |
| 238 | // pathNodes[pathNodes.Length] = part; | |
| 239 | } | |
| 240 | //house[0] DisconnectPaths(); | |
| 241 | //house[0] ConnectPaths(); | |
| 242 | wait 3.1; | |
| 243 | lever = GetEnt(self.target, "targetname"); | |
| 244 | lever RotateTo((0, 0, 135), 1, 0.5); | |
| 245 | PlaySoundAtPosition("zm_mc_house_pistons", (0,0,0));
| |
| 246 | } | |
| 247 | ||
| 248 | function teleportplayers() | |
| 249 | {
| |
| 250 | node = (-160,-352,32); | |
| 251 | tptrig = GetEnt("mc_tele_players", "targetname");
| |
| 252 | foreach(player in GetPlayers()) | |
| 253 | {
| |
| 254 | player SetOrigin(node); | |
| 255 | node += (100,0,0); | |
| 256 | wait 0.05; | |
| 257 | ||
| 258 | if(player IsTouching(tptrig)) | |
| 259 | {
| |
| 260 | player SetOrigin(node); | |
| 261 | node += (100,0,0); | |
| 262 | wait 0.05; | |
| 263 | } | |
| 264 | } | |
| 265 | } |