9
3

Ommanoden.lua 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  1. --[[
  2. Script Name : SpawnScripts/Starcrest/Ommanoden.lua
  3. Script Purpose : Ommanoden <Spell Scrolls>
  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, 9, "InRange", "LeaveRange")
  11. ProvidesQuest(NPC,5601)
  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,5601)then
  22. local chance = math.random(0, 100)
  23. if chance <= 25 then
  24. FaceTarget(NPC, Spawn)
  25. PlayFlavor(NPC, "voiceover/english/scribe_ommanoden/qey_village02/100_scribe_ommanoden_multhail1_becd50b2.mp3", "Can't you see I'm busy organizing my collections of wisdom? I've no time for chatting. Leave me alone!", "", 3010394589, 1905118172, Spawn)
  26. end
  27. elseif not HasQuest(Spawn, 5601) and not HasCompletedQuest(Spawn,5601)then
  28. local chance = math.random(0, 100)
  29. if chance <= 80 then
  30. local choice = MakeRandomInt(1,3)
  31. FaceTarget(NPC, Spawn)
  32. if choice == 1 then
  33. PlayFlavor(NPC, "voiceover/english/scribe_ommanoden/qey_village02/100_scribe_ommanoden_multhail1_becd50b2.mp3", "Can't you see I'm busy organizing my collections of wisdom? I've no time for chatting. Leave me alone!", "", 3010394589, 1905118172, Spawn)
  34. elseif choice == 2 then
  35. PlayFlavor(NPC, "voiceover/english/scribe_ommanoden/qey_village02/100_scribe_ommanoden_callout_95b88e8b.mp3", "Drat! Out of quills again! I must get more. I'm very busy so either make yourself useful or leave!", "doh", 615324011, 212063445, Spawn, 0)
  36. elseif choice == 3 then --Repeated for focus
  37. PlayFlavor(NPC, "voiceover/english/scribe_ommanoden/qey_village02/100_scribe_ommanoden_callout_95b88e8b.mp3", "Drat! Out of quills again! I must get more. I'm very busy so either make yourself useful or leave!", "doh", 615324011, 212063445, Spawn, 0)
  38. end
  39. end
  40. end
  41. end
  42. end
  43. function hailed(NPC, Spawn)
  44. FaceTarget(NPC, Spawn)
  45. if GetFactionAmount(Spawn,11)<0 then
  46. PlayFlavor(NPC, "", "", "shakefist", 0, 0, Spawn)
  47. else
  48. Dialog1(NPC, Spawn)
  49. end
  50. end
  51. function Dialog1(NPC, Spawn)
  52. FaceTarget(NPC, Spawn)
  53. Dialog.New(NPC, Spawn)
  54. PlayFlavor(NPC, "", "", "tapfoot", 0, 0, Spawn)
  55. Dialog.AddDialog("Yes, yes. What is it? Can't you see I am busy organizing my collections of wisdom?")
  56. Dialog.AddVoiceover("voiceover/english/scribe_ommanoden/qey_village02/ommanoden.mp3", 4094384559, 297636522)
  57. if not HasCompletedQuest (Spawn, 5601) and not HasQuest (Spawn, 5601) then
  58. Dialog.AddOption("I'm actually looking for work. Have anything I can do for you and your shop?","Dialog2")
  59. end
  60. if GetQuestStep (Spawn, 5601)==2 then
  61. Dialog.AddOption("Here are five of the best hawk feather plumes I could find from Antonica.","Delivered")
  62. end
  63. Dialog.AddOption("Just browsing your wares.")
  64. Dialog.Start()
  65. end
  66. function Dialog2(NPC, Spawn)
  67. FaceTarget(NPC, Spawn)
  68. Dialog.New(NPC, Spawn)
  69. PlayFlavor(NPC, "", "", "agree", 0, 0, Spawn)
  70. Dialog.AddDialog("That's one question I will answer young one. I need more quills. Problem is I'm very picky about my plumes. I only use one type of feather; those of the full-fledged hawk.")
  71. Dialog.AddVoiceover("voiceover/english/scribe_ommanoden/qey_village02/ommanoden000.mp3", 3539147498, 3086766086)
  72. Dialog.AddOption("I could gather some of those for you.", "QuestBegin")
  73. Dialog.AddOption("A bit too picky for me. I must be going.")
  74. Dialog.Start()
  75. end
  76. function QuestBegin (NPC, Spawn)
  77. FaceTarget(NPC, Spawn)
  78. OfferQuest(NPC, Spawn, 5601)
  79. end
  80. function Delivered(NPC, Spawn)
  81. FaceTarget(NPC, Spawn)
  82. Dialog.New(NPC, Spawn)
  83. SetStepComplete(Spawn, 5601, 2)
  84. PlayFlavor(NPC, "", "", "stare", 0, 0, Spawn)
  85. Dialog.AddDialog("Excellent! I'll start perfecting them immediately!... Why are you still here? I suppose you expect some sort of payment. Very well. Take these coins in return for the feathers.")
  86. Dialog.AddVoiceover("voiceover/english/scribe_ommanoden/qey_village02/ommanoden002.mp3", 4264271972, 1899307891)
  87. Dialog.AddOption("Pleasure doing business.")
  88. Dialog.AddOption("Thanks. Let me just show myself out.")
  89. Dialog.Start()
  90. end