MerchantQwergoTogglesmeet.lua 6.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173
  1. --[[
  2. Script Name : SpawnScripts/TempleSt/MerchantQwergoTogglesmeet.lua
  3. Script Author : Dorbin
  4. Script Date : 2023.10.30 04:10:40
  5. Script Purpose :
  6. :
  7. --]]
  8. require "SpawnScripts/Generic/DialogModule"
  9. local QwergosPlan = 5916
  10. function spawn(NPC)
  11. ProvidesQuest(NPC, QwergosPlan)
  12. Emotes(NPC)
  13. SetPlayerProximityFunction(NPC, 7, "InRange", "LeaveRange")
  14. SetTempVariable(NPC,"CalloutTimer","false")
  15. AddTimer(NPC,MakeRandomInt(2000,4000),"Vlepo")
  16. end
  17. function LeaveRange(NPC,Spawn)
  18. Vlepo(NPC,Spawn)
  19. if GetTempVariable(NPC,"CalloutTimer")=="true" then
  20. SetTempVariable(NPC,"CalloutTimer","false")
  21. end
  22. end
  23. function InRange(NPC,Spawn)
  24. if CanReceiveQuest(Spawn,QwergosPlan) and GetTempVariable(NPC,"CalloutTimer") ~= "true" then
  25. SetTempVariable(NPC,"CalloutTimer","true")
  26. SetTarget(NPC,Spawn)
  27. FaceTarget(NPC,Spawn)
  28. PlayFlavor(NPC, "voiceover/english/merchant_qwergo_togglesmeet/fprt_hood03/100_merchantqwergobtogglesmeet_callout_3ca72d41.mp3", "I have something so very important to say to you! Will you not hear me out?", "wave", 892700118, 2368875233, Spawn, 0)
  29. AddTimer(NPC,24000,"ResetCallout",1,Spawn)
  30. end
  31. end
  32. function ResetCallout(NPC,Spawn)
  33. SetTempVariable(NPC,"CalloutTimer","false")
  34. end
  35. function Emotes(NPC,Spawn)
  36. local Choice = MakeRandomInt(1,4)
  37. if GetTempVariable(NPC,"CalloutTimer")=="false" then
  38. if Choice == 1 then
  39. if not IsPlayer(GetTarget(NPC)) then
  40. FaceTarget(NPC)
  41. PlayFlavor(NPC, "","","heckno",0,0)
  42. end
  43. AddTimer(NPC,3200,"Emotes")
  44. elseif Choice == 2 then
  45. if not IsPlayer(GetTarget(NPC)) then
  46. PlayFlavor(NPC, "","","shakefist",0,0)
  47. end
  48. AddTimer(NPC,5200,"Emotes")
  49. elseif Choice == 3 then
  50. if not IsPlayer(GetTarget(NPC)) then
  51. PlayFlavor(NPC, "","","grumble",0,0)
  52. end
  53. AddTimer(NPC,5000,"Emotes")
  54. elseif Choice == 4 then
  55. if not IsPlayer(GetTarget(NPC)) then
  56. PlayFlavor(NPC, "","","flex",0,0)
  57. end
  58. AddTimer(NPC,7000,"Emotes")
  59. end
  60. else --If Recently Called Out to Player
  61. AddTimer(NPC,7000,"Emotes")
  62. end
  63. end
  64. function Vlepo(NPC,Spawn)
  65. local zone = GetZone(NPC)
  66. local VlepoRatonga = GetSpawnByLocationID(zone,420536)
  67. SetTarget(NPC,VlepoRatonga)
  68. FaceTarget(NPC, VlepoRatonga)
  69. end
  70. function hailed(NPC, Spawn)
  71. SetTarget(NPC,Spawn)
  72. if GetFactionAmount(Spawn,12) <0 then
  73. FaceTarget(NPC, Spawn)
  74. PlayFlavor(NPC, "","","shakefist",0,0, Spawn)
  75. elseif CanReceiveQuest(Spawn, QwergosPlan) then
  76. Dialog1(NPC,Spawn)
  77. elseif HasQuest(Spawn, QwergosPlan) and GetQuestStep(Spawn,QwergosPlan) <=2 then
  78. Dialog2(NPC,Spawn)
  79. elseif HasQuest(Spawn, QwergosPlan) and GetQuestStep(Spawn,QwergosPlan) ==3 then
  80. Dialog1 (NPC,Spawn)
  81. else
  82. Dialog1(NPC,Spawn)
  83. end
  84. end
  85. function respawn(NPC)
  86. spawn(NPC)
  87. end
  88. function Dialog1(NPC,Spawn)
  89. SetTarget(NPC,Spawn)
  90. FaceTarget(NPC, Spawn)
  91. Dialog.New(NPC, Spawn)
  92. Dialog.AddDialog("Buy from the Togglesmeets! Those rats have inferior goods made from shoddy workmanship. Don't believe their lies, I tell you.")
  93. Dialog.AddVoiceover("voiceover/english/merchant_qwergo_togglesmeet/fprt_hood03/mer_merchantqwergobtogglesmeet.mp3", 2636370755, 418957991)
  94. PlayFlavor(NPC, "", "", "scold", 0, 0, Spawn)
  95. if CanReceiveQuest(Spawn, QwergosPlan) then
  96. Dialog.AddOption("Why don't you move your stall somewhere else?","Dialog1a")
  97. end
  98. if GetQuestStep(Spawn, QwergosPlan)==3 then
  99. Dialog.AddOption("Chrna gave me the Rumblebumbler... I should have asked her why it was ticking.","Dialog3")
  100. end
  101. Dialog.AddOption("Let me see your wares and judge for myself.")
  102. Dialog.Start()
  103. end
  104. function Dialog1a(NPC,Spawn)
  105. SetTarget(NPC,Spawn)
  106. FaceTarget(NPC, Spawn)
  107. Dialog.New(NPC, Spawn)
  108. Dialog.AddDialog("Move my stall? Why should I move it? Especially when this is a prime location, precisely selected by careful analysis of current marketing parameters. The solution to this problem is not for us Togglesmeets to move but for those rats to be dislodged! And I could do it at once, but for lack of an igniter rumblerod, which I have not. Perhaps you would get one for me?")
  109. Dialog.AddVoiceover("voiceover/english/merchant_qwergo_togglesmeet/fprt_hood03/quests/qwergotogglesmeet/qwergo_x1_initial.mp3", 1165405636, 3920431354)
  110. PlayFlavor(NPC, "", "", "whome", 0, 0, Spawn)
  111. Dialog.AddOption("Perhaps I could. What am I looking for again?","Offer1")
  112. Dialog.AddOption("You should just move! No need for crazy gadgets!")
  113. Dialog.Start()
  114. end
  115. function Offer1(NPC,Spawn)
  116. OfferQuest(NPC, Spawn, QwergosPlan)
  117. end
  118. function Dialog2(NPC,Spawn)
  119. SetTarget(NPC,Spawn)
  120. FaceTarget(NPC, Spawn)
  121. Dialog.New(NPC, Spawn)
  122. PlayFlavor(NPC, "", "", "stare", 0, 0, Spawn)
  123. Dialog.AddDialog("I do not see the igniter rumblerod in your possession. Perhaps I must explain to you again its significance to my family's overall business plan. Or ... you could simply go and get it, as I asked.")
  124. Dialog.AddOption("Hold on! I'm still looking!")
  125. Dialog.Start()
  126. end
  127. function Dialog3(NPC,Spawn)
  128. SetTarget(NPC,Spawn)
  129. FaceTarget(NPC, Spawn)
  130. Dialog.New(NPC, Spawn)
  131. Dialog.AddDialog("Oh, good-good-good! Oh dear! You triggered the bi-toggle capacitance diode! I must deactivate it at once, or the entire city will be blown well into the sky ... now let's see ... was it the blue rod or the red ... I think the red, yes ... no! The blue! It's the blue! There ... snap that in place ... and (*whew*) ... I have just averted a disaster of municipal proportions.")
  132. Dialog.AddVoiceover("voiceover/english/merchant_qwergo_togglesmeet/fprt_hood03/quests/qwergotogglesmeet/qwergo_x1_finish.mp3", 79547774, 518183957)
  133. PlayFlavor(NPC, "", "", "ponder", 0, 0, Spawn)
  134. Dialog.AddOption("Well... good! What could have started it? I didn't ask Chrna.","Dialog3a")
  135. Dialog.Start()
  136. end
  137. function Dialog3a(NPC,Spawn)
  138. SetTarget(NPC,Spawn)
  139. SetStepComplete(Spawn, QwergosPlan, 3)
  140. FaceTarget(NPC, Spawn)
  141. Dialog.New(NPC, Spawn)
  142. Dialog.AddDialog("Ah, perhaps it was joggled in transport, then. Delicate little items these are. If it's still operational, I will carry out my original plan. Otherwise, if it's not, I will cleverly offer it to the rats in exchange for their relocation. Yes, yes, ingenious, that is! Think like a rat when dealing with rats. Oh, you're still here. Take your payment.")
  143. Dialog.AddVoiceover("voiceover/english/merchant_qwergo_togglesmeet/fprt_hood03/quests/qwergotogglesmeet/qwergo_x1_finish2.mp3", 1828195215, 1976528953)
  144. PlayFlavor(NPC, "", "", "confused", 0, 0, Spawn)
  145. Dialog.AddOption("How clever of you... I'll take my coin. Thanks.")
  146. Dialog.Start()
  147. end