9
3

MerchantTwergoTogglesmeet.lua 6.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185
  1. --[[
  2. Script Name : SpawnScripts/TempleSt/MerchantTwergoTogglesmeet.lua
  3. Script Author : Dorbin
  4. Script Date : 2023.10.30 03:10:09
  5. Script Purpose :
  6. :
  7. --]]
  8. --
  9. require "SpawnScripts/Generic/DialogModule"
  10. local TwergosPlan = 5915
  11. function spawn(NPC)
  12. ProvidesQuest(NPC, TwergosPlan)
  13. SetPlayerProximityFunction(NPC, 7, "InRange", "LeaveRange")
  14. SetTempVariable(NPC,"CalloutTimer","false")
  15. AddTimer(NPC,2000,"Vleko")
  16. AddTimer(NPC,MakeRandomInt(2000,4000),"Emotes")
  17. end
  18. function LeaveRange(NPC,Spawn)
  19. Vleko(NPC,Spawn)
  20. if GetTempVariable(NPC,"CalloutTimer")=="true" then
  21. SetTempVariable(NPC,"CalloutTimer","false")
  22. end
  23. end
  24. function InRange(NPC,Spawn)
  25. end
  26. function ResetCallout(NPC,Spawn)
  27. SetTempVariable(NPC,"CalloutTimer","false")
  28. end
  29. function Emotes(NPC,Spawn)
  30. local Choice = MakeRandomInt(1,6)
  31. if GetTempVariable(NPC,"CalloutTimer")=="false" then
  32. if Choice == 1 then
  33. if not IsPlayer(GetTarget(NPC)) then
  34. PlayFlavor(NPC, "","","shame",0,0)
  35. end
  36. AddTimer(NPC,5200,"Emotes")
  37. elseif Choice == 2 then
  38. if not IsPlayer(GetTarget(NPC)) then
  39. PlayFlavor(NPC, "","","sulk",0,0)
  40. end
  41. AddTimer(NPC,5200,"Emotes")
  42. elseif Choice == 3 then
  43. if not IsPlayer(GetTarget(NPC)) then
  44. PlayFlavor(NPC, "","","point",0,0)
  45. end
  46. AddTimer(NPC,5000,"Emotes")
  47. elseif Choice == 4 then
  48. if not IsPlayer(GetTarget(NPC)) then
  49. PlayFlavor(NPC, "","","threaten",0,0)
  50. end
  51. AddTimer(NPC,7300,"Emotes")
  52. elseif Choice == 5 then
  53. if not IsPlayer(GetTarget(NPC)) then
  54. PlayFlavor(NPC, "","","swear",0,0)
  55. end
  56. AddTimer(NPC,7300,"Emotes")
  57. elseif Choice == 6 then
  58. if not IsPlayer(GetTarget(NPC)) then
  59. PlayFlavor(NPC, "","","peer",0,0)
  60. end
  61. AddTimer(NPC,7300,"Emotes")
  62. end
  63. else --If Recently Called Out to Player
  64. AddTimer(NPC,7000,"Emotes")
  65. end
  66. end
  67. function Vleko(NPC,Spawn)
  68. local zone = GetZone(NPC)
  69. local VlekoRatonga = GetSpawnByLocationID(zone,420537)
  70. SetTarget(NPC,VlekoRatonga)
  71. FaceTarget(NPC, VlekoRatonga)
  72. end
  73. function hailed(NPC, Spawn)
  74. SetTarget(NPC,Spawn)
  75. if GetFactionAmount(Spawn,12) <0 then
  76. FaceTarget(NPC, Spawn)
  77. PlayFlavor(NPC, "","","shakefist",0,0, Spawn)
  78. elseif CanReceiveQuest(Spawn, TwergosPlan) then
  79. Dialog1(NPC,Spawn)
  80. elseif HasQuest(Spawn, TwergosPlan) and GetQuestStep(Spawn,TwergosPlan) ==1 then
  81. Dialog2(NPC,Spawn)
  82. elseif HasQuest(Spawn, TwergosPlan) and GetQuestStep(Spawn,TwergosPlan) ==2 then
  83. Dialog1 (NPC,Spawn)
  84. else
  85. Dialog1(NPC,Spawn)
  86. end
  87. end
  88. function respawn(NPC)
  89. spawn(NPC)
  90. end
  91. function Dialog1(NPC,Spawn)
  92. SetTarget(NPC,Spawn)
  93. FaceTarget(NPC, Spawn)
  94. Dialog.New(NPC, Spawn)
  95. Dialog.AddDialog("My dad runs the best shop in town! A much better shop, mind you, than those ratmen trying to ruin our business.")
  96. Dialog.AddVoiceover("voiceover/english/merchant_twergo_togglesmeet/fprt_hood03/mer_merchanttwergobtogglesmeet.mp3", 1379589936, 3170428831)
  97. if CanReceiveQuest(Spawn, TwergosPlan) then
  98. Dialog.AddOption("What makes you so sure you're better than them?","Dialog1a")
  99. end
  100. if GetQuestStep(Spawn, TwergosPlan)==2 then
  101. Dialog.AddOption("Here are your ripe zombie brains, just as you ordered.","Dialog3")
  102. end
  103. Dialog.AddOption("Let me see you wares and judge for myself.")
  104. Dialog.Start()
  105. end
  106. function Dialog1a(NPC,Spawn)
  107. SetTarget(NPC,Spawn)
  108. FaceTarget(NPC, Spawn)
  109. Dialog.New(NPC, Spawn)
  110. Dialog.AddDialog("My father always has some plan in the works but never quite gets the bugs out of the details. I, on the other hand, have thought up a flawless scheme. I'm building a device that redirects the neuro-synaptic pathways of anyone who approaches within 10.24 decapaces of our shop, inducing an externally triggered behavioral modification to our benefit.")
  111. Dialog.AddVoiceover("voiceover/english/merchant_twergo_togglesmeet/fprt_hood03/quests/twergotogglesmeet/twergo_x1_initial.mp3", 3607729720, 766730315)
  112. PlayFlavor(NPC, "", "", "agree", 0, 0, Spawn)
  113. Dialog.AddOption("What on Norrath are you going on about?","Dialog1b")
  114. Dialog.AddOption("Tell me more! What does it do?","Dialog1b")
  115. Dialog.AddOption("I've no time for your schemes! I'm busy with my own!")
  116. Dialog.Start()
  117. end
  118. function Dialog1b(NPC,Spawn)
  119. SetTarget(NPC,Spawn)
  120. FaceTarget(NPC, Spawn)
  121. Dialog.New(NPC, Spawn)
  122. Dialog.AddDialog("It's a mind controller! Brilliant, yes? Everyone who comes near will feel an unstoppable urge to buy from us! And it's almost completed, but I still need a bioadaptive energy source. Perhaps you'll help me?")
  123. Dialog.AddVoiceover("voiceover/english/merchant_twergo_togglesmeet/fprt_hood03/quests/twergotogglesmeet/twergo_x1_initial2.mp3", 3740705944, 3329604525)
  124. PlayFlavor(NPC, "", "", "happy", 0, 0, Spawn)
  125. if CanReceiveQuest(Spawn, TwergosPlan) then
  126. Dialog.AddOption("That DOES sound interesting. What do you need?","Offer1")
  127. end
  128. Dialog.AddOption("I'd rather not improve YOUR ability to control my mind!")
  129. Dialog.Start()
  130. end
  131. function Offer1(NPC,Spawn)
  132. OfferQuest(NPC, Spawn, TwergosPlan)
  133. end
  134. function Dialog2(NPC,Spawn)
  135. SetTarget(NPC,Spawn)
  136. FaceTarget(NPC, Spawn)
  137. Dialog.New(NPC, Spawn)
  138. PlayFlavor(NPC, "", "", "glare", 0, 0, Spawn)
  139. Dialog.AddDialog("Good friend, those zombie brains are not going to gallump over here by themselves! You must fetch them for me!")
  140. Dialog.AddOption("I'll be back with some fresh juicy ones soon.")
  141. Dialog.Start()
  142. end
  143. function Dialog3(NPC,Spawn)
  144. SetTarget(NPC,Spawn)
  145. FaceTarget(NPC, Spawn)
  146. Dialog.New(NPC, Spawn)
  147. Dialog.AddDialog("Delightful! They're nice and smelly too ... exactly what I need. If they meet my specifications as a bioadaptive energy source, my device will control the minds of people everywhere ... within this trading plaza, that is. I shall call it my \"Anti-Ratonga Transaction Detractor!\"")
  148. Dialog.AddVoiceover("voiceover/english/merchant_twergo_togglesmeet/fprt_hood03/quests/twergotogglesmeet/twergo_x1_finish.mp3", 657641506, 1581390099)
  149. PlayFlavor(NPC, "", "", "smile", 0, 0, Spawn)
  150. Dialog.AddOption("Why don't you make it so that it would work everywhere? You could rule the world!","Dialog3a")
  151. Dialog.Start()
  152. end
  153. function Dialog3a(NPC,Spawn)
  154. SetTarget(NPC,Spawn)
  155. SetStepComplete(Spawn, TwergosPlan, 2)
  156. FaceTarget(NPC, Spawn)
  157. Dialog.New(NPC, Spawn)
  158. Dialog.AddDialog("What's that? Rule the world? Now, that would be silly. If we had that many customers our little shop could never keep up with the demand!")
  159. Dialog.AddVoiceover("voiceover/english/merchant_twergo_togglesmeet/fprt_hood03/quests/twergotogglesmeet/twergo_x1_finish2.mp3", 1105993552, 3488280823)
  160. PlayFlavor(NPC, "", "", "confused", 0, 0, Spawn)
  161. Dialog.AddOption("Good point... and good luck.")
  162. Dialog.Start()
  163. end