BaseGhost1.lua 7.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173
  1. --[[
  2. Script Name : SpawnScripts/Generic/MonsterCallouts/BaseGhost1.lua
  3. Script Author : Dorbin
  4. Script Date : 2023.05.27 03:05:33
  5. Script Purpose :
  6. :
  7. --]]
  8. local HealthCallout = false --REDUCES Half-Health Spam
  9. local CalloutTimer = false --REDUCES Callout Spam
  10. local FIGHTER = 1
  11. local WARRIOR =2
  12. local GUARDIAN= 3
  13. local BERSERKER = 4
  14. local BRAWLER = 5
  15. local MONK = 6
  16. local BRUISER= 7
  17. local CRUSADER = 8
  18. local SHADOWKNIGHT = 9
  19. local PALADIN = 10
  20. local MAGE = 21
  21. local SORCERER = 22
  22. local WIZARD = 23
  23. local WARLOCK = 24
  24. local ENCHANTER = 25
  25. local ILLUSIONIST = 26
  26. local COERCER = 27
  27. local SUMMONER = 28
  28. local CONJUROR = 29
  29. local NECROMANCER = 30
  30. local Barbarian = 0
  31. local DarkElf = 1
  32. local Dwarf = 2
  33. local Erudite = 3
  34. local Froglok = 4
  35. local Gnome = 5
  36. local HalfElf = 6
  37. local Halfling = 7
  38. local HighElf = 8
  39. local Human = 9
  40. local Iksar = 10
  41. local Kerra = 11
  42. local Ogre = 12
  43. local Ratonga = 13
  44. local Troll = 14
  45. local WoodElf = 15
  46. function aggro(NPC,Spawn)
  47. SetTempVariable(NPC, "CalloutTimer", "false")
  48. SetTempVariable(NPC, "HealthCallout", "false")
  49. if GetTempVariable(NPC, "CalloutTimer")== "false"then
  50. SetTempVariable(NPC, "CalloutTimer", "true")
  51. AddTimer(NPC,7000,"ResetTimer")
  52. if GetGender(NPC)==1 then --GENDER CHECK. 1==Male
  53. AddTimer(NPC,math.random(15000,30000),"FifteenCall",1,Spawn)
  54. choice = MakeRandomInt(1,3)
  55. if choice == 1 then
  56. PlayFlavor(NPC, "voiceover/english/ghost_base_1/ft/ghost/ghost_base_1_1_aggro_gm_3e2a680d.mp3", "You cannot run from death, mortal!", "", 3726501132, 2641272181)
  57. elseif choice == 2 then
  58. PlayFlavor(NPC, "voiceover/english/ghost_base_1/ft/ghost/ghost_base_1_1_aggro_gm_11cb6bf8.mp3", "Mortal agony is nothing compared to the torment that awaits you!", "", 2544751499, 3488336081)
  59. elseif choice == 3 then
  60. PlayFlavor(NPC, "voiceover/english/ghost_base_1/ft/ghost/ghost_base_1_1_aggro_gm_8a0dd99d.mp3", "I will show you the true pain of death!", "", 2563182730, 2699265972)
  61. end
  62. else
  63. choice = MakeRandomInt(1,3)
  64. if choice == 1 then
  65. PlayFlavor(NPC, "voiceover/english/ghost_base_1/ft/ghost/ghost_base_1_1_aggro_gf_11cb6bf8.mp3", "Mortal agony is nothing compared to the torment that awaits you!", "", 1709305523, 785917379)
  66. elseif choice == 2 then
  67. PlayFlavor(NPC, "voiceover/english/ghost_base_1/ft/ghost/ghost_base_1_1_aggro_gf_8a0dd99d.mp3", "I will show you the true pain of death!", "", 1781892618, 4026020917)
  68. elseif choice == 3 then
  69. PlayFlavor(NPC, "voiceover/english/ghost_base_1/ft/ghost/ghost_base_1_1_aggro_gf_3e2a680d.mp3", "You cannot run from death, mortal!", "", 351069702, 1435784652)
  70. end
  71. end
  72. end
  73. end
  74. function FifteenCall(NPC,Spawn)
  75. if IsAlive(NPC) and IsInCombat(NPC)==true and IsPlayer(Spawn)and GetTempVariable(NPC, "CalloutTimer")== "false" then
  76. if math.random(0,100)<=33 then
  77. SetTempVariable(NPC, "CalloutTimer", "true")
  78. AddTimer(NPC,10000,"ResetTimer")
  79. if GetGender(NPC) ==1 then
  80. local choice = MakeRandomInt(1,2)
  81. if choice == 1 then
  82. PlayFlavor(NPC, "voiceover/english/ghost_base_1/ft/ghost/ghost_base_1_1_everyfifteenseconds_gm_57b99cd6.mp3", "Eternal sleep is at hand.", "", 1119398838, 1604535949)
  83. elseif choice == 2 then
  84. if GetClass(Spawn) >=1 and GetClass(Spawn)<=11 or GetClass(Spawn) >=21 and GetClass(Spawn)<=30 then
  85. if GetClass(Spawn) >=1 and GetClass(Spawn)<=11 then
  86. PlayFlavor(NPC, "voiceover/english/ghost_base_1/ft/ghost/ghost_base_1_1_maofighter_gm_fccb4e4.mp3", "Your strength will not fend off death!","" ,3954285821, 1661926535)
  87. elseif GetClass(Spawn) >=21 and GetClass(Spawn)<=30 then
  88. PlayFlavor(NPC, "voiceover/english/ghost_base_1/ft/ghost/ghost_base_1_1_maomage_gm_8ab05a8f.mp3", "The dead do not fear your magic.", "", 2363203300, 1086897009)
  89. end
  90. end
  91. else
  92. end
  93. end
  94. end
  95. if IsAlive(NPC)then
  96. AddTimer(NPC,math.random(15000,30000),"FifteenCall",1,Spawn)
  97. end
  98. end
  99. end
  100. function death(NPC,Spawn)
  101. if CalloutTimer== false then
  102. if GetGender(NPC)==1 then
  103. local choice = MakeRandomInt(1,2)
  104. if choice == 1 then
  105. PlayFlavor(NPC, "voiceover/english/ghost_base_1/ft/ghost/ghost_base_1_1_death_gm_49b06ac1.mp3", "You cannot kill what is already dead!", "", 2840452858, 3381399753, Spawn, 0)
  106. elseif choice == 2 then
  107. PlayFlavor(NPC, "voiceover/english/ghost_base_1/ft/ghost/ghost_base_1_1_death_gm_18bd9c56.mp3", "You will see us again in your nightmares!", "", 3496984483, 236189449, Spawn, 0)
  108. end
  109. else
  110. local choice = MakeRandomInt(1,2)
  111. if choice == 1 then
  112. PlayFlavor(NPC, "voiceover/english/ghost_base_1/ft/ghost/ghost_base_1_1_death_gf_49b06ac1.mp3", "You cannot kill what is already dead!", "", 3015653280, 2452981919, Spawn, 0)
  113. else
  114. PlayFlavor(NPC, "voiceover/english/ghost_base_1/ft/ghost/ghost_base_1_1_death_gf_18bd9c56.mp3", "You will see us again in your nightmares!", "", 925894256, 166843390, Spawn, 0)
  115. end
  116. end
  117. end
  118. end
  119. function healthchanged(NPC, Spawn)
  120. if GetHP(NPC) <= GetMaxHP(NPC) * 0.55 and GetHP(NPC) >= GetMaxHP(NPC) * 0.45 then
  121. if IsAlive(NPC) and IsInCombat(NPC)==true and IsPlayer(Spawn)and GetTempVariable(NPC, "CalloutTimer")== "false" and GetTempVariable(NPC, "HealthCallout")== "false" then
  122. SetTempVariable(NPC, "HealthCallout", "true")
  123. AddTimer(NPC,9000,"ResetTimer")
  124. AddTimer(NPC,9000,"HealthReset")
  125. if GetGender(NPC)==1 then
  126. PlayFlavor(NPC, "voiceover/english/ghost_base_1/ft/ghost/ghost_base_1_1_halfhealth_gf_4c18f3ce.mp3", "Your struggle is for naught!", "", 1689672062, 2512623281)
  127. else
  128. PlayFlavor(NPC, "voiceover/english/ghost_base_1/ft/ghost/ghost_base_1_1_halfhealth_gm_4c18f3ce.mp3", "Your struggle is for naught!", "", 1816370688, 1982413936)
  129. end
  130. end
  131. end
  132. end
  133. function victory(NPC,Spawn)
  134. if GetGender(NPC)==1 then
  135. local choice = MakeRandomInt(1,2)
  136. if choice == 1 then
  137. PlayFlavor(NPC, "voiceover/english/ghost_human_base_1/ft/ghost/ghost_human_base_1_1_victory_gm_79236cb9.mp3", "It was too late. They have met our fate.", "", 869850080, 2857504352, Spawn)
  138. elseif choice == 2 then
  139. PlayFlavor(NPC, "voiceover/english/ghost_base_1/ft/ghost/ghost_base_1_1_victory_gm_3f0a2355.mp3", "Death is only the beginning!", "", 468059547, 3073125588)
  140. end
  141. else
  142. local choice = MakeRandomInt(1,2)
  143. if choice == 1 then
  144. PlayFlavor(NPC, "voiceover/english/ghost_base_1/ft/ghost/ghost_base_1_1_victory_gf_20212485.mp3", "", "", 700890837, 3828169591)
  145. elseif choice == 2 then
  146. PlayFlavor(NPC, "voiceover/english/ghost_base_1/ft/ghost/ghost_base_1_1_victory_gf_3f0a2355.mp3", "Death is only the beginning!", "", 1504821242, 3900153298)
  147. end
  148. end
  149. end
  150. function ResetTimer(NPC) -- 7 SECOND PAUSE BETWEEN VOs
  151. SetTempVariable(NPC, "CalloutTimer", "false")
  152. end
  153. function HealthReset (NPC) --SO HALF HEALTH DOESN'T SPAM
  154. SetTempVariable(NPC, "HealthCallout", "false")
  155. SetTempVariable(NPC, "CalloutTimer", "false")
  156. end