9
3

Alexa.lua 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. --[[
  2. Script Name : SpawnScripts/Nektropos1/Alexa.lua
  3. Script Purpose : Alexa in the Chapel
  4. Script Author : smash
  5. Script Date : 1/28/2016
  6. Script Notes :
  7. --]]
  8. require "SpawnScripts/Generic/PlayerHistory"
  9. function spawn(NPC)
  10. end
  11. function hailed(NPC, Spawn)
  12. if GetTempVariable(NPC, "talking") ~= "true" then
  13. StartDialogLoop(NPC, Spawn)
  14. local player_group = GetGroup(Spawn)
  15. if player_group ~= nil then
  16. for k,v in ipairs(player_group) do
  17. if IsPlayer(v) and GetPlayerHistory(v, HISTORY.NEK_CASTLE_SCONCE_ACCESS) ~= 1 then
  18. SetPlayerHistory(v, HISTORY.NEK_CASTLE_SCONTZ_KEY_ACCESS, 1)
  19. end
  20. end
  21. elseif GetPlayerHistory(Spawn, HISTORY.NEK_CASTLE_SCONCE_ACCESS) ~= 1 then
  22. SetPlayerHistory(Spawn, HISTORY.NEK_CASTLE_SCONCE_KEY_ACCESS, 1)
  23. end
  24. end
  25. end
  26. function StartDialogLoop(NPC, Spawn)
  27. SetTempVariable(NPC, "talking", "true")
  28. Say(NPC, "Finally someone who may be strong enough to free me from this wretched place.")
  29. AddTimer(NPC, 3500, "Dialog2")
  30. end
  31. function Dialog2(NPC)
  32. Say(NPC, "If you will aid me I can lead you to Rikantus Everling's treasures.")
  33. AddTimer(NPC, 3500, "Dialog3")
  34. end
  35. function Dialog3(NPC)
  36. Say(NPC, "Rikantus gathered strange and odd artifacts from across the land,")
  37. AddTimer(NPC, 3500, "Dialog4")
  38. end
  39. function Dialog4(NPC)
  40. Say(NPC, "and hid them in a secret chamber of the castle. If you release my soul I will tell you where they are.")
  41. AddTimer(NPC, 3500, "Dialog5")
  42. end
  43. function Dialog5(NPC)
  44. Say(NPC, "One of Rikantus' daughters, Elise, built a basement beneath her room without her father's knowledge.")
  45. AddTimer(NPC, 3500, "Dialog6")
  46. end
  47. function Dialog6(NPC)
  48. Say(NPC, "It allowed her to sneak about the castle whenever she desired.")
  49. AddTimer(NPC, 3500, "Dialog7")
  50. end
  51. function Dialog7(NPC)
  52. Say(NPC, "The architect of the basement wanted to tell Lord Everling about the basement but was unable to before he had to leave.")
  53. AddTimer(NPC, 3500, "Dialog8")
  54. end
  55. function Dialog8(NPC)
  56. Say(NPC, "He wrote a letter to Lord Everling and hid it in the parlor for him to find.")
  57. AddTimer(NPC, 3500, "Dialog9")
  58. end
  59. function Dialog9(NPC)
  60. Say(NPC, "If you can find that note, you may be able to find a way into the basement.")
  61. AddTimer(NPC, 3500, "Dialog10")
  62. end
  63. function Dialog10(NPC)
  64. Say(NPC, "If you can gain access to the basement, I can show you how to release me and to the treasures.")
  65. AddTimer(NPC, 3500, "Dialog11")
  66. end
  67. function Dialog11(NPC)
  68. Say(NPC, "Please hurry. If he finds out I have been speaking with you, he will punish me.")
  69. AddTimer(NPC, 5000, "Despawn")
  70. SpawnByLocationID(GetZone(NPC), 1584474)
  71. end