Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- func_spawnAZombieBoss()
- {
- L("boss_main -> called");
- if(self.var["ZOMBIE_BOSS"])
- return;
- if(getZombz().size < 0)
- {
- S("No Zombie found!");
- return;
- }
- self.var["ZOMBIE_BOSS"] = true;
- boss = getZombz();
- // boss 0 is the current boss
- boss[0] attach("zombie_skull", "J_Eyeball_LE", true);
- boss[0] attach("zombie_teddybear", "J_Ankle_LE", true);
- boss[0] attach("zombie_teddybear", "J_Ankle_RI", true);
- self thread boss_healthmonetoring(boss[0]);
- self thread boss_think(boss[0]);
- self thread boss_think_death(boss[0]);
- L("boss_main -> called_end");
- }
- boss_healthmonetoring(i)
- {
- i.health = 100000;
- self.var["ZOMBIE_BOSS_HEALTH"] = 1;
- while(self.var["ZOMBIE_BOSS"])
- {
- if(self.var["ZOMBIE_BOSS_HEALTH"] != i.health)
- {
- S("Boss health ^2"+i.health);
- self.var["ZOMBIE_BOSS_HEALTH"] = i.health;
- wait .1;
- }
- wait 0.025;
- }
- }
- boss_think(i)
- {
- while(self.var["ZOMBIE_BOSS"])
- {
- if(Distance( self.origin, i.origin ) <= 50)
- {
- L("touch boss near!");
- i setMovmentSpeed("idle");
- if(isDefined(level._effect["poltergeist"]))
- PlayFX(level._effect["poltergeist"], i.origin);
- wait .5;
- earthquake(0.6,5,i.origin,100);
- i setMovmentSpeed("sprint");
- wait 2;
- earthquake(0.6,5,i.origin,100);
- wait 3;
- earthquake(0.6,5,i.origin,100);
- wait 3;
- earthquake(0.6,5,i.origin,100);
- wait 2;
- earthquake(0.6,5,i.origin,1000);
- }
- else if(Distance( self.origin, i.origin ) <= 200)
- {
- L("touch boss");
- i setMovmentSpeed("run");
- }
- else
- i setMovmentSpeed("walk");
- wait .5;
- }
- }
- boss_think_death(i)
- {
- for(;;)
- {
- if(i.health < 0)
- {
- self.var["ZOMBIE_BOSS"] = false;
- L("Boss is death");
- break;
- }
- wait 0.1;
- }
- }
- setMovmentSpeed(i)
- {
- self maps\_zombiemode_spawner::set_zombie_run_cycle(i);
- L("Movment Cycle ^2changed");
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement