Release Mob of the dead, infinite afterlives and mana, included a bonus or two

Xeirh

Veteran
Messages
7
Reaction score
1
Points
563
be sure to add #include maps\mp\zombies\_zm_afterlife;
get_afterlives_loop( player ) {
player endon( "call_afterlives_loop" );
while( true ) {
if( isdefined( player.lives ) ) {
if( player.lives < 1 ) {
player.lives = 1;
}
}
player setclientfieldtoplayer( "player_lives", player.lives );
wait .05;
}
}
get_afterlife_mana_loop( player ) {
player endon( "call_afterlife_mana_loop" );
while( player.manacur > 0 ) {
if( player.manacur < 200 ) {
player.manacur = 200;
}
n_mapped_mana = linear_map( player.manacur, 0, 200, 0, 1 );
player setclientfieldtoplayer( "player_afterlife_mana", n_mapped_mana );
wait .05;
}
}
you could just use `maps\mp\zombies\_zm_afterlife::afterlife_doors_open();` but will only work on the map itself and will crash all the others, sadly you gotta have spaghetti code
afterlife_doors( action ) {
if( isdefined( player.afterlife ) && player.afterlife ) {
player iprintln( "Leave afterlife to use this function" );
}
else {
if( action == "Show Doors" ) {
player thread afterlife_doors_open();
}
if( action == "Hide Doors" ) {
player thread afterlife_doors_close();
}
}
}
afterlife_doors_open() {
n_network_sent = 0;
a_show = getentarray( "afterlife_show", "targetname" );
a_show = arraycombine( a_show, getentarray( "afterlife_prop", "script_noteworthy" ), 0, 0 );
_a888 = a_show;
_k888 = getfirstarraykey( _a888 );
while( isdefined( _k888 ) ) {
ent = _a888[ _k888 ];
n_network_sent++;
if( n_network_sent > 10 ) {
n_network_sent = 0;
wait_network_frame();
}
if( isdefined( ent ) ) {
ent setvisibletoplayer( self );
}
_k888 = getnextarraykey( _a888, _k888 );
}
a_hide = getentarray( "afterlife_door", "targetname" );
a_hide = arraycombine( a_hide, getentarray( "zombie_door", "targetname" ), 0, 0 );
a_hide = arraycombine( a_hide, getentarray( "quest_trigger", "script_noteworthy" ), 0, 0 );
a_hide = arraycombine( a_hide, getentarray( "trap_trigger", "script_noteworthy" ), 0, 0 );
a_hide = arraycombine( a_hide, getentarray( "travel_trigger", "script_noteworthy" ), 0, 0 );
_a907 = a_hide;
_k907 = getfirstarraykey( _a907 );
while( isdefined( _k907 ) ) {
ent = _a907[ _k907 ];
n_network_sent++;
if ( n_network_sent > 10 ) {
n_network_sent = 0;
wait_network_frame();
}
if ( isDefined( ent ) ) {
ent setinvisibletoplayer( self );
}
_k907 = getnextarraykey( _a907, _k907 );
}
while( isdefined( self.claymores ) ) {
_a924 = self.claymores;
_k924 = getfirstarraykey( _a924 );
while( isdefined( _k924 ) ) {
claymore = _a924[ _k924 ];
if( isdefined( claymore.pickuptrigger ) ) {
claymore.pickuptrigger setinvisibletoplayer( self );
}
_k924 = getnextarraykey( _a924, _k924 );
}
}
}
afterlife_doors_close() {
n_network_sent = 0;
a_hide = getentarray( "afterlife_show", "targetname" );
a_hide = arraycombine( a_hide, getentarray( "afterlife_prop", "script_noteworthy" ), 0, 0 );
_a943 = a_hide;
_k943 = getfirstarraykey( _a943 );
while( isdefined( _k943 ) ) {
ent = _a943[ _k943 ];
n_network_sent++;
if( n_network_sent > 10 ) {
n_network_sent = 0;
wait_network_frame();
}
if( isdefined( ent ) ) {
ent setinvisibletoplayer( self );
}
_k943 = getnextarraykey( _a943, _k943 );
}
a_show = getentarray( "afterlife_door", "targetname" );
a_show = arraycombine( a_show, getentarray( "zombie_door", "targetname" ), 0, 0 );
a_show = arraycombine( a_show, getentarray( "quest_trigger", "script_noteworthy" ), 0, 0 );
a_show = arraycombine( a_show, getentarray( "trap_trigger", "script_noteworthy" ), 0, 0 );
a_show = arraycombine( a_show, getentarray( "travel_trigger", "script_noteworthy" ), 0, 0 );
_a962 = a_show;
_k962 = getfirstarraykey( _a962 );
while( isdefined( _k962 ) ) {
ent = _a962[ _k962 ];
n_network_sent++;
if( n_network_sent > 10 ) {
n_network_sent = 0;
wait_network_frame();
}
if( isdefined( ent ) ) {
ent setvisibletoplayer( self );
}
_k962 = getnextarraykey( _a962, _k962 );
}
while( isdefined( self.claymores ) ) {
_a979 = self.claymores;
_k979 = getfirstarraykey( _a979 );
while( isdefined( _k979 ) ) {
claymore = _a979[ _k979 ];
if( isdefined( claymore.pickuptrigger ) ) {
claymore.pickuptrigger setvisibletoplayer( self );
}
_k979 = getnextarraykey( _a979, _k979 );
}
}
}
special thanks to ZECxR3ap3r for helping with shield rotations stow models and hints, only issue is the tomb shield does have collision, but the zombies don't care.
fake_shield() {
if( self.fake_shield == false ) {
self.fake_shield = true;
self.trigger = spawn( "trigger_radius", self.origin, 0, 35, 80 );
self.trigger setcursorhint( "HINT_NOICON" );
self.trigger sethintstring( &"MP_GENERIC_PICKUP" );
if( level.script == "zm_transit" ) {
self.pickupmodel = spawn( "script_model", self.origin + ( 0, 0, 25 ) );
self.pickupmodel setmodel( "t6_wpn_zmb_shield_world" );
self.pickupmodel.angles = self.angles;
}
if( level.script == "zm_prison" || level.script == "zm_tomb" ) {
self.pickupmodel = spawn( "script_model", self.origin + ( 0, 0, 28 ) );
self.pickupmodel.angles = self.angles + vectorScale( ( 90, 1, 0 ), 90 );
if( level.script == "zm_prison" ) {
self.pickupmodel setmodel( "t6_wpn_zmb_shield_dlc2_dmg0_stow" );
}
if( level.script == "zm_tomb" ) {
self.pickupmodel setmodel( "t6_wpn_zmb_shield_dlc4_dmg0_stow" );
}
self.pickupmodel rotatepitch( 270, 0.05 );
}
}
else {
self.fake_shield = false;
self.pickupmodel delete();
self.trigger delete();
}
}
 
Top