Bryson.lua 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. --[[
  2. Script Name : SpawnScripts/ElddarGrove/Bryson.lua
  3. Script Purpose : Bryson
  4. Script Author : Dorbin
  5. Script Date : 2022.05.10
  6. Script Notes :
  7. --]]
  8. local bow = 5529
  9. function spawn(NPC)
  10. SetPlayerProximityFunction(NPC, 7, "InRange", "LeaveRange")
  11. ProvidesQuest(NPC,bow)
  12. end
  13. function hailed(NPC, Spawn)
  14. FaceTarget(NPC, Spawn)
  15. if GetFactionAmount(Spawn, 11) <0 then
  16. PlayFlavor(NPC, "", "", "shakefist", 0, 0, Spawn)
  17. else
  18. PlayFlavor(NPC, "voiceover/english/bryson/qey_elddar/bryson000.mp3", "", "smile", 4245794295, 2132791920, Spawn)
  19. local conversation = CreateConversation()
  20. if not HasQuest(Spawn,bow) and not HasCompletedQuest(Spawn, bow) then
  21. AddConversationOption(conversation, "I'm looking for work. Need anything?", "Option1")
  22. end
  23. if GetQuestStep(Spawn,bow)==2 then
  24. AddConversationOption(conversation, "Here is your bow from carpenter Paddock", "Delivered")
  25. end
  26. AddConversationOption(conversation, "Afraid I missed it. I'll have to see it next time.")
  27. StartConversation(conversation, NPC, Spawn, "You see, a bullseye! I knew I'd hit it soon.")
  28. end
  29. end
  30. function InRange(NPC,Spawn)
  31. if GetFactionAmount(Spawn, 11) <0 then
  32. PlayFlavor(NPC, "", "", "shakefist", 0, 0, Spawn)
  33. else
  34. if not HasCompletedQuest (Spawn, bow) and not HasQuest (Spawn, bow) then
  35. if math.random(1, 100) <= 80 then
  36. choice = math.random(1,2)
  37. if choice == 1 then
  38. PlayFlavor(NPC, "voiceover/english/bryson/qey_elddar/100_archer_human_bryson_multhail1_591026b2.mp3", "Now, if you hope to be as fine an archer as me, you should be off practicing instead of talking to me!", "smirk", 2519962645, 3532721498, Spawn)
  39. elseif choice == 2 then
  40. PlayFlavor(NPC, "voiceover/english/bryson/qey_elddar/100_archer_human_bryson_callout1_c9e17e55.mp3", "Ha! A bullseye! I knew I would hit it soon. Take a look at this, friend!", "smile", 4180624223, 2622592, Spawn)
  41. end
  42. end
  43. end
  44. end
  45. end
  46. function Option1(NPC, Spawn)
  47. FaceTarget(NPC, Spawn)
  48. PlayFlavor(NPC, "voiceover/english/bryson/qey_elddar/bryson001.mp3", "", "agree", 1715589937, 1740141288, Spawn)
  49. local conversation = CreateConversation()
  50. AddConversationOption(conversation, "Say no more. I'll go fetch your bow from Paddock.", "StartQuest")
  51. AddConversationOption(conversation, "I meant real work, not a delivery person. Nevermind!")
  52. StartConversation(conversation, NPC, Spawn, "Straight to the point. I like that in a person! You're in luck! I need a bow retrieved that's on order from Carpenter Paddock. With all my archery practice I've been too busy to pick it up.")
  53. end
  54. function StartQuest(NPC, Spawn)
  55. FaceTarget(NPC, Spawn)
  56. OfferQuest(NPC, Spawn,bow)
  57. end
  58. function Delivered(NPC, Spawn)
  59. FaceTarget(NPC, Spawn)
  60. PlayFlavor(NPC, "voiceover/english/bryson/qey_elddar/bryson002.mp3", "", "thanks", 4157132890, 1410204263, Spawn)
  61. local conversation = CreateConversation()
  62. AddConversationOption(conversation, "It was no problem.", "FinishQuest")
  63. AddConversationOption(conversation, "Good luck with the new bow!", "FinishQuest")
  64. StartConversation(conversation, NPC, Spawn, "Fantastic! I know the bow will improve my aim! And, of course, I'll pay you a bit of a coin for your fair deed.")
  65. end
  66. function FinishQuest(NPC, Spawn)
  67. FaceTarget(NPC, Spawn)
  68. SetStepComplete(Spawn,bow, 2)
  69. end