Soulforge.lua 4.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  1. --[[
  2. Script Name : SpawnScripts/Graystone/Steelforge.lua
  3. Script Purpose : Steelforge <Weaponsmith>
  4. Script Author : Dorbin
  5. Script Date : 2022.03.07
  6. Script Notes :
  7. --]]
  8. local Delivery = 5502
  9. function spawn(NPC)
  10. SetPlayerProximityFunction(NPC, 8, "InRange", "LeaveRange")
  11. ProvidesQuest(NPC, Delivery)
  12. SetInfoStructString(NPC, "action_state", "tapfoot")
  13. end
  14. function InRange(NPC, Spawn) --Quest Callout
  15. if not HasCompletedQuest (Spawn, Delivery) and not HasQuest (Spawn, Delivery) and GetLevel(Spawn) >=6 then
  16. if math.random(1, 100) <= 70 then
  17. FaceTarget(NPC, Spawn)
  18. PlayFlavor(NPC, "voiceover/english/weaponsmith_soulforge/qey_village03/100_weaponsmith_barbarian_soulfoge_callout_f8f8f127.mp3", "I sure could use some more materials. Oh! Why, hello! Are you interested in weapons? Or perhaps some work?", "hello", 190942341, 2950153557, Spawn)
  19. end
  20. else
  21. if math.random(1, 100) <= 70 then
  22. PlayFlavor(NPC, "", "", "hello", 0, 0, Spawn)
  23. end
  24. end
  25. end
  26. function respawn(NPC)
  27. spawn(NPC)
  28. end
  29. function hailed(NPC, Spawn)
  30. FaceTarget(NPC, Spawn)
  31. conversation = CreateConversation()
  32. PlayFlavor(NPC, "voiceover/english/weaponsmith_soulforge/qey_village03/weaponsmithsoulforge000.mp3", "", "hello", 549167891, 890595853, Spawn)
  33. if not HasCompletedQuest (Spawn, Delivery) and not HasQuest (Spawn, Delivery) and GetLevel(Spawn) >=6 then
  34. AddConversationOption(conversation, "Can I assist you with anything around the shop?", "Snakes")
  35. end
  36. if GetQuestStep(Spawn, Delivery)==2 then
  37. AddConversationOption(conversation, "I'm back! I've got the skins you requested!", "SnakesFinish")
  38. end
  39. AddConversationOption(conversation, "I'm just looking around.")
  40. StartConversation(conversation, NPC, Spawn, "If steel is what you seek traveler, then look no further!")
  41. end
  42. function Snakes(NPC, Spawn)
  43. conversation = CreateConversation()
  44. PlayFlavor(NPC, "voiceover/english/weaponsmith_soulforge/qey_village03/weaponsmithsoulforge001.mp3", "", "", 1346634645, 774618868, Spawn)
  45. AddConversationOption(conversation, "Of course I am, sir.", "Snakes2")
  46. AddConversationOption(conversation, "I don't have time. Sorry.")
  47. StartConversation(conversation, NPC, Spawn, "To tell the truth, I need someone to fetch these skins for my handles. Do you think you're up to the task, young one?")
  48. end
  49. function Snakes2(NPC, Spawn)
  50. conversation = CreateConversation()
  51. PlayFlavor(NPC, "voiceover/english/weaponsmith_soulforge/qey_village03/weaponsmithsoulforge002.mp3", "", "nod", 2117434498, 740221965, Spawn)
  52. AddConversationOption(conversation, "I'll return with the skins soon.", "QuestBegin")
  53. AddConversationOption(conversation, "Snakes!? I hate snakes!", "Snakes3")
  54. AddConversationOption(conversation, "Err.. I'm not interested in going to the Caves. Good day.")
  55. StartConversation(conversation, NPC, Spawn, "Humor me then. Go skin some cave snakes in the caves north of the Baubbleshire. Bring me back the skins and I'll what I can do about paying you.")
  56. end
  57. function Snakes3(NPC, Spawn)
  58. conversation = CreateConversation()
  59. PlayFlavor(NPC, "voiceover/english/weaponsmith_soulforge/qey_village03/weaponsmithsoulforge004.mp3", "", "frustrated", 3067377267, 3322501955, Spawn)
  60. AddConversationOption(conversation, "I'll return with the skins soon.", "QuestBegin")
  61. AddConversationOption(conversation, "You'll have to find someone else. Sorry.")
  62. StartConversation(conversation, NPC, Spawn, "Oh all right! I don't have time to deal with youngling drama. Just bring me back as many as you see fit.")
  63. end
  64. function QuestBegin (NPC, Spawn)
  65. FaceTarget(NPC, Spawn)
  66. OfferQuest(NPC, Spawn, Delivery)
  67. end
  68. function SnakesFinish(NPC, Spawn)
  69. PlayFlavor(NPC, "voiceover/english/weaponsmith_soulforge/qey_village03/weaponsmithsoulforge005.mp3", "", "ponder", 3067377267, 3322501955, Spawn) --DOESN'T WORK (Wrong key)
  70. FaceTarget(NPC, Spawn)
  71. conversation = CreateConversation()
  72. AddConversationOption(conversation, "Ok, well, I'll have to make due with that.", "Reward")
  73. StartConversation(conversation, NPC, Spawn, "Let's have a look, shall we? Hmm ... These skins are damaged. I can't pay you as much as I'd like. This will have to do.")
  74. end
  75. function Reward(NPC, Spawn)
  76. SetStepComplete(Spawn, Delivery, 2)
  77. end