9
3

TibbyCopperpot.lua 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  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. end
  33. end
  34. function Dialog1(NPC, Spawn)
  35. FaceTarget(NPC, Spawn)
  36. Dialog.New(NPC, Spawn)
  37. PlayVoice(NPC, "voiceover/english/voice_emotes/greetings/greetings_1_1005.mp3", 0, 0, Spawn)
  38. 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.")
  39. if not HasQuest(Spawn,Cake) and not HasCompletedQuest(Spawn,Cake) then
  40. Dialog.AddOption("You must be pretty busy then. Anything I can help with?", "Dialog2")
  41. end
  42. if GetQuestStep(Spawn,Cake)==2 then
  43. Dialog.AddOption("Harold was quite pleased the variety of baked goods you has me deliver.", "Dialog3")
  44. end
  45. Dialog.AddOption("Smells great. Don't let me interrupt!")
  46. Dialog.Start()
  47. end
  48. function Dialog2(NPC, Spawn)
  49. FaceTarget(NPC, Spawn)
  50. Dialog.New(NPC, Spawn)
  51. 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?")
  52. PlayFlavor(NPC,"","","agree",0,0,Spawn)
  53. if HasQuest(Spawn,5527) or HasCompletedQuest(Spawn,5527) then --Extra fluff if player met Tara in Elddar Grove
  54. 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")
  55. end
  56. Dialog.AddOption("I would be happy to.","Job")
  57. Dialog.AddOption("Another time, perhaps.")
  58. Dialog.Start()
  59. end
  60. function Job(NPC,Spawn)
  61. FaceTarget(NPC,Spawn)
  62. OfferQuest(NPC, Spawn,Cake)
  63. end
  64. function Dialog3(NPC, Spawn)
  65. FaceTarget(NPC, Spawn)
  66. Dialog.New(NPC, Spawn)
  67. 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!")
  68. PlayFlavor(NPC,"","","happy",0,0,Spawn)
  69. Dialog.AddOption("Glad I could help.","JobDone")
  70. Dialog.Start()
  71. end
  72. function JobDone(NPC, Spawn)
  73. FaceTarget(NPC, Spawn)
  74. SetStepComplete(Spawn,Cake, 2)
  75. end
  76. function RandomGreeting(NPC, Spawn)
  77. local choice = MakeRandomInt(1,3)
  78. if choice == 1 then
  79. PlayVoice(NPC, "voiceover/english/voice_emotes/greetings/greetings_2_1005.mp3", 0, 0, Spawn)
  80. elseif choice == 2 then
  81. PlayVoice(NPC, "voiceover/english/voice_emotes/greetings/greetings_1_1005.mp3", 0, 0, Spawn)
  82. elseif choice == 3 then
  83. PlayVoice(NPC, "voiceover/english/voice_emotes/greetings/greetings_3_1005.mp3", 0, 0, Spawn)
  84. end
  85. end