TibbyCopperpot.lua 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  1. --[[
  2. Script Name : SpawnScripts/SouthQeynos/TibbyCopperpot.lua
  3. Script Purpose : Tibby Copperpot <Baker>
  4. Script Author : Dorbin
  5. Script Date : 2022.06.02
  6. Script Notes : Quest dialog is completely frabricated
  7. --]]
  8. local Cake = 5580
  9. require "SpawnScripts/Generic/DialogModule"
  10. function spawn(NPC)
  11. SetPlayerProximityFunction(NPC, 10, "InRange", "LeaveRange")
  12. ProvidesQuest(NPC,Cake)
  13. end
  14. function respawn(NPC)
  15. spawn(NPC)
  16. end
  17. function InRange(NPC, Spawn)
  18. end
  19. function LeaveRange(NPC, Spawn)
  20. end
  21. function hailed(NPC, Spawn)
  22. FaceTarget(NPC, Spawn)
  23. if GetFactionAmount(Spawn,11) <0 then
  24. choice = math.random(1,2)
  25. if choice == 1 then
  26. PlayFlavor(NPC, "", "", "shakefist", 2088886924, 3736631596, Spawn)
  27. elseif choice == 2 then
  28. PlayFlavor(NPC, "", "", "heckno", 1584866727, 581589457, Spawn)
  29. end
  30. else
  31. Dialog1(NPC, Spawn)
  32. -- RandomGreeting(NPC, Spawn)
  33. end
  34. end
  35. function Dialog1(NPC, Spawn)
  36. FaceTarget(NPC, Spawn)
  37. Dialog.New(NPC, Spawn)
  38. PlayVoice(NPC, "voiceover/english/voice_emotes/greetings/greetings_1_1005.mp3", 0, 0, Spawn)
  39. Dialog.AddDialog("I sure do love to cook. Yummy baked goods and cakes. I make my sister do all the selling. To tell you the truth I think she likes it.")
  40. if not HasQuest(Spawn,Cake) then
  41. Dialog.AddOption("You must be pretty busy then. Anything I can help with?", "Dialog2")
  42. end
  43. if GetQuestStep(Spawn,Cake)==2 then
  44. Dialog.AddOption("Harold was quite pleased the variety of baked goods you has me deliver.", "Dialog3")
  45. end
  46. Dialog.AddOption("Smells great. Don't let me interrupt!")
  47. Dialog.Start()
  48. end
  49. function Dialog2(NPC, Spawn)
  50. FaceTarget(NPC, Spawn)
  51. Dialog.New(NPC, Spawn)
  52. Dialog.AddDialog("Oh yes. I have all these deliveries to make but also all this baking to do. Our lovely Tara use to come over and do all the deliveries, but she recently became an initiate with the Silent Fist. She just isn't around anymore and we haven't found anyone else to help. Would you have the time to make a delivery for me?")
  53. PlayFlavor(NPC,"","","agree",0,0,Spawn)
  54. if HasQuest(Spawn,5527) or HasCompletedQuest(Spawn,5527) then --Extra fluff if player met Tara in Elddar Grove
  55. Dialog.AddOption("I've actually met Tara. She seemed a bit homesick, but steadfast in her training. I would gladly help in her stead.","Job")
  56. end
  57. Dialog.AddOption("I would be happy to.","Job2")
  58. Dialog.AddOption("Another time, perhaps.")
  59. Dialog.Start()
  60. end
  61. function Job(NPC,Spawn)
  62. FaceTarget(NPC,Spawn)
  63. OfferQuest(NPC, Spawn,Cake)
  64. end
  65. function Dialog3(NPC, Spawn)
  66. FaceTarget(NPC, Spawn)
  67. Dialog.New(NPC, Spawn)
  68. Dialog.AddDialog("Lovely! Hopefully we can come to an agreement with Irontoes East for more in the future. You've saved me the time I needed here in the kitchen. Please, take these brews and baked breads as our thanks. Good day to you!")
  69. PlayFlavor(NPC,"","","happy",0,0,Spawn)
  70. Dialog.AddOption("Glad I could help.","JobDone")
  71. Dialog.Start()
  72. end
  73. function JobDone(NPC, Spawn)
  74. FaceTarget(NPC, Spawn)
  75. SetStepComplete(Spawn,Cake, 2)
  76. end
  77. function RandomGreeting(NPC, Spawn)
  78. local choice = MakeRandomInt(1,3)
  79. if choice == 1 then
  80. PlayVoice(NPC, "voiceover/english/voice_emotes/greetings/greetings_2_1005.mp3", 0, 0, Spawn)
  81. elseif choice == 2 then
  82. PlayVoice(NPC, "voiceover/english/voice_emotes/greetings/greetings_1_1005.mp3", 0, 0, Spawn)
  83. elseif choice == 3 then
  84. PlayVoice(NPC, "voiceover/english/voice_emotes/greetings/greetings_3_1005.mp3", 0, 0, Spawn)
  85. end
  86. end