9
3

CaptainTyreth.lua 4.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  1. --[[
  2. Script Name : CaptainTyreth.lua
  3. Script Purpose : Captain Tyreth
  4. Script Author : vo1d
  5. Script Date : 10/12/2019
  6. Script Notes : WIP, Tyreth isn't functioning yet.
  7. --]]
  8. local EvilGoblinTent1 = 2780125
  9. local EvilGoblinTent2 = 2780124
  10. local EvilGoblinTent3 = 2780123
  11. -- Quest ID's
  12. local TheFinalAssault = 367
  13. function spawn(NPC)
  14. SetPlayerProximityFunction(NPC, 10, "InRange", "LeaveRange")
  15. SetPlayerProximityFunction(NPC, 50, "SpawnAccess", "SpawnAccess")
  16. AddSpawnAccess(NPC, NPC)
  17. end
  18. function respawn(NPC)
  19. spawn(NPC)
  20. end
  21. function InRange(NPC, Spawn)
  22. end
  23. function LeaveRange(NPC, Spawn)
  24. end
  25. function SpawnAccess(NPC, Spawn)
  26. if HasCompletedQuest(Spawn, TheFinalAssault) or GetQuestStep(Spawn, TheFinalAssault) == 2 then
  27. AddSpawnAccess(GetSpawn(NPC, EvilGoblinTent1), Spawn)
  28. AddSpawnAccess(GetSpawn(NPC, EvilGoblinTent2), Spawn)
  29. AddSpawnAccess(GetSpawn(NPC, EvilGoblinTent3), Spawn)
  30. else
  31. AddSpawnAccess(NPC, Spawn)
  32. end
  33. end
  34. function hailed(NPC, Spawn)
  35. if HasQuest(Spawn, TheFinalAssault) and GetQuestStep(Spawn, TheFinalAssault) == 1 then
  36. FaceTarget(NPC, Spawn)
  37. Conversation = CreateConversation()
  38. PlayFlavor(NPC, "voiceover/english/tutorial_revamp/captain_tyreth/tutorial_island02_evil_revamp/quests/citizenship/captaintyreth/captaintyreth001.mp3", "", "", 3280197482, 1135652426, Spawn)
  39. AddConversationOption(Conversation, "That's me.", "dlg_2")
  40. AddConversationOption(Conversation, "I need to be leaving.")
  41. StartConversation(Conversation, NPC, Spawn, "Hahaha! The attack has begun and the enemy shall fall! You must be " .. GetName(Spawn) .. ", here to take part in the festivities.")
  42. elseif HasQuest(Spawn, TheFinalAssault) and GetQuestStep(Spawn, TheFinalAssault) == 2 then
  43. FaceTarget(NPC, Spawn)
  44. Conversation = CreateConversation()
  45. AddConversationOption(Conversation, "I lost my torch!", "LostTorch")
  46. AddConversationOption(Conversation, "Goodbye.")
  47. StartConversation(Conversation, NPC, Spawn, "Burn any of their tents nearby. The island must be taken, and the time is now. There are tents here in the Valley of Discipline, and some east near Fisher Falls.")
  48. elseif HasQuest(Spawn, TheFinalAssault) and GetQuestStep(Spawn, TheFinalAssault) == 3 then
  49. SetStepComplete(Spawn, TheFinalAssault, 3)
  50. elseif HasQuest(Spawn, TheFinalAssault) and GetQuestStep(Spawn, TheFinalAssault) == 5 then
  51. SetStepComplete(Spawn, TheFinalAssault, 5)
  52. end
  53. end
  54. function dlg_2(NPC, Spawn)
  55. FaceTarget(NPC, Spawn)
  56. Conversation = CreateConversation()
  57. PlayFlavor(NPC, "voiceover/english/tutorial_revamp/captain_tyreth/tutorial_island02_evil_revamp/quests/citizenship/captaintyreth/captaintyreth002.mp3", "", "", 3182304037, 930301833, Spawn)
  58. AddConversationOption(Conversation, "What must I do?", "dlg_3")
  59. StartConversation(Conversation, NPC, Spawn, "Ah, you were the one who coerced these sentries out of the area before the attack. Nicely done! It is time to complete our domination. The Militia are advancing and beginning to clear the area. It is time to strike, quickly!")
  60. end
  61. function dlg_3(NPC, Spawn)
  62. FaceTarget(NPC, Spawn)
  63. Conversation = CreateConversation()
  64. SummonItem(Spawn, 48997, 1)
  65. PlayFlavor(NPC, "voiceover/english/tutorial_revamp/captain_tyreth/tutorial_island02_evil_revamp/quests/citizenship/captaintyreth/captaintyreth003.mp3", "", "", 3312554119, 4055641204, Spawn)
  66. AddConversationOption(Conversation, "I'll burn the tents of the Qeynosians.")
  67. StartConversation(Conversation, NPC, Spawn, "Take this torch. Work your way in and set fire to two of the nearby tents. Others have begun the razing as well. If another's flame fails, make sure you finish the job. This island will soon be ours!")
  68. SetStepComplete(Spawn, TheFinalAssault, 1)
  69. end
  70. function LostTorch(NPC, Spawn)
  71. if HasQuest(Spawn, TheFinalAssault) then
  72. if HasItem(Spawn, 48997, 1) then
  73. FaceTarget(NPC, Spawn)
  74. Conversation = CreateConversation()
  75. AddConversationOption(Conversation, "Doh")
  76. StartConversation(Conversation, NPC, Spawn, "You already have a torch.")
  77. else
  78. SummonItem(Spawn, 48997, 1)
  79. end
  80. end
  81. end