Tanaira.lua 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135
  1. --[[
  2. Script Name : SpawnScripts/Starcrest/Tanaira.lua
  3. Script Purpose : Tanaira <Provisioner>
  4. Script Author : Dorbin
  5. Script Date : 06.282022
  6. Script Notes : Auto-Generated Conversation from PacketParser Data
  7. --]]
  8. require "SpawnScripts/Generic/DialogModule"
  9. local FAR_SEAS_DR_PBG0162_QUEST_ID = 515
  10. local FAR_SEAS_DR_PBG0295_QUEST_ID = 516
  11. local HailCheck = false
  12. function spawn(NPC)
  13. ProvidesQuest(NPC,5605)
  14. AddTimer(NPC, 5000, "EmoteLoop")
  15. end
  16. function hailed(NPC, Spawn)
  17. if GetFactionAmount(Spawn,11)<0 then
  18. PlayFlavor(NPC,"","","noway",0,0,Spawn)
  19. else
  20. HailCheck = true
  21. AddTimer(NPC,32000,"HailReset")
  22. SetTarget(NPC,Spawn)
  23. Dialog1(NPC, Spawn)
  24. end
  25. end
  26. function HailReset(NPC)
  27. HailCheck = false
  28. end
  29. function Dialog1(NPC, Spawn)
  30. FaceTarget(NPC, Spawn)
  31. Dialog.New(NPC, Spawn)
  32. Dialog.AddDialog("Oh, hello! Sorry, I didn't see you. My eyes tend to wander towards Grekin over there.")
  33. PlayFlavor(NPC,"","","hello",0,0,Spawn)
  34. Dialog.AddVoiceover("voiceover/english/merchant_tanaira/qey_village02/merchanttanaira.mp3", 2005566825, 1356521608)
  35. if HasQuest(Spawn, FAR_SEAS_DR_PBG0162_QUEST_ID) and GetQuestStep(Spawn, FAR_SEAS_DR_PBG0162_QUEST_ID) == 2 or HasQuest(Spawn, FAR_SEAS_DR_PBG0295_QUEST_ID) and GetQuestStep(Spawn, FAR_SEAS_DR_PBG0295_QUEST_ID) == 3 then
  36. Dialog.AddOption("I have Far Seas Trading Requisition order PBG0162. ", "Dialog2")
  37. end
  38. if not HasQuest(Spawn, 5605)and not HasCompletedQuest(Spawn,5605) then
  39. Dialog.AddOption("He does seem fairly preoccupied. Have you gone to talk to him?","Dialog3")
  40. end
  41. if GetQuestStep(Spawn, 5605) == 2 then
  42. Dialog.AddOption("I've completed the map to the picnic spot. Just past the Clearwater Pond you follow the stream. You'll find the waterfall near the cliff surrounded by frogs.","Delivered")
  43. end
  44. Dialog.AddOption("I am just browsing. I'll let you get back to daydreaming. ")
  45. Dialog.Start()
  46. end
  47. function Dialog2(NPC, Spawn)
  48. FaceTarget(NPC, Spawn)
  49. Dialog.New(NPC, Spawn)
  50. if HasQuest(Spawn, FAR_SEAS_DR_PBG0162_QUEST_ID) and GetQuestStep(Spawn, FAR_SEAS_DR_PBG0162_QUEST_ID) == 2 then
  51. SetStepComplete(Spawn, FAR_SEAS_DR_PBG0162_QUEST_ID, 2)
  52. end
  53. if HasQuest(Spawn, FAR_SEAS_DR_PBG0295_QUEST_ID) and GetQuestStep(Spawn, FAR_SEAS_DR_PBG0295_QUEST_ID) == 3 then
  54. SetStepComplete(Spawn, FAR_SEAS_DR_PBG0295_QUEST_ID, 3)
  55. end
  56. PlayFlavor(NPC,"","","boggle",0,0,Spawn)
  57. Dialog.AddDialog("Oh! Grekin has occupied so much of my thoughts that I forgot about this requisition I placed weeks ago. I may have forgotten but I am glad you did not.")
  58. Dialog.AddVoiceover("voiceover/english/merchant_tanaira/qey_village02/merchanttanaira003.mp3", 1432585003, 855405461)
  59. Dialog.AddOption("Just doing my job. ")
  60. Dialog.Start()
  61. end
  62. function Dialog3(NPC, Spawn)
  63. FaceTarget(NPC, Spawn)
  64. Dialog.New(NPC, Spawn)
  65. PlayFlavor(NPC, "", "", "sigh", 0, 0, Spawn)
  66. Dialog.AddDialog("I know. He's always so busy selling he doesn't get any time to relax. I would like to take him on a picnic but I don't know of any good spots. I heard Oakmyst Forest has a very good spot but I haven't been able to see the area for myself. Would you do me a favor and find this spot for me?")
  67. Dialog.AddVoiceover("voiceover/english/merchant_tanaira/qey_village02/merchanttanaira000.mp3", 3232265570, 2678677300)
  68. Dialog.AddOption("I could head that way and check out scenic spots for a picnic.", "QuestBegin")
  69. Dialog.AddOption("Trapsing through the forest doesn't sound ideal to me. I'd rather not.")
  70. Dialog.Start()
  71. end
  72. function QuestBegin (NPC, Spawn)
  73. FaceTarget(NPC, Spawn)
  74. OfferQuest(NPC, Spawn, 5605)
  75. end
  76. function Delivered(NPC, Spawn)
  77. FaceTarget(NPC, Spawn)
  78. Dialog.New(NPC, Spawn)
  79. SetStepComplete(Spawn, 5605, 2)
  80. PlayFlavor(NPC, "", "", "thanks", 0, 0, Spawn)
  81. Dialog.AddDialog("Thank you so much! This map looks great. Now, I just need to ask Grekin about that picnic.")
  82. Dialog.AddVoiceover("voiceover/english/merchant_tanaira/qey_village02/merchanttanaira002.mp3", 702642153, 3039622281)
  83. Dialog.AddOption("Best of luck to you both.")
  84. Dialog.Start()
  85. end
  86. function EmoteLoop(NPC)
  87. if HailCheck == true then
  88. local Grekin = GetSpawn(NPC, 2340037) -- Get Grekin
  89. if Grekin ~= nil then
  90. SetTarget(NPC,Grekin)
  91. end
  92. AddTimer(NPC,26100,"EmoteLoop")
  93. else
  94. local emoteChoice = MakeRandomInt(1,6)
  95. if emoteChoice == 1 then
  96. -- doubletake
  97. PlayAnimation(NPC, 11415)
  98. AddTimer(NPC, MakeRandomInt(11000,12000), "EmoteLoop")
  99. elseif emoteChoice == 2 then
  100. -- smirk
  101. PlayAnimation(NPC, 12286)
  102. AddTimer(NPC, MakeRandomInt(6000,8000), "EmoteLoop")
  103. elseif emoteChoice == 3 then
  104. -- peer
  105. PlayAnimation(NPC, 11976)
  106. AddTimer(NPC, MakeRandomInt(12000,14000), "EmoteLoop")
  107. elseif emoteChoice == 4 then
  108. -- sigh
  109. PlayAnimation(NPC, 12246)
  110. AddTimer(NPC, MakeRandomInt(8000,9000), "EmoteLoop")
  111. elseif emoteChoice == 5 then
  112. -- ponder
  113. PlayAnimation(NPC, 12030)
  114. AddTimer(NPC, MakeRandomInt(12000,13500), "EmoteLoop")
  115. elseif emoteChoice == 6 then
  116. -- peer x2
  117. PlayAnimation(NPC, 11976)
  118. AddTimer(NPC, MakeRandomInt(12000,14000), "EmoteLoop")
  119. end
  120. end
  121. end