mirror of
https://github.com/JezuzLizard/t6-fastfile-mods.git
synced 2025-06-10 11:17:59 -05:00
Add ghost and add all anims to zm_all_basic.
Add all scripts to mod zones.
This commit is contained in:
173
zm_ai_pack/scripts/zm/_zm_ai_ghost.csc
Normal file
173
zm_ai_pack/scripts/zm/_zm_ai_ghost.csc
Normal file
@ -0,0 +1,173 @@
|
||||
// T6 GSC SOURCE
|
||||
// Generated by https://github.com/xensik/gsc-tool
|
||||
#include clientscripts\mp\_utility;
|
||||
#include clientscripts\mp\zombies\_zm_utility;
|
||||
|
||||
precache()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
#using_animtree("zm_buried_ghost");
|
||||
|
||||
init_animtree()
|
||||
{
|
||||
scriptmodelsuseanimtree( #animtree );
|
||||
}
|
||||
|
||||
precache_fx()
|
||||
{
|
||||
if ( !isdefined( level.ghost_effects ) )
|
||||
{
|
||||
level.ghost_effects = [];
|
||||
level.ghost_effects[1] = loadfx( "maps/zombie_buried/fx_buried_ghost_death" );
|
||||
level.ghost_effects[2] = loadfx( "maps/zombie_buried/fx_buried_ghost_drain" );
|
||||
level.ghost_effects[3] = loadfx( "maps/zombie_buried/fx_buried_ghost_spawn" );
|
||||
level.ghost_effects[4] = loadfx( "maps/zombie_buried/fx_buried_ghost_trail" );
|
||||
level.ghost_effects[5] = loadfx( "maps/zombie_buried/fx_buried_ghost_evaporation" );
|
||||
level.ghost_impact_effects[1] = loadfx( "maps/zombie_buried/fx_buried_ghost_impact" );
|
||||
}
|
||||
}
|
||||
|
||||
main()
|
||||
{
|
||||
precache_fx();
|
||||
register_client_fields();
|
||||
}
|
||||
|
||||
register_client_fields()
|
||||
{
|
||||
registerclientfield( "actor", "ghost_impact_fx", 12000, 1, "int", ::play_impact_fx_clientfield_cb, 0 );
|
||||
registerclientfield( "actor", "ghost_fx", 12000, 3, "int", ::play_fx_clientfield_cb, 0 );
|
||||
registerclientfield( "actor", "sndGhostAudio", 12000, 3, "int", ::sndghostaudio, 0 );
|
||||
registerclientfield( "scriptmover", "ghost_fx", 12000, 3, "int", ::play_fx_clientfield_cb, 0 );
|
||||
registerclientfield( "scriptmover", "sndGhostAudio", 12000, 3, "int", ::sndghostaudio, 0 );
|
||||
registerclientfield( "world", "ghost_round_light_state", 12000, 1, "int", ::ghost_round_presentation_light_state_cb, 1 );
|
||||
}
|
||||
|
||||
play_impact_fx_clientfield_cb( localclientnum, oldval, newval, bnewent, binitialsnap, fieldname, bwasdemojump )
|
||||
{
|
||||
if ( !isdefined( newval ) )
|
||||
return;
|
||||
|
||||
if ( newval > 0 )
|
||||
self thread play_impact_fx_internal( localclientnum, newval );
|
||||
}
|
||||
|
||||
play_impact_fx_internal( localclientnum, newval )
|
||||
{
|
||||
self endon( "entityshutdown" );
|
||||
self waittill_dobj( localclientnum );
|
||||
effect = level.ghost_impact_effects[newval];
|
||||
|
||||
if ( isdefined( effect ) )
|
||||
playfx( localclientnum, effect, self.origin + vectorscale( ( 0, 0, 1 ), 36.0 ) );
|
||||
}
|
||||
|
||||
play_fx_clientfield_cb( localclientnum, oldval, newval, bnewent, binitialsnap, fieldname, bwasdemojump )
|
||||
{
|
||||
if ( !isdefined( newval ) )
|
||||
return;
|
||||
|
||||
if ( newval > 0 )
|
||||
self play_fx( localclientnum, newval );
|
||||
else if ( isdefined( self._fx_array ) && isdefined( self._fx_array[localclientnum] ) )
|
||||
deletefx( localclientnum, self._fx_array[localclientnum], 0 );
|
||||
}
|
||||
|
||||
play_fx( localclientnum, newval )
|
||||
{
|
||||
self thread play_fx_internal( localclientnum, newval );
|
||||
}
|
||||
|
||||
play_fx_internal( localclientnum, newval )
|
||||
{
|
||||
self endon( "entityshutdown" );
|
||||
self waittill_dobj( localclientnum );
|
||||
|
||||
if ( !isdefined( self._fx_array ) )
|
||||
self._fx_array = [];
|
||||
|
||||
linktag = "tag_origin";
|
||||
effect = level.ghost_effects[newval];
|
||||
|
||||
if ( isdefined( self._fx_tag_override ) )
|
||||
linktag = self._fx_tag_override;
|
||||
|
||||
if ( isdefined( self._fx_array[localclientnum] ) )
|
||||
deletefx( localclientnum, self._fx_array[localclientnum], 0 );
|
||||
|
||||
if ( newval == 1 )
|
||||
self notify( "sndDeath" );
|
||||
|
||||
if ( newval == 1 || newval == 5 )
|
||||
self._fx_array[localclientnum] = playfx( localclientnum, effect, self.origin );
|
||||
else
|
||||
self._fx_array[localclientnum] = playfxontag( localclientnum, effect, self, linktag );
|
||||
}
|
||||
|
||||
ghost_round_presentation_light_state_cb( localclientnum, oldval, newval, bnewent, binitialsnap, fieldname, bwasdemojump )
|
||||
{
|
||||
if ( !isdefined( newval ) )
|
||||
return;
|
||||
|
||||
if ( newval == 1 )
|
||||
{
|
||||
if ( !is_true( level.ghost_round_presentation_light_flicker_on ) )
|
||||
{
|
||||
level notify( "ghost_round_flicker" );
|
||||
level.ghost_round_presentation_light_flicker_on = 1;
|
||||
}
|
||||
}
|
||||
else if ( is_true( level.ghost_round_presentation_light_flicker_on ) )
|
||||
{
|
||||
level notify( "ghost_round_flicker" );
|
||||
level.ghost_round_presentation_light_flicker_on = 0;
|
||||
}
|
||||
}
|
||||
|
||||
sndghostaudio( localclientnum, oldval, newval, bnewent, binitialsnap, fieldname, bwasdemojump )
|
||||
{
|
||||
if ( !isdefined( self.sndent ) )
|
||||
{
|
||||
self.sndent = spawn( 0, self.origin, "script_origin" );
|
||||
self.sndent linkto( self );
|
||||
self thread sndghostaudiodeleteent( self.sndent );
|
||||
}
|
||||
|
||||
if ( newval == 1 )
|
||||
{
|
||||
self playsound( 0, "zmb_ai_ghost_apparate" );
|
||||
self.sndent playloopsound( "zmb_ai_ghost_loop", 1 );
|
||||
}
|
||||
else
|
||||
{
|
||||
self playsound( 0, "zmb_ai_ghost_disapparate" );
|
||||
self.sndent playloopsound( "zmb_ai_ghost_loop", 1 );
|
||||
}
|
||||
}
|
||||
|
||||
sndghostaudiodeleteent( ent )
|
||||
{
|
||||
self waittill_any( "death", "entityshutdown", "sndDeath" );
|
||||
ent delete();
|
||||
}
|
||||
|
||||
sndghostattackaudio()
|
||||
{
|
||||
if ( !isdefined( self.sndattackent ) )
|
||||
{
|
||||
self.sndattackent = spawn( 0, self.origin, "script_origin" );
|
||||
self.sndattackent linkto( self );
|
||||
self thread sndghostattackaudiodeleteent( self.sndattackent );
|
||||
}
|
||||
|
||||
self.sndattackent playloopsound( "zmb_ai_ghost_attack_loop", 0.1 );
|
||||
}
|
||||
|
||||
sndghostattackaudiodeleteent( ent )
|
||||
{
|
||||
self endon( "sndDoneAttacking" );
|
||||
self waittill_any( "death", "entityshutdown" );
|
||||
ent delete();
|
||||
}
|
98
zm_ai_pack/scripts/zm/ghost.gsc
Normal file
98
zm_ai_pack/scripts/zm/ghost.gsc
Normal file
@ -0,0 +1,98 @@
|
||||
#include maps\mp\zombies\_zm_ai_ghost;
|
||||
#include maps\mp\zombies\_zm_utility;
|
||||
#include maps\mp\_utility;
|
||||
#include common_scripts\utility;
|
||||
|
||||
main()
|
||||
{
|
||||
if ( getDvar( "mapname" ) == "zm_buried" )
|
||||
{
|
||||
return;
|
||||
}
|
||||
maps\mp\zombies\_zm_ai_ghost::precache_fx();
|
||||
maps\mp\zombies\_zm_ai_ghost::init();
|
||||
}
|
||||
|
||||
init()
|
||||
{
|
||||
level thread ghost_zone_spawning_think();
|
||||
}
|
||||
|
||||
ghost_zone_spawning_think()
|
||||
{
|
||||
level endon( "intermission" );
|
||||
|
||||
if ( isdefined( level.intermission ) && level.intermission )
|
||||
return;
|
||||
|
||||
if ( !isdefined( level.female_ghost_spawner ) )
|
||||
{
|
||||
/#
|
||||
assertmsg( "No female ghost spawner in the map. Check to see if the zone is active and if it's pointing to spawners." );
|
||||
#/
|
||||
}
|
||||
|
||||
while ( true )
|
||||
{
|
||||
if ( level.zombie_ghost_count >= level.zombie_ai_limit_ghost )
|
||||
{
|
||||
wait 0.1;
|
||||
continue;
|
||||
}
|
||||
|
||||
if ( level.zombie_spawn_locations.size <= 0 )
|
||||
{
|
||||
wait 0.1;
|
||||
continue;
|
||||
}
|
||||
|
||||
spawn_point = random( level.zombie_spawn_locations );
|
||||
|
||||
if ( !isdefined( spawn_point ) )
|
||||
{
|
||||
print( "No spawn point" );
|
||||
wait 0.1;
|
||||
continue;
|
||||
}
|
||||
|
||||
/#
|
||||
if ( isdefined( level.force_no_ghost ) && level.force_no_ghost )
|
||||
{
|
||||
wait 0.1;
|
||||
continue;
|
||||
}
|
||||
#/
|
||||
ghost_ai = undefined;
|
||||
|
||||
if ( isdefined( level.female_ghost_spawner ) )
|
||||
ghost_ai = spawn_zombie( level.female_ghost_spawner, level.female_ghost_spawner.targetname, spawn_point );
|
||||
else
|
||||
{
|
||||
print( "No spawner" );
|
||||
/#
|
||||
assertmsg( "No female ghost spawner in the map." );
|
||||
#/
|
||||
}
|
||||
|
||||
if ( isdefined( ghost_ai ) )
|
||||
{
|
||||
ghost_ai setclientfield( "ghost_fx", 3 );
|
||||
ghost_ai.spawn_point = spawn_point;
|
||||
ghost_ai.is_ghost = 1;
|
||||
ghost_ai.is_spawned_in_ghost_zone = 1;
|
||||
ghost_ai.find_target = 1;
|
||||
level.zombie_ghost_count++;
|
||||
/#
|
||||
ghost_print( "ghost total " + level.zombie_ghost_count );
|
||||
#/
|
||||
}
|
||||
else
|
||||
{
|
||||
/#
|
||||
assertmsg( "Female ghost: failed spawn" );
|
||||
#/
|
||||
}
|
||||
|
||||
wait 0.1;
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user