SergeantatArmsUthros.lua 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115
  1. --[[
  2. Script Name : SpawnScripts/ForestRuins/SergeantatArmsUthros.lua
  3. Script Purpose : Sergeant at Arms Uthros
  4. Script Author : Dorbin
  5. Script Date : 2022.02.22
  6. Script Notes :
  7. --]]
  8. function spawn(NPC)
  9. ProvidesQuest(NPC, 5486)
  10. SetPlayerProximityFunction(NPC, 8, "InRange", "LeaveRange")
  11. waypoints(NPC)
  12. end
  13. function InRange(NPC, Spawn)
  14. if math.random(1, 100) <= 75 then
  15. choice = math.random(1,3)
  16. FaceTarget(NPC, Spawn)
  17. if choice ==1 then
  18. PlayFlavor(NPC, "", "", "attention", 0, 0, Spawn)
  19. elseif choice ==2 then
  20. PlayFlavor(NPC, "", "", "salute", 0, 0, Spawn)
  21. else
  22. PlayFlavor(NPC, "", "", "hello", 0, 0, Spawn)
  23. end
  24. end
  25. end
  26. function hailed(NPC, Spawn)
  27. FaceTarget(NPC, Spawn)
  28. local count = GetQuestCompleteCount(Spawn, 5486)
  29. conversation = CreateConversation()
  30. if GetQuestStep(Spawn,5486) ==2 then
  31. SetStepComplete(Spawn, 5486, 2)
  32. PlayFlavor(NPC, "voiceover/english/sergeant_at_arms_uthros/qey_adv02_ruins/quests/sergeant_uthros/sergeant_uthros002.mp3", "", "hello", 1245586444, 1008307013)
  33. if count <= 5 then
  34. AddConversationOption(conversation, "Sure.", "dlg_14_2")
  35. end
  36. AddConversationOption(conversation, "Not right now. ")
  37. StartConversation(conversation, NPC, Spawn, "Hey! Great work on the vermin. Can you spare more time to help Qeynos?")
  38. elseif not HasCompletedQuest(Spawn, 5486) then
  39. PlayFlavor(NPC, "voiceover/english/sergeant_at_arms_uthros/qey_adv02_ruins/quests/sergeant_uthros/sergeant_uthros.mp3", "", "salute", 2454266022, 3710462328)
  40. if not HasQuest(Spawn, 5486) then
  41. AddConversationOption(conversation, "I'm intent on staying.", "dlg_0_1")
  42. end
  43. AddConversationOption(conversation, "Perhaps I should play it safe and go back to the village.")
  44. StartConversation(conversation, NPC, Spawn, "Watch your step, friend. Many adventurers get injured because they don't know the dangers that lurk here. These grounds are home to the ruins of the old mage academy. It was destroyed during the wars that raged centuries ago. And aside from the already dangerous inhabitants of these ruins, elemental servants of mages lurk about. Scared yet? ... If you're intent on staying in Qeynos, I suppose we can use your help.")
  45. else
  46. PlayFlavor(NPC, "voiceover/english/sergeant_at_arms_uthros/qey_adv02_ruins/quests/sergeant_uthros/sergeant_uthros002.mp3", "", "", 1245586444, 1008307013)
  47. if not HasQuest(Spawn, 5486) and count <= 5 then
  48. AddConversationOption(conversation, "Sure.", "dlg_14_2")
  49. end
  50. if not HasQuest(Spawn, 5486) then
  51. AddConversationOption(conversation, "Not right now. ")
  52. end
  53. if HasQuest(Spawn, 5486) then
  54. AddConversationOption(conversation, "I'm working on it.")
  55. end
  56. StartConversation(conversation, NPC, Spawn, "Hey! Great work on the vermin. Can you spare more time to help Qeynos?")
  57. end
  58. end
  59. function dlg_0_1(NPC, Spawn)
  60. FaceTarget(NPC, Spawn)
  61. conversation = CreateConversation()
  62. PlayFlavor(NPC, "voiceover/english/sergeant_at_arms_uthros/qey_adv02_ruins/quests/sergeant_uthros/sergeant_uthros000.mp3", "", "", 1978368877, 3695152842)
  63. AddConversationOption(conversation, "Sounds good.", "dlg_0_2")
  64. StartConversation(conversation, NPC, Spawn, "Well, then, make yourself useful and kill some of the nasty vermin who live in this area. And if you need something to do later, come on back, I always need help!")
  65. end
  66. function dlg_14_2(NPC, Spawn)
  67. FaceTarget(NPC, Spawn)
  68. conversation = CreateConversation()
  69. PlayFlavor(NPC, "voiceover/english/sergeant_at_arms_uthros/qey_adv02_ruins/quests/sergeant_uthros/sergeant_uthros003.mp3", "", "salute", 827162019, 3003960469)
  70. AddConversationOption(conversation, "You bet.", "dlg_0_2")
  71. StartConversation(conversation, NPC, Spawn, "Great! Then go and kill more vermin.")
  72. end
  73. function dlg_0_2 (NPC, Spawn)
  74. FaceTarget(NPC, Spawn)
  75. OfferQuest(NPC, Spawn, 5486)
  76. end
  77. function waypoints(NPC)
  78. if GetSpawnLocationID(NPC)==133777752 then
  79. MovementLoopAddLocation(NPC, 898.56, -15.35, -572.21, 2, 0)
  80. MovementLoopAddLocation(NPC, 901.94, -16.04, -569.54, 2, 0)
  81. MovementLoopAddLocation(NPC, 907.79, -17.07, -564.93, 2, 0)
  82. MovementLoopAddLocation(NPC, 913.01, -18.62, -562.48, 2, 0)
  83. MovementLoopAddLocation(NPC, 921.17, -20.85, -562.89, 2, 0)
  84. MovementLoopAddLocation(NPC, 926.05, -21.07, -563.82, 2, 15)
  85. MovementLoopAddLocation(NPC, 927.38, -21.09, -564.07, 2, 0)
  86. MovementLoopAddLocation(NPC, 927.21, -21, -562.63, 2, 0)
  87. MovementLoopAddLocation(NPC, 923.29, -20.84, -560.9, 2, 0)
  88. MovementLoopAddLocation(NPC, 914.8, -19.08, -561.61, 2, 0)
  89. MovementLoopAddLocation(NPC, 908.12, -17.14, -563.96, 2, 0)
  90. MovementLoopAddLocation(NPC, 901.46, -15.95, -569.31, 2, 0)
  91. MovementLoopAddLocation(NPC, 898.81, -15.28, -573.93, 2, 15)
  92. MovementLoopAddLocation(NPC, 897.44, -15.07, -573.54, 2, 0)
  93. MovementLoopAddLocation(NPC, 896.75, -14.98, -572.09, 2, 0)
  94. MovementLoopAddLocation(NPC, 893.36, -13.91, -566.7, 2, 0)
  95. MovementLoopAddLocation(NPC, 891.35, -13.05, -561.21, 2, 15)
  96. MovementLoopAddLocation(NPC, 896.42, -14.91, -572.29, 2, 0)
  97. MovementLoopAddLocation(NPC, 897.13, -14.97, -573.72, 2, 15)
  98. end
  99. end