9
3

FredrickLosce.lua 4.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  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. local Dryads = 5557
  9. function spawn(NPC)
  10. SetPlayerProximityFunction(NPC, 7, "InRange", "LeaveRange")
  11. ProvidesQuest(NPC,Dryads)
  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. choice = math.random(1,2)
  20. if choice == 1 then
  21. PlayFlavor(NPC, "", "", "shakefist", 2088886924, 3736631596, Spawn)
  22. elseif choice == 2 then
  23. PlayFlavor(NPC, "", "", "heckno", 1584866727, 581589457, Spawn)
  24. end
  25. else
  26. if not HasCompletedQuest (Spawn, Dryads) and not HasQuest (Spawn, Dryads) then
  27. if math.random(1, 100) <= 80 then
  28. choice = math.random(1,2)
  29. FaceTarget(NPC, Spawn)
  30. if choice == 1 then
  31. 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)
  32. elseif choice == 2 then
  33. 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)
  34. end
  35. end
  36. end
  37. end
  38. end
  39. function LeaveRange(NPC, Spawn)
  40. end
  41. function hailed(NPC, Spawn)
  42. if GetFactionAmount(Spawn,11) <0 then
  43. choice = math.random(1,2)
  44. if choice == 1 then
  45. PlayFlavor(NPC, "", "", "shakefist", 2088886924, 3736631596, Spawn)
  46. elseif choice == 2 then
  47. PlayFlavor(NPC, "", "", "heckno", 1584866727, 581589457, Spawn)
  48. end
  49. else
  50. if GetQuestStep(Spawn,Dryads)==2 then
  51. PlayFlavor(NPC, "voiceover/english/voice_emotes/greetings/greetings_1_1002.mp3", "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.", "nod", 0, 0, Spawn)
  52. FaceTarget(NPC, Spawn)
  53. SetStepComplete(Spawn,Dryads, 2)
  54. elseif not HasCompletedQuest (Spawn, Dryads) then
  55. PlayFlavor(NPC, "voiceover/english/fredrick_losce/qey_south/fredricklosce000.mp3", "", "", 1020132754, 3906146647, Spawn)
  56. local conversation = CreateConversation()
  57. if not HasQuest(Spawn,Delivery) and not HasCompletedQuest(Spawn, Delivery) then
  58. AddConversationOption(conversation, "Perhaps. What would I be doing?", "Delivery1")
  59. end
  60. AddConversationOption(conversation, "Not really interested. Enjoy your drink.")
  61. StartConversation(conversation, NPC, Spawn, "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?")
  62. else
  63. FaceTarget(NPC, Spawn)
  64. 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)
  65. end
  66. end
  67. end
  68. function Delivery1(NPC,Spawn)
  69. FaceTarget(NPC, Spawn)
  70. PlayFlavor(NPC, "voiceover/english/fredrick_losce/qey_south/fredricklosce001.mp3", "", "sniff", 2839949411, 2971198506, Spawn)
  71. local conversation = CreateConversation()
  72. AddConversationOption(conversation, "Gladly. I'll take care of these dryads.", "Delivery2")
  73. AddConversationOption(conversation, "I'd rather not. Find someone else to clean up the forest for your 'walks'.")
  74. StartConversation(conversation, NPC, Spawn, "I love walking through the Oakmyst Forest, but in recent times corrupt dryads have taken over the area. These cretins love to ruins my walks. If you could rid the world of these horrid creatures it would be a noble task, indeed!")
  75. end
  76. function Delivery2(NPC, Spawn)
  77. PlayFlavor(NPC, "", "", "thanks",0 , 0, Spawn)
  78. FaceTarget(NPC, Spawn)
  79. OfferQuest(NPC, Spawn,Dryads)
  80. end