Baynor.lua 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  1. --[[
  2. Script Name : SpawnScripts/WillowWood/Baynor.lua
  3. Script Purpose : Baynor <Armorsmith>
  4. Script Author : Dorbin
  5. Script Date : 2022.19.2022
  6. Script Notes :
  7. --]]
  8. --dofile("SpawnScripts/Generic/GenericArmorsmithVoiceOvers.lua")
  9. local Delivery = 5482
  10. function spawn(NPC)
  11. SetPlayerProximityFunction(NPC, 8, "InRange", "LeaveRange")
  12. ProvidesQuest(NPC, Delivery)
  13. end
  14. function InRange(NPC, Spawn) --Quest Callout
  15. if GetLevel (Spawn) <=5 then
  16. if math.random(1, 100) <= 60 then
  17. FaceTarget(NPC, Spawn)
  18. PlayFlavor(NPC, "voiceover/english/blacksmith_baynor/qey_village05/100_blacksmith_baynor_multhail2_9300848f.mp3", "Be careful, friend. There are many things in here that are sharp, heavy, and scalding hot wares in my shop. Now, what is it you need?", "", 4126996742, 4172113169, Spawn)
  19. end
  20. elseif not HasCompletedQuest (Spawn, Delivery) and not HasQuest (Spawn, Delivery) and GetLevel(Spawn) >=6 then
  21. if math.random(1, 100) <= 60 then
  22. FaceTarget(NPC, Spawn)
  23. PlayFlavor(NPC, "voiceover/english/blacksmith_baynor/qey_village05/100_blacksmith_baynor_callout_580dcbd9.mp3", "Ugh! Bent the tongs again! I must have Ironmallet fix them. Greetings adventurer. What do you need?","frustrated", 3453022457, 3858112584, Spawn)
  24. end
  25. else
  26. if math.random(1, 100) <= 50 then
  27. choice = math.random(1,2)
  28. if choice ==1 then
  29. PlayFlavor(NPC, "voiceover/english/blacksmith_baynor/qey_village05/100_blacksmith_baynor_multhail2_9300848f.mp3", "Be careful, friend. There are many things in here that are sharp, heavy, and scalding hot wares in my shop. Now, what is it you need?", "", 4126996742, 4172113169, Spawn)
  30. else
  31. FaceTarget(NPC, Spawn)
  32. PlayFlavor(NPC, "", "", "", 0, 0, Spawn)
  33. end
  34. end
  35. end
  36. end
  37. function respawn(NPC)
  38. spawn(NPC)
  39. end
  40. function hailed(NPC, Spawn)
  41. FaceTarget(NPC, Spawn)
  42. if GetLevel (Spawn) <=5 then
  43. PlayFlavor(NPC, "voiceover/english/blacksmith_baynor/qey_village05/100_blacksmith_baynor_multhail2_9300848f.mp3", "Be careful, friend. There are many things in here that are sharp, heavy, and scalding hot wares in my shop. Now, what is it you need?", "", 4126996742, 4172113169, Spawn)
  44. else
  45. conversation = CreateConversation()
  46. PlayFlavor(NPC, "voiceover/english/blacksmith_baynor/qey_village05/blacksmithbaynor000.mp3", "", "scold", 2763232852, 1393139984, Spawn)
  47. if not HasCompletedQuest (Spawn, Delivery) and not HasQuest (Spawn, Delivery) then
  48. AddConversationOption(conversation, "Got any work?", "Tongs")
  49. end
  50. if GetQuestStep(Spawn, Delivery)==2 then
  51. AddConversationOption(conversation, "Here are your repaired tongs.", "TongsFinish")
  52. end
  53. AddConversationOption(conversation, "I'll be careful. Thanks.")
  54. StartConversation(conversation, NPC, Spawn, "Be careful there, friend. There are many things in here that are sharp, heavy, and scalding hot.")
  55. end
  56. function Tongs(NPC, Spawn)
  57. conversation = CreateConversation()
  58. PlayFlavor(NPC, "voiceover/english/blacksmith_baynor/qey_village05/blacksmithbaynor001.mp3", "", "", 3121819439, 2362304035, Spawn)
  59. AddConversationOption(conversation, "Why not fix them yourself?", "Tongs2")
  60. AddConversationOption(conversation, "I don't have time. Sorry.")
  61. StartConversation(conversation, NPC, Spawn, "A helpful one, you are! You can run an errand for me if you're not too busy. I would go, but I'm swampped. You see, I was finishing up an order of blades, and in my haste I smashed my favorite tongs. I must say, my hammer did quite a job on them! Could you take them to Graystone Yard to have them fixed?")
  62. end
  63. function Tongs2(NPC, Spawn)
  64. conversation = CreateConversation()
  65. PlayFlavor(NPC, "voiceover/english/blacksmith_baynor/qey_village05/blacksmithbaynor002.mp3", "", "", 4282883595, 1382929018, Spawn)
  66. AddConversationOption(conversation, "I'll take them for you", "QuestBegin")
  67. AddConversationOption(conversation, "I don't have time. Sorry.")
  68. StartConversation(conversation, NPC, Spawn, "Hmm, good question. I guess I'm supersticious. A long time ago, Ironmallet made these tongs for me. When they break, I have him fix them. I've tried fixing them, they never have the same grip! Please run these tongs to Ironmallet. I'll pay you for your troubles.")
  69. end
  70. function QuestBegin (NPC, Spawn)
  71. FaceTarget(NPC, Spawn)
  72. OfferQuest(NPC, Spawn, Delivery)
  73. end
  74. function TongsFinish(NPC, Spawn)
  75. PlayFlavor(NPC, "voiceover/english/blacksmith_baynor/qey_village05/blacksmithbaynor003.mp3", "", "thank", 4052925746, 2525148033, Spawn)
  76. FaceTarget(NPC, Spawn)
  77. conversation = CreateConversation()
  78. AddConversationOption(conversation, "Thanks, and be careful with those tongs.", "Reward")
  79. StartConversation(conversation, NPC, Spawn, "Thank you, friend! Ah, yes. These tongs work as well as the day Ironmallet gave them to me! Please, take a bit of coin for your trouble. Farewell.")
  80. end
  81. function Reward(NPC, Spawn)
  82. SetStepComplete(Spawn, Delivery, 2)
  83. end
  84. end