9
3

SageXoort.lua 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112
  1. --[[
  2. Script Name : SpawnScripts/Baubbleshire/SageXoort.lua
  3. Script Purpose : Sage Xoort
  4. Script Author : John Adams
  5. Script Date : 2008.09.23
  6. Updated: Dorbin 2021.01.08
  7. Script Notes : Updated using Dialog Module 2022.08.20 Dorbin
  8. --]]
  9. require "SpawnScripts/Generic/DialogModule"
  10. local EMBERS_FOR_XOOT = 333 -- was 57
  11. function spawn(NPC)
  12. ProvidesQuest(NPC, EMBERS_FOR_XOOT)
  13. SetPlayerProximityFunction(NPC, 10, "InRange", "LeaveRange")
  14. end
  15. function respawn(NPC)
  16. spawn(NPC)
  17. end
  18. function InRange(NPC, Spawn)
  19. if GetFactionAmount(Spawn,11) <0 then
  20. PlayFlavor(NPC, "", "", "shakefist", 0, 0, Spawn)
  21. FaceTarget(NPC, Spawn)
  22. else
  23. if math.random(1, 100) <= 80 then
  24. if not HasCompletedQuest(Spawn, EMBERS_FOR_XOOT) then
  25. PlayFlavor(NPC, "voiceover/english/sage_xoort/qey_village06/100_sage_xoort_xoort_first_4b109355.mp3", "Oh to Drunder with this! How will I ever be able to get this thing working?", "frustrated", 3733527937, 3267359953, Spawn)
  26. else
  27. PlayFlavor(NPC, "", "", "ponder", 0, 0, Spawn)
  28. end
  29. end
  30. end
  31. end
  32. function LeaveRange(NPC, Spawn)
  33. end
  34. function hailed(NPC, Spawn)
  35. if GetFactionAmount(Spawn,11) <0 then
  36. PlayFlavor(NPC, "", "", "shakefist", 0, 0, Spawn)
  37. FaceTarget(NPC, Spawn)
  38. else
  39. FaceTarget(NPC, Spawn)
  40. Dialog.New(NPC, Spawn)
  41. Dialog.AddDialog("Hello there! How can I be of service?")
  42. Dialog.AddVoiceover("voiceover/english/sage_xoort/qey_village06/sagexoort000.mp3", 202647880, 3563931951)
  43. PlayFlavor(NPC, "", "", "hello", 0, 0, Spawn)
  44. if not HasQuest(Spawn, EMBERS_FOR_XOOT) and not HasCompletedQuest(Spawn, EMBERS_FOR_XOOT) and GetLevel(Spawn) >= 6 then
  45. Dialog.AddOption("I was just looking at what you were writing there.", "LookingAtWriting")
  46. elseif HasQuest(Spawn, EMBERS_FOR_XOOT) and GetQuestStep(Spawn, EMBERS_FOR_XOOT) == 2 then
  47. Dialog.AddOption("I'm actually the one that's of service here!", "ImOfService")
  48. end
  49. Dialog.AddOption("I'm just looking around, thanks.")
  50. Dialog.Start()
  51. end
  52. end
  53. function LookingAtWriting(NPC, Spawn)
  54. FaceTarget(NPC, Spawn)
  55. Dialog.New(NPC, Spawn)
  56. Dialog.AddDialog("Nothing much, just a schematic I'm working on. I can't find a power source for it ... Oh, Solusek's flame! How in the name of Brell can I make this thing work?")
  57. Dialog.AddVoiceover("voiceover/english/sage_xoort/qey_village06/sagexoort001.mp3", 2659791211, 4166741888)
  58. PlayFlavor(NPC, "", "", "ponder", 0, 0, Spawn)
  59. Dialog.AddOption("What's wrong with fire as a power source?", "WhatsWrongWithFire")
  60. Dialog.AddOption("I don't know. Good luck with that. ")
  61. Dialog.Start()
  62. end
  63. function WhatsWrongWithFire(NPC, Spawn) --missing Voiceover key 002
  64. FaceTarget(NPC, Spawn)
  65. Dialog.New(NPC, Spawn)
  66. Dialog.AddDialog("Fire's no good. It doesn't get hot enough or burn long enough. WAIT! HAH! Oh, you're right! I need a special type of coal. You thought of it, so you can fetch it. I need still-burning embers from the forgotten guardians in the Forest Ruins.")
  67. Dialog.AddVoiceover("voiceover/english/sage_xoort/qey_village06/sagexoort002.mp3", 0, 0)
  68. PlayFlavor(NPC, "", "", "no", 0, 0, Spawn)
  69. Dialog.AddOption("I'll get some.", "OfferQuest1")
  70. Dialog.AddOption("Afraid this is too much excitement for me! Goodbye!")
  71. Dialog.Start()
  72. end
  73. function OfferQuest1(NPC, Spawn)
  74. FaceTarget(NPC, Spawn)
  75. OfferQuest(NPC, Spawn, EMBERS_FOR_XOOT)
  76. end
  77. function ImOfService(NPC, Spawn)
  78. FaceTarget(NPC, Spawn)
  79. Dialog.New(NPC, Spawn)
  80. Dialog.AddDialog("So, you return with the coals ... I hope you didn't get burned! Let me take a look...")
  81. Dialog.AddVoiceover("voiceover/english/sage_xoort/qey_village06/sagexoort003.mp3", 3017924926, 3471986747)
  82. PlayFlavor(NPC, "", "", "agree", 0, 0, Spawn)
  83. Dialog.AddOption("Here you are. ", "HereYouAre")
  84. Dialog.Start()
  85. end
  86. function HereYouAre(NPC, Spawn)
  87. SetStepComplete(Spawn, EMBERS_FOR_XOOT, 2)
  88. FaceTarget(NPC, Spawn)
  89. Dialog.New(NPC, Spawn)
  90. Dialog.AddDialog("Oh yes! These shall work nicely! Tell you what -- take this money for your work. I planned on buying a spell for creating a power source but because of your smart thinking and hard work, I need no spell!")
  91. Dialog.AddVoiceover("voiceover/english/sage_xoort/qey_village06/sagexoort004.mp3", 4269195696, 625587041)
  92. PlayFlavor(NPC, "", "", "happy", 0, 0, Spawn)
  93. Dialog.AddOption("Thanks, it's appreciated.")
  94. Dialog.Start()
  95. end