FlibbitQuagmarr_(shelf).lua 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. --[[
  2. Script Name : SpawnScripts/FrostfangSea/FlibbitQuagmarr_(shelf).lua
  3. Script Purpose : for the spawn "Flibbit Quagmarr" located in the great shelf cave.
  4. Script Author : theFoof
  5. Script Date : 2013.5.30
  6. Script Notes :
  7. --]]
  8. local GreatShelf = 30
  9. function spawn(NPC)
  10. AddSpawnAccess(NPC, NPC)
  11. SetPlayerProximityFunction(NPC, 50, "SpawnAccess", "SpawnAccess")
  12. end
  13. function respawn(NPC)
  14. spawn(NPC)
  15. end
  16. function SpawnAccess(NPC, Spawn)
  17. if GetQuestStep(Spawn, GreatShelf) == 2 or HasCompletedQuest(Spawn, GreatShelf) then
  18. AddSpawnAccess(NPC, Spawn)
  19. end
  20. end
  21. function hailed(NPC, Spawn)
  22. FaceTarget(NPC, Spawn)
  23. if GetQuestStep(Spawn, GreatShelf) == 2 then
  24. pet = GetTempVariable(Spawn, "splorp")
  25. if IsAlive(pet) then
  26. Despawn(pet)
  27. end
  28. SetTempVariable(Spawn, "splorp", nil)
  29. RemoveSpawnAccess(GetSpawnByLocationID(GetZone(Spawn), 5221), Spawn)
  30. AddSpawnAccess(GetSpawnByLocationID(GetZone(Spawn), 5219), Spawn)
  31. SetStepComplete(Spawn, GreatShelf, 2)
  32. conversation = CreateConversation()
  33. PlayFlavor(NPC, "flibbit_quagmarr/halas/gwenevyns_cove/flibbit_quagmarr/flibbit_quagmarr_018.mp3", "", "", 2168167174, 2891640064, Spawn)
  34. AddConversationOption(conversation, "We've arrived safe and sound!", "Chat1")
  35. StartConversation(conversation, NPC, Spawn, "Thank you for escorting Splorpy. You do not know how relieved I am! I trust the trip was uneventful?")
  36. else
  37. PlayFlavor(NPC, "", "You made it to the Great Shelf!", "cheer", 0, 0, Spawn)
  38. end
  39. end
  40. function Chat1(NPC, Spawn)
  41. FaceTarget(NPC, Spawn)
  42. conversation = CreateConversation()
  43. AddConversationOption(conversation, "Thank you, Flibbit.")
  44. AddConversationOption(conversation, "Can I help you further?", "Chat2")
  45. StartConversation(conversation, NPC, Spawn, "I cannot thank you enough, " .. GetName(Spawn) .. "! You have kept both me and my son safe, and provided for us, time and time again. You deserve both song and praise for all that you have done.")
  46. end
  47. function Chat2(NPC, Spawn)
  48. FaceTarget(NPC, Spawn)
  49. conversation = CreateConversation()
  50. AddConversationOption(conversation, "It was no problem. I did not mind it one bit")
  51. StartConversation(conversation, NPC, Spawn, "I cannot accept any further aid from you, mighty one. I have appreciated it, but you have also shown me that there are some challenges that we must overcome on our own. And for that too, I must thank you! I am sure that we have slowed you from completing your own quest.")
  52. end