Baynor.lua 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  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. SetInfoStructString(NPC, "action_state", "metalworking_idle")
  14. end
  15. function InRange(NPC, Spawn) --Quest Callout
  16. if GetLevel (Spawn) <=5 then
  17. if math.random(1, 100) <= 60 then
  18. FaceTarget(NPC, Spawn)
  19. 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)
  20. end
  21. elseif not HasCompletedQuest (Spawn, Delivery) and not HasQuest (Spawn, Delivery) and GetLevel(Spawn) >=6 then
  22. if math.random(1, 100) <= 60 then
  23. FaceTarget(NPC, Spawn)
  24. 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)
  25. end
  26. else
  27. if math.random(1, 100) <= 50 then
  28. choice = math.random(1,2)
  29. if choice ==1 then
  30. 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)
  31. else
  32. FaceTarget(NPC, Spawn)
  33. PlayFlavor(NPC, "", "", "", 0, 0, Spawn)
  34. end
  35. end
  36. end
  37. end
  38. function respawn(NPC)
  39. spawn(NPC)
  40. end
  41. function hailed(NPC, Spawn)
  42. FaceTarget(NPC, Spawn)
  43. if GetLevel (Spawn) <=5 then
  44. 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)
  45. else
  46. conversation = CreateConversation()
  47. PlayFlavor(NPC, "voiceover/english/blacksmith_baynor/qey_village05/blacksmithbaynor000.mp3", "", "scold", 2763232852, 1393139984, Spawn)
  48. if not HasCompletedQuest (Spawn, Delivery) and not HasQuest (Spawn, Delivery) then
  49. AddConversationOption(conversation, "Got any work?", "Tongs")
  50. end
  51. if GetQuestStep(Spawn, Delivery)==2 then
  52. AddConversationOption(conversation, "Here are your repaired tongs.", "TongsFinish")
  53. end
  54. AddConversationOption(conversation, "I'll be careful. Thanks.")
  55. StartConversation(conversation, NPC, Spawn, "Be careful there, friend. There are many things in here that are sharp, heavy, and scalding hot.")
  56. end
  57. function Tongs(NPC, Spawn)
  58. conversation = CreateConversation()
  59. PlayFlavor(NPC, "voiceover/english/blacksmith_baynor/qey_village05/blacksmithbaynor001.mp3", "", "", 3121819439, 2362304035, Spawn)
  60. AddConversationOption(conversation, "Why not fix them yourself?", "Tongs2")
  61. AddConversationOption(conversation, "I don't have time. Sorry.")
  62. 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?")
  63. end
  64. function Tongs2(NPC, Spawn)
  65. conversation = CreateConversation()
  66. PlayFlavor(NPC, "voiceover/english/blacksmith_baynor/qey_village05/blacksmithbaynor002.mp3", "", "", 4282883595, 1382929018, Spawn)
  67. AddConversationOption(conversation, "I'll take them for you", "QuestBegin")
  68. AddConversationOption(conversation, "I don't have time. Sorry.")
  69. 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.")
  70. end
  71. function QuestBegin (NPC, Spawn)
  72. FaceTarget(NPC, Spawn)
  73. OfferQuest(NPC, Spawn, Delivery)
  74. end
  75. function TongsFinish(NPC, Spawn)
  76. PlayFlavor(NPC, "voiceover/english/blacksmith_baynor/qey_village05/blacksmithbaynor003.mp3", "", "thank", 4052925746, 2525148033, Spawn)
  77. FaceTarget(NPC, Spawn)
  78. conversation = CreateConversation()
  79. AddConversationOption(conversation, "Thanks, and be careful with those tongs.", "Reward")
  80. 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.")
  81. end
  82. function Reward(NPC, Spawn)
  83. SetStepComplete(Spawn, Delivery, 2)
  84. end
  85. end