ScholarObidudyn.lua 3.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  1. --[[
  2. Script Name : SpawnScripts/Starcrest/ScholarObidudyn.lua
  3. Script Purpose : Scholar Obidudyn
  4. Script Author : Dorbin
  5. Script Date : 07.01.2022
  6. Script Notes :
  7. --]]
  8. require "SpawnScripts/Generic/DialogModule"
  9. function spawn(NPC)
  10. SetPlayerProximityFunction(NPC, 10, "InRange", "LeaveRange")
  11. ProvidesQuest(NPC,5600)
  12. end
  13. function respawn(NPC)
  14. spawn(NPC)
  15. end
  16. function InRange(NPC, Spawn)
  17. if GetFactionAmount(Spawn,11)<0 then
  18. FaceTarget(NPC, Spawn)
  19. PlayFlavor(NPC, "", "", "glare", 0, 0, Spawn)
  20. else
  21. if HasCompletedQuest(Spawn,5600)then
  22. local chance = math.random(0, 100)
  23. if chance <= 80 then
  24. PlayFlavor(NPC, "", "", "tapfoot", 0, 0, Spawn, 0)
  25. end
  26. elseif not HasQuest(Spawn, 5600) and not HasCompletedQuest(Spawn,5600)then
  27. local chance = math.random(0, 100)
  28. if chance <= 80 then
  29. FaceTarget(NPC, Spawn)
  30. PlayFlavor(NPC, "voiceover/english/scholar_obidudyn/qey_village02/100_erudite_scholar_callout_9435d1c5.mp3", "Oh, a moment of peace. What I'd give for one moment without little human girls, felines ... or inquisitive adventurers... What do you want? Unless you're of any use, get out of my sight.", "", 3858056740, 933386302, Spawn)
  31. end
  32. end
  33. end
  34. end
  35. function hailed(NPC, Spawn)
  36. FaceTarget(NPC, Spawn)
  37. if GetFactionAmount(Spawn,11)<0 then
  38. PlayFlavor(NPC, "", "", "shakefist", 0, 0, Spawn)
  39. else
  40. Dialog1(NPC, Spawn)
  41. end
  42. end
  43. function Dialog1(NPC, Spawn)
  44. FaceTarget(NPC, Spawn)
  45. Dialog.New(NPC, Spawn)
  46. PlayFlavor(NPC, "", "", "sniff", 0, 0, Spawn)
  47. Dialog.AddDialog("Oh to have a moment of peace. A moment without little human girls or felines ... or inquisitive adventurers...")
  48. Dialog.AddVoiceover("voiceover/english/scholar_obidudyn/qey_village02/scholarobidudyn000.mp3", 139374477, 106530516)
  49. if not HasCompletedQuest (Spawn, 5600) and not HasQuest (Spawn, 5600) then
  50. Dialog.AddOption("You must have a reason for stay here then. What are you contemplating?","Dialog2")
  51. end
  52. if GetQuestStep (Spawn, 5600)==2 then
  53. Dialog.AddOption("I've returned with the elemental essences you needed for your research.","Delivered")
  54. end
  55. Dialog.AddOption("Just passing by. Good day.")
  56. Dialog.Start()
  57. end
  58. function Dialog2(NPC, Spawn)
  59. FaceTarget(NPC, Spawn)
  60. Dialog.New(NPC, Spawn)
  61. PlayFlavor(NPC, "", "", "no", 0, 0, Spawn)
  62. Dialog.AddDialog("I don't expect your feeble mind to comprehend my wisdom of elemental summoning. If it weren't for all my disruptions I would be a summoner of great renown! However, you do seem curious. Perhaps you could help me with a simple task.")
  63. Dialog.AddVoiceover("voiceover/english/scholar_obidudyn/qey_village02/scholarobidudyn001.mp3", 2445829460, 388945180)
  64. Dialog.AddOption("I am actually curious. What can I do to help your research?", "QuestBegin")
  65. Dialog.AddOption("You'll have to go finish your simple task with all that wisdom. Goodbye.")
  66. Dialog.Start()
  67. end
  68. function QuestBegin (NPC, Spawn)
  69. FaceTarget(NPC, Spawn)
  70. OfferQuest(NPC, Spawn, 5600)
  71. end
  72. function Delivered(NPC, Spawn)
  73. FaceTarget(NPC, Spawn)
  74. Dialog.New(NPC, Spawn)
  75. SetStepComplete(Spawn, 5600, 2)
  76. PlayFlavor(NPC, "", "", "nod", 0, 0, Spawn)
  77. Dialog.AddDialog("Impressive! You accomplished that task rather quickly. I imagined it would take you much longer. Prehaps you are not as dimwitted as I first precieved. No matter. Here is the coin I promised for the essences. May your thirst for knowledge know no bounderies.")
  78. Dialog.AddVoiceover("voiceover/english/scholar_obidudyn/qey_village02/scholarobidudyn002.mp3", 139374477, 106530516)
  79. Dialog.AddOption("Glad to be of assistance.")
  80. Dialog.AddOption("Thanks... I think?")
  81. Dialog.Start()
  82. end