Advertisement
Guest User

_motd_wolves_draft.gsc

a guest
Aug 9th, 2016
185
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 13.06 KB | None | 0 0
  1. // SCRIPT ORIGINALLY BY NATESMITHZOMBIES ON UGX-MODS
  2. #include maps\_utility;
  3. #include common_scripts\utility;
  4. #include maps\_zombiemode_utility;
  5. #include maps\_zombiemode_net;
  6. // #include maps\_easyAnimation;
  7. #using_animtree( "generic_human" );
  8.  
  9. init()
  10. {
  11.     level.soul_catchers = [];
  12.     level.soul_catchers_vol = [];
  13.     level.a_wolf_structs = getstructarray( "wolf_poster", "targetname" );
  14.     // level.soul_catchers = getstructarray( "wolf_poster", "targetname" );
  15.    
  16.     for( i=0;i<level.a_wolf_structs.size;i++ )
  17.     {
  18.         level.soul_catchers[ i ] = level.a_wolf_structs[ i ];
  19.         level.soul_catchers_vol[ i ] = getent( level.a_wolf_structs[ i ].target, "targetname" );
  20.     }
  21.    
  22.     for( i=0;i<level.soul_catchers.size;i++ )
  23.     {
  24.         level.soul_catchers[i] spawn_posters();  
  25.         level.soul_catchers[i].souls_received = 0;
  26.         level.soul_catchers[i].is_ready_to_eat = true;
  27.         level.soul_catchers[i] thread soul_catcher_check();     // Checks if wolf is fed, and if wolf has spawned
  28.     }
  29.  
  30.     level.soul_catchers_charged = 0;
  31.     thread get_the_zoms();          // Constantly checks zoms death in wolf zone
  32.     level thread soul_catchers_charged();   // Constantly checks if all wolves are fed
  33.     // iprintlnbold( "level.soul_catchers_vol.size = " +level.soul_catchers_vol.size );
  34.     // iprintlnbold( "level.soul_catchers.size = " +level.soul_catchers.size );
  35. }
  36.  
  37. soul_catchers_charged()
  38. {
  39.     while ( 1 )
  40.     {
  41.         if ( level.soul_catchers_charged >= level.soul_catchers.size )
  42.         {
  43.             // level notify( "nsz_wolves_fully_fed" );
  44.             maps\_zombiemode_weap_tomahawk::tomahawk_pickup();
  45. self thread door();
  46.             // iprintlnbold( "last wolf fed" );
  47.             return;
  48.         }
  49.         else
  50.         {
  51.             wait(1);
  52.         }
  53.     }
  54. }
  55.  
  56. soul_catcher_check()
  57. {
  58.     self.is_charged = 0;
  59.     self.wolf_head_model.is_charged = 0;
  60.     while ( 1 )
  61.     {
  62.         if ( self.souls_received >= 6 )
  63.         {
  64.             level.soul_catchers_charged++;
  65.             // playsoundatposition( "soul_count", self.origin );
  66.             wait( getanimlength(%o_zombie_dreamcatcher_wallconsume_pre_eat_f) + getanimlength(%o_zombie_dreamcatcher_idle_twitch_yawn) );
  67.             self.is_charged = 1;
  68.             self.wolf_head_model.is_charged = 1;
  69.             wait(3);
  70.             self notify( "fully_charged" );
  71.             break;
  72.         }
  73.         else
  74.         {
  75.             wait(0.05);
  76.         }
  77.     }
  78. }
  79.  
  80. get_the_zoms()
  81. {
  82.     // iprintlnbold("get_the_zoms");
  83.     while(1)
  84.     {
  85.         wait(.05);
  86.         zoms = getaispeciesarray("axis");
  87.         for (i=0;i<zoms.size;i++)
  88.         {
  89.             if ( isdefined(zoms[i].is_accounted) && zoms[i].is_accounted == true )
  90.             {
  91.            
  92.             }
  93.             else
  94.             {
  95.                 zoms[i].is_accounted = true;
  96.                 zoms[i].nsz_no_gib = false;
  97.                 // iprintlnbold( "about to watch for death" );
  98.                 zoms[i] thread watch_for_death();
  99.                 zoms[i] thread check_for_zombie_in_wolf_area();
  100.             }
  101.            
  102.         }
  103.     }
  104. }
  105.  
  106. watch_for_death()
  107. {
  108.     self waittill("death");
  109.     // iprintlnbold( "level.soul_catchers.target.size = " +level.soul_catchers.size );
  110.     if( (IsDefined(self.in_the_ground) && self.in_the_ground == true) || (IsDefined(self.animname) && self.animname != "zombie") )  
  111.         return;
  112.     for( i=0;i<level.soul_catchers.size;i++ )
  113.     {
  114.         // iprintlnbold( "inside the for loop for waiting for death" );
  115.         if( self istouching(level.soul_catchers_vol[i]) && level.soul_catchers[i].souls_received == 0 && level.soul_catchers[i].is_ready_to_eat == true  )
  116.         {
  117.             level.soul_catchers[i] thread wolf_cooldown(true);
  118.             level.soul_catchers[i].souls_received++;
  119.             fx_origin = getstruct( level.soul_catchers_vol[i].target, "targetname" );
  120.             level.soul_catchers[i] thread replace_poster(fx_origin.origin);
  121.             level.soul_catchers[i] thread spawn_wolf_head(fx_origin.origin);
  122.             level.soul_catchers[i].poster hide();
  123.             // wait( getanimlength(%o_zombie_dreamcatcher_intro) );
  124.             wolf_mouth = level.soul_catchers[i].origin;  
  125.             clone = self get_zombie_clone();
  126.             clone thread ai_eaten_func( wolf_mouth );
  127.             wait(3 + getanimlength(%o_zombie_dreamcatcher_intro));
  128.             level.soul_catchers[i].wolf_head_model thread eat_anims();
  129.             // iprintlnbold( "primary death" );
  130.             // iprintlnbold(level.soul_catchers[i].souls_received);
  131.             // iprintlnbold( "first death spawn wolf" );
  132.             return;
  133.         }
  134.         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 )
  135.         {
  136.             level.soul_catchers[i] thread wolf_cooldown();
  137.             level.soul_catchers[i].souls_received++;
  138.             wolf_mouth = level.soul_catchers[i].wolf_head_model gettagorigin( "tag_mouth_fx" ) - (5,5,15);  
  139.             clone = self get_zombie_clone();
  140.             clone thread ai_eaten_func( wolf_mouth );
  141.             wait(3 + getanimlength(%o_zombie_dreamcatcher_intro));
  142.             level.soul_catchers[i].wolf_head_model thread eat_anims();
  143.             // iprintlnbold( "secondary death" );
  144.             // iprintlnbold(level.soul_catchers[i].souls_received);
  145.             return;
  146.         }
  147.         else
  148.         {
  149.             // iprintlnbold("The wolf is either full or the zom isnt in the zone");
  150.         }
  151.          
  152.     }
  153. }
  154.  
  155. get_zombie_clone()
  156. {
  157.     gib_ref = "";
  158.     if(IsDefined( self.a.gib_ref ))
  159.     {
  160.         gib_ref = self.a.gib_ref;
  161.     }
  162.    
  163.     limb_data = getLimbData( gib_ref, self);
  164.     // self hide();
  165.     zombie_clone = spawn("script_model", self.origin);
  166.     zombie_clone.angles = self.angles;
  167.     zombie_clone SetModel( limb_data["body"] );
  168.     zombie_clone Attach( limb_data["head"] );
  169.     zombie_clone Attach( limb_data["legs"] );
  170.     self delete();
  171.    
  172.     return zombie_clone;    
  173. }
  174.  
  175. getLimbData(gib_ref, zombie)
  176. {
  177.     temp_array = [];
  178.  
  179.     //Setup Default model
  180.     temp_array["head"] = zombie.headModel;
  181.     temp_array["body"] = zombie.torsoDmg1;
  182.     temp_array["legs"] = zombie.legDmg1;
  183.     temp_array["type"] = "zombie";
  184.  
  185.     if(gib_ref == "right_arm")
  186.     {  
  187.         if(IsDefined( zombie.torsoDmg2 ))
  188.         {
  189.             temp_array["body"] = zombie.torsoDmg2;
  190.             return temp_array;
  191.         }
  192.     }
  193.  
  194.     if(gib_ref == "left_arm")
  195.     {
  196.         if(IsDefined( zombie.torsoDmg3 ))
  197.         {
  198.             temp_array["body"] = zombie.torsoDmg3;
  199.         }
  200.     }
  201.  
  202.     if(gib_ref == "guts")
  203.     {
  204.         if(IsDefined( zombie.torsoDmg4 ))
  205.         {
  206.             temp_array["body"] = zombie.legDtorsoDmg4mg3;
  207.         }
  208.     }
  209.  
  210.     if(gib_ref == "head")
  211.     {
  212.         if(IsDefined( zombie.torsoDmg5 ))
  213.         {
  214.             temp_array["body"] = zombie.torsoDmg5;
  215.         }
  216.     }
  217.  
  218.     if(gib_ref == "right_leg")
  219.     {  
  220.         if(IsDefined( zombie.legDmg2 ))
  221.         {
  222.             temp_array["legs"] = zombie.legDmg2;
  223.             temp_array["type"] = "crawler";
  224.         }
  225.     }
  226.  
  227.     if(gib_ref == "left_leg")
  228.     {
  229.         if(IsDefined( zombie.legDmg3 ))
  230.         {
  231.             temp_array["legs"] = zombie.legDmg3;
  232.             temp_array["type"] = "crawler";
  233.         }
  234.     }
  235.  
  236.     if(gib_ref == "no_legs")
  237.     {
  238.         if(IsDefined( zombie.legDmg4 ))
  239.         {
  240.             temp_array["legs"] = zombie.legDmg4;
  241.             temp_array["type"] = "crawler";
  242.         }
  243.     }
  244.  
  245.     return temp_array;
  246. }
  247.  
  248. spawn_wolf_head(fx_origin)
  249. {
  250.     // iprintlnbold( "spawned wolf head" );
  251.     self.wolf_head_model = spawn( "script_model", self.origin );
  252.     self.wolf_head_model setmodel( "bo2_c_zom_wolf_head" );
  253.     self.wolf_head_model.angles = self.angles + (0,90,0);
  254.     self.wolf_head_model.fx = spawn( "script_model",  fx_origin );
  255.     self.wolf_head_model.fx setmodel( "tag_origin" );
  256.     self.wolf_head_model.fx.angles = self.wolf_head_model.angles + (0,0,90);
  257.     playfxontag(level._effect["nsz_wolf_fire"], self.wolf_head_model.fx, "tag_origin" );
  258.     self.wolf_head_model PlayLoopSound( "wolf_playing" );
  259.     self.wolf_head_model thread intro_anims();
  260.     wait( getanimlength(%o_zombie_dreamcatcher_intro) );
  261. }
  262.  
  263. intro_anims()
  264. {
  265.     playsoundatposition( "wolf_howl_dc_02", self.origin );
  266.     self thread head_sounds();
  267.     self UseAnimTree(#animtree);   
  268.     self AnimScripted( "wolf_bark_notify", self.origin, self.angles, %o_zombie_dreamcatcher_intro );
  269.     wait( getanimlength(%o_zombie_dreamcatcher_intro) );
  270.     self idle_anims();
  271. }
  272.  
  273. outtro_anims()
  274. {
  275.     playsoundatposition( "wolf_howl_dc_02", self.origin );  
  276.     self stopAnimScripted();
  277.     self AnimScripted( "test", self.origin, self.angles, %o_zombie_dreamcatcher_outtro );
  278.     wait( getanimlength(%o_zombie_dreamcatcher_outtro) );
  279.     wait(0.05);
  280.     self.fx delete();
  281.     self delete();
  282. }
  283.  
  284. idle_anims()
  285. {
  286.     self endon( "eating_notify" );
  287.     while(1)
  288.     {  
  289.         // iprintlnbold( "top of while 1 in idle_anims" );
  290.         self AnimScripted( "wolf_bark_notify", self.origin, self.angles, %o_zombie_dreamcatcher_idle );
  291.         wait( getanimlength(%o_zombie_dreamcatcher_idle) );
  292.        
  293.         rand_anim = undefined;
  294.         // Choose a Random Idle Anim
  295.             var = randomintrange(1, 3);
  296.             if( var == 1 )
  297.                 rand_anim = %o_zombie_dreamcatcher_idle_twitch_scan;
  298.             if ( var == 2 )
  299.                 rand_anim = %o_zombie_dreamcatcher_idle_twitch_shake;
  300.        
  301.         self stopAnimScripted();       
  302.         self AnimScripted( "wolf_bark_notify", self.origin, self.angles, rand_anim );
  303.         wait( getanimlength(rand_anim) );
  304.     }
  305. }
  306.  
  307. eat_anims()
  308. {
  309.     self notify( "eating_notify" );
  310.     // iprintlnbold("eating_anims()");
  311.     self stopAnimScripted();
  312.     self AnimScripted( "test", self.origin, self.angles, %o_zombie_dreamcatcher_wallconsume_pre_eat_f );
  313.     wait( getanimlength(%o_zombie_dreamcatcher_wallconsume_pre_eat_f) );
  314.     self stopAnimScripted();
  315.     self AnimScripted( "wolf_bark_notify", self.origin, self.angles, %o_zombie_dreamcatcher_idle_twitch_yawn );
  316.     wait( getanimlength(%o_zombie_dreamcatcher_idle_twitch_yawn) );
  317.     if( self.is_charged == 0 )
  318.     {
  319.         self thread idle_anims();
  320.     }
  321.     else if( self.is_charged == 1 )
  322.     {
  323.         self thread outtro_anims();
  324.     }
  325.  
  326.     playsoundatposition( "soul_count", self.origin );
  327. }
  328.  
  329. head_sounds()
  330. {
  331.     note = undefined;
  332.     while(1)
  333.     {
  334.         self waittill("wolf_bark_notify", note);
  335.         if( note == "wolf_bark" )
  336.         {
  337.             var = randomintrange(0,7);
  338.             playsoundatposition( "wolf_bark_0"+var, self.origin );
  339.         }
  340.         if( note == "wolf_growl" )
  341.         {
  342.             var = randomintrange(0,4);
  343.             playsoundatposition( "growl_close_0"+var, self.origin );
  344.         }
  345.         if( note == "wolf_boom" )
  346.         {
  347.             playsoundatposition( "wolf_boom", self.origin );
  348.             fx_model = spawn( "script_model", self gettagorigin("j_tongue_3") );
  349.             fx_model setmodel( "tag_origin" );
  350.             playfx( level._effect["distortion"], fx_model.origin );
  351.             Earthquake( 0.3, 2, self.origin, 800 );
  352.             fx_model delete();
  353.             players = getplayers();
  354.             for( i=0;i<players.size;i++ )
  355.             {
  356.                 distance = distancesquared(players[i].origin, self.origin);
  357.                 if( distance < 250000 )
  358.                     players[i] give_blur();
  359.             }
  360.         }
  361.     }
  362. }
  363.  
  364. give_blur()
  365. {
  366.     self setblur( 5, 1 );
  367.     self setburn(1);
  368.     wait(1);
  369.     self setblur( 0, 1 );
  370. }
  371.  
  372. spawn_posters()
  373. {
  374.     self.poster = spawn( "script_model", self.origin );
  375.     self.poster setmodel( "p6_zm_al_dream_catcher_off" );
  376.     self.poster.angles = self.angles;
  377. }
  378.  
  379. replace_poster(fx_origin)
  380. {
  381.     self waittill("fully_charged");
  382.     self.poster setmodel("p6_zm_al_dream_catcher");
  383.     self.poster show();
  384.     if( isDefined(fx_origin) )
  385.     {
  386.         playfx( level._effect["nsz_wolf_end"], fx_origin );
  387.         wait(2);
  388.         self.poster PlayLoopSound( "rune_glow" );
  389.     }
  390. }
  391.  
  392. wolf_cooldown(intro_or_no)
  393. {
  394.     self.is_ready_to_eat = false;
  395.     if( isDefined(intro_or_no) && intro_or_no == true )
  396.         wait( getanimlength(%o_zombie_dreamcatcher_intro) );
  397.     wait( getanimlength(%o_zombie_dreamcatcher_wallconsume_pre_eat_f) );
  398.     wait( getanimlength(%o_zombie_dreamcatcher_idle_twitch_yawn) );
  399.     self.is_ready_to_eat = true;
  400. }
  401.  
  402. check_for_zombie_in_wolf_area()
  403. {
  404.     self endon("death");
  405.     while(1)
  406.     {
  407.         wait(0.05);
  408.         for( i=0;i<level.soul_catchers_vol.size;i++ )
  409.         {
  410.             // iprintlnbold( "level.soul_catchers_vol.size = " +level.soul_catchers_vol.size );
  411.             if( self istouching(level.soul_catchers_vol[i]) && level.soul_catchers[i].is_charged != 1 && self.nsz_no_gib == false )
  412.             {
  413.                 self.nsz_no_gib = true;
  414.                 self.gibbed = true;  
  415.                 self.head_gibbed = true;
  416.                 // iprintlnbold("zom in zone dont gib");
  417.             }
  418.         }
  419.     }
  420. }
  421.  
  422. ai_eaten_func(wolf_mouth, add_wait_time)
  423. {
  424.     self.animName = "zombie";
  425.     self UseAnimTree(#animtree);
  426.     self AnimScripted( "test", self.origin, self.angles, %ai_zombie_dreamcatch_impact );
  427.     // playsoundatposition( "bodyfall_flesh_large", self.origin );
  428.     wait( getanimlength(%ai_zombie_dreamcatch_impact) );
  429.     wait( getanimlength(%o_zombie_dreamcatcher_wallconsume_pre_eat_f) );
  430.     wait( getanimlength(%o_zombie_dreamcatcher_intro) );
  431.     self stopAnimScripted();
  432.     wait(.5);
  433.    
  434.     if( isDefined(add_wait_time) )
  435.         wait(add_wait_time);
  436.        
  437.     self SetAnim( %ai_zombie_dreamcatch_rise );
  438.     playsoundatposition( "soul_suck", self.origin );
  439.     wait( getanimlength(%ai_zombie_dreamcatch_rise) -.5 );
  440.     self moveto( wolf_mouth, 1 );
  441.     wait(.5);
  442.     self hide();
  443.     playfxontag(level._effect["nsz_big_geyser"], self, "j_spineupper" );
  444.     wait(1);
  445.     self delete();
  446. }
  447. door()
  448. {
  449.         door = getEnt("hells_gate", "targetname");  //this will be the door that opens
  450.     door delete();
  451.     door_clip = getEnt("hells_clip", "targetname");
  452.     door_clip delete();
  453.        // door MoveZ (-200, 2);
  454.         // door MoveY (100, 5);
  455.         // door MoveX (100, 5);
  456.         door connectpaths();
  457.          iprintln("A gate has been opened");     //remove this line if you don't want it to say that
  458.  
  459.        
  460.         wait 1;
  461. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement