Zombie Boss: Banzai Zombie (Level: Easy)

broken avatar :(
Created 52 days ago
by gympie6
0 Members and 1 Guest are viewing this topic.
79 views
broken avatar :(
×
broken avatar :(
Location: nl
Date Registered: 20 September 2013
Last active: 12 hours ago
Posts
514
Respect
Forum Rank
Zombie Enslaver
Primary Group
Community Scripter
My Groups
More
My Contact & Social Links
More
Personal Quote
No code is bug free
Signature
My published cod maps:

Djinncaves
Enclosed (a.k.a baconcube)
Bayern
Snowblind
Furtrelock

Black Ops Perks: https://www.ugx-mods.com/forum/scripts/55/call-of-duty-world-at-war-black-ops-perks/22180/
×
gympie6's Groups
Community Scripter Has shown effort and knowledge in the area of scripting while being a part of the UGX-Mods community.
gympie6's Contact & Social LinksTheRevenantSkullTeffrieTeffrieGympie5#5971


I made this mini boss a few years back for my big map called: Snowblind
It works fine but they are maybe too focused on their targets even if they are in laststand.
If you are able to fix this issue be my guest and post it here. 
I re-checked and fixed some old issues so maybe it's already solved but who knows?

________________________________________________

1. copy the following files from raw/maps folder to your mod: 
  • _zombiemode
  • _zombiemode_spawner
  • dlc3_code
 (If you already have those files you don't need to copy them)

________________________________________________

2. In your mod make a new script file (MODNAME/maps) and paste the following code in there:
#include maps\_utility; 
#include common_scripts\utility;
#include maps\_zombiemode_utility;

#using_animtree( "generic_human" );
spawn_banzaizombie()
{   
    self.gib_override = false;
    self.gibbed = true;
   
    self setModel("char_ger_ansel_body");
   
    self.hatmodel = "char_ger_wermachtwet_helm1";
    self Attach( self.hatmodel );

    // Wait until the zombie entered the player area
    while(1)
    {
        if (!self.ignoreall)
        {
            self thread banzai_zombie();
            break;
        }
        wait 0.5;
    }
}

banzai_zombie()
{
    self endon( "death" );

    // Settings
    self.moveplaybackrate = 0.80; // Play banzai animation at 80%
    self.banzai_minimum_damage = 65; // Melee minimum damage with bayonet
    self.banzai_maximum_damage = 75; // Melee maximum damage with bayonet
    self.banzai_range = 70; // Melee range with bayonet
    self.banzai_hit_range = 30; // Melee hit range with bayonet
    // Settings
   
    self.pathEnemyFightDist = 0.0000001; // To Disable hand melee attacks.
    self.banzai_stop_stabbing = false;
    self thread banzai_zombie_stop_stabbing();
    self thread banzai_zombie_draw_weapon();
   
    self.zombie_move_speed = "sprint";
    banzaiRandom = randomFloat(100);
    if (banzaiRandom <= 25) self.run_combatanim = %ai_bonzai_sprint_a;
    else if (banzaiRandom > 25 && banzaiRandom <= 50) self.run_combatanim = %ai_bonzai_sprint_b;
    else if (banzaiRandom > 50 && banzaiRandom <= 75) self.run_combatanim = %ai_bonzai_sprint_c;
    else self.run_combatanim = %ai_bonzai_sprint_d;
   
    players = get_players();
   
    while( 1 )
    {
        if (isdefined(self.favoriteenemy))
        {
            target = self.favoriteenemy;
            if (self.banzai_stop_stabbing)
            {
                return;
            }
           
            if (target.is_zombie || target maps\_laststand::player_is_in_laststand() || target.sessionstate == "spectator" || !isalive(target))
            {
                continue;
            }
           
            if (distance( target.origin, self.origin ) <= self.banzai_range && target.origin != self.origin)
            {       
                self thread banzai_zombie_attack(target, target.origin);
                self waittill( "attack_done" );
            }
        }
        wait .05;
    }
}

banzai_zombie_attack(player, player_pos)
{
    angles = VectorToAngles( player_pos - self.origin );
    self OrientMode( "face angle", angles );
    self animscripted("melee_zombies", self.origin, self.angles, %ai_bayonet_stab_melee);       
   
    while ( 1 )
    {
        self waittill( "melee_zombies", note );
        if ( note == "fire" )
        {
            if( isalive(player) )
            {
                if (distance( player.origin, self.origin ) < self.banzai_range)
                {
                    radiusdamage(player_pos, 45, self.banzai_maximum_damage, self.banzai_minimum_damage, self, "MOD_MELEE");
                   
                    //Give the player the feeling he got stabbed
                    radiusdamage(player_pos, 45, 0, 0, player, "MOD_MELEE");
                    wait .2;
                    self stopAnimScripted();
                    break;
                }
            }
        }
        if ( note == "end" )
            break;       
    }
    self notify( "attack_done" );
}

banzai_zombie_stop_stabbing()
{
    self endon( "death" );

    level waittill( "end_game" );
   
    self.banzai_stop_stabbing = true;
}

banzai_zombie_draw_weapon()
{
    self endon( "death" );
   
    wait 3; // Otherwise you see spooky things
    self.primaryweapon = "kar98k_bayonet";
    self animscripts\shared::placeWeaponOn( self.primaryweapon, "right" );
}
(You can for example copy the _zombiemode.gsc file, clear that file and paste this in)
________________________________________________
3. openup _zombiemode and look for: 
precache_models()
{
    precachemodel( "char_ger_honorgd_zomb_behead" );
    precachemodel( "char_ger_zombieeye" );
    PrecacheModel( "tag_origin" );
}
change it to this:
precache_models()
{
    precachemodel( "char_ger_honorgd_zomb_behead" );
    precachemodel( "char_ger_zombieeye" );
    PrecacheModel( "tag_origin" );
   
    precachemodel( "char_ger_ansel_body" );
    precachemodel( "char_ger_wermachtwet_helm1" );
}
 ________________________________________________
4. openup _zombiemode_spawner and look for:
self notify( "zombie_init_done" );
change it to this:
self notify( "zombie_init_done" );

if (self.animname != "quad_zombie" && self.animname != "boss_zombie" && self.animname != "zombie_dog")
{
    spawn_round = 6; // the starting round the banzai zombie will spawn
    spawn_percentage = 10; // the spawn percentage the banzai zombie will spawn

    if (level.round_number >= spawn_round && randomInt(100) <= spawn_percentage)
    {
        self thread maps\YOURSCRIPT::spawn_banzaizombie();
    }
}
________________________________________________
5. openup dlc3_code and look for:
include_weapon
 along the others add this:
include_weapon( "kar98k_bayonet", false );
________________________________________________
6. Add this to your modbuilder:
// Banzai Zombie
xmodel,char_ger_ansel_body
xmodel,char_ger_wermachtwet_helm1
xanim,ai_bonzai_sprint_a
xanim,ai_bonzai_sprint_b
xanim,ai_bonzai_sprint_c
xanim,ai_bonzai_sprint_d
xanim,ai_bayonet_stab_melee
weapon,sp/kar98k_bayonet
// Banzai Zombie
________________________________________________
7. Build mod and you're done! Have fun! :)
Last Edit: August 26, 2021, 07:09:05 pm by gympie6

 

Login

or login with an authentication provider below
Sign In with Google
Sign In with Twitter
Sign In with Discord
Sign In with Steam
Sign In with Facebook
Sign In with Twitch
Loading ...