NylaDiggs.lua 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109
  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. SetInfoStructString(NPC, "action_state", "cooking_idle")
  16. end
  17. function respawn(NPC)
  18. spawn(NPC)
  19. end
  20. function InRange(NPC, Spawn) --Provides Language Based Callout with delay
  21. if GetFactionAmount(Spawn,11) >0 and math.random (0,100) <80 then
  22. if not HasLanguage(Spawn, 8) then
  23. Garbled(NPC,Spawn)
  24. elseif not HasCompletedQuest (Spawn, PieThief) and not HasQuest (Spawn, PieThief) then
  25. 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)
  26. end
  27. end
  28. end
  29. function LeaveRange(NPC, Spawn)
  30. end
  31. function hailed(NPC,Spawn)
  32. if GetFactionAmount(Spawn,11) <0 then
  33. PlayFlavor(NPC, "", "", "shakefist", 0, 0, Spawn)
  34. else
  35. if not HasLanguage(Spawn, 8) then -- Language Check for Stout (8)
  36. Garbled(NPC,Spawn)
  37. else
  38. if not HasCompletedQuest (Spawn, PieThief) and not HasQuest (Spawn, PieThief) then
  39. Dialog1(NPC,Spawn)
  40. elseif not HasCompletedQuest (Spawn, PieThief) and HasQuest (Spawn, PieThief) then
  41. Dialog2(NPC,Spawn)
  42. else
  43. 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)
  44. end
  45. end
  46. end
  47. end
  48. function Dialog1(NPC, Spawn)
  49. FaceTarget(NPC, Spawn)
  50. Dialog.New(NPC, Spawn)
  51. Dialog.AddDialog("Oh, why hello there dear. How are you today? Afraid I can't talk right now")
  52. Dialog.AddVoiceover("voiceover/english/nyla_diggs/qey_village06/nyladiggs000.mp3", 2088434236, 3361269998)
  53. Dialog.AddLanguage(8)
  54. Dialog.AddOption("You seem lost in thought. Anything I can help with?", "Pie1")
  55. Dialog.AddOption("Just saying hello!")
  56. Dialog.Start()
  57. end
  58. function Pie1(NPC, Spawn)
  59. FaceTarget(NPC, Spawn)
  60. Dialog.New(NPC, Spawn)
  61. 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!")
  62. Dialog.AddVoiceover("voiceover/english/nyla_diggs/qey_village06/nyladiggs001.mp3", 919242821, 353275540)
  63. Dialog.AddLanguage(8)
  64. Dialog.AddOption("I can still smell it! Would you like me to look for it?","Offer")
  65. Dialog.AddOption("Oh, look at the time. I must be going!")
  66. Dialog.Start()
  67. end
  68. function Offer(NPC, Spawn)
  69. FaceTarget(NPC, Spawn)
  70. OfferQuest(NPC, Spawn, PieThief)
  71. end
  72. function Dialog2(NPC, Spawn)
  73. FaceTarget(NPC, Spawn)
  74. Dialog.New(NPC, Spawn)
  75. Dialog.AddDialog("Well, who is it? They're in for a tongue-lashing!")
  76. Dialog.AddVoiceover("voiceover/english/nyla_diggs/qey_village06/nyladiggs003.mp3", 1047555750, 2550790552)
  77. Dialog.AddLanguage(8)
  78. if GetQuestStep(Spawn, PieThief) == 5 then
  79. Dialog.AddOption( "Lozoria over in the tavern ate it!", "ThiefFinished")
  80. end
  81. Dialog.AddOption("I'm still looking!")
  82. Dialog.Start()
  83. end
  84. function ThiefFinished(NPC, Spawn)
  85. FaceTarget(NPC, Spawn)
  86. Dialog.New(NPC, Spawn)
  87. Dialog.AddDialog("Oh, that rascal! Here's your pie, dear. I'll take care of that rapscallion later!")
  88. Dialog.AddVoiceover("voiceover/english/nyla_diggs/qey_village06/nyladiggs004.mp3", 3185345641, 3927954754)
  89. Dialog.AddLanguage(8)
  90. Dialog.AddOption("Thanks, the pie smells delicous!")
  91. Dialog.Start()
  92. SetStepComplete(Spawn, PieThief, 5)
  93. end