SmithyFindlebop.lua 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116
  1. --[[
  2. Script Name : SpawnScripts/Baubbleshire/SmithyFindlebop.lua
  3. Script Purpose : Smithy Findlebop <Weaponsmith>
  4. Script Author : Scatman
  5. Script Date : 2009.09.27
  6. Script Notes : Added quest & updated dialog module. 2022.08.20 Dorbin
  7. --]]
  8. require "SpawnScripts/Generic/DialogModule"
  9. local MystratTails = 5439
  10. --dofile("SpawnScripts/Generic/GenericWeaponsmithVoiceOvers.lua") NOT NECESSARY FOR FINDLEBOP
  11. function spawn(NPC)
  12. SetPlayerProximityFunction(NPC, 8, "InRange", "LeaveRange")
  13. ProvidesQuest(NPC, MystratTails)
  14. end
  15. function respawn(NPC)
  16. spawn(NPC)
  17. end
  18. function InRange(NPC, Spawn)
  19. if GetFactionAmount(Spawn,11) <0 then
  20. FaceTarget(NPC, Spawn)
  21. PlayFlavor(NPC, "","","shakefist",0,0, Spawn)
  22. else
  23. if not HasCompletedQuest(Spawn, MystratTails) then
  24. if math.random(0, 100) <= 85 then
  25. PlayFlavor(NPC, "voiceover/english/smithy_findlebop/qey_village06/100_smithy_findlebop_findlebop_first_fd0d329e.mp3", "More dirt? How in Brell's name can I get this thing to work if I can't keep it clean?!", "grumble", 1928188613, 3260712092, Spawn)
  26. end
  27. else
  28. if math.random(0, 100) <= 25 then
  29. local choice = MakeRandomInt(1, 2)
  30. FaceTarget(NPC, Spawn)
  31. if choice == 1 then
  32. PlayFlavor(NPC, "voiceover/english/smithy_findlebop/qey_village06/100_smithy_findlebop_multhail1_aa73007b.mp3", "Now, if I can only figure out how the sprocket will fit in this device, I'll be set! Why are you interrupting my work? Can't you see I'm busy? Go away!", "scream", 3823811804, 70891212, Spawn)
  33. else
  34. PlayFlavor(NPC, "voiceover/english/smithy_findlebop/qey_village06/100_smithy_findlebop_multhail2_5d0f29cb.mp3", "Now, if I can only figure out how the sprocket will fit in this device, I'll be set! Why are you interrupting my work? Can't you see I'm busy?", "frustrated", 446470782, 3454872230, Spawn)
  35. end
  36. end
  37. end
  38. end
  39. end
  40. function LeaveRange(NPC, Spawn)
  41. end
  42. function hailed(NPC, Spawn)
  43. if GetFactionAmount(Spawn,11) <0 then
  44. FaceTarget(NPC, Spawn)
  45. PlayFlavor(NPC, "","","shakefist",0,0, Spawn)
  46. else
  47. if not HasCompletedQuest(Spawn, MystratTails) then
  48. FaceTarget(NPC, Spawn)
  49. Begin(NPC,Spawn)
  50. else
  51. Callout(NPC,Spawn)
  52. end
  53. end
  54. end
  55. function Callout(NPC,Spawn)
  56. local randomCall2 = MakeRandomInt(1, 2)
  57. FaceTarget(NPC, Spawn)
  58. if randomCall2 == 1 then
  59. PlayFlavor(NPC, "voiceover/english/smithy_findlebop/qey_village06/100_smithy_findlebop_multhail1_aa73007b.mp3", "Now, if I can only figure out how the sprocket will fit in this device, I'll be set! Why are you interrupting my work? Can't you see I'm busy? Go away!", "scream", 3823811804, 70891212, Spawn)
  60. elseif randomCall2 == 2 then
  61. PlayFlavor(NPC, "voiceover/english/smithy_findlebop/qey_village06/100_smithy_findlebop_multhail2_5d0f29cb.mp3", "Now, if I can only figure out how the sprocket will fit in this device, I'll be set! Why are you interrupting my work? Can't you see I'm busy?", "frustrated", 446470782, 3454872230, Spawn)
  62. end
  63. end
  64. function GotAnyWork(NPC, Spawn)
  65. FaceTarget(NPC, Spawn)
  66. Dialog.New(NPC, Spawn)
  67. Dialog.AddDialog("No, NO! I'm too busy to give you a task! GET OUT! Get out, before I lose my train of thought! Now where was I? Oh, yes, if only I had something to scrub this bit of metal...")
  68. PlayFlavor(NPC, "","","no",0,0, Spawn)
  69. Dialog.AddVoiceover("voiceover/english/smithy_findlebop/qey_village06/smithyfindlebop001.mp3",3069436891,2776154152)
  70. Dialog.AddOption("I could look for something to clean that for you.", "OfferQuest1")
  71. Dialog.AddOption("Yeesh, sorry I asked.")
  72. Dialog.Start()
  73. end
  74. function OfferQuest1(NPC, Spawn)
  75. FaceTarget(NPC, Spawn)
  76. OfferQuest(NPC, Spawn, MystratTails)
  77. end
  78. function Begin(NPC, Spawn)
  79. FaceTarget(NPC, Spawn)
  80. Dialog.New(NPC, Spawn)
  81. Dialog.AddDialog("Now, if only I could only figure out how this sprocket will fit in this device, it'll be set. Oh! Yes? Why are you interrupting my work? Can't you SEE I'M BUSY HERE?")
  82. PlayFlavor(NPC, "","","frustrated",0,0, Spawn)
  83. Dialog.AddVoiceover("voiceover/english/smithy_findlebop/qey_village06/smithyfindlebop000.mp3",1173629486, 2280866988)
  84. if not HasQuest(Spawn, MystratTails) and not HasCompletedQuest(Spawn, MystratTails) then
  85. Dialog.AddOption("You seem very preoccupied. Need any help around here?", "GotAnyWork")
  86. elseif HasQuest(Spawn, MystratTails) and GetQuestStep(Spawn, MystratTails) == 2 then
  87. Dialog.AddOption("Here is a nice Mystrat tail for you.", "RatTail_Handin")
  88. end
  89. Dialog.AddOption("Sorry. Just passing by.")
  90. Dialog.Start()
  91. end
  92. function RatTail_Handin(NPC, Spawn)
  93. SetStepComplete(Spawn, MystratTails, 2)
  94. FaceTarget(NPC, Spawn)
  95. Dialog.New(NPC, Spawn)
  96. Dialog.AddDialog("Yes, YES! This tail will do the trick! Very bristley, indeed. Good job! Perhaps you weren't a bother afterall. Let me pay you for your trouble. It is the least I could do. Sorry for being rude earlier.")
  97. PlayFlavor(NPC, "","","thanks",0,0, Spawn)
  98. Dialog.AddVoiceover("voiceover/english/smithy_findlebop/qey_village06/smithyfindlebop003.mp3",4033931152,227104096)
  99. Dialog.AddOption("Thanks, I'll be sure not to step on any of your sprockets on my way out.")
  100. Dialog.Start()
  101. end