KnightCaptainSalomar.lua 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  1. --[[
  2. Script Name : SpawnScripts/Graystone/Knight-CaptainSalomar.lua
  3. Script Purpose : Knight-Captain Salomar
  4. Script Author : Dorbin
  5. Script Date : 2022.03.09
  6. Script Notes : Auto-Generated Conversation from PacketParser Data
  7. --]]
  8. local OakGate = 5504
  9. function spawn(NPC)
  10. ProvidesQuest(NPC, 5504)
  11. SetPlayerProximityFunction(NPC, 7, "InRange", "LeaveRange")
  12. end
  13. function InRange(NPC, Spawn) --Quest Callout
  14. if math.random(1, 100) <= 70 then
  15. if not HasCompletedQuest (Spawn, OakGate) and not HasQuest (Spawn, OakGate) then
  16. choice = math.random(1,2)
  17. if choice ==1 then
  18. PlayFlavor(NPC, "voiceover/english/captain_salomar/qey_village03/100_guard_captain_human_salomar_multhail2_4196ff15.mp3", "Well met! We could indeed your assistance, good adventurer!", "salute", 4231390538, 1602293868, Spawn)
  19. else
  20. PlayFlavor(NPC, "voiceover/english/captain_salomar/qey_village03/100_guard_captain_human_salomar_multhail1_2d65b2d1.mp3", "Ah ... on second thought you had better broaden your training before serving the Qeynos Guard. Good day, citizen!", "", 138672311, 3107129991, Spawn)
  21. end
  22. else
  23. choice = math.random(1,2)
  24. if choice ==1 then
  25. PlayFlavor(NPC, "", "", "salute", 0, 0, Spawn)
  26. else
  27. PlayFlavor(NPC, "", "", "attention", 0, 0, Spawn)
  28. end
  29. end
  30. end
  31. end
  32. function hailed(NPC, Spawn)
  33. conversation = CreateConversation()
  34. FaceTarget(NPC, Spawn)
  35. PlayFlavor(NPC, "voiceover/english/captain_salomar/qey_village03/captainsalomar000.mp3", "", "", 2258693446, 3021950674, Spawn)
  36. if GetQuestStep (Spawn, OakGate)==2 then
  37. AddConversationOption(conversation, "The Oakmyst Forest gate appears to be intact.", "Finished")
  38. end
  39. if not HasCompletedQuest (Spawn, OakGate) and not HasQuest (Spawn, OakGate) then
  40. AddConversationOption(conversation, "The tavern does seem to have its fair share of rough housing.","Graystone")
  41. end
  42. AddConversationOption(conversation, "Glad to have you here anyway.")
  43. StartConversation(conversation, NPC, Spawn, "I'm afraid my men are only here to deal with city buisness. Bar room brawls are a matter for the village to handle.")
  44. end
  45. function Graystone(NPC, Spawn)
  46. conversation = CreateConversation()
  47. FaceTarget(NPC, Spawn)
  48. PlayFlavor(NPC, "voiceover/english/captain_salomar/qey_village03/captainsalomar001.mp3","","",1098392922,2954030291,Spawn)
  49. AddConversationOption(conversation, "What is The Graystone Watch?","WhatWatch")
  50. StartConversation(conversation, NPC, Spawn, "You mean like The Frozen Tundra Tavern. Ah, its a rough place. Don't expect any extra protection from The Graystone Watch. Bah!")
  51. end
  52. function WhatWatch(NPC, Spawn)
  53. conversation = CreateConversation()
  54. FaceTarget(NPC, Spawn)
  55. PlayFlavor(NPC, "voiceover/english/captain_salomar/qey_village03/captainsalomar002.mp3","","",78744458,3687664161,Spawn)
  56. AddConversationOption(conversation, "Can I join them?","JoinWatch")
  57. AddConversationOption(conversation, "They do what they must. Good day.")
  58. StartConversation(conversation, NPC, Spawn, "The Watch are the local militia here in Graystone. They're supposed to handle all the village disputes, but they're an undisciplined lot.")
  59. end
  60. function JoinWatch(NPC, Spawn)
  61. conversation = CreateConversation()
  62. FaceTarget(NPC, Spawn)
  63. PlayFlavor(NPC, "voiceover/english/captain_salomar/qey_village03/captainsalomar003.mp3","","",977812867,1076147271,Spawn)
  64. AddConversationOption(conversation, "What can I do for the Qeynos Guard?","QGuard")
  65. AddConversationOption(conversation, "I don't have time to help either. Good day.")
  66. StartConversation(conversation, NPC, Spawn, "Join them! Are you mad? I heard their recruiting rituals are a terrible ordeal. Besides, you look too civilized to join their ranks. If you really want to help, do the Qeynos Guard a favor instead. We need you.")
  67. end
  68. function QGuard(NPC, Spawn)
  69. conversation = CreateConversation()
  70. FaceTarget(NPC, Spawn)
  71. PlayFlavor(NPC, "voiceover/english/captain_salomar/qey_village03/captainsalomar004.mp3","","",3783365478,3563979362,Spawn)
  72. AddConversationOption(conversation, "I will go check the gate and report back.","QuestStart")
  73. AddConversationOption(conversation, "I've heard that too! I'm not going anywhere near it. Goodbye.")
  74. AddConversationOption(conversation, "I'm too busy. Sorry.")
  75. StartConversation(conversation, NPC, Spawn, "The tavern patrons are all a-buzz about the Oakmyst Forest gate being toppled. Now, maybe it's true and maybe it's just scuttlebutt. Would you go to the gate and see for yourself? Report back to me and I'll reward you with coin of the realm.")
  76. end
  77. function QuestStart(NPC,Spawn)
  78. OfferQuest(NPC,Spawn, OakGate)
  79. FaceTarget(NPC, Spawn)
  80. end
  81. function Finished(NPC, Spawn)
  82. conversation = CreateConversation()
  83. FaceTarget(NPC, Spawn)
  84. PlayFlavor(NPC, "voiceover/english/captain_salomar/qey_village03/captainsalomar005.mp3","","thank",1841540516,576734016,Spawn)
  85. AddConversationOption(conversation, "Glad to assist.","Finished2")
  86. AddConversationOption(conversation, "Enjoy your pint!","Finished2")
  87. StartConversation(conversation, NPC, Spawn, "Intact, is it? Good. That's one less worry on my mind. Perhaps I'll relax with a pint at the tavern now. Please accept this reward for assisting the Kingdom of Qeynos. I am ever grateful to you.")
  88. end
  89. function Finished2(NPC,Spawn)
  90. SetStepComplete(Spawn,OakGate,2)
  91. FaceTarget(NPC, Spawn)
  92. end