9
3

SchmittyMcEricson.lua 7.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160
  1. --[[
  2. Script Name : SpawnScripts/Butcherblock/SchmittyMcEricson.lua
  3. Script Author : jakejp
  4. Script Date : 2018.05.29 10:05:02
  5. Script Purpose :
  6. :
  7. --]]
  8. require "SpawnScripts/Generic/PlayerHistory"
  9. local SchmittysSandals = 266
  10. function spawn(NPC)
  11. ProvidesQuest(NPC, SchmittysSandals)
  12. end
  13. function respawn(NPC)
  14. spawn(NPC)
  15. end
  16. function hailed(NPC, Spawn)
  17. FaceTarget(NPC, Spawn)
  18. local conversation = CreateConversation()
  19. if HasQuest(Spawn, SchmittysSandals) and GetQuestStep(Spawn, SchmittysSandals) < 6 then
  20. if GetQuestStep(Spawn, SchmittysSandals) == 1 then
  21. --on 1st part of quest
  22. Say(NPC, "Did you get everything on the list? I can't make me new sandals until ye come back with all the parts I need.")
  23. elseif GetQuestStep(Spawn, SchmittysSandals) == 2 then
  24. -- on 2nd part of quest
  25. Say(NPC, "Did you get everything on the list? I can't make me new sandals until ye come back with all the parts I need.")
  26. elseif GetQuestStep(Spawn, SchmittysSandals) == 3 then
  27. --on 3rd part of quest
  28. Say(NPC, "Did you get everything on the list? I can't make me new sandals until ye come back with all the parts I need.")
  29. elseif GetQuestStep(Spawn, SchmittysSandals) == 4 then
  30. --on 4th part of quest
  31. --PlayFlavor(NPC, "voiceover/english/voice_emotes/greetings/greetings_2_1002.mp3", "", "", 0, 0, Spawn)
  32. AddConversationOption(conversation, "Right, anyways I brought back all the parts you need.", "dlg_2_1")
  33. StartConversation(conversation, NPC, Spawn, "Phew! Something smells fishy! Oh, it's you... Sorry.")
  34. elseif GetQuestStep(Spawn, SchmittysSandals) == 5 then
  35. --on 5th part of quest
  36. local time = GetPlayerHistory(Spawn, HISTORY.BB_SCHMITTYSANDALS_STEP5_WAIT) + 300
  37. if os.time() < time then
  38. Say(NPC, "Sorry, friend. I still haven't finished the sandals. Give me a few more minutes, please.")
  39. elseif os.time() > time then
  40. SetStepComplete(Spawn, SchmittysSandals, 5)
  41. PlayFlavor(NPC, "voiceover/english/voice_emotes/greetings/greetings_1_1002.mp3", "", "", 0, 0, Spawn)
  42. AddConversationOption(conversation, "Sounds like a win-win situation to me!")
  43. StartConversation(conversation, NPC, Spawn, "Here you are. Some of me best work! Thanks again for your help. I probably never would have found me old sandals were it not fer you.")
  44. end
  45. end
  46. elseif HasCompletedQuest(Spawn, SchmittysSandals) then
  47. FaceTarget(NPC, Spawn)
  48. Say(NPC, "I'm so happy I found me old sandals, I could kick them off in a fit of joy.")
  49. elseif CanReceiveQuest(Spawn, SchmittysSandals) then
  50. AddConversationOption(conversation, "I beg your pardon? I was just saying hello.", "Option1")
  51. StartConversation(conversation, NPC, Spawn, "Oh, what? You wanna fight er somethin'?")
  52. else
  53. local choice = math.random(1,2)
  54. if choice == 1 then
  55. Say(NPC, "Whoops! I almost hit you with my pole. What a tragedy THAT would have been!")
  56. elseif choice == 2 then
  57. Say(NPC, "You don't know me. You think you're better than me?!")
  58. end
  59. end
  60. end
  61. function Option1(NPC, Spawn)
  62. FaceTarget(NPC, Spawn)
  63. local conversation = CreateConversation()
  64. AddConversationOption(conversation, "Are the fish not biting?", "Option2")
  65. AddConversationOption(conversation, "Don't blame me. Bye!")
  66. StartConversation(conversation, NPC, Spawn, "Ah, jeez. I'm sorry, friend. I didn't mean ta come at ya like that. You see, I'm just a poor fisherman who's fallen on hard times and is lookin' to blame everyone else for me problems besides meself.")
  67. end
  68. function Option2(NPC, Spawn)
  69. FaceTarget(NPC, Spawn)
  70. local conversation = CreateConversation()
  71. AddConversationOption(conversation, "How did you lose them?", "Option3")
  72. StartConversation(conversation, NPC, Spawn, "Oh no, the fishing is great. It's just... well, it may seem silly ta you but... I've gone and lost me sandals.")
  73. end
  74. function Option3(NPC, Spawn)
  75. FaceTarget(NPC, Spawn)
  76. local conversation = CreateConversation()
  77. AddConversationOption(conversation, "I see... So, can I help you find them?", "Option4")
  78. StartConversation(conversation, NPC, Spawn, "I dunno! One moment I'm standing here, doin' my job. You know, fishing and making sure the ale hasn't been poisoned. Next thing I know, I'm looking down at my bare feet. Twas the strangest thing.")
  79. end
  80. function Option4(NPC, Spawn)
  81. FaceTarget(NPC, Spawn)
  82. local conversation = CreateConversation()
  83. AddConversationOption(conversation, "Alright. What do you need to make the new sandals?", "GiveSchmittysSandals")
  84. AddConversationOption(conversation, "All this talk of ale and fish has gotten me hungry. I must go.")
  85. StartConversation(conversation, NPC, Spawn, "I appreciate the offer friend, but I've looked all over for 'em wit no luck at all. You know... I think I could use your help! I'll just make me some new sandals! Haha!")
  86. end
  87. function GiveSchmittysSandals(NPC, Spawn)
  88. OfferQuest(NPC, Spawn, SchmittysSandals)
  89. end
  90. function Option6(NPC, Spawn)
  91. FaceTarget(NPC, Spawn)
  92. local conversation = CreateConversation()
  93. AddConversationOption(conversation, "Off I go!")
  94. StartConversation(conversation, NPC, Spawn, "Excellent! All the things I need can be found around this bay. You shouldn't have much trouble finding them.")
  95. end
  96. function dlg_2_1(NPC, Spawn)
  97. FaceTarget(NPC, Spawn)
  98. conversation = CreateConversation()
  99. PlayFlavor(NPC, "", "", "", 0, 0, Spawn)
  100. AddConversationOption(conversation, "Remarkable... Though, what am I going to do with all these odd animal parts?", "dlg_2_2")
  101. AddConversationOption(conversation, "Actually, I can believe it. Here are the parts you asked for.")
  102. StartConversation(conversation, NPC, Spawn, "Huh? Ohhhh! For the sandals. Right, right. Well, yer not gonna believe this, but I found me ol' sandals! Turns out they were just buried under a pile o' sand! Haha!")
  103. end
  104. function dlg_2_2(NPC, Spawn)
  105. FaceTarget(NPC, Spawn)
  106. conversation = CreateConversation()
  107. PlayFlavor(NPC, "", "", "", 0, 0, Spawn)
  108. AddConversationOption(conversation, "Yeah, why don't you make the sandals anyway. I could always use them.", "dlg_2_3")
  109. StartConversation(conversation, NPC, Spawn, "Well, no sense in lettin' it all go ta waste now, right?")
  110. end
  111. function dlg_2_3(NPC, Spawn)
  112. FaceTarget(NPC, Spawn)
  113. conversation = CreateConversation()
  114. PlayFlavor(NPC, "", "", "", 0, 0, Spawn)
  115. AddConversationOption(conversation, "This is going to be a bit. Isn't it?", "dlg_2_4")
  116. StartConversation(conversation, NPC, Spawn, "That's a great idea! Now let's see here. This thread goes through that hole here...")
  117. end
  118. function dlg_2_4(NPC, Spawn)
  119. SetStepComplete(Spawn, SchmittysSandals, 4)
  120. FaceTarget(NPC, Spawn)
  121. conversation = CreateConversation()
  122. PlayFlavor(NPC, "", "", "", 0, 0, Spawn)
  123. AddConversationOption(conversation, "I'll be back.", "dlg_2_5")
  124. StartConversation(conversation, NPC, Spawn, "And that connects there... Aye. Come back in a few minutes. I'll have your sandals for you then.")
  125. end
  126. function StillWorking(NPC, Spawn)
  127. FaceTarget(NPC, Spawn)
  128. Say(NPC, "Sorry, friend. I still haven't finished the sandals. Give me a few more minutes, please.")
  129. end