s_wrath.qc 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581
  1. /* Copyright (C) 1996-2022 id Software LLC
  2. This program is free software; you can redistribute it and/or modify
  3. it under the terms of the GNU General Public License as published by
  4. the Free Software Foundation; either version 2 of the License, or
  5. (at your option) any later version.
  6. This program is distributed in the hope that it will be useful,
  7. but WITHOUT ANY WARRANTY; without even the implied warranty of
  8. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  9. GNU General Public License for more details.
  10. You should have received a copy of the GNU General Public License
  11. along with this program; if not, write to the Free Software
  12. Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  13. See file, 'COPYING', for details.
  14. */
  15. // overlord.qc
  16. $skin s_wrtrst
  17. $frame s_wrtfrm
  18. // walk
  19. $frame s_wtwk01 s_wtwk02 s_wtwk03 s_wtwk04 s_wtwk05
  20. $frame s_wtwk06 s_wtwk07 s_wtwk08 s_wtwk09 s_wtwk10
  21. $frame s_wtwk11 s_wtwk12 s_wtwk13 s_wtwk14 s_wtwk15
  22. // hand to hand attacks
  23. $frame s_wtaa01 s_wtaa02 s_wtaa03 s_wtaa04 s_wtaa05
  24. $frame s_wtaa06 s_wtaa07 s_wtaa08 s_wtaa09 s_wtaa10
  25. $frame s_wtab01 s_wtab02 s_wtab03 s_wtab04 s_wtab05
  26. $frame s_wtab06 s_wtab07 s_wtab08 s_wtab09 s_wtab10
  27. $frame s_wtab11 s_wtab12 s_wtab13 s_wtab14
  28. $frame s_wtac01 s_wtac02 s_wtac03 s_wtac04 s_wtac05
  29. $frame s_wtac06 s_wtac07 s_wtac08 s_wtac09 s_wtac10
  30. $frame s_wtac11 s_wtac12 s_wtac13 s_wtac14
  31. // ranged attack
  32. $frame s_wtba01 s_wtba02 s_wtba03 s_wtba04 s_wtba05
  33. $frame s_wtba06 s_wtba07 s_wtba08 s_wtba09 s_wtba10 s_wtba11 s_wtba12
  34. // pain
  35. $frame s_wtpa01 s_wtpa02 s_wtpa03 s_wtpa04 s_wtpa05
  36. $frame s_wtpa06 s_wtpa07 s_wtpa08 s_wtpa09 s_wtpa10
  37. $frame s_wtpa11 s_wtpa12 s_wtpa13 s_wtpa14
  38. $frame s_wtpb01 s_wtpb02 s_wtpb03 s_wtpb04 s_wtpb05
  39. $frame s_wtpb06 s_wtpb07 s_wtpb08 s_wtpb09 s_wtpb10
  40. $frame s_wtpb11
  41. // death
  42. $frame s_wtdt01 s_wtdt02 s_wtdt03 s_wtdt04 s_wtdt05
  43. $frame s_wtdt06 s_wtdt07 s_wtdt08 s_wtdt09 s_wtdt10
  44. $frame s_wtdt11 s_wtdt12 s_wtdt13 s_wtdt14 s_wtdt15
  45. $frame s_wtdt16 s_wtdt17
  46. float(entity thePoint) isSpawnPointEmpty =
  47. {
  48. local entity neighbors;
  49. local entity start;
  50. neighbors = findradius ( thePoint.origin, 64 );
  51. if (neighbors == world)
  52. return 1;
  53. start = neighbors;
  54. while (neighbors)
  55. {
  56. if (neighbors != thePoint)
  57. {
  58. if (neighbors.flags & FL_MONSTER)
  59. {
  60. return 0;
  61. }
  62. else if (neighbors.classname == "player")
  63. {
  64. return 0;
  65. }
  66. else if (neighbors.think)
  67. {
  68. return 0;
  69. }
  70. }
  71. neighbors = neighbors.chain;
  72. if (neighbors == start)
  73. return 1;
  74. }
  75. return 1;
  76. };
  77. entity() overlord_find_dest3 =
  78. {
  79. local entity furthestDest;
  80. local entity bestDest;
  81. local entity curDest;
  82. local entity thePlayer;
  83. local float theDist;
  84. local float curDist;
  85. local float dot;
  86. local vector curVector;
  87. furthestDest = world;
  88. bestDest = world;
  89. theDist=0;
  90. thePlayer=find(world, classname, "player");
  91. curDest=world;
  92. makevectors (thePlayer.angles);
  93. while (1)
  94. {
  95. curDest = find ( curDest, classname, "info_overlord_destination");
  96. if ( curDest == world )
  97. {
  98. if (bestDest != world)
  99. return bestDest;
  100. return furthestDest;
  101. }
  102. if (isSpawnPointEmpty(curDest))
  103. {
  104. curVector = curDest.origin - thePlayer.origin;
  105. curDist = vlen ( curVector );
  106. curVector = normalize (curVector);
  107. dot = curVector * v_forward;
  108. if ( dot > 0.6 )
  109. {
  110. if (curDist > 150)
  111. {
  112. bestDest = curDest;
  113. }
  114. }
  115. if (curDist > theDist )
  116. {
  117. furthestDest = curDest;
  118. theDist = curDist;
  119. }
  120. }
  121. }
  122. // just in case, return the world.
  123. return world;
  124. };
  125. // =======================================================
  126. entity() overlord_find_dest =
  127. {
  128. local entity curDest, lastDest;
  129. local float loopCount;
  130. curDest = find ( world, classname, "info_overlord_destination");
  131. if (curDest != world)
  132. {
  133. lastDest = curDest;
  134. loopCount = random()*5;
  135. while (loopCount > 1)
  136. {
  137. curDest = nextent ( curDest );
  138. curDest = find ( curDest, classname, "info_overlord_destination");
  139. if (curDest != world)
  140. {
  141. if (isSpawnPointEmpty(curDest))
  142. {
  143. loopCount = loopCount - 1;
  144. lastDest = curDest;
  145. }
  146. else
  147. curDest = world;
  148. }
  149. else
  150. {
  151. return lastDest;
  152. }
  153. }
  154. return curDest;
  155. }
  156. return curDest;
  157. };
  158. void() overlord_teleport =
  159. {
  160. local float chance;
  161. local entity theDest;
  162. local vector org;
  163. if (!(self.spawnflags & 2))
  164. return;
  165. chance = random();
  166. if (chance > 0.75)
  167. return;
  168. // theDest = overlord_find_dest();
  169. theDest = overlord_find_dest3();
  170. if (theDest == world)
  171. return;
  172. // put a tfog where the player was
  173. spawn_tfog (self.origin);
  174. // spawn a tfog flash in front of the destination
  175. makevectors (self.angles);
  176. org = theDest.origin + 32 * v_forward;
  177. spawn_tfog (org);
  178. spawn_tdeath(theDest.origin, self);
  179. setorigin (self, theDest.origin);
  180. self.flags = self.flags - self.flags & FL_ONGROUND;
  181. };
  182. // =======================================================
  183. void() overlord_stand1 =[ $s_wtwk01, overlord_stand1 ] { ai_stand();};
  184. void() overlord_walk01 =[ $s_wtwk01, overlord_walk02 ] { ai_walk(8); };
  185. void() overlord_walk02 =[ $s_wtwk02, overlord_walk03 ] { ai_walk(8); };
  186. void() overlord_walk03 =[ $s_wtwk03, overlord_walk04 ] { ai_walk(8); };
  187. void() overlord_walk04 =[ $s_wtwk04, overlord_walk05 ] { ai_walk(8); };
  188. void() overlord_walk05 =[ $s_wtwk05, overlord_walk06 ] { ai_walk(8); };
  189. void() overlord_walk06 =[ $s_wtwk06, overlord_walk07 ] { ai_walk(8); };
  190. void() overlord_walk07 =[ $s_wtwk07, overlord_walk08 ] { ai_walk(8); };
  191. void() overlord_walk08 =[ $s_wtwk08, overlord_walk09 ] { ai_walk(8); };
  192. void() overlord_walk09 =[ $s_wtwk09, overlord_walk10 ] { ai_walk(8); };
  193. void() overlord_walk10 =[ $s_wtwk10, overlord_walk11 ] { ai_walk(8); };
  194. void() overlord_walk11 =[ $s_wtwk11, overlord_walk12 ] { ai_walk(8); };
  195. void() overlord_walk12 =[ $s_wtwk12, overlord_walk13 ] { ai_walk(8); };
  196. void() overlord_walk13 =[ $s_wtwk13, overlord_walk14 ] { ai_walk(8); };
  197. void() overlord_walk14 =[ $s_wtwk14, overlord_walk15 ] { ai_walk(8); };
  198. void() overlord_walk15 =[ $s_wtwk15, overlord_walk01 ] { ai_walk(8); };
  199. void() overlord_run01 =[ $s_wtwk01, overlord_run02 ] { ai_run(12); };
  200. void() overlord_run02 =[ $s_wtwk02, overlord_run03 ] { ai_run(12); };
  201. void() overlord_run03 =[ $s_wtwk03, overlord_run04 ] { ai_run(12); };
  202. void() overlord_run04 =[ $s_wtwk04, overlord_run05 ] { ai_run(12); };
  203. void() overlord_run05 =[ $s_wtwk05, overlord_run06 ] { ai_run(12); };
  204. void() overlord_run06 =[ $s_wtwk06, overlord_run07 ] { ai_run(12); };
  205. void() overlord_run07 =[ $s_wtwk07, overlord_run08 ] { ai_run(12); };
  206. void() overlord_run08 =[ $s_wtwk08, overlord_run09 ] { ai_run(12); };
  207. void() overlord_run09 =[ $s_wtwk09, overlord_run10 ] { ai_run(12); };
  208. void() overlord_run10 =[ $s_wtwk10, overlord_run11 ] { ai_run(12); };
  209. void() overlord_run11 =[ $s_wtwk11, overlord_run12 ] { ai_run(12); };
  210. void() overlord_run12 =[ $s_wtwk12, overlord_run13 ] { ai_run(12); };
  211. void() overlord_run13 =[ $s_wtwk13, overlord_run14 ] { ai_run(12); };
  212. void() overlord_run14 =[ $s_wtwk14, overlord_run15 ] { ai_run(12); };
  213. void() overlord_run15 =[ $s_wtwk15, overlord_run01 ] { ai_run(12); };
  214. // =================================================
  215. // overlord hand-to-hand attack
  216. // =================================================
  217. void() overlord_smash;
  218. void() overlord_at_a01 =[ $s_wtaa01, overlord_at_a02 ] { ai_charge(12);};
  219. void() overlord_at_a02 =[ $s_wtaa02, overlord_at_a03 ] { ai_charge(12);};
  220. void() overlord_at_a03 =[ $s_wtaa03, overlord_at_a04 ] { ai_charge(12);};
  221. void() overlord_at_a04 =[ $s_wtaa04, overlord_at_a05 ] { ai_charge(12);};
  222. void() overlord_at_a05 =[ $s_wtaa05, overlord_at_a06 ] { ai_charge(12);};
  223. void() overlord_at_a06 =[ $s_wtaa06, overlord_at_a07 ] { ai_charge(12);};
  224. void() overlord_at_a07 =[ $s_wtaa07, overlord_at_a08 ] {overlord_smash();};
  225. void() overlord_at_a08 =[ $s_wtaa08, overlord_at_a09 ] { ai_charge(12);};
  226. void() overlord_at_a09 =[ $s_wtaa09, overlord_at_a10 ] { ai_charge(12);};
  227. void() overlord_at_a10 =[ $s_wtaa10, overlord_run01 ] { ai_charge(12);};
  228. void() overlord_at_b01 =[ $s_wtab01, overlord_at_b02 ] { ai_charge(12);};
  229. void() overlord_at_b02 =[ $s_wtab02, overlord_at_b03 ] { ai_charge(12);};
  230. void() overlord_at_b03 =[ $s_wtab03, overlord_at_b04 ] { ai_charge(12);};
  231. void() overlord_at_b04 =[ $s_wtab04, overlord_at_b05 ] { ai_charge(12);};
  232. void() overlord_at_b05 =[ $s_wtab05, overlord_at_b06 ] { ai_charge(12);};
  233. void() overlord_at_b06 =[ $s_wtab06, overlord_at_b07 ] { ai_charge(12);};
  234. void() overlord_at_b07 =[ $s_wtab07, overlord_at_b08 ] { ai_charge(12);};
  235. void() overlord_at_b08 =[ $s_wtab08, overlord_at_b09 ] {overlord_smash();};
  236. void() overlord_at_b09 =[ $s_wtab09, overlord_at_b10 ] { ai_charge(12);};
  237. void() overlord_at_b10 =[ $s_wtab10, overlord_at_b11 ] { ai_charge(12);};
  238. void() overlord_at_b11 =[ $s_wtab11, overlord_at_b12 ] { ai_charge(12);};
  239. void() overlord_at_b12 =[ $s_wtab12, overlord_at_b13 ] { ai_charge(12);};
  240. void() overlord_at_b13 =[ $s_wtab13, overlord_at_b14 ] { ai_charge(12);};
  241. void() overlord_at_b14 =[ $s_wtab14, overlord_run01 ] { ai_charge(12);};
  242. void() overlord_at_c01 =[ $s_wtac01, overlord_at_c02 ] { ai_charge(12);};
  243. void() overlord_at_c02 =[ $s_wtac02, overlord_at_c03 ] { ai_charge(12);};
  244. void() overlord_at_c03 =[ $s_wtac03, overlord_at_c04 ] { ai_charge(12);};
  245. void() overlord_at_c04 =[ $s_wtac04, overlord_at_c05 ] { ai_charge(12);};
  246. void() overlord_at_c05 =[ $s_wtac05, overlord_at_c06 ] { ai_charge(12);};
  247. void() overlord_at_c06 =[ $s_wtac06, overlord_at_c07 ] {overlord_smash();};
  248. void() overlord_at_c07 =[ $s_wtac07, overlord_at_c08 ] { ai_charge(12);};
  249. void() overlord_at_c08 =[ $s_wtac08, overlord_at_c09 ] { ai_charge(12);};
  250. void() overlord_at_c09 =[ $s_wtac09, overlord_at_c10 ] { ai_charge(12);};
  251. void() overlord_at_c10 =[ $s_wtac10, overlord_at_c11 ] { ai_charge(12);};
  252. void() overlord_at_c11 =[ $s_wtac11, overlord_at_c12 ] {overlord_smash();};
  253. void() overlord_at_c12 =[ $s_wtac12, overlord_at_c13 ] { ai_charge(12);};
  254. void() overlord_at_c13 =[ $s_wtac13, overlord_at_c14 ] { ai_charge(12);};
  255. void() overlord_at_c14 =[ $s_wtac14, overlord_run01 ] { ai_charge(12);};
  256. void() overlord_smash =
  257. {
  258. local vector delta;
  259. local float smashDmg;
  260. if (!self.enemy)
  261. return;
  262. if (!CanDamage (self.enemy, self))
  263. return;
  264. ai_charge(10);
  265. delta = self.enemy.origin - self.origin;
  266. if (vlen(delta) > 100)
  267. return;
  268. smashDmg = 20 + random () * 10;
  269. sound (self, CHAN_WEAPON, "s_wrath/smash.wav", 1, ATTN_NORM);
  270. T_Damage (self.enemy, self, self, smashDmg);
  271. delta = normalize (self.enemy.origin - self.origin + self.enemy.view_ofs);
  272. SpawnBlood ( self.enemy.origin - delta * 30, delta * -100, smashDmg);
  273. };
  274. void() overlord_melee =
  275. {
  276. local float r;
  277. r = random();
  278. if (r < 0.33)
  279. {
  280. overlord_at_a01 ();
  281. }
  282. else if (r < 0.66)
  283. {
  284. overlord_at_b01 ();
  285. }
  286. else
  287. {
  288. overlord_at_c01 ();
  289. }
  290. };
  291. // ==================================================
  292. // missile attacks
  293. // ==================================================
  294. void(float AttackNumber) WrathMissile;
  295. void() overlord_msl_a01 =[ $s_wtba01, overlord_msl_a02 ] { ai_charge(12);};
  296. void() overlord_msl_a02 =[ $s_wtba02, overlord_msl_a03 ] { ai_charge(12);};
  297. void() overlord_msl_a03 =[ $s_wtba03, overlord_msl_a04 ] { ai_charge(12);};
  298. void() overlord_msl_a04 =[ $s_wtba04, overlord_msl_a05 ] { ai_charge(12);};
  299. void() overlord_msl_a05 =[ $s_wtba05, overlord_msl_a06 ] { ai_charge(12);};
  300. void() overlord_msl_a06 =[ $s_wtba06, overlord_msl_a07 ] {WrathMissile(4);};
  301. void() overlord_msl_a07 =[ $s_wtba07, overlord_msl_a08 ] { ai_charge(12);};
  302. void() overlord_msl_a08 =[ $s_wtba08, overlord_msl_a09 ] { ai_charge(12);};
  303. void() overlord_msl_a09 =[ $s_wtba09, overlord_msl_a10 ] { ai_charge(12);};
  304. void() overlord_msl_a10 =[ $s_wtba10, overlord_msl_a11 ] { ai_charge(12);};
  305. void() overlord_msl_a11 =[ $s_wtba11, overlord_msl_a12 ] { ai_charge(12);};
  306. void() overlord_msl_a12 =[ $s_wtba12, overlord_run01 ] {overlord_teleport();};
  307. void() overlord_missile =
  308. {
  309. local float r;
  310. r = random();
  311. overlord_msl_a01();
  312. };
  313. // ==================================================
  314. // pain
  315. // ==================================================
  316. void() overlord_pn_a01 =[ $s_wtpa01, overlord_pn_a02 ] {};
  317. void() overlord_pn_a02 =[ $s_wtpa02, overlord_pn_a03 ] {};
  318. void() overlord_pn_a03 =[ $s_wtpa03, overlord_pn_a04 ] {overlord_teleport();};
  319. void() overlord_pn_a04 =[ $s_wtpa04, overlord_pn_a05 ] {};
  320. void() overlord_pn_a05 =[ $s_wtpa05, overlord_pn_a06 ] {};
  321. void() overlord_pn_a06 =[ $s_wtpa06, overlord_pn_a07 ] {};
  322. void() overlord_pn_a07 =[ $s_wtpa07, overlord_run01 ] {};
  323. void() overlord_pn_b01 =[ $s_wtpb01, overlord_pn_b02 ] {};
  324. void() overlord_pn_b02 =[ $s_wtpb02, overlord_pn_b03 ] {};
  325. void() overlord_pn_b03 =[ $s_wtpb03, overlord_pn_b04 ] {overlord_teleport();};
  326. void() overlord_pn_b04 =[ $s_wtpb04, overlord_pn_b05 ] {};
  327. void() overlord_pn_b05 =[ $s_wtpb05, overlord_pn_b06 ] {};
  328. void() overlord_pn_b06 =[ $s_wtpb06, overlord_pn_b07 ] {};
  329. void() overlord_pn_b07 =[ $s_wtpb07, overlord_run01 ] {};
  330. void() overlord_pain =
  331. {
  332. local float r;
  333. if (self.pain_finished > time)
  334. return;
  335. r = random();
  336. if (r > 0.2)
  337. return;
  338. if (r < 0.15)
  339. overlord_pn_a01 ();
  340. else
  341. overlord_pn_b01 ();
  342. self.pain_finished = time + 2;
  343. sound (self, CHAN_VOICE, "wrath/wpain.wav", 1, ATTN_NORM);
  344. };
  345. void(string gibName) ol_toss =
  346. {
  347. local vector flingVelocity;
  348. local entity myGib;
  349. makevectors(self.angles);
  350. flingVelocity = v_forward*250 + v_up*300;
  351. flingVelocity = flingVelocity + v_up * (random() * 100 - 50);
  352. flingVelocity = flingVelocity + v_right * (random() * 200 - 100);
  353. myGib = StartGib (gibName);
  354. myGib.velocity = flingVelocity;
  355. };
  356. // note - death frame 9 is intentionally done twice.
  357. void() overlord_die01 =[ $s_wtdt01, overlord_die02 ] {self.nextthink = time +0.05;};
  358. void() overlord_die02 =[ $s_wtdt02, overlord_die03 ]
  359. { self.flags = self.flags | FL_FLY; self.nextthink = time +0.05;};
  360. void() overlord_die03 =[ $s_wtdt03, overlord_die04 ] {self.nextthink = time +0.05;};
  361. void() overlord_die04 =[ $s_wtdt04, overlord_die05 ] {self.nextthink = time +0.05;};
  362. void() overlord_die05 =[ $s_wtdt05, overlord_die06 ] {self.nextthink = time +0.05;};
  363. void() overlord_die06 =[ $s_wtdt06, overlord_die07 ] {self.nextthink = time +0.05;};
  364. void() overlord_die07 =[ $s_wtdt07, overlord_die08 ] {self.nextthink = time +0.05;};
  365. void() overlord_die08 =[ $s_wtdt08, overlord_die09 ] {self.nextthink = time +0.05;};
  366. void() overlord_die09 =[ $s_wtdt09, overlord_die10 ] {self.nextthink = time +0.05;};
  367. void() overlord_die10 =[ $s_wtdt09, overlord_die11 ] {self.nextthink = time +0.05;};
  368. void() overlord_die11 =[ $s_wtdt10, overlord_die12 ] {self.nextthink = time +0.05;};
  369. void() overlord_die12 =[ $s_wtdt11, overlord_die13 ] {self.nextthink = time +0.05;};
  370. void() overlord_die13 =[ $s_wtdt12, overlord_die14 ] {self.nextthink = time +0.05;};
  371. void() overlord_die14 =[ $s_wtdt13, overlord_die15 ] {self.nextthink = time +0.05;};
  372. void() overlord_die15 =[ $s_wtdt14, overlord_die16 ] {self.nextthink = time +0.05;};
  373. void() overlord_die16 =[ $s_wtdt15, overlord_die17 ] {self.nextthink = time +0.05;};
  374. void() overlord_die17 =[ $s_wtdt16, overlord_die18 ]
  375. {
  376. self.model = "";
  377. WriteByte (MSG_BROADCAST, SVC_TEMPENTITY);
  378. WriteByte (MSG_BROADCAST, TE_EXPLOSION2);
  379. WriteCoord (MSG_BROADCAST, self.origin_x);
  380. WriteCoord (MSG_BROADCAST, self.origin_y);
  381. WriteCoord (MSG_BROADCAST, self.origin_z);
  382. WriteByte (MSG_BROADCAST, 0);
  383. WriteByte (MSG_BROADCAST, 4);
  384. ol_toss("progs/s_wrtgb2.mdl");
  385. ol_toss("progs/s_wrtgb3.mdl");
  386. ol_toss("progs/wrthgib1.mdl");
  387. ol_toss("progs/wrthgib2.mdl");
  388. ol_toss("progs/wrthgib3.mdl");
  389. self.nextthink = time + 0.1;
  390. };
  391. void() overlord_die18 =[ $s_wtdt17, overlord_die19 ]
  392. {
  393. local float counter;
  394. counter = 2;
  395. WriteByte (MSG_BROADCAST, SVC_TEMPENTITY);
  396. WriteByte (MSG_BROADCAST, TE_EXPLOSION2);
  397. WriteCoord (MSG_BROADCAST, self.origin_x);
  398. WriteCoord (MSG_BROADCAST, self.origin_y);
  399. WriteCoord (MSG_BROADCAST, self.origin_z);
  400. WriteByte (MSG_BROADCAST, 0);
  401. WriteByte (MSG_BROADCAST, 4);
  402. while(counter>0)
  403. {
  404. ol_toss("progs/gib1.mdl");
  405. ol_toss("progs/gib2.mdl");
  406. ol_toss("progs/gib3.mdl");
  407. counter = counter - 1;
  408. }
  409. self.nextthink = time + 0.1;
  410. };
  411. void() overlord_die19 = [ $s_wtdt17, overlord_die19 ]
  412. {
  413. local float counter;
  414. counter = 2;
  415. WriteByte (MSG_BROADCAST, SVC_TEMPENTITY);
  416. WriteByte (MSG_BROADCAST, TE_EXPLOSION2);
  417. WriteCoord (MSG_BROADCAST, self.origin_x);
  418. WriteCoord (MSG_BROADCAST, self.origin_y);
  419. WriteCoord (MSG_BROADCAST, self.origin_z);
  420. WriteByte (MSG_BROADCAST, 0);
  421. WriteByte (MSG_BROADCAST, 4);
  422. while(counter>0)
  423. {
  424. ol_toss("progs/gib1.mdl");
  425. ol_toss("progs/gib2.mdl");
  426. ol_toss("progs/gib3.mdl");
  427. counter = counter - 1;
  428. }
  429. remove(self);
  430. };
  431. /*QUAKED monster_super_wrath (1 0 0) (-16 -16 -24) (16 16 32) Ambush BossMode
  432. The super wrath (Overlord).
  433. BossMode enables the superwrath's powershield and the random teleporting.
  434. */
  435. void() monster_super_wrath =
  436. {
  437. if (deathmatch)
  438. {
  439. remove(self);
  440. return;
  441. }
  442. precache_model ("progs/s_wrath.mdl");
  443. //
  444. precache_model ("progs/s_wrtgb1.mdl");
  445. precache_model ("progs/s_wrtgb2.mdl");
  446. precache_model ("progs/s_wrtgb3.mdl");
  447. precache_model ("progs/wrthgib1.mdl");
  448. precache_model ("progs/wrthgib2.mdl");
  449. precache_model ("progs/wrthgib3.mdl");
  450. precache_model ("progs/w_ball.mdl");
  451. precache_sound ("wrath/wsee.wav");
  452. precache_sound ("wrath/watt.wav");
  453. precache_sound ("wrath/wpain.wav");
  454. precache_sound ("wrath/wdthc.wav");
  455. precache_sound ("s_wrath/smash.wav");
  456. self.solid = SOLID_SLIDEBOX;
  457. self.movetype = MOVETYPE_STEP;
  458. setmodel (self, "progs/s_wrath.mdl");
  459. setsize (self, VEC_HULL_MIN, VEC_HULL_MAX);
  460. self.health = 1000;
  461. self.pain_finished = 0;
  462. // if(self.spawnflags & 2)
  463. // self.items2 = IT2_SHIELD;
  464. self.th_stand = overlord_stand1;
  465. self.th_walk = overlord_walk01;
  466. self.th_run = overlord_run01;
  467. self.th_missile = overlord_missile;
  468. self.th_melee = overlord_melee;
  469. self.th_pain = overlord_pain;
  470. self.th_die = overlord_die02;
  471. flymonster_start ();
  472. };
  473. /*QUAKED info_overlord_destination (.5 .5 .5) (-8 -8 -8) (8 8 32)
  474. This is the destination marker for the overlord.
  475. It does not require any other fields filled in.
  476. */
  477. void() info_overlord_destination =
  478. {
  479. // this does nothing, just serves as a target spot
  480. self.mangle = self.angles;
  481. self.angles = '0 0 0';
  482. self.model = "";
  483. self.origin = self.origin + '0 0 27';
  484. };