9
3

KeeperoftheChamber.lua 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. --[[
  2. Script Name : SpawnScripts/The Vault of the Fallen/KeeperoftheChamber.lua
  3. Script Author : Premierio015
  4. Script Date : 2021.07.17 12:07:29
  5. Script Purpose : script for Keeper of the Chamber which gives a quest to open Tseralith Door.
  6. :
  7. --]]
  8. local TseralithDoorQuest = 5325
  9. function spawn(NPC)
  10. ProvidesQuest(NPC, TseralithDoorQuest)
  11. end
  12. function hailed(NPC, Spawn)
  13. FaceTarget(NPC, Spawn)
  14. if not HasQuest(Spawn, TseralithDoorQuest) then
  15. local conversation = CreateConversation()
  16. AddConversationOption(conversation, "How can I pass through the door?", "Option1")
  17. AddConversationOption(conversation, "Then I shall be leaving.")
  18. StartConversation(conversation, NPC, Spawn, "The power that holds the final door is strong. You can not proceed.")
  19. elseif GetQuestStep(Spawn, TseralithDoorQuest) == 31 then
  20. Option2(NPC, Spawn)
  21. elseif HasQuest(Spawn, TseralithDoorQuest) and GetQuestStep(Spawn, TseralithDoorQuest) ~= 31 then
  22. PlayFlavor(NPC, "", "The door is still holding strong. It cannot be opened", "", 0, 0, Spawn)
  23. end
  24. end
  25. function Option1(NPC, Spawn)
  26. FaceTarget(NPC, Spawn)
  27. local conversation = CreateConversation()
  28. AddConversationOption(conversation, "I will return with the seals.", "offer")
  29. AddConversationOption(conversation, "Then I shall be leaving.")
  30. StartConversation(conversation, NPC, Spawn, "The power of the dragoons holds this door shut. With their seals it can be broken.")
  31. end
  32. function offer(NPC, Spawn)
  33. OfferQuest(NPC, Spawn, TseralithDoorQuest)
  34. end
  35. function Option2(NPC, Spawn)
  36. local conversation = CreateConversation()
  37. AddConversationOption(conversation, "Then you shall face your final rest.", "Keeper_Attack")
  38. StartConversation(conversation, NPC, Spawn, "You can not enter. I will stop you.")
  39. end
  40. function Keeper_Attack(NPC, Spawn) -- ATTACK STAGE
  41. SetStepComplete(Spawn, TseralithDoorQuest, 31)
  42. PlayFlavor(NPC, "", "You are not allowed in here.", "", 0, 0, Spawn)
  43. SpawnSet(NPC, "faction", 1)
  44. SpawnSet(NPC, "attackable", 1)
  45. SpawnSet(NPC, "show_level", 1)
  46. Attack(NPC, Spawn)
  47. end
  48. function death(NPC, Spawn) -- OPEN DOORS TO ROOM WITH TSERALITH UPON DEATH
  49. local door = GetSpawn(NPC, 6420017)
  50. local door2 = GetSpawn(NPC, 6420018)
  51. OpenDoor(door)
  52. OpenDoor(door2)
  53. local zone = GetZone(Spawn)
  54. local tseralith = GetSpawnByLocationID(zone, 345623)
  55. if tseralith == nil then
  56. SpawnByLocationID(zone, 345623)
  57. end
  58. end
  59. function respawn(NPC)
  60. spawn(NPC)
  61. end