9
3

CaylessChambers.lua 3.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. --[[
  2. Script Name : SpawnScripts/Nettleville/CaylessChambers.lua
  3. Script Purpose : Cayless Chambers <Armorsmith>
  4. Script Author : Dorbin
  5. Script Date : 2022.06.25
  6. Script Notes :
  7. --]]
  8. require "SpawnScripts/Generic/DialogModule"
  9. function spawn(NPC)
  10. SetPlayerProximityFunction(NPC, 10, "InRange", "LeaveRange")
  11. ProvidesQuest(NPC,5599)
  12. end
  13. function respawn(NPC)
  14. spawn(NPC)
  15. end
  16. function InRange(NPC, Spawn)
  17. if GetFactionAmount(Spawn,11)<0 then
  18. FaceTarget(NPC, Spawn)
  19. PlayFlavor(NPC, "", "", "glare", 0, 0, Spawn)
  20. else
  21. if not HasQuest(Spawn, 5599) and not HasCompletedQuest(Spawn,5599)then
  22. local chance = math.random(0, 100)
  23. if chance <= 80 then
  24. local choice = MakeRandomInt(1,2)
  25. FaceTarget(NPC, Spawn)
  26. if choice == 1 then
  27. PlayFlavor(NPC, "voiceover/english/smith_cayless_chambers/qey_village01/qey_village01_blacksmith_cayless_chambers_callout1_e4015547.mp3", "So busy... I'll never have time to visit the Claymore Monument. Could you spare a moment?", "sigh", 3001484550, 1530588244, Spawn)
  28. elseif choice == 2 then
  29. PlayFlavor(NPC, "voiceover/english/smith_cayless_chambers/qey_village01/qey_village01_blacksmith_cayless_chambers_multhail2_ff591044.mp3", "I can trust you wield a pencil as well as you yield a sword. Are you interested?", "hello", 1977979265, 3455148298, Spawn, 0)
  30. end
  31. end
  32. elseif HasQuest(Spawn, 5599)then
  33. FaceTarget(NPC, Spawn)
  34. PlayFlavor(NPC, "voiceover/english/smith_cayless_chambers/qey_village01/qey_village01_blacksmith_cayless_chambers_multhail4_e6c82589.mp3", "Are you finished? I hope you don't need another pencil. That was my last one! Now hurry and finish my sketch!", "ponder", 933986448, 3135769704, Spawn, 0)
  35. end
  36. end
  37. end
  38. function hailed(NPC, Spawn)
  39. if GetFactionAmount(Spawn,11)<0 then
  40. FaceTarget(NPC, Spawn)
  41. PlayFlavor(NPC, "", "", "noway", 0, 0, Spawn)
  42. else
  43. FaceTarget(NPC, Spawn)
  44. Dialog.New(NPC, Spawn)
  45. Dialog.AddDialog("Welcome to the Knight's Edge. Looking for fine quality armors? I'm your lady. Place your order and stand back.")
  46. Dialog.AddVoiceover("voiceover/english/smith_cayless_chambers/qey_village01/smithcayless000.mp3", 360119992, 780476339)
  47. if not HasCompletedQuest (Spawn, 5599) and not HasQuest (Spawn, 5599) then
  48. Dialog.AddOption("Have any tasks you need completed? I've got some time if you need a hand.","Start")
  49. end
  50. if GetQuestStep (Spawn, 5599)==2 then
  51. Dialog.AddOption("Here is the sketch of the Claymore Monument. I hope it works for your needs.","Delivered")
  52. end
  53. Dialog.AddOption("Just looking.")
  54. Dialog.Start()
  55. end
  56. end
  57. function Start(NPC, Spawn)
  58. FaceTarget(NPC, Spawn)
  59. Dialog.New(NPC, Spawn)
  60. PlayFlavor(NPC, "", "", "nod", 0, 0, Spawn)
  61. Dialog.AddDialog("Looking for work are we? I do have a task for you but I can't promise it pays heavy coin. But, at least it shall fill some space in your coin purse.")
  62. Dialog.AddVoiceover("voiceover/english/smith_cayless_chambers/qey_village01/smithcayless001.mp3", 3914052449, 3223841210)
  63. Dialog.AddOption("I would be happy for the work. Tell me what needs doing and I'll do it for you.", "QuestBegin")
  64. Dialog.AddOption("Hmm, I'm actually looking for something that pays well. Perhaps you will find someone else.")
  65. Dialog.Start()
  66. end
  67. function QuestBegin (NPC, Spawn)
  68. FaceTarget(NPC, Spawn)
  69. OfferQuest(NPC, Spawn, 5599)
  70. end
  71. function Delivered(NPC, Spawn)
  72. FaceTarget(NPC, Spawn)
  73. Dialog.New(NPC, Spawn)
  74. PlayFlavor(NPC, "", "", "smile", 0, 0, Spawn)
  75. Dialog.AddDialog("Great work! This sketch will help me copy every detail of the original sword. As for payment, this is all I can afford.")
  76. SetStepComplete(Spawn, 5599, 2)
  77. Dialog.AddVoiceover("voiceover/english/smith_cayless_chambers/qey_village01/smithcayless003.mp3", 1409147876, 2669680807)
  78. Dialog.AddOption("This is fine. I'm just glad I could help.")
  79. Dialog.AddOption("This sketch easel is more than enough. Thank you.")
  80. Dialog.Start()
  81. end