acapturedsarnak.lua 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. --[[
  2. Script Name : SpawnScripts/TimorousDeep/acapturedsarnak.lua
  3. Script Purpose : a captured sarnak
  4. Script Author : John Adams
  5. Script Date : 2009.03.07
  6. Script Notes : Auto-Generated Conversation from PacketParser Data
  7. --]]
  8. QUEST_PRISON_BREAK = 131
  9. function spawn(NPC)
  10. end
  11. function respawn(NPC)
  12. spawn(NPC)
  13. end
  14. function hailed(NPC, Spawn)
  15. FaceTarget(NPC, Spawn)
  16. if HasQuest(Spawn, QUEST_PRISON_BREAK) and GetQuestStep(Spawn, QUEST_PRISON_BREAK) == 1 then
  17. if NoSentriesAreClose(NPC) then
  18. conversation = CreateConversation()
  19. PlayFlavor(NPC, "voiceover/english/rok_questvo/a_captured_sarnak/_exp04/exp04_rgn_timorous_deep/chrykori_tie/captured_sarnak/sarnak000.mp3", "", "", 828273370, 3232818637, Spawn)
  20. AddConversationOption(conversation, "Yes, run back to Chrykori Tie.", "ItsSafe")
  21. StartConversation(conversation, NPC, Spawn, "Is it safe?")
  22. else
  23. PlayFlavor(NPC, "voiceover/english/rok_questvo/a_captured_sarnak/_exp04/exp04_rgn_timorous_deep/sarnak/actor_captured_sarnak_not_safe_c743b130.mp3", "There are still sentries about!", "", 1306178937, 536022533, Spawn)
  24. end
  25. else
  26. Say(NPC, "...", Spawn)
  27. end
  28. end
  29. function NoSentriesAreClose(NPC)
  30. Sentry = GetSpawn(NPC, 2630093)
  31. if GetDistance(NPC, Sentry) <= 10 then
  32. if not IsAlive(Sentry) then
  33. return true;
  34. else
  35. return false;
  36. end
  37. else
  38. return true;
  39. end
  40. end
  41. function ItsSafe(NPC, Spawn)
  42. PlayFlavor(NPC, "voiceover/english/rok_questvo/a_captured_sarnak/_exp04/exp04_rgn_timorous_deep/sarnak/actor_captured_sarnak_thanks_64962be1.mp3", "Thank you!", "", 3145148211, 2012659312, Spawn)
  43. AddStepProgress(Spawn, QUEST_PRISON_BREAK, 1, 1)
  44. RunAway(NPC, Spawn)
  45. end
  46. function RunAway(NPC, Spawn)
  47. MovementLoopAddLocation(NPC, 330.01, 80.49, 148.29, 10, 0)
  48. MovementLoopAddLocation(NPC, 293.32, 49.81, 66.89, 10, 0)
  49. MovementLoopAddLocation(NPC, 288.29, 49.15, 68.3, 10, 0)
  50. MovementLoopAddLocation(NPC, 270.94, 38.79, 104.6, 10, 0)
  51. MovementLoopAddLocation(NPC, 214.08, 36.39, 100.36, 10, 0)
  52. MovementLoopAddLocation(NPC, 202.58, 29.11, 126.46, 10, 0)
  53. MovementLoopAddLocation(NPC, 109.03, 17.9, 140.07, 10, 10, "MakeDespawn")
  54. end
  55. function MakeDespawn(NPC)
  56. Despawn(NPC)
  57. end