Advertisement
CabCon

Untitled

Feb 9th, 2016
193
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.86 KB | None | 0 0
  1. func_spawnAZombieBoss()
  2. {
  3. L("boss_main -> called");
  4. if(self.var["ZOMBIE_BOSS"])
  5. return;
  6. if(getZombz().size < 0)
  7. {
  8. S("No Zombie found!");
  9. return;
  10. }
  11. self.var["ZOMBIE_BOSS"] = true;
  12. boss = getZombz();
  13. // boss 0 is the current boss
  14.  
  15. boss[0] attach("zombie_skull", "J_Eyeball_LE", true);
  16. boss[0] attach("zombie_teddybear", "J_Ankle_LE", true);
  17. boss[0] attach("zombie_teddybear", "J_Ankle_RI", true);
  18.  
  19. self thread boss_healthmonetoring(boss[0]);
  20. self thread boss_think(boss[0]);
  21. self thread boss_think_death(boss[0]);
  22.  
  23. L("boss_main -> called_end");
  24. }
  25.  
  26. boss_healthmonetoring(i)
  27. {
  28. i.health = 100000;
  29. self.var["ZOMBIE_BOSS_HEALTH"] = 1;
  30. while(self.var["ZOMBIE_BOSS"])
  31. {
  32. if(self.var["ZOMBIE_BOSS_HEALTH"] != i.health)
  33. {
  34. S("Boss health ^2"+i.health);
  35. self.var["ZOMBIE_BOSS_HEALTH"] = i.health;
  36. wait .1;
  37. }
  38. wait 0.025;
  39. }
  40. }
  41.  
  42. boss_think(i)
  43. {
  44. while(self.var["ZOMBIE_BOSS"])
  45. {
  46. if(Distance( self.origin, i.origin ) <= 50)
  47. {
  48. L("touch boss near!");
  49. i setMovmentSpeed("idle");
  50. if(isDefined(level._effect["poltergeist"]))
  51. PlayFX(level._effect["poltergeist"], i.origin);
  52. wait .5;
  53. earthquake(0.6,5,i.origin,100);
  54. i setMovmentSpeed("sprint");
  55. wait 2;
  56. earthquake(0.6,5,i.origin,100);
  57. wait 3;
  58. earthquake(0.6,5,i.origin,100);
  59. wait 3;
  60. earthquake(0.6,5,i.origin,100);
  61. wait 2;
  62. earthquake(0.6,5,i.origin,1000);
  63. }
  64. else if(Distance( self.origin, i.origin ) <= 200)
  65. {
  66. L("touch boss");
  67. i setMovmentSpeed("run");
  68. }
  69. else
  70. i setMovmentSpeed("walk");
  71. wait .5;
  72. }
  73. }
  74.  
  75. boss_think_death(i)
  76. {
  77. for(;;)
  78. {
  79. if(i.health < 0)
  80. {
  81. self.var["ZOMBIE_BOSS"] = false;
  82. L("Boss is death");
  83. break;
  84. }
  85. wait 0.1;
  86. }
  87. }
  88.  
  89.  
  90. setMovmentSpeed(i)
  91. {
  92. self maps\_zombiemode_spawner::set_zombie_run_cycle(i);
  93. L("Movment Cycle ^2changed");
  94. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement