9
3

NylaDiggs.lua 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  1. --[[
  2. Script Name : SpawnScripts/TheBaubbleshire/NylaDiggs.lua
  3. Script Purpose : Nyla Diggs
  4. Script Author : Dorbin
  5. Script Date : 2022.01.10
  6. Script Notes : Racial language check for Callout & Quest offering
  7. Applied new format/cleaned up script - 2022.08.11 Dorbin
  8. --]]
  9. require "SpawnScripts/Generic/DialogModule"
  10. dofile("SpawnScripts/Generic/UnknownLanguage.lua")
  11. local PieThief = 5437
  12. function spawn(NPC)
  13. ProvidesQuest(NPC, PieThief)
  14. SetPlayerProximityFunction(NPC, 9, "InRange", "LeaveRange")
  15. end
  16. function respawn(NPC)
  17. spawn(NPC)
  18. end
  19. function InRange(NPC, Spawn) --Provides Language Based Callout with delay
  20. if GetFactionAmount(Spawn,11) >0 and math.random (0,100) <80 then
  21. if not HasLanguage(Spawn, 8) then
  22. Garbled(NPC,Spawn)
  23. elseif not HasCompletedQuest (Spawn, PieThief) and not HasQuest (Spawn, PieThief) then
  24. PlayFlavor(NPC, "voiceover/english/nyla_diggs/qey_village06/100_nyla_diggs_nyla_first_d022db59.mp3", "Now where's that pie? I know I had it here.", "", 3499289366, 4159200256, Spawn, 8)
  25. end
  26. end
  27. end
  28. function LeaveRange(NPC, Spawn)
  29. end
  30. function hailed(NPC,Spawn)
  31. if GetFactionAmount(Spawn,11) <0 then
  32. PlayFlavor(NPC, "", "", "shakefist", 0, 0, Spawn)
  33. else
  34. if not HasLanguage(Spawn, 8) then -- Language Check for Stout (8)
  35. Garbled(NPC,Spawn)
  36. else
  37. if not HasCompletedQuest (Spawn, PieThief) and not HasQuest (Spawn, PieThief) then
  38. Dialog1(NPC,Spawn)
  39. elseif not HasCompletedQuest (Spawn, PieThief) and HasQuest (Spawn, PieThief) then
  40. Dialog2(NPC,Spawn)
  41. else
  42. PlayFlavor(NPC, "voiceover/english/nyla_diggs/qey_village06/nyladiggs000.mp3", "Oh, why hello there dear. How are you today? Afraid I can't talk right now", "", 2088434236, 3361269998, Spawn,8)
  43. end
  44. end
  45. end
  46. end
  47. function Dialog1(NPC, Spawn)
  48. FaceTarget(NPC, Spawn)
  49. Dialog.New(NPC, Spawn)
  50. Dialog.AddDialog("Oh, why hello there dear. How are you today? Afraid I can't talk right now")
  51. Dialog.AddVoiceover("voiceover/english/nyla_diggs/qey_village06/nyladiggs000.mp3", 2088434236, 3361269998)
  52. Dialog.AddLanguage(8)
  53. Dialog.AddOption("You seem lost in thought. Anything I can help with?", "Pie1")
  54. Dialog.AddOption("Just saying hello!")
  55. Dialog.Start()
  56. end
  57. function Pie1(NPC, Spawn)
  58. FaceTarget(NPC, Spawn)
  59. Dialog.New(NPC, Spawn)
  60. Dialog.AddDialog("You see, the pie I baked earlier today, it's missing. Not an uncommon event around here if you know what I mean! You'll always find a rumblin' belly 'round here, love!")
  61. Dialog.AddVoiceover("voiceover/english/nyla_diggs/qey_village06/nyladiggs001.mp3", 919242821, 353275540)
  62. Dialog.AddLanguage(8)
  63. Dialog.AddOption("I can still smell it! Would you like me to look for it?","Offer")
  64. Dialog.AddOption("Oh, look at the time. I must be going!")
  65. Dialog.Start()
  66. end
  67. function Offer(NPC, Spawn)
  68. FaceTarget(NPC, Spawn)
  69. OfferQuest(NPC, Spawn, PieThief)
  70. end
  71. function Dialog2(NPC, Spawn)
  72. FaceTarget(NPC, Spawn)
  73. Dialog.New(NPC, Spawn)
  74. Dialog.AddDialog("Well, who is it? They're in for a tongue-lashing!")
  75. Dialog.AddVoiceover("voiceover/english/nyla_diggs/qey_village06/nyladiggs003.mp3", 1047555750, 2550790552)
  76. Dialog.AddLanguage(8)
  77. if GetQuestStep(Spawn, PieThief) == 5 then
  78. Dialog.AddOption( "Lozoria over in the tavern ate it!", "ThiefFinished")
  79. end
  80. Dialog.AddOption("I'm still looking!")
  81. Dialog.Start()
  82. end
  83. function ThiefFinished(NPC, Spawn)
  84. FaceTarget(NPC, Spawn)
  85. Dialog.New(NPC, Spawn)
  86. Dialog.AddDialog("Oh, that rascal! Here's your pie, dear. I'll take care of that rapscallion later!")
  87. Dialog.AddVoiceover("voiceover/english/nyla_diggs/qey_village06/nyladiggs004.mp3", 3185345641, 3927954754)
  88. Dialog.AddLanguage(8)
  89. Dialog.AddOption("Thanks, the pie smells delicous!")
  90. Dialog.Start()
  91. SetStepComplete(Spawn, PieThief, 5)
  92. end