Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // SCRIPT ORIGINALLY BY NATESMITHZOMBIES ON UGX-MODS
- #include maps\_utility;
- #include common_scripts\utility;
- #include maps\_zombiemode_utility;
- #include maps\_zombiemode_net;
- // #include maps\_easyAnimation;
- #using_animtree( "generic_human" );
- init()
- {
- level.soul_catchers = [];
- level.soul_catchers_vol = [];
- level.a_wolf_structs = getstructarray( "wolf_poster", "targetname" );
- // level.soul_catchers = getstructarray( "wolf_poster", "targetname" );
- for( i=0;i<level.a_wolf_structs.size;i++ )
- {
- level.soul_catchers[ i ] = level.a_wolf_structs[ i ];
- level.soul_catchers_vol[ i ] = getent( level.a_wolf_structs[ i ].target, "targetname" );
- }
- for( i=0;i<level.soul_catchers.size;i++ )
- {
- level.soul_catchers[i] spawn_posters();
- level.soul_catchers[i].souls_received = 0;
- level.soul_catchers[i].is_ready_to_eat = true;
- level.soul_catchers[i] thread soul_catcher_check(); // Checks if wolf is fed, and if wolf has spawned
- }
- level.soul_catchers_charged = 0;
- thread get_the_zoms(); // Constantly checks zoms death in wolf zone
- level thread soul_catchers_charged(); // Constantly checks if all wolves are fed
- // iprintlnbold( "level.soul_catchers_vol.size = " +level.soul_catchers_vol.size );
- // iprintlnbold( "level.soul_catchers.size = " +level.soul_catchers.size );
- }
- soul_catchers_charged()
- {
- while ( 1 )
- {
- if ( level.soul_catchers_charged >= level.soul_catchers.size )
- {
- // level notify( "nsz_wolves_fully_fed" );
- maps\_zombiemode_weap_tomahawk::tomahawk_pickup();
- self thread door();
- // iprintlnbold( "last wolf fed" );
- return;
- }
- else
- {
- wait(1);
- }
- }
- }
- soul_catcher_check()
- {
- self.is_charged = 0;
- self.wolf_head_model.is_charged = 0;
- while ( 1 )
- {
- if ( self.souls_received >= 6 )
- {
- level.soul_catchers_charged++;
- // playsoundatposition( "soul_count", self.origin );
- wait( getanimlength(%o_zombie_dreamcatcher_wallconsume_pre_eat_f) + getanimlength(%o_zombie_dreamcatcher_idle_twitch_yawn) );
- self.is_charged = 1;
- self.wolf_head_model.is_charged = 1;
- wait(3);
- self notify( "fully_charged" );
- break;
- }
- else
- {
- wait(0.05);
- }
- }
- }
- get_the_zoms()
- {
- // iprintlnbold("get_the_zoms");
- while(1)
- {
- wait(.05);
- zoms = getaispeciesarray("axis");
- for (i=0;i<zoms.size;i++)
- {
- if ( isdefined(zoms[i].is_accounted) && zoms[i].is_accounted == true )
- {
- }
- else
- {
- zoms[i].is_accounted = true;
- zoms[i].nsz_no_gib = false;
- // iprintlnbold( "about to watch for death" );
- zoms[i] thread watch_for_death();
- zoms[i] thread check_for_zombie_in_wolf_area();
- }
- }
- }
- }
- watch_for_death()
- {
- self waittill("death");
- // iprintlnbold( "level.soul_catchers.target.size = " +level.soul_catchers.size );
- if( (IsDefined(self.in_the_ground) && self.in_the_ground == true) || (IsDefined(self.animname) && self.animname != "zombie") )
- return;
- for( i=0;i<level.soul_catchers.size;i++ )
- {
- // iprintlnbold( "inside the for loop for waiting for death" );
- if( self istouching(level.soul_catchers_vol[i]) && level.soul_catchers[i].souls_received == 0 && level.soul_catchers[i].is_ready_to_eat == true )
- {
- level.soul_catchers[i] thread wolf_cooldown(true);
- level.soul_catchers[i].souls_received++;
- fx_origin = getstruct( level.soul_catchers_vol[i].target, "targetname" );
- level.soul_catchers[i] thread replace_poster(fx_origin.origin);
- level.soul_catchers[i] thread spawn_wolf_head(fx_origin.origin);
- level.soul_catchers[i].poster hide();
- // wait( getanimlength(%o_zombie_dreamcatcher_intro) );
- wolf_mouth = level.soul_catchers[i].origin;
- clone = self get_zombie_clone();
- clone thread ai_eaten_func( wolf_mouth );
- wait(3 + getanimlength(%o_zombie_dreamcatcher_intro));
- level.soul_catchers[i].wolf_head_model thread eat_anims();
- // iprintlnbold( "primary death" );
- // iprintlnbold(level.soul_catchers[i].souls_received);
- // iprintlnbold( "first death spawn wolf" );
- return;
- }
- else if( self istouching(level.soul_catchers_vol[i]) && level.soul_catchers[i].souls_received > 0 && level.soul_catchers[i].is_charged != 1 && level.soul_catchers[i].is_ready_to_eat == true )
- {
- level.soul_catchers[i] thread wolf_cooldown();
- level.soul_catchers[i].souls_received++;
- wolf_mouth = level.soul_catchers[i].wolf_head_model gettagorigin( "tag_mouth_fx" ) - (5,5,15);
- clone = self get_zombie_clone();
- clone thread ai_eaten_func( wolf_mouth );
- wait(3 + getanimlength(%o_zombie_dreamcatcher_intro));
- level.soul_catchers[i].wolf_head_model thread eat_anims();
- // iprintlnbold( "secondary death" );
- // iprintlnbold(level.soul_catchers[i].souls_received);
- return;
- }
- else
- {
- // iprintlnbold("The wolf is either full or the zom isnt in the zone");
- }
- }
- }
- get_zombie_clone()
- {
- gib_ref = "";
- if(IsDefined( self.a.gib_ref ))
- {
- gib_ref = self.a.gib_ref;
- }
- limb_data = getLimbData( gib_ref, self);
- // self hide();
- zombie_clone = spawn("script_model", self.origin);
- zombie_clone.angles = self.angles;
- zombie_clone SetModel( limb_data["body"] );
- zombie_clone Attach( limb_data["head"] );
- zombie_clone Attach( limb_data["legs"] );
- self delete();
- return zombie_clone;
- }
- getLimbData(gib_ref, zombie)
- {
- temp_array = [];
- //Setup Default model
- temp_array["head"] = zombie.headModel;
- temp_array["body"] = zombie.torsoDmg1;
- temp_array["legs"] = zombie.legDmg1;
- temp_array["type"] = "zombie";
- if(gib_ref == "right_arm")
- {
- if(IsDefined( zombie.torsoDmg2 ))
- {
- temp_array["body"] = zombie.torsoDmg2;
- return temp_array;
- }
- }
- if(gib_ref == "left_arm")
- {
- if(IsDefined( zombie.torsoDmg3 ))
- {
- temp_array["body"] = zombie.torsoDmg3;
- }
- }
- if(gib_ref == "guts")
- {
- if(IsDefined( zombie.torsoDmg4 ))
- {
- temp_array["body"] = zombie.legDtorsoDmg4mg3;
- }
- }
- if(gib_ref == "head")
- {
- if(IsDefined( zombie.torsoDmg5 ))
- {
- temp_array["body"] = zombie.torsoDmg5;
- }
- }
- if(gib_ref == "right_leg")
- {
- if(IsDefined( zombie.legDmg2 ))
- {
- temp_array["legs"] = zombie.legDmg2;
- temp_array["type"] = "crawler";
- }
- }
- if(gib_ref == "left_leg")
- {
- if(IsDefined( zombie.legDmg3 ))
- {
- temp_array["legs"] = zombie.legDmg3;
- temp_array["type"] = "crawler";
- }
- }
- if(gib_ref == "no_legs")
- {
- if(IsDefined( zombie.legDmg4 ))
- {
- temp_array["legs"] = zombie.legDmg4;
- temp_array["type"] = "crawler";
- }
- }
- return temp_array;
- }
- spawn_wolf_head(fx_origin)
- {
- // iprintlnbold( "spawned wolf head" );
- self.wolf_head_model = spawn( "script_model", self.origin );
- self.wolf_head_model setmodel( "bo2_c_zom_wolf_head" );
- self.wolf_head_model.angles = self.angles + (0,90,0);
- self.wolf_head_model.fx = spawn( "script_model", fx_origin );
- self.wolf_head_model.fx setmodel( "tag_origin" );
- self.wolf_head_model.fx.angles = self.wolf_head_model.angles + (0,0,90);
- playfxontag(level._effect["nsz_wolf_fire"], self.wolf_head_model.fx, "tag_origin" );
- self.wolf_head_model PlayLoopSound( "wolf_playing" );
- self.wolf_head_model thread intro_anims();
- wait( getanimlength(%o_zombie_dreamcatcher_intro) );
- }
- intro_anims()
- {
- playsoundatposition( "wolf_howl_dc_02", self.origin );
- self thread head_sounds();
- self UseAnimTree(#animtree);
- self AnimScripted( "wolf_bark_notify", self.origin, self.angles, %o_zombie_dreamcatcher_intro );
- wait( getanimlength(%o_zombie_dreamcatcher_intro) );
- self idle_anims();
- }
- outtro_anims()
- {
- playsoundatposition( "wolf_howl_dc_02", self.origin );
- self stopAnimScripted();
- self AnimScripted( "test", self.origin, self.angles, %o_zombie_dreamcatcher_outtro );
- wait( getanimlength(%o_zombie_dreamcatcher_outtro) );
- wait(0.05);
- self.fx delete();
- self delete();
- }
- idle_anims()
- {
- self endon( "eating_notify" );
- while(1)
- {
- // iprintlnbold( "top of while 1 in idle_anims" );
- self AnimScripted( "wolf_bark_notify", self.origin, self.angles, %o_zombie_dreamcatcher_idle );
- wait( getanimlength(%o_zombie_dreamcatcher_idle) );
- rand_anim = undefined;
- // Choose a Random Idle Anim
- var = randomintrange(1, 3);
- if( var == 1 )
- rand_anim = %o_zombie_dreamcatcher_idle_twitch_scan;
- if ( var == 2 )
- rand_anim = %o_zombie_dreamcatcher_idle_twitch_shake;
- self stopAnimScripted();
- self AnimScripted( "wolf_bark_notify", self.origin, self.angles, rand_anim );
- wait( getanimlength(rand_anim) );
- }
- }
- eat_anims()
- {
- self notify( "eating_notify" );
- // iprintlnbold("eating_anims()");
- self stopAnimScripted();
- self AnimScripted( "test", self.origin, self.angles, %o_zombie_dreamcatcher_wallconsume_pre_eat_f );
- wait( getanimlength(%o_zombie_dreamcatcher_wallconsume_pre_eat_f) );
- self stopAnimScripted();
- self AnimScripted( "wolf_bark_notify", self.origin, self.angles, %o_zombie_dreamcatcher_idle_twitch_yawn );
- wait( getanimlength(%o_zombie_dreamcatcher_idle_twitch_yawn) );
- if( self.is_charged == 0 )
- {
- self thread idle_anims();
- }
- else if( self.is_charged == 1 )
- {
- self thread outtro_anims();
- }
- playsoundatposition( "soul_count", self.origin );
- }
- head_sounds()
- {
- note = undefined;
- while(1)
- {
- self waittill("wolf_bark_notify", note);
- if( note == "wolf_bark" )
- {
- var = randomintrange(0,7);
- playsoundatposition( "wolf_bark_0"+var, self.origin );
- }
- if( note == "wolf_growl" )
- {
- var = randomintrange(0,4);
- playsoundatposition( "growl_close_0"+var, self.origin );
- }
- if( note == "wolf_boom" )
- {
- playsoundatposition( "wolf_boom", self.origin );
- fx_model = spawn( "script_model", self gettagorigin("j_tongue_3") );
- fx_model setmodel( "tag_origin" );
- playfx( level._effect["distortion"], fx_model.origin );
- Earthquake( 0.3, 2, self.origin, 800 );
- fx_model delete();
- players = getplayers();
- for( i=0;i<players.size;i++ )
- {
- distance = distancesquared(players[i].origin, self.origin);
- if( distance < 250000 )
- players[i] give_blur();
- }
- }
- }
- }
- give_blur()
- {
- self setblur( 5, 1 );
- self setburn(1);
- wait(1);
- self setblur( 0, 1 );
- }
- spawn_posters()
- {
- self.poster = spawn( "script_model", self.origin );
- self.poster setmodel( "p6_zm_al_dream_catcher_off" );
- self.poster.angles = self.angles;
- }
- replace_poster(fx_origin)
- {
- self waittill("fully_charged");
- self.poster setmodel("p6_zm_al_dream_catcher");
- self.poster show();
- if( isDefined(fx_origin) )
- {
- playfx( level._effect["nsz_wolf_end"], fx_origin );
- wait(2);
- self.poster PlayLoopSound( "rune_glow" );
- }
- }
- wolf_cooldown(intro_or_no)
- {
- self.is_ready_to_eat = false;
- if( isDefined(intro_or_no) && intro_or_no == true )
- wait( getanimlength(%o_zombie_dreamcatcher_intro) );
- wait( getanimlength(%o_zombie_dreamcatcher_wallconsume_pre_eat_f) );
- wait( getanimlength(%o_zombie_dreamcatcher_idle_twitch_yawn) );
- self.is_ready_to_eat = true;
- }
- check_for_zombie_in_wolf_area()
- {
- self endon("death");
- while(1)
- {
- wait(0.05);
- for( i=0;i<level.soul_catchers_vol.size;i++ )
- {
- // iprintlnbold( "level.soul_catchers_vol.size = " +level.soul_catchers_vol.size );
- if( self istouching(level.soul_catchers_vol[i]) && level.soul_catchers[i].is_charged != 1 && self.nsz_no_gib == false )
- {
- self.nsz_no_gib = true;
- self.gibbed = true;
- self.head_gibbed = true;
- // iprintlnbold("zom in zone dont gib");
- }
- }
- }
- }
- ai_eaten_func(wolf_mouth, add_wait_time)
- {
- self.animName = "zombie";
- self UseAnimTree(#animtree);
- self AnimScripted( "test", self.origin, self.angles, %ai_zombie_dreamcatch_impact );
- // playsoundatposition( "bodyfall_flesh_large", self.origin );
- wait( getanimlength(%ai_zombie_dreamcatch_impact) );
- wait( getanimlength(%o_zombie_dreamcatcher_wallconsume_pre_eat_f) );
- wait( getanimlength(%o_zombie_dreamcatcher_intro) );
- self stopAnimScripted();
- wait(.5);
- if( isDefined(add_wait_time) )
- wait(add_wait_time);
- self SetAnim( %ai_zombie_dreamcatch_rise );
- playsoundatposition( "soul_suck", self.origin );
- wait( getanimlength(%ai_zombie_dreamcatch_rise) -.5 );
- self moveto( wolf_mouth, 1 );
- wait(.5);
- self hide();
- playfxontag(level._effect["nsz_big_geyser"], self, "j_spineupper" );
- wait(1);
- self delete();
- }
- door()
- {
- door = getEnt("hells_gate", "targetname"); //this will be the door that opens
- door delete();
- door_clip = getEnt("hells_clip", "targetname");
- door_clip delete();
- // door MoveZ (-200, 2);
- // door MoveY (100, 5);
- // door MoveX (100, 5);
- door connectpaths();
- iprintln("A gate has been opened"); //remove this line if you don't want it to say that
- wait 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement