BarryViceheart.lua 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  1. --[[
  2. Script Name : SpawnScripts/Graystone/BarryViceheart.lua
  3. Script Purpose : Barry Viceheart
  4. Script Author : Dorbin
  5. Script Date : 2022.03.07
  6. Script Notes :
  7. --]]
  8. local Delivery = 5500
  9. function spawn(NPC)
  10. SetPlayerProximityFunction(NPC, 8, "InRange", "LeaveRange")
  11. ProvidesQuest(NPC, Delivery)
  12. end
  13. function InRange(NPC, Spawn) --Quest Callout
  14. if math.random(1, 100) <= 60 then
  15. if not HasCompletedQuest (Spawn, Delivery) and not HasQuest (Spawn, Delivery) then
  16. choice = math.random(1,2)
  17. if choice ==1 then
  18. FaceTarget(NPC, Spawn)
  19. PlayFlavor(NPC, "voiceover/english/barry_viceheart/qey_village03/100_customer_barbarian_viceheart_callout_1461fbc1.mp3", "This tome will never reach home as long my buisness in Graystone is hampered. Are you looking to make some coin, friend?", "", 2446304440, 3164893910, Spawn)
  20. else
  21. FaceTarget(NPC, Spawn)
  22. PlayFlavor(NPC, "voiceover/english/barry_viceheart/qey_village03/100_customer_barbarian_viceheart_multhail1_31dbd300.mp3", "I don't think you want to help me with this difficult task. Farewell!", "no", 2478336212, 3512678812, Spawn)
  23. end
  24. else
  25. choice = math.random(1,2)
  26. if choice ==1 then
  27. PlayFlavor(NPC, "", "", "sigh", 0, 0, Spawn)
  28. else
  29. PlayFlavor(NPC, "", "", "grumble", 0, 0, Spawn)
  30. end
  31. end
  32. end
  33. end
  34. function respawn(NPC)
  35. spawn(NPC)
  36. end
  37. function hailed(NPC, Spawn)
  38. FaceTarget(NPC, Spawn)
  39. conversation = CreateConversation()
  40. PlayFlavor(NPC, "voiceover/english/barry_viceheart/qey_village03/barryviceheart000.mp3","","grumble",2578443870,2025920276,Spawn)
  41. if not HasCompletedQuest (Spawn, Delivery) and not HasQuest (Spawn, Delivery) then
  42. AddConversationOption(conversation, "Why don't you just come back later?", "DeliveryStart")
  43. end
  44. if GetQuestStep(Spawn,Delivery)==2 then
  45. AddConversationOption(conversation, "The tome is returned. They had words for you.", "DeliveryDone")
  46. end
  47. AddConversationOption(conversation, "Keep your place in line.")
  48. StartConversation(conversation, NPC, Spawn, "If you think I'm going to give up my place in line for a few coins, think again! Everyday it is the same long long. When will they hire new help?!")
  49. end
  50. function DeliveryStart(NPC, Spawn)
  51. conversation = CreateConversation()
  52. PlayFlavor(NPC, "voiceover/english/barry_viceheart/qey_village03/barryviceheart001.mp3","","",544720212,2865021326,Spawn)
  53. AddConversationOption(conversation, "This line seems to be your only crusade?", "QuestBegin1")
  54. AddConversationOption(conversation, "Alright then. Good luck with that.")
  55. StartConversation(conversation, NPC, Spawn, "By this time tomorrow I'll be marching across the fields of Antonica on a crusade to rid the land of the remaining gnolls. This shall prove the might and worth of Viceheart. The Qeynos Guard will be begging me to join their ranks.")
  56. end
  57. function QuestBegin1(NPC, Spawn)
  58. conversation = CreateConversation()
  59. PlayFlavor(NPC, "voiceover/english/barry_viceheart/qey_village03/barryviceheart002.mp3","","agree",1094577603,3787168085,Spawn)
  60. AddConversationOption(conversation, "Can I help?", "QuestBegin2")
  61. AddConversationOption(conversation, "Alright then. Good luck with that.")
  62. StartConversation(conversation, NPC, Spawn, "Aye. I must agree. This line has been a greater bane than the hordes of khekloks and pirates I faced on my journey to Qeynos. If I cannot defeat this line in a few hours I will never defeat the fine I shall incur by not returning this tome.")
  63. end
  64. function QuestBegin2(NPC, Spawn)
  65. conversation = CreateConversation()
  66. PlayFlavor(NPC, "voiceover/english/barry_viceheart/qey_village03/barryviceheart003.mp3","","agree",1066723073,3215544160,Spawn)
  67. AddConversationOption(conversation, "I'll return the book to Bleemeb.", "QuestBegin")
  68. AddConversationOption(conversation, "On second thought, I'm busy. Sorry.")
  69. StartConversation(conversation, NPC, Spawn, "Carry this tome to Castleview Hamlet. There you will find a Scribe's shop. Be sure that Bleemeb recieves the tome. Do this, and I'll shall reward you with coin.")
  70. end
  71. function QuestBegin (NPC, Spawn)
  72. FaceTarget(NPC, Spawn)
  73. OfferQuest(NPC, Spawn, Delivery)
  74. end
  75. function DeliveryDone(NPC, Spawn)
  76. conversation = CreateConversation()
  77. PlayFlavor(NPC, "voiceover/english/barry_viceheart/qey_village03/barryviceheart004.mp3","","facepalm",1668909106,3942142974,Spawn)
  78. AddConversationOption(conversation, "Thanks for the coin, and good luck with the line.", "Reward")
  79. StartConversation(conversation, NPC, Spawn, "Bah! I do not need to hear a scribbler's threats. Your deed is kind and a reward is just. Take these few coins. May your journeys bring you many victories.")
  80. end
  81. function Reward(NPC, Spawn)
  82. SetStepComplete(Spawn, Delivery, 2)
  83. end