9
3

Jodi.lua 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  1. --[[
  2. Script Name : SpawnScripts/Graystone/Jodi.lua
  3. Script Purpose : Jodi
  4. Script Author : Dorbin
  5. Script Date : 2022.01.20
  6. Script Notes : Recreated Manually
  7. --]]
  8. local Delivery = 5445
  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. PlayFlavor(NPC, "voiceover/english/jodi/qey_village03/100_customer_human_jodi_multhail1_ef852e92.mp3", "Hmmm... I think I'll pick up the potions myself.", "ponder", 1168503261, 3143676939, Spawn)
  19. else
  20. PlayFlavor(NPC, "voiceover/english/jodi/qey_village03/100_customer_human_jodi_callout_2ca4aa88.mp3", "I will never make Baubbleshire in time. I need a courier.", "sulk", 1892112323, 654880852, Spawn)
  21. end
  22. else
  23. choice = math.random(1,2)
  24. if choice ==1 then
  25. PlayFlavor(NPC, "", "", "wave", 0, 0, Spawn)
  26. else
  27. PlayFlavor(NPC, "", "", "sigh", 0, 0, Spawn)
  28. end
  29. end
  30. end
  31. end
  32. function respawn(NPC)
  33. spawn(NPC)
  34. end
  35. function hailed(NPC, Spawn)
  36. FaceTarget(NPC, Spawn)
  37. if not HasCompletedQuest (Spawn, Delivery) and not HasQuest (Spawn, Delivery) then
  38. conversation = CreateConversation()
  39. PlayFlavor(NPC, "voiceover/english/jodi/qey_village03/customerjodi000.mp3","","hello",129779928,3581149564,Spawn)
  40. AddConversationOption(conversation, "I could pick up your potions.", "Potions")
  41. AddConversationOption(conversation, "Sorry, I'm busy.")
  42. StartConversation(conversation, NPC, Spawn, "I only need to make a quick deposit. Would you hold my place in line? I need to rush to Baubbleshire before my potions are sold to others!")
  43. elseif not HasCompletedQuest (Spawn, Delivery) and HasQuest (Spawn, Delivery) then
  44. FaceTarget(NPC, Spawn)
  45. conversation = CreateConversation()
  46. if GetQuestStep (Spawn, Delivery) == 2 then
  47. AddConversationOption(conversation, "Here are your potions.", "Delivered")
  48. end
  49. PlayFlavor(NPC, "voiceover/english/voice_emotes/greetings/greetings_2_1005.mp3","","hello",0,0,Spawn)
  50. AddConversationOption(conversation, "I'll pick them up soon. Your coin is still safe with me.")
  51. StartConversation(conversation, NPC, Spawn, "Did you pick up my potions by chance?")
  52. else
  53. choice = math.random(1,2)
  54. if choice ==1 then
  55. PlayFlavor(NPC, "", "", "sigh", 0, 0, Spawn)
  56. else
  57. PlayFlavor(NPC, "", "", "tap", 0, 0, Spawn)
  58. end
  59. end
  60. end
  61. function Potions(NPC, Spawn)
  62. conversation = CreateConversation()
  63. PlayFlavor(NPC, "voiceover/english/jodi/qey_village03/customerjodi001.mp3","","hello",571487572,589939480,Spawn)
  64. AddConversationOption(conversation, "I can do that. I'll take the coin to him.", "QuestBegin")
  65. AddConversationOption(conversation, "On second thought, I must be going.")
  66. StartConversation(conversation, NPC, Spawn, "Thank you for offering. You must go to Baubbleshire and find a merchant named Dondl Fuzzlecutter. As a favor, he's holding a few special bottles of healing potions for me. Take this coin and pay him for the potions.")
  67. end
  68. function QuestBegin (NPC, Spawn)
  69. FaceTarget(NPC, Spawn)
  70. OfferQuest(NPC, Spawn, Delivery)
  71. end
  72. function Delivered(NPC, Spawn)
  73. conversation = CreateConversation()
  74. PlayFlavor(NPC, "voiceover/english/jodi/qey_village03/customerjodi002.mp3","","hello",2239606086,3876738451,Spawn)
  75. AddConversationOption(conversation, "Thanks for the coin, and good luck with the line.", "Reward")
  76. StartConversation(conversation, NPC, Spawn, "I'm so greatful! I would have never have made it. This line has barely moved a bolt! Please keep the change as a reward for your kind service.")
  77. end
  78. function Reward(NPC, Spawn)
  79. SetStepComplete(Spawn, Delivery, 2)
  80. end