From d20be0e885add65cfd9742f992b3eb329e7f80e6 Mon Sep 17 00:00:00 2001 From: Sparker <60593579+Sparker-99@users.noreply.github.com> Date: Thu, 20 Feb 2020 23:59:11 +0530 Subject: [PATCH] Create tombstone.gsc --- TombstoneFix/tombstone.gsc | 66 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 66 insertions(+) create mode 100644 TombstoneFix/tombstone.gsc diff --git a/TombstoneFix/tombstone.gsc b/TombstoneFix/tombstone.gsc new file mode 100644 index 0000000..e542ff6 --- /dev/null +++ b/TombstoneFix/tombstone.gsc @@ -0,0 +1,66 @@ +#include maps\mp\_utility; +#include common_scripts\utility; +#include maps\mp\gametypes_zm\_hud_util; +#include maps\mp\gametypes_zm\_hud_message; +#include maps\mp\zombies\_zm_perks; + +init() +{ + level thread perk_machine_spawn_init(); + thread solo_tombstone_removal(); + thread turn_tombstone_on(); +} + +solo_tombstone_removal() +{ + notify( "tombstone_on" ); +} + +turn_tombstone_on() +{ + while ( 1 ) + { + machine = getentarray( "vending_tombstone", "targetname" ); + machine_triggers = getentarray( "vending_tombstone", "target" ); + i = 0; + while ( i < machine.size ) + { + machine[ i ] setmodel( level.machine_assets[ "tombstone" ].off_model ); + i++; + } + level thread do_initial_power_off_callback( machine, "tombstone" ); + array_thread( machine_triggers, ::set_power_on, 0 ); + level waittill( "tombstone_on" ); + i = 0; + while ( i < machine.size ) + { + machine[ i ] setmodel( level.machine_assets[ "tombstone" ].on_model ); + machine[ i ] vibrate( vectorScale( ( 0, -1, 0 ), 100 ), 0,3, 0,4, 3 ); + machine[ i ] playsound( "zmb_perks_power_on" ); + machine[ i ] thread perk_fx( "tombstone_light" ); + machine[ i ] thread play_loop_on_machine(); + i++; + } + level notify( "specialty_scavenger_power_on" ); + array_thread( machine_triggers, ::set_power_on, 1 ); + if ( isDefined( level.machine_assets[ "tombstone" ].power_on_callback ) ) + { + array_thread( machine, level.machine_assets[ "tombstone" ].power_on_callback ); + } + level waittill( "tombstone_off" ); + if ( isDefined( level.machine_assets[ "tombstone" ].power_off_callback ) ) + { + array_thread( machine, level.machine_assets[ "tombstone" ].power_off_callback ); + } + array_thread( machine, ::turn_perk_off ); + players = get_players(); + _a1718 = players; + _k1718 = getFirstArrayKey( _a1718 ); + while ( isDefined( _k1718 ) ) + { + player = _a1718[ _k1718 ]; + player.hasperkspecialtytombstone = undefined; + _k1718 = getNextArrayKey( _a1718, _k1718 ); + } + } +}