SergeantatArmsUthros.lua 4.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  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. end
  12. function InRange(NPC, Spawn)
  13. if math.random(1, 100) <= 75 then
  14. choice = math.random(1,3)
  15. FaceTarget(NPC, Spawn)
  16. if choice ==1 then
  17. PlayFlavor(NPC, "", "", "attention", 0, 0, Spawn)
  18. elseif choice ==2 then
  19. PlayFlavor(NPC, "", "", "salute", 0, 0, Spawn)
  20. else
  21. PlayFlavor(NPC, "", "", "hello", 0, 0, Spawn)
  22. end
  23. end
  24. end
  25. function hailed(NPC, Spawn)
  26. FaceTarget(NPC, Spawn)
  27. local count = GetQuestCompleteCount(Spawn, 5486)
  28. conversation = CreateConversation()
  29. if GetQuestStep(Spawn,5486) ==2 then
  30. SetStepComplete(Spawn, 5486, 2)
  31. PlayFlavor(NPC, "voiceover/english/sergeant_at_arms_uthros/qey_adv02_ruins/quests/sergeant_uthros/sergeant_uthros002.mp3", "", "hello", 1245586444, 1008307013)
  32. if count <= 5 then
  33. AddConversationOption(conversation, "Sure.", "dlg_14_2")
  34. end
  35. AddConversationOption(conversation, "Not right now. ")
  36. StartConversation(conversation, NPC, Spawn, "Hey! Great work on the vermin. Can you spare more time to help Qeynos?")
  37. elseif not HasCompletedQuest(Spawn, 5486) then
  38. PlayFlavor(NPC, "voiceover/english/sergeant_at_arms_uthros/qey_adv02_ruins/quests/sergeant_uthros/sergeant_uthros.mp3", "", "salute", 2454266022, 3710462328)
  39. if not HasQuest(Spawn, 5486) then
  40. AddConversationOption(conversation, "I'm intent on staying.", "dlg_0_1")
  41. end
  42. AddConversationOption(conversation, "Perhaps I should play it safe and go back to the village.")
  43. 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.")
  44. else
  45. PlayFlavor(NPC, "voiceover/english/sergeant_at_arms_uthros/qey_adv02_ruins/quests/sergeant_uthros/sergeant_uthros002.mp3", "", "", 1245586444, 1008307013)
  46. if not HasQuest(Spawn, 5486) and count <= 5 then
  47. AddConversationOption(conversation, "Sure.", "dlg_14_2")
  48. end
  49. if not HasQuest(Spawn, 5486) then
  50. AddConversationOption(conversation, "Not right now. ")
  51. end
  52. if HasQuest(Spawn, 5486) then
  53. AddConversationOption(conversation, "I'm working on it.")
  54. end
  55. StartConversation(conversation, NPC, Spawn, "Hey! Great work on the vermin. Can you spare more time to help Qeynos?")
  56. end
  57. end
  58. function dlg_0_1(NPC, Spawn)
  59. FaceTarget(NPC, Spawn)
  60. conversation = CreateConversation()
  61. PlayFlavor(NPC, "voiceover/english/sergeant_at_arms_uthros/qey_adv02_ruins/quests/sergeant_uthros/sergeant_uthros000.mp3", "", "", 1978368877, 3695152842)
  62. AddConversationOption(conversation, "Sounds good.", "dlg_0_2")
  63. 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!")
  64. end
  65. function dlg_14_2(NPC, Spawn)
  66. FaceTarget(NPC, Spawn)
  67. conversation = CreateConversation()
  68. PlayFlavor(NPC, "voiceover/english/sergeant_at_arms_uthros/qey_adv02_ruins/quests/sergeant_uthros/sergeant_uthros003.mp3", "", "salute", 827162019, 3003960469)
  69. AddConversationOption(conversation, "You bet.", "dlg_0_2")
  70. StartConversation(conversation, NPC, Spawn, "Great! Then go and kill more vermin.")
  71. end
  72. function dlg_0_2 (NPC, Spawn)
  73. FaceTarget(NPC, Spawn)
  74. OfferQuest(NPC, Spawn, 5486)
  75. end