SkeletonSleepless1.lua 6.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125
  1. --[[
  2. Script Name : SpawnScripts/Generic/MonsterCallouts/SkeletonSleepless1.lua
  3. Script Author : Dorbin
  4. Script Date : 2022.10.18 03:10:13
  5. Script Purpose : Sleepless skeleton VOs. Found primarily in Forest Ruins.
  6. :
  7. --]]
  8. local HealthCallout = false --REDUCES Half-Health Spam
  9. local CalloutTimer = false --REDUCES Callout Spam
  10. function aggro(NPC,Spawn)
  11. SetTempVariable(NPC, "CalloutTimer", "false")
  12. if GetTempVariable(NPC, "CalloutTimer")== "false" and math.random(0,100) <=40 and IsPlayer(Spawn) then
  13. SetTempVariable(NPC, "CalloutTimer", "true")
  14. AddTimer(NPC,10000,"ResetTimer")
  15. local choice = MakeRandomInt(1,6)
  16. if choice == 1 then
  17. PlayFlavor(NPC, "voiceover/english/skeleton_sleepless_magi/ft/skeleton/skeleton_sleepless_magi_1_aggro_594f832b.mp3", "A proper test!", "", 2458242400, 1568956619)
  18. elseif choice == 2 then
  19. PlayFlavor(NPC, "voiceover/english/skeleton_sleepless_magi/ft/skeleton/skeleton_sleepless_magi_1_aggro_e04379ce.mp3", "Do not disturb me!", "", 3771011343, 3015021446)
  20. elseif choice == 3 then
  21. PlayFlavor(NPC, "voiceover/english/skeleton_sleepless_magi/ft/skeleton/skeleton_sleepless_magi_1_aggro_301dd369.mp3", "My progress will not be halted!", "", 3094765826, 2792009212)
  22. elseif choice == 4 then
  23. PlayFlavor(NPC, "voiceover/english/optional3/skeleton_sleepless_magi/ft/skeleton/skeleton_sleepless_magi_2_aggro_594f832b.mp3", "A proper test!", "", 3163910475, 1454332736)
  24. elseif choice == 5 then
  25. PlayFlavor(NPC, "voiceover/english/optional3/skeleton_sleepless_magi/ft/skeleton/skeleton_sleepless_magi_2_aggro_301dd369.mp3", "My progress will not be halted!", "", 3626750848, 2194222501)
  26. elseif choice == 6 then
  27. PlayFlavor(NPC, "voiceover/english/optional3/skeleton_sleepless_magi/ft/skeleton/skeleton_sleepless_magi_2_aggro_e04379ce.mp3", "Do not disturb me!", "", 2666722708, 325802695)
  28. end
  29. end
  30. AddTimer(NPC,math.random(15000,30000),"FifteenCall",1,Spawn)
  31. end
  32. function death(NPC,Spawn)
  33. if GetTempVariable(NPC, "CalloutTimer")== "false" and IsPlayer(Spawn) then
  34. local choice = MakeRandomInt(1,3)
  35. if choice == 1 then
  36. PlayFlavor(NPC, "voiceover/english/skeleton_sleepless_magi/ft/skeleton/skeleton_sleepless_magi_1_death_773d1ae2.mp3", "You cannot defeat us all!", "", 727426116, 26895558)
  37. elseif choice == 2 then
  38. PlayFlavor(NPC, "voiceover/english/optional3/skeleton_sleepless_magi/ft/skeleton/skeleton_sleepless_magi_2_death_773d1ae2.mp3", "You cannot defeat us all!", "", 1100354814, 1332403039)
  39. elseif choice == 3 then
  40. PlayFlavor(NPC, "voiceover/english/skeleton_sleepless_magi/ft/skeleton/skeleton_sleepless_magi_1_death_7e2a7df7.mp3", "It is not over!", "", 4202384571, 4094436000)
  41. end
  42. end
  43. end
  44. function FifteenCall(NPC,Spawn)
  45. if IsInCombat(NPC)==true and IsAlive(NPC) == true and math.random(0,100)<=25 and IsPlayer(Spawn) then
  46. if GetTempVariable(NPC, "CalloutTimer") == "false" then
  47. SetTempVariable(NPC, "CalloutTimer", "true")
  48. AddTimer(NPC,10000,"ResetTimer")
  49. local choice = MakeRandomInt(1,3)
  50. if choice == 1 then
  51. PlayFlavor(NPC, "voiceover/english/skeleton_base_1/ft/skeleton/skeleton_base_1_1_everyfifteenseconds_8c0aac8c.mp3", "Nightmares are not only for slumber.", "", 4250803944, 3206368665)
  52. elseif choice == 2 then
  53. PlayFlavor(NPC, "voiceover/english/skeleton_sleepless_magi/ft/skeleton/skeleton_sleepless_magi_1_everyfifteenseconds_4ea7c10a.mp3", "Must find ink, quills.", "", 4179902262, 3067236564)
  54. elseif choice == 3 then
  55. PlayFlavor(NPC, "", "I don't know where they'll go from here.", "", 0, 0)
  56. end
  57. end
  58. if IsAlive(NPC)then
  59. AddTimer(NPC,math.random(15000,30000),"FifteenCall",1,Spawn)
  60. end
  61. end
  62. end
  63. function healthchanged(NPC, Spawn)
  64. if GetTempVariable(NPC, "CalloutTimer") == "false" and IsPlayer(Spawn) then
  65. if GetTempVariable(NPC, "HealthCallout") == "false" then
  66. if GetHP(NPC) < GetMaxHP(NPC) * 0.55 then
  67. if GetHP(NPC) > GetMaxHP(NPC) * 0.45 then
  68. SetTempVariable(NPC, "HealthCallout", "true")
  69. SetTempVariable(NPC, "CalloutTimer", "true")
  70. AddTimer(NPC,10000,"ResetTimer")
  71. AddTimer(NPC,12500,"HealthReset")
  72. local choice = MakeRandomInt(1,6)
  73. if choice == 1 then
  74. PlayFlavor(NPC, "voiceover/english/optional3/skeleton_sleepless_magi/ft/skeleton/skeleton_sleepless_magi_2_halfhealth_68a94926.mp3", "No, must recall studies!", "", 9643365, 45994411)
  75. elseif choice == 2 then
  76. PlayFlavor(NPC, "voiceover/english/skeleton_sleepless_magi/ft/skeleton/skeleton_sleepless_magi_1_halfhealth_68a94926.mp3", "No, must recall studies!", "", 287237519, 284767385)
  77. elseif choice == 3 then
  78. PlayFlavor(NPC, "voiceover/english/optional3/skeleton_sleepless_magi/ft/skeleton/skeleton_sleepless_magi_2_halfhealth_ce22f0af.mp3", "I am weakening!", "", 3616537019, 3052298435)
  79. elseif choice == 4 then
  80. PlayFlavor(NPC, "", "Eh, just a temporary setback.", "", 0, 0)
  81. elseif choice == 5 then
  82. PlayFlavor(NPC, "", "Curious. I don't even feel that.", "", 0, 0)
  83. elseif choice == 6 then
  84. PlayFlavor(NPC, "", "Much to remember!", "", 0, 0)
  85. end
  86. end
  87. end
  88. end
  89. end
  90. end
  91. function victory(NPC,Spawn)
  92. local choice = MakeRandomInt(1,3)
  93. if choice == 1 then
  94. PlayFlavor(NPC, "voiceover/english/skeleton_base_1/ft/skeleton/skeleton_base_1_1_victory_d2a649e7.mp3", "The life ebbs from them so quickly.", "", 2674394976, 3151731037)
  95. elseif choice == 2 then
  96. PlayFlavor(NPC, "", "A pity.", "", 0, 0)
  97. elseif choice == 3 then
  98. PlayFlavor(NPC, "voiceover/english/skeleton_base_1/ft/skeleton/skeleton_base_1_1_victory_ccde17c2.mp3", "Another falls to join our ranks.", "", 3285235030, 4198320186)
  99. end
  100. end
  101. function ResetTimer(NPC) -- 7 SECOND PAUSE BETWEEN VOs
  102. SetTempVariable(NPC, "CalloutTimer", "false")
  103. end
  104. function HealthReset (NPC) --SO HALF HEALTH DOESN'T SPAM
  105. SetTempVariable(NPC, "HealthCallout", "false")
  106. end