9
3

FredrickLosce.lua 3.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  1. --[[
  2. Script Name : SpawnScripts/SouthQeynos/FredrickLosce.lua
  3. Script Purpose : Fredrick Losce
  4. Script Author : Dorbin
  5. Script Date : 2022.05.16
  6. Script Notes :
  7. --]]
  8. require "SpawnScripts/Generic/DialogModule"
  9. local Dryads = 5557
  10. function spawn(NPC)
  11. SetPlayerProximityFunction(NPC, 7, "InRange", "LeaveRange")
  12. ProvidesQuest(NPC,Dryads)
  13. end
  14. function respawn(NPC)
  15. spawn(NPC)
  16. end
  17. function InRange(NPC, Spawn)
  18. if GetFactionAmount(Spawn,11) <0 then
  19. FaceTarget(NPC, Spawn)
  20. choice = math.random(1,2)
  21. if choice == 1 then
  22. PlayFlavor(NPC, "", "", "shakefist", 2088886924, 3736631596, Spawn)
  23. elseif choice == 2 then
  24. PlayFlavor(NPC, "", "", "heckno", 1584866727, 581589457, Spawn)
  25. end
  26. else
  27. if not HasCompletedQuest (Spawn, Dryads) and not HasQuest (Spawn, Dryads) then
  28. if math.random(1, 100) <= 80 then
  29. choice = math.random(1,2)
  30. FaceTarget(NPC, Spawn)
  31. if choice == 1 then
  32. PlayFlavor(NPC, "voiceover/english/fredrick_losce/qey_south/100_qst_fredrick_losce_multhail1_39997e53.mp3", "I'm sorry friend. I thought you were someone else.", "", 2011619923, 2423962881, Spawn)
  33. elseif choice == 2 then
  34. PlayFlavor(NPC, "voiceover/english/fredrick_losce/qey_south/100_qst_fredrick_losce_callout1_a3881416.mp3", "Darn those pesky dryads. What I'd give to rid the forest of those nasty beasts! You there! Can you help me?", "frustrated", 75957079, 4242676520, Spawn)
  35. end
  36. end
  37. end
  38. end
  39. end
  40. function LeaveRange(NPC, Spawn)
  41. end
  42. function hailed(NPC, Spawn)
  43. if GetFactionAmount(Spawn,11) <0 then
  44. choice = math.random(1,2)
  45. if choice == 1 then
  46. PlayFlavor(NPC, "", "", "shakefist", 2088886924, 3736631596, Spawn)
  47. elseif choice == 2 then
  48. PlayFlavor(NPC, "", "", "heckno", 1584866727, 581589457, Spawn)
  49. end
  50. else
  51. if HasQuest (Spawn, Dryads) and GetQuestStep(Spawn,Dryads)==2 then
  52. SetStepComplete(Spawn,Dryads, 2)
  53. FaceTarget(NPC, Spawn)
  54. Dialog.New(NPC, Spawn)
  55. PlayFlavor(NPC,"","","scheme", 0, 0, Spawn)
  56. Dialog.AddDialog( "I can tell by your face the deed is done. Thank you for ridding the forest of those corrupted beasts! Please, take this as a token for doing the world- and particularlly me- a favor. Now off with you.")
  57. Dialog.AddVoiceover("voiceover/english/voice_emotes/greetings/greetings_1_1002.mp3", 390832885, 49061382)
  58. Dialog.AddOption("Your reward is thank you enough. I am glad I could help!")
  59. Dialog.Start()
  60. elseif not HasCompletedQuest (Spawn, Dryads) then
  61. FaceTarget(NPC, Spawn)
  62. Dialog.New(NPC, Spawn)
  63. PlayFlavor(NPC,"","","nod", 0, 0, Spawn)
  64. Dialog.AddDialog( "Hail citizen. You seem to be looking for something to do? Might I tempt you with doing myself and the rest of the world a favor?")
  65. Dialog.AddVoiceover("voiceover/english/fredrick_losce/qey_south/fredricklosce000.mp3", 1020132754, 3906146647)
  66. if not HasQuest(Spawn,Dryads) and not HasCompletedQuest(Spawn, Dryads) then
  67. Dialog.AddOption("Perhaps. What would I be doing?", "Delivery2")
  68. end
  69. Dialog.AddOption("Not really interested. Enjoy your drink.")
  70. Dialog.Start()
  71. else
  72. FaceTarget(NPC, Spawn)
  73. PlayFlavor(NPC, "voiceover/english/fredrick_losce/qey_south/100_qst_fredrick_losce_multhail1_39997e53.mp3", "I'm sorry friend. I thought you were someone else.", "", 2011619923, 2423962881, Spawn)
  74. end
  75. end
  76. end
  77. function Delivery2(NPC, Spawn)
  78. PlayFlavor(NPC, "", "", "thanks",0 , 0, Spawn)
  79. FaceTarget(NPC, Spawn)
  80. OfferQuest(NPC, Spawn,Dryads)
  81. end