9
3

TavithiNsari.lua 6.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199
  1. --[[
  2. Script Name : SpawnScripts/QeynosCitizenshipTrialChamber/TavithiNsari.lua
  3. Script Author : Dorbin
  4. Script Date : 2022.08.31 06:08:32
  5. Script Purpose :
  6. :
  7. --]]
  8. require "SpawnScripts/Generic/DialogModule"
  9. require "SpawnScripts/Generic/CombatModule"
  10. local BQCitizen = 5718
  11. local CVQCitizen = 5719
  12. local GQCitizen = 5720
  13. local NQCitizen = 5721
  14. local SCQCitizen = 5722
  15. local WWQCitizen = 5723
  16. function spawn(NPC, Spawn)
  17. combatModule(NPC, Spawn)
  18. SetPlayerProximityFunction(NPC, 7, "InRange", "LeaveRange")
  19. SpawnSet(NPC,"model_type",79)
  20. SpawnSet(NPC,"soga_model_type",4973)
  21. SetTempVariable(NPC,"HailTimer",nil)
  22. end
  23. function InRange(NPC, Spawn)
  24. if not IsInCombat(NPC) and GetTempVariable(NPC,"HailTimer")~="1" then
  25. PlayFlavor(NPC, "","No! Please don't hurt me!", "cringe", 0,0, Spawn)
  26. end
  27. end
  28. function hailed(NPC, Spawn)
  29. if GetTempVariable(NPC,"HailTimer")~="1" then
  30. Dialog1(NPC, Spawn)
  31. end
  32. end
  33. function respawn(NPC)
  34. spawn(NPC)
  35. end
  36. function Dialog1(NPC, Spawn)
  37. FaceTarget(NPC, Spawn)
  38. Dialog.New(NPC, Spawn)
  39. Dialog.AddDialog("I swear, I didn't do anything! The guards pulled me from my home and beat me! I just want to go home!")
  40. Dialog.AddVoiceover("voiceover/english/tavithi_n_sari/qey_catacomb_epic01/tavithinsari000.mp3", 4098142648, 4182661778)
  41. PlayFlavor(NPC,"","","no",0,0,Spawn)
  42. Dialog.AddOption("Wait a minute... they beat you?", "Dialog2")
  43. Dialog.AddOption("You're saying you don't belong down here?", "Dialog2")
  44. Dialog.Start()
  45. end
  46. function Dialog2(NPC, Spawn)
  47. FaceTarget(NPC, Spawn)
  48. Dialog.New(NPC, Spawn)
  49. Dialog.AddDialog("Yes! You must believe me! I was minding my own business, when they came for me! I wasn't even near the Ironforge Estate!")
  50. Dialog.AddVoiceover("voiceover/english/tavithi_n_sari/qey_catacomb_epic01/tavithinsari001.mp3", 3040294218, 711712198)
  51. PlayFlavor(NPC,"","","agree",0,0,Spawn)
  52. Dialog.AddOption("Well for that, I'm sorry you had to endure it. Wait here until I've made my decision.")
  53. Dialog.AddOption("Err, who said anything about the Ironforges?", "Dialog3")
  54. Dialog.Start()
  55. end
  56. function Dialog3(NPC, Spawn)
  57. FaceTarget(NPC, Spawn)
  58. Dialog.New(NPC, Spawn)
  59. Dialog.AddDialog("You did! Just a second ago, don't you remember?")
  60. Dialog.AddVoiceover("voiceover/english/tavithi_n_sari/qey_catacomb_epic01/tavithinsari002.mp3", 2424577779, 2139550412)
  61. PlayFlavor(NPC,"","","stare",0,0,Spawn)
  62. Dialog.AddOption("Did I? It must have slipped my mind.")
  63. Dialog.AddOption("I never said anything of the sort.", "Dialog4")
  64. Dialog.Start()
  65. end
  66. function Dialog4(NPC, Spawn)
  67. SetTempVariable(NPC,"HailTimer",1)
  68. FaceTarget(NPC, Spawn)
  69. Dialog.New(NPC, Spawn)
  70. Dialog.AddDialog("You fool! You should've let me go when you had the chance! Prepare to be a stain on the floor of Innoruuk's realm!")
  71. Dialog.AddVoiceover("voiceover/english/tavithi_n_sari/qey_catacomb_epic01/tavithinsari003.mp3", 3211336740, 2450849190)
  72. PlayFlavor(NPC,"","","cackle",0,0,Spawn)
  73. SpawnSet(NPC,"mood_state",11852)
  74. AddTimer(NPC,4000,"Shimmer",1,Spawn)
  75. AddTimer(NPC,6000,"Poof",1,Spawn)
  76. AddTimer(NPC,8700,"AttackTimer",1,Spawn)
  77. AddTimer(NPC,9100,"Poof2",1,Spawn)
  78. Dialog.AddOption("...","Continue")
  79. Dialog.Start()
  80. end
  81. function Continue(NPC,Spawn)
  82. end
  83. function Shimmer(NPC,Spawn)
  84. PlayFlavor(NPC,"","","result_teleport_sparkle",0,0)
  85. end
  86. function Poof(NPC,Spawn)
  87. PlayFlavor(NPC,"","","result_teleport_appear",0,0)
  88. end
  89. function Poof2(NPC,Spawn)
  90. PlayFlavor(NPC,"","","result_dispell1_out",0,0)
  91. end
  92. function AttackTimer(NPC,Spawn)
  93. CloseConversation(NPC,Spawn)
  94. SpawnSet(NPC,"model_type",116)
  95. SpawnSet(NPC,"soga_model_type",4965)
  96. SpawnSet(NPC,"attackable",1)
  97. SpawnSet(NPC,"show_level",1)
  98. AddPrimaryEntityCommand(Spawn,NPC,"",0,"")
  99. AddPrimaryEntityCommand(Spawn,NPC,"attack",10000,"attack")
  100. SendUpdateDefaultCommand(NPC,10000,"attack")
  101. AddTimer(NPC,1200,"Attacking",1,Spawn)
  102. end
  103. function Attacking(NPC,Spawn)
  104. Attack(NPC,Spawn)
  105. end
  106. function aggro(NPC,Spawn)
  107. SpawnSet(NPC,"attackable",1)
  108. SpawnSet(NPC,"show_level",1)
  109. SpawnSet(NPC,"command_primary","11")
  110. end
  111. function death(NPC,Spawn)
  112. local Mole = GetSpawn(NPC,8250011)
  113. local Refu = GetSpawn(NPC,8250012)
  114. local Part = GetSpawn(NPC,8250013)
  115. local Tavi = GetSpawn(NPC,8250014)
  116. if not HasLanguage(Spawn,2) then
  117. PlayFlavor(NPC, "voiceover/english/optional3/darkelf_base_2/ft/darkelf/darkelf_base_2_1_garbled_gf_810a3ce3.mp3", "Dark in body and soul! Hah!", "", 1604363761, 647045676, Spawn, 2)
  118. end
  119. if Mole == nil or not IsAlive(Mole) then
  120. if Refu == nil or not IsAlive(Refu) then
  121. if Part == nil or not IsAlive(Part) then
  122. if Tavi == nil or not IsAlive(Tavi) then
  123. if HasQuest(Spawn,BQCitizen) then
  124. SetStepComplete(Spawn,BQCitizen,4)
  125. elseif HasQuest(Spawn,CVQCitizen) then
  126. SetStepComplete(Spawn,CVQCitizen,4)
  127. elseif HasQuest(Spawn,GQCitizen) then
  128. SetStepComplete(Spawn,GQCitizen,4)
  129. elseif HasQuest(Spawn,NQCitizen) then
  130. SetStepComplete(Spawn,NQCitizen,4)
  131. elseif HasQuest(Spawn,SCQCitizen) then
  132. SetStepComplete(Spawn,SCQCitizen,4)
  133. elseif HasQuest(Spawn,WWQCitizen) then
  134. SetStepComplete(Spawn,WWQCitizen,4)
  135. end
  136. end
  137. end
  138. end
  139. end
  140. end
  141. function FailureExit(NPC,Spawn)
  142. if GetRace(Spawn)== 7 or GetRace(Spawn)== 5 then
  143. BBShire = GetZone("Baubbleshire")
  144. Zone(BBShire,Spawn,819.46, -20.60, -525.61, 200.47)
  145. elseif GetRace(Spawn)== 0 or GetRace(Spawn)== 2 then
  146. Gray = GetZone("graystone")
  147. Zone(Gray,Spawn,865.03, -25.45, -97.91, 357.68)
  148. elseif GetRace(Spawn)== 4 or GetRace(Spawn)== 8 then
  149. CV = GetZone("castleview")
  150. Zone(CV,Spawn,729.01, -21.10, -124.36, 290.81)
  151. elseif GetRace(Spawn)== 9 or GetRace(Spawn)== 11 then
  152. Net = GetZone("nettleville")
  153. Zone(Net,Spawn,670.07, -20.39, 273.85, 114.78)
  154. elseif GetRace(Spawn)== 3 or GetRace(Spawn)== 8 then
  155. SC = GetZone("starcrest")
  156. Zone(SC,Spawn,704.07, -20.38, 264.40, 269.84)
  157. elseif GetRace(Spawn)== 15 or GetRace(Spawn)== 16 or GetRace(Spawn)== 6 then
  158. WW = GetZone("willowwood")
  159. Zone(WW,Spawn,809.96, -21.30, -566.02, 323.13)
  160. else
  161. Net = GetZone("nettleville")
  162. Zone(Net,Spawn,670.07, -20.39, 273.85, 114.78)
  163. end
  164. end
  165. function victory(NPC,Spawn)
  166. AddTimer(NPC,2500,"FailureExit",1,Spawn)
  167. end