9
3

TheDevoured.lua 8.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171
  1. --[[
  2. Script Name : SpawnScripts/Caves/TheDevoured.lua
  3. Script Author : Dorbin
  4. Script Date : 2022.10.10 01:10:45
  5. Script Purpose :
  6. :
  7. --]]
  8. function spawn(NPC)
  9. dmgMod = GetStr(NPC)/10
  10. SetInfoStructUInt(NPC, "override_primary_weapon", 1)
  11. SetInfoStructUInt(NPC, "primary_weapon_damage_low", math.floor(24 + dmgMod))
  12. SetInfoStructUInt(NPC, "primary_weapon_damage_high", math.floor(42 + dmgMod))
  13. end
  14. function hailed(NPC, Spawn)
  15. end
  16. function respawn(NPC)
  17. spawn(NPC)
  18. end
  19. local HealthCallout = false --REDUCES Half-Health Spam
  20. local CalloutTimer = false --REDUCES Callout Spam
  21. function ResetTimer(NPC) -- 7 SECOND PAUSE BETWEEN VOs
  22. SetTempVariable(NPC, "CalloutTimer", "false")
  23. end
  24. function HealthReset (NPC) -- SO HALF HEALTH DOESN'T SPAM
  25. SetTempVariable(NPC, "HealthCallout", "false")
  26. end
  27. function Garbled(NPC,Player)
  28. local choice = MakeRandomInt(1,5)
  29. if choice == 1 then
  30. PlayFlavor(NPC, "voiceover/english/gnoll_base_1/ft/gnoll/gnoll_base_1_1_garbled_2f8caa7b.mp3", "Krovel grarggt ereverrrn", "", 3999652656, 427507713, Player, 18)
  31. elseif choice == 2 then
  32. PlayFlavor(NPC, "voiceover/english/gnoll_base_1/ft/gnoll/gnoll_base_1_2_garbled_fe1eedd8.mp3", "Rrrrevvvvnarrr jahht ttekkkman", "", 1674950709, 3936377565, Player, 18)
  33. elseif choice == 3 then
  34. PlayFlavor(NPC, "voiceover/english/gnoll_base_1/ft/gnoll/gnoll_base_1_3_garbled_fad67c0f.mp3", "Grrrolven brakth kerrtt", "", 2579932316, 1973717234, Player, 18)
  35. elseif choice == 4 then
  36. PlayFlavor(NPC, "voiceover/english/gnoll_base_1/ft/gnoll/gnoll_base_1_3_garbled_3eefc118.mp3", "Vologrrren aggart renevenn", "", 3980060701, 1422372699, Player, 18)
  37. elseif choice == 5 then
  38. PlayFlavor(NPC, "voiceover/english/gnoll_base_1/ft/gnoll/gnoll_base_1_2_garbled_2f8caa7b.mp3", "Krovel grarggt ereverrrn", "", 2385604574, 3717589402, Player, 18)
  39. end
  40. end
  41. function aggro(NPC,Player)
  42. AddTimer(NPC,math.random(14000,31000),"FifteenCall")
  43. SetTempVariable(NPC, "CalloutTimer", "false")
  44. if GetTempVariable(NPC, "CalloutTimer")== "false"and IsPlayer(Player) then
  45. SetTempVariable(NPC, "CalloutTimer", "true")
  46. AddTimer(NPC,10000,"ResetTimer")
  47. if not HasLanguage(Player,18 )then
  48. Garbled(NPC,Player)
  49. else
  50. local choice = MakeRandomInt(1,8)
  51. if choice == 1 then
  52. PlayFlavor(NPC, "voiceover/english/gnoll_base_1/ft/gnoll/gnoll_base_1_1_aggro_75cd5d19.mp3", "Not allowed here!", "", 1292107958, 2335134714, Player, 18)
  53. elseif choice == 2 then
  54. PlayFlavor(NPC, "voiceover/english/gnoll_base_1/ft/gnoll/gnoll_base_1_2_aggro_75cd5d19.mp3", "Not allowed here!", "", 1266801616, 137145352, Player, 18)
  55. elseif choice == 3 then
  56. PlayFlavor(NPC, "voiceover/english/gnoll_base_1/ft/gnoll/gnoll_base_1_3_aggro_75cd5d19.mp3", "Not allowed here!", "", 942309136, 3095091783, Player, 18)
  57. elseif choice == 4 then
  58. PlayFlavor(NPC, "voiceover/english/gnoll_base_1/ft/gnoll/gnoll_base_1_1_aggro_d81be55c.mp3", "Bite! Show sharp teeth!", "", 612586564, 102929785, Player, 18)
  59. elseif choice == 5 then
  60. PlayFlavor(NPC, "voiceover/english/gnoll_base_1/ft/gnoll/gnoll_base_1_2_aggro_d81be55c.mp3", "Bite! Show sharp teeth!", "", 3848163428, 3270249405, Player, 18)
  61. elseif choice == 6 then
  62. PlayFlavor(NPC, "voiceover/english/gnoll_base_1/ft/gnoll/gnoll_base_1_3_aggro_d81be55c.mp3", "Bite! Show sharp teeth!", "", 3276849474, 2846177216, Player, 18)
  63. elseif choice == 7 then
  64. PlayFlavor(NPC, "voiceover/english/gnoll_base_1/ft/gnoll/gnoll_base_1_1_aggro_fda03a16.mp3", "Spin, weave, dodge, attack!!!", "", 1347636574, 484324781, Player, 18)
  65. elseif choice == 8 then
  66. PlayFlavor(NPC, "voiceover/english/gnoll_base_1/ft/gnoll/gnoll_base_1_3_aggro_fda03a16.mp3", "Spin, weave, dodge, attack!!!", "", 1516290828, 3143203494, Player, 18)
  67. end
  68. end
  69. end
  70. end
  71. -- Doesn't Work PlayFlavor(NPC, "voiceover/english/optional5/gnoll_base_2/ft/gnoll/gnoll_base_2_1_aggro_959e4683.mp3", "Intruder!", "", 1672215946, 3521592402, Player, 18)
  72. function death(NPC,Player)
  73. if GetTempVariable(NPC, "CalloutTimer")== "false" and IsPlayer(Player) then
  74. if math.random(0,100)<=35 then
  75. if not HasLanguage(Player,18 )then
  76. Garbled(NPC,Player)
  77. else
  78. local choice = MakeRandomInt(1,5)
  79. if choice == 1 then
  80. PlayFlavor(NPC, "voiceover/english/gnoll_base_1/ft/gnoll/gnoll_base_1_1_death_9c1f07cb.mp3", "Another member of the pack down!", "", 782807197, 154562007, Player, 18)
  81. elseif choice == 2 then
  82. PlayFlavor(NPC, "voiceover/english/gnoll_base_1/ft/gnoll/gnoll_base_1_1_death_138a3058.mp3", "That one never mate!", "", 3110437136, 1206351893, Player, 18)
  83. elseif choice == 3 then
  84. PlayFlavor(NPC, "voiceover/english/gnoll_base_1/ft/gnoll/gnoll_base_1_3_death_138a3058.mp3", "That one will never mate!", "", 216068291, 510666258, Player, 18)
  85. elseif choice == 4 then
  86. PlayFlavor(NPC, "voiceover/english/gnoll_base_1/ft/gnoll/gnoll_base_1_2_death_9c1f07cb.mp3", "Another member of the pack down!", "", 3426629421, 3660282518, Player, 18)
  87. elseif choice == 5 then
  88. PlayFlavor(NPC, "voiceover/english/gnoll_base_1/ft/gnoll/gnoll_base_1_3_death_9c1f07cb.mp3", "Another member of the pack down!", "", 869495756, 2144000535, Player, 18)
  89. end
  90. end
  91. end
  92. end
  93. end
  94. -- DOES NOT WORK PlayFlavor(NPC, "voiceover/english/optional5/gnoll_base_2/ft/gnoll/gnoll_base_2_1_death_7cbd3c71.mp3", "I'll rip your throat open!", "", 134141978, 4165685331, Spawn, 18)
  95. function FifteenCall(NPC,Player)
  96. if IsInCombat(NPC)==true then
  97. if IsAlive(NPC) and GetTempVariable(NPC, "CalloutTimer")== "false" and math.random(0,100) <=33 and IsPlayer(Player) then
  98. SetTempVariable(NPC, "CalloutTimer", "true")
  99. AddTimer(NPC,10000,"ResetTimer")
  100. if not HasLanguage(Player,18 )then
  101. Garbled(NPC,Player)
  102. else
  103. local choice = MakeRandomInt(1,4)
  104. if choice == 1 then
  105. PlayFlavor(NPC, "voiceover/english/gnoll_base_1/ft/gnoll/gnoll_base_1_2_everyfifteenseconds_m_dbbe969a.mp3", "Grrrrrrrrrr! Yip!", "", 3107536729, 1468959623, Player, 18)
  106. elseif choice == 2 then
  107. PlayFlavor(NPC, "voiceover/english/gnoll_base_1/ft/gnoll/gnoll_base_1_2_everyfifteenseconds_7c69417c.mp3", "Nip at their heels when they flee!", "", 4292535613, 1359167400, Player, 18)
  108. elseif choice == 3 then
  109. PlayFlavor(NPC, "voiceover/english/gnoll_base_1/ft/gnoll/gnoll_base_1_1_battle_m_2b13fb2e.mp3", "For the pack!", "", 2513141586, 2807818416, Player, 18)
  110. elseif choice == 4 then
  111. if GetClass(Player) >=21 and GetClass(Player) <=30 then
  112. PlayFlavor(NPC, "voiceover/english/gnoll_base_1/ft/gnoll/gnoll_base_1_3_maomage_8fb8565d.mp3", "Yip! Watch out for their magic!", "", 1674162517, 4259121980, Spawn, 18)
  113. else
  114. PlayFlavor(NPC, "voiceover/english/optional5/gnoll_base_2/ft/gnoll/gnoll_base_2_1_battle_m_5c7913bb.mp3", "Bah! You smell horrible!", "", 687847219, 3365844906, Spawn, 18)
  115. end
  116. end
  117. end
  118. if IsAlive(NPC)then
  119. AddTimer(NPC,math.random(14000,31000),"FifteenCall")
  120. end
  121. end
  122. end
  123. end
  124. function healthchanged(NPC, Player)
  125. if GetTempVariable(NPC, "HealthCallout")== "false" and IsPlayer(Player) then
  126. if GetHP(NPC) < GetMaxHP(NPC) * 0.55 and GetHP(NPC) > GetMaxHP(NPC) * 0.45 then
  127. SetTempVariable(NPC, "HealthCallout", "true")
  128. AddTimer(NPC,10000,"HealthReset")
  129. if not HasLanguage(Player,18 )then
  130. Garbled(NPC,Player)
  131. else
  132. PlayFlavor(NPC, "voiceover/english/gnoll_base_1/ft/gnoll/gnoll_base_1_3_halfhealth_d093de2d.mp3", "Yip yip yip!", "", 166674284, 1395857397, Player, 18)
  133. end
  134. end
  135. end
  136. end
  137. function victory(NPC,Player)
  138. if IsPlayer(Player)and not HasLanguage(Player,18 )then
  139. Garbled(NPC,Player)
  140. elseif IsPlayer(Player) and HasLanguage(Player,18 )then
  141. local choice = MakeRandomInt(1,3)
  142. if choice == 1 then
  143. PlayFlavor(NPC, "voiceover/english/gnoll_base_1/ft/gnoll/gnoll_base_1_3_victory_e4520926.mp3", "Packmate not happy with scrawny catch.", "", 1321865956, 173648139, Player, 18)
  144. elseif choice == 2 then
  145. PlayFlavor(NPC, "voiceover/english/optional5/gnoll_base_2/ft/gnoll/gnoll_base_2_1_victory_8e18fe38.mp3", "Your fight is hopeless!", "", 2306110016, 2442076674, Player, 18)
  146. elseif choice == 3 then
  147. PlayFlavor(NPC, "voiceover/english/gnoll_base_1/ft/gnoll/gnoll_base_1_1_victory_f225e591.mp3", "One to bring back to lair!", "", 3397285495, 2608729760,Player,18)
  148. end
  149. end
  150. end