Duvo.lua 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  1. --[[
  2. Script Name : SpawnScripts/ElddarGrove/Duvo.lua
  3. Script Purpose : Duvo <Alchemist>
  4. Script Author : Dorbin
  5. Script Date : 2022.05.09
  6. Script Notes :
  7. --]]
  8. local muffins = 5524
  9. local papers = 5536
  10. function spawn(NPC)
  11. SetPlayerProximityFunction(NPC, 6, "InRange", "LeaveRange")
  12. ProvidesQuest(NPC,muffins)
  13. end
  14. function InRange(NPC,Spawn)
  15. if GetFactionAmount(Spawn,11) <0 then
  16. FaceTarget(NPC, Spawn)
  17. choice = math.random(1,2)
  18. if choice == 1 then
  19. PlayFlavor(NPC, "", "", "shakefist", 2088886924, 3736631596, Spawn)
  20. elseif choice == 2 then
  21. PlayFlavor(NPC, "", "", "heckno", 1584866727, 581589457, Spawn)
  22. end
  23. else
  24. if not HasCompletedQuest (Spawn, muffins) and not HasQuest (Spawn, muffins) then
  25. if math.random(1, 100) <= 70 then
  26. choice = math.random(1,2)
  27. if choice == 1 then
  28. PlayFlavor(NPC, "voiceover/english/scribe_duvo/qey_elddar/100_scribe_halfling_duvo_callout1_c6eaefe5.mp3", "My apologies, friend. I did not see you there ... What is it you need?", "", 3948051330, 1166584264, Spawn)
  29. elseif choice == 2 then
  30. PlayFlavor(NPC, "voiceover/english/scribe_duvo/qey_elddar/100_scribe_halfling_duvo_multhail1_a72f47c8.mp3", "I'm sorry. I cannot help you.", "", 1448300901, 17119076, Spawn)
  31. end
  32. end
  33. end
  34. end
  35. end
  36. function hailed(NPC, Spawn)
  37. FaceTarget(NPC, Spawn)
  38. if GetFactionAmount(Spawn,11) <0 then
  39. choice = math.random(1,2)
  40. if choice == 1 then
  41. PlayFlavor(NPC, "", "", "shakefist", 2088886924, 3736631596, Spawn)
  42. elseif choice == 2 then
  43. PlayFlavor(NPC, "", "", "heckno", 1584866727, 581589457, Spawn)
  44. end
  45. else
  46. PlayFlavor(NPC, "voiceover/english/scribe_duvo/qey_elddar/scribeduvo.mp3", "", "", 2044085104, 2381901652, Spawn)
  47. local conversation = CreateConversation()
  48. if not HasQuest(Spawn,muffins) and not HasCompletedQuest(Spawn, muffins) then
  49. AddConversationOption(conversation, "You appear preoccupied. Need any help?", "Delivery")
  50. end
  51. if GetQuestStep(Spawn,papers)==1 then
  52. AddConversationOption(conversation, "Andrea Dovesong sent me to pick up some parchment.", "Pickup")
  53. end
  54. if GetQuestStep(Spawn,muffins)==2 then
  55. AddConversationOption(conversation, "Penny gave me her recipie you requested. Here you go.", "Delivered")
  56. end
  57. AddConversationOption(conversation, "Nothing. I'll leave you to your work.")
  58. StartConversation(conversation, NPC, Spawn, "My apologies, friend. I did not see you there ... What is it you need?")
  59. end
  60. end
  61. function Delivery(NPC, Spawn)
  62. FaceTarget(NPC, Spawn)
  63. PlayFlavor(NPC, "voiceover/english/scribe_duvo/qey_elddar/scribeduvo000.mp3", "", "", 3906484096, 313118896, Spawn)
  64. local conversation = CreateConversation()
  65. AddConversationOption(conversation, "Alright! I'll do whatever you ask.", "Delivery2")
  66. AddConversationOption(conversation, "I better not. This sounds too important for me.")
  67. StartConversation(conversation, NPC, Spawn, "Excellent! I would love your help if you have the time to spare. I never seem to have a spare momment. Now, the task I need done is VERY important! If you agree to help, you must do it now!")
  68. end
  69. function Delivery2(NPC, Spawn)
  70. FaceTarget(NPC, Spawn)
  71. OfferQuest(NPC, Spawn,muffins)
  72. end
  73. function Delivered(NPC, Spawn)
  74. FaceTarget(NPC, Spawn)
  75. PlayFlavor(NPC, "voiceover/english/scribe_duvo/qey_elddar/scribeduvo002.mp3", "", "thanks", 3093182397, 3807334296, Spawn)
  76. local conversation = CreateConversation()
  77. AddConversationOption(conversation, "Well, I hope it was worth the trouble.", "FinishQuest")
  78. StartConversation(conversation, NPC, Spawn, "Fantastic! Let me see the recipie... Yes... I see now...*mumbling*... That... is the ingredient I was missing! You're a life saver! These muffins make a fine mid-morning meal. I know the paper will publish the paper as soon as I rewrite it in fine script.")
  79. end
  80. function FinishQuest(NPC, Spawn)
  81. FaceTarget(NPC, Spawn)
  82. SetStepComplete(Spawn,muffins, 2)
  83. end
  84. function Pickup(NPC, Spawn)
  85. FaceTarget(NPC, Spawn)
  86. PlayFlavor(NPC, "voiceover/english/scribe_duvo/qey_elddar/scribeduvo006.mp3", "", "thanks", 4243768654, 3960378090, Spawn)
  87. local conversation = CreateConversation()
  88. AddConversationOption(conversation, "I will. Thanks.", "Papers1")
  89. StartConversation(conversation, NPC, Spawn, "I have pleanty of parchment to spare. Here. Take these to her. If she needs more tell her to come by.")
  90. end
  91. function Papers1(NPC, Spawn)
  92. FaceTarget(NPC, Spawn)
  93. SetStepComplete(Spawn,papers, 1)
  94. end