amysteriouscontact.lua 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. --[[
  2. Script Name : SpawnScripts/Commonlands/amysteriouscontact.lua
  3. Script Author : Premierio015
  4. Script Date : 2021.01.10 06:01:22
  5. Script Purpose :
  6. :
  7. --]]
  8. local SmugglersSecrets = 452
  9. function spawn(NPC)
  10. AddSpawnAccess(NPC, NPC)
  11. SetPlayerProximityFunction(NPC, 20, "SpawnAccess", "SpawnAccess")
  12. end
  13. function hailed(NPC, Spawn)
  14. FaceTarget(NPC, Spawn)
  15. PlayFlavor(NPC, "voiceover/english/voice_emotes/greetings/greetings_3_1052.mp3", "", "tapfoot", 0, 0, Spawn)
  16. if HasQuest(Spawn, SmugglersSecrets) and GetQuestStep(Spawn, SmugglersSecrets) == 4 and HasSpellEffect(Spawn, 5459) then
  17. conversation = CreateConversation()
  18. AddConversationOption(conversation, "Sorry. I was held up by some snooping Buccaneer.", "dlg2")
  19. AddConversationOption(conversation, "My apologies. Do what you will with me, the scroll is the important item.", "dlg1")
  20. StartConversation(conversation, NPC, Spawn, "Hmm. The time had past. Luck is that I am forgiving.")
  21. end
  22. end
  23. function dlg1(NPC, Spawn)
  24. FaceTarget(NPC, Spawn)
  25. conversation = CreateConversation()
  26. AddConversationOption(conversation, "I shall carry that message.", "dlg3")
  27. StartConversation(conversation, NPC, Spawn, "A point of such truths. I am to relay that the next shipment is ready.")
  28. end
  29. function dlg2(NPC, Spawn)
  30. FaceTarget(NPC, Spawn)
  31. PlayAnimation(NPC, 13056)
  32. conversation = CreateConversation()
  33. AddConversationOption(conversation, "My apologies. Do what you will with me, the scroll is the important item.", "dlg3")
  34. StartConversation(conversation, NPC, Spawn, "Excuses do not flatter you.")
  35. end
  36. function dlg3(NPC, Spawn)
  37. FaceTarget(NPC, Spawn)
  38. SetStepComplete(Spawn, SmugglersSecrets, 4)
  39. conversation = CreateConversation()
  40. AddConversationOption(conversation, "Best of my ability.", "poof")
  41. StartConversation(conversation, NPC, Spawn, "Good. So far, the leader has been impressed. Do see that it continues.")
  42. end
  43. function poof(NPC, Spawn)
  44. RemoveSpawnAccess(NPC, Spawn)
  45. end
  46. function respawn(NPC)
  47. spawn(NPC)
  48. end
  49. function SpawnAccess(NPC, Spawn)
  50. if GetQuestStep(Spawn, SmugglersSecrets) == 4 then
  51. AddSpawnAccess(NPC, Spawn)
  52. elseif not HasQuest(Spawn, SmugglersSecrets) and not GetQuestStep(Spawn,SmugglersSecrets) == 4 then
  53. RemoveSpawnAccess(NPC, Spawn)
  54. end
  55. end