Duvo.lua 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107
  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. SetInfoStructString(NPC, "action_state", "alchemy_idle")
  14. end
  15. function InRange(NPC,Spawn)
  16. if GetFactionAmount(Spawn,11) <0 then
  17. FaceTarget(NPC, Spawn)
  18. choice = math.random(1,2)
  19. if choice == 1 then
  20. PlayFlavor(NPC, "", "", "shakefist", 2088886924, 3736631596, Spawn)
  21. elseif choice == 2 then
  22. PlayFlavor(NPC, "", "", "heckno", 1584866727, 581589457, Spawn)
  23. end
  24. else
  25. if not HasCompletedQuest (Spawn, muffins) and not HasQuest (Spawn, muffins) then
  26. if math.random(1, 100) <= 70 then
  27. choice = math.random(1,2)
  28. if choice == 1 then
  29. 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)
  30. elseif choice == 2 then
  31. 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)
  32. end
  33. end
  34. end
  35. end
  36. end
  37. function hailed(NPC, Spawn)
  38. FaceTarget(NPC, Spawn)
  39. if GetFactionAmount(Spawn,11) <0 then
  40. choice = math.random(1,2)
  41. if choice == 1 then
  42. PlayFlavor(NPC, "", "", "shakefist", 2088886924, 3736631596, Spawn)
  43. elseif choice == 2 then
  44. PlayFlavor(NPC, "", "", "heckno", 1584866727, 581589457, Spawn)
  45. end
  46. else
  47. PlayFlavor(NPC, "voiceover/english/scribe_duvo/qey_elddar/scribeduvo.mp3", "", "", 2044085104, 2381901652, Spawn)
  48. local conversation = CreateConversation()
  49. if not HasQuest(Spawn,muffins) and not HasCompletedQuest(Spawn, muffins) then
  50. AddConversationOption(conversation, "You appear preoccupied. Need any help?", "Delivery")
  51. end
  52. if GetQuestStep(Spawn,papers)==1 then
  53. AddConversationOption(conversation, "Andrea Dovesong sent me to pick up some parchment.", "Pickup")
  54. end
  55. if GetQuestStep(Spawn,muffins)==2 then
  56. AddConversationOption(conversation, "Penny gave me her recipie you requested. Here you go.", "Delivered")
  57. end
  58. AddConversationOption(conversation, "Nothing. I'll leave you to your work.")
  59. StartConversation(conversation, NPC, Spawn, "My apologies, friend. I did not see you there ... What is it you need?")
  60. end
  61. end
  62. function Delivery(NPC, Spawn)
  63. FaceTarget(NPC, Spawn)
  64. PlayFlavor(NPC, "voiceover/english/scribe_duvo/qey_elddar/scribeduvo000.mp3", "", "", 3906484096, 313118896, Spawn)
  65. local conversation = CreateConversation()
  66. AddConversationOption(conversation, "Alright! I'll do whatever you ask.", "Delivery2")
  67. AddConversationOption(conversation, "I better not. This sounds too important for me.")
  68. 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!")
  69. end
  70. function Delivery2(NPC, Spawn)
  71. FaceTarget(NPC, Spawn)
  72. OfferQuest(NPC, Spawn,muffins)
  73. end
  74. function Delivered(NPC, Spawn)
  75. FaceTarget(NPC, Spawn)
  76. PlayFlavor(NPC, "voiceover/english/scribe_duvo/qey_elddar/scribeduvo002.mp3", "", "thanks", 3093182397, 3807334296, Spawn)
  77. local conversation = CreateConversation()
  78. AddConversationOption(conversation, "Well, I hope it was worth the trouble.", "FinishQuest")
  79. 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.")
  80. end
  81. function FinishQuest(NPC, Spawn)
  82. FaceTarget(NPC, Spawn)
  83. SetStepComplete(Spawn,muffins, 2)
  84. end
  85. function Pickup(NPC, Spawn)
  86. FaceTarget(NPC, Spawn)
  87. PlayFlavor(NPC, "voiceover/english/scribe_duvo/qey_elddar/scribeduvo006.mp3", "", "thanks", 4243768654, 3960378090, Spawn)
  88. local conversation = CreateConversation()
  89. AddConversationOption(conversation, "I will. Thanks.", "Papers1")
  90. 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.")
  91. end
  92. function Papers1(NPC, Spawn)
  93. FaceTarget(NPC, Spawn)
  94. SetStepComplete(Spawn,papers, 1)
  95. end