9
3

awanderingminstrel.lua 7.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177
  1. --[[
  2. Script Name : SpawnScripts/Antonica/awanderingminstrel.lua
  3. Script Author : Premierio015
  4. Script Date : 2021.08.27 07:08:08
  5. Script Purpose :
  6. :
  7. --]]
  8. dofile("SpawnScripts/Generic/MonsterCallouts/Windstalkers.lua")
  9. require "SpawnScripts/Generic/NPCModule"
  10. function spawn(NPC, Spawn)
  11. --State(NPC)
  12. --SetInfoStructString(NPC, "action_state", "cast_bard_stringed_persist")
  13. SpawnSet(NPC,"visual_state,","cast_bard_stringed_persist")
  14. end
  15. function hailed(NPC, Spawn)
  16. FaceTarget(NPC, Spawn)
  17. local choice = MakeRandomInt(1, 4)
  18. if choice == 1 then
  19. PlayFlavor(NPC, "", "Have you heard the Bonny Lass?", "", 0, 0, Spawn)
  20. elseif choice == 2 then
  21. PlayFlavor(NPC, "", "The townsfolk aren't as pleasant as they were during my last visit.", "", 0, 0, Spawn)
  22. elseif choice == 3 then
  23. PlayFlavor(NPC, "", "Buy me a drink, and I'll sing you a song.", 0, 0, Spawn)
  24. elseif choice == 4 then
  25. PlayFlavor(NPC, "", "I always stop in to have some of Lanice's delightful ale.", 0, 0, Spawn)
  26. end
  27. end
  28. function State(NPC)
  29. SpawnSet(NPC,"visual_state,","cast_bard_stringed_persist")
  30. end
  31. function respawn(NPC)
  32. spawn(NPC)
  33. end
  34. --AGGRO CHECK --
  35. function aggro(NPC,Spawn) --RACE CHECK
  36. SpawnSet(NPC,"visual_state,",0)
  37. SetTempVariable(NPC, "CalloutTimer", "false")
  38. SetTempVariable(NPC, "HealthCallout", "false")
  39. if GetTempVariable(NPC, "CalloutTimer")== "false"then
  40. SetTempVariable(NPC, "CalloutTimer", "true")
  41. AddTimer(NPC,7000,"ResetTimer")
  42. if GetGender(NPC)==1 then --GENDER CHECK. 1==Male
  43. if GetClass(Spawn)>=21 and GetClass(Spawn)<=30 then
  44. Pick = MakeRandomInt(1,3) --MAGE CHECK
  45. else
  46. Pick = MakeRandomInt(1,2)
  47. end
  48. if Pick == 1 then
  49. PlayFlavor(NPC, "voiceover/english/halfelf_base_1/ft/halfelf/halfelf_base_1_1_aggro_gm_13a3055.mp3", "Summon help, intruders have arrived!", "", 262436067, 4127133618)
  50. elseif Pick == 2 then
  51. PlayFlavor(NPC, "voiceover/english/halfelf_base_1/ft/halfelf/halfelf_base_1_1_aggro_gm_12fbaefb.mp3", "Destroy the invader!", "", 489857902, 941763715)
  52. elseif Pick == 3 then
  53. PlayFlavor(NPC, "voiceover/english/halfelf_base_1/ft/halfelf/halfelf_base_1_1_maomage_gm_96692f88.mp3", "Distract the magician or we'll all die!", "", 3332270247, 2351356263)
  54. end
  55. else
  56. local choice = MakeRandomInt(1,3)
  57. if choice == 1 then
  58. PlayFlavor(NPC, "voiceover/english/optional3/halfelf_base_1/ft/halfelf/halfelf_base_1_1_aggro_gf_12fbaefb.mp3", "Destroy the invader!", "", 1313233821, 723410897)
  59. elseif choice == 2 then
  60. PlayFlavor(NPC, "voiceover/english/optional3/halfelf_base_1/ft/halfelf/halfelf_base_1_1_aggro_gf_a68f64b6.mp3", "Alarm! Alarm!", "", 1220383018, 2962002142)
  61. elseif choice == 3 then
  62. PlayFlavor(NPC, "voiceover/english/optional3/halfelf_base_1/ft/halfelf/halfelf_base_1_1_aggro_gf_13a3055.mp3", "Summon help, intruders have arrived!", "", 3324527452, 2122161878)
  63. end
  64. end
  65. end
  66. end
  67. -- DEATH CHECK --
  68. function death(NPC,Spawn) --RACE CHECK
  69. if GetTempVariable(NPC, "CalloutTimer")== "false"then
  70. local choice = MakeRandomInt(1,2)
  71. if GetGender(NPC)==1 then
  72. if choice == 1 then
  73. PlayFlavor(NPC, "voiceover/english/halfelf_base_1/ft/halfelf/halfelf_base_1_1_death_gm_1a659852.mp3", "We must withdraw before we all die!", "", 3147364973, 1341536758)
  74. elseif choice == 2 then
  75. PlayFlavor(NPC, "voiceover/english/halfelf_base_1/ft/halfelf/halfelf_base_1_1_death_gm_610c650e.mp3", "You must flee! I'll try to hold them.", "", 3580386891, 3023137994)
  76. end
  77. else
  78. if choice == 1 then
  79. PlayFlavor(NPC, "voiceover/english/optional3/halfelf_base_1/ft/halfelf/halfelf_base_1_1_death_gf_610c650e.mp3", "You must flee! I'll try to hold them.", "", 1612338229, 10301262)
  80. else
  81. PlayFlavor(NPC, "voiceover/english/optional3/halfelf_base_1/ft/halfelf/halfelf_base_1_1_death_gf_1a659852.mp3", "We must withdraw before we all die!", "", 2249500792, 2154633904)
  82. end
  83. end
  84. end
  85. end
  86. -- Battle Cry Call (Female Human Only)
  87. function FifteenCall(NPC,Spawn)
  88. if IsAlive(NPC) and IsInCombat(NPC)==true and IsPlayer(Spawn)and GetTempVariable(NPC, "CalloutTimer")== "false" then
  89. if math.random(0,100)<=33 then
  90. SetTempVariable(NPC, "CalloutTimer", "true")
  91. AddTimer(NPC,10000,"ResetTimer")
  92. local choice = MakeRandomInt(1,2)
  93. if choice == 1 then
  94. PlayFlavor(NPC, "voiceover/english/optional3/human_windstalkers/ft/human/human_windstalkers_1_battle_gf_7ad3a09.mp3", "Can't you hear the animals screaming?", "", 959773922, 3663023157)
  95. elseif choice == 2 then
  96. PlayFlavor(NPC, "voiceover/english/optional3/human_windstalkers/ft/human/human_windstalkers_1_battle_gf_d1f33b41.mp3", "Pay for your crimes against nature's creatures.", "", 3824659479, 1994519243)
  97. end
  98. end
  99. end
  100. if IsAlive(NPC)then
  101. AddTimer(NPC,math.random(15000,30000),"FifteenCall",1,Spawn)
  102. end
  103. end
  104. -- HealthChange CHECK --
  105. function healthchanged(NPC,Spawn) --RACE CHECK
  106. if GetHP(NPC) <= GetMaxHP(NPC) * 0.55 and GetHP(NPC) >= GetMaxHP(NPC) * 0.45 then
  107. if IsAlive(NPC) and IsInCombat(NPC)==true and IsPlayer(Spawn)and GetTempVariable(NPC, "CalloutTimer")== "false" and GetTempVariable(NPC, "HealthCallout")== "false" then
  108. SetTempVariable(NPC, "HealthCallout", "true")
  109. AddTimer(NPC,9000,"HealthReset")
  110. local choice = MakeRandomInt(1,2)
  111. if GetGender(NPC)==1 then
  112. if choice == 1 then
  113. PlayFlavor(NPC, "voiceover/english/halfelf_base_1/ft/halfelf/halfelf_base_1_1_halfhealth_gm_e0686420.mp3", "Well, it seems you have some martial arts skills.", "", 1009191098, 3016339818, Spawn)
  114. elseif choice == 2 then
  115. PlayFlavor(NPC, "voiceover/english/halfelf_base_1/ft/halfelf/halfelf_base_1_1_halfhealth_gm_e48659f9.mp3", "Now, that really hurt!", "", 241651222, 476491397, Spawn)
  116. end
  117. else
  118. if choice == 1 then
  119. PlayFlavor(NPC, "voiceover/english/optional3/halfelf_base_1/ft/halfelf/halfelf_base_1_1_halfhealth_gf_e0686420.mp3", "Well, it seems you have some martial arts skills.", "", 743699854, 1906875496, Spawn)
  120. elseif choice == 2 then
  121. PlayFlavor(NPC, "voiceover/english/optional3/halfelf_base_1/ft/halfelf/halfelf_base_1_1_halfhealth_gf_e48659f9.mp3", "Now, that really hurt!", "", 413378164, 719939114, Spawn)
  122. end
  123. end
  124. end
  125. end
  126. end
  127. -- Victory CHECK --
  128. function victory(NPC,Spawn) --RACE CHECK
  129. if GetGender(NPC)==1 then
  130. local choice = MakeRandomInt(1,2)
  131. if choice == 1 then
  132. PlayFlavor(NPC, "voiceover/english/darkelf_base_1/ft/darkelf/darkelf_base_1_1_victory_gm_f5088778.mp3", "Get up! Death isn't good enough for you!", "", 3381713633, 2145918189)
  133. elseif choice == 2 then
  134. PlayFlavor(NPC, "voiceover/english/darkelf_base_1/ft/darkelf/darkelf_base_1_1_victory_gm_f4fc7cf8.mp3", "Did you really think you had a chance?", "", 607143583, 3133144305)
  135. end
  136. else
  137. local choice = MakeRandomInt(1,2)
  138. if choice == 1 then
  139. PlayFlavor(NPC, "voiceover/english/optional3/human_base_1/ft/human/human_base_1_1_victory_gf_6f459088.mp3", "Flee now or meet this one's fate.", "", 290765367, 473549337)
  140. elseif choice == 2 then
  141. PlayFlavor(NPC, "voiceover/english/optional3/human_base_1/ft/human/human_base_1_1_victory_gf_ec0cd85a.mp3", "I hope they're all this easy.", "", 1073758360, 3342649012)
  142. end
  143. end
  144. end
  145. function ResetTimer(NPC) -- 7 SECOND PAUSE BETWEEN VOs
  146. SetTempVariable(NPC, "CalloutTimer", "false")
  147. end
  148. function HealthReset (NPC) --SO HALF HEALTH DOESN'T SPAM
  149. SetTempVariable(NPC, "HealthCallout", "false")
  150. SetTempVariable(NPC, "CalloutTimer", "false")
  151. end