PaulaMarx133770928.lua 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  1. --[[
  2. Script Name : SpawnScripts/QueensColony/PaulaMarx133770928.lua
  3. Script Author : Zcoretri
  4. Script Date : 2015.07.30
  5. Script Purpose : Paula Marx dialog
  6. Modified Date : 2017.04.13, 2020.04.03, 2020.09.03
  7. Modified by : EmemJr,premierio015, Rylec
  8. Notes : Added dialog and code for Turning in collections, Added animation and VoiceOvers.
  9. --]]
  10. function spawn(NPC)
  11. MovementLoopAddLocation(NPC, 16.51, -6.87, 207.38, 2, 4)
  12. MovementLoopAddLocation(NPC, 21.6, -6.85, 201.56, 2, 0)
  13. MovementLoopAddLocation(NPC, 20.09, -6.88, 191.73, 2, 9, "InitialPause")
  14. MovementLoopAddLocation(NPC, 18.14, -6.9, 189.9, 2, 0)
  15. MovementLoopAddLocation(NPC, 5.39, -5.27, 188.95, 2, 9, "InitialPause")
  16. MovementLoopAddLocation(NPC, 4.74, -6.57, 197.4, 2, 9, "InitialPause")
  17. MovementLoopAddLocation(NPC, 13.55, -6.89, 198.66, 2, 9, "InitialPause")
  18. MovementLoopAddLocation(NPC, -0.61, -5.53, 209.76, 2, 9, "InitialPause")
  19. MovementLoopAddLocation(NPC, -1.95, -5.26, 210.79, 2, 9, "InitialPause")
  20. MovementLoopAddLocation(NPC, 11.74, -6.87, 193.84, 2, 9, "InitialPause")
  21. MovementLoopAddLocation(NPC, 16.68, -6.86, 188.22, 2, 0)
  22. MovementLoopAddLocation(NPC, 19.18, -6.86, 183.95, 2, 9, "InitialPause")
  23. MovementLoopAddLocation(NPC, 18.94, -6.9, 188.54, 2, 9, "InitialPause")
  24. MovementLoopAddLocation(NPC, 18.6, -6.9, 191.93, 2, 0)
  25. MovementLoopAddLocation(NPC, 17.01, -6.86, 196.87, 2, 9, "InitialPause")
  26. MovementLoopAddLocation(NPC, 16.12, -6.86, 200.68, 2, 0)
  27. end
  28. function respawn(NPC)
  29. spawn(NPC)
  30. end
  31. function hailed(NPC, Spawn)
  32. FaceTarget(NPC, Spawn)
  33. conversation = CreateConversation()
  34. --if (player has a collection then add a conversation option to hand in a collection
  35. --end
  36. math.randomseed(os.time())
  37. local choice = math.random (1, 3)
  38. str = tostring(choice)
  39. if choice == 1 then
  40. PlayFlavor(NPC, "voiceover/english/voice_emotes/greetings/greetings_1_1003.mp3", "", "hello", 0, 0, Spawn)
  41. AddConversationOption(conversation, "What Collections?","WhatCollections")
  42. elseif choice == 2 then
  43. PlayFlavor(NPC, "voiceover/english/voice_emotes/greetings/greetings_2_1003.mp3", "", "hello", 0, 0, Spawn)
  44. AddConversationOption(conversation, "What Collections?","WhatCollections")
  45. else
  46. PlayFlavor(NPC, "voiceover/english/voice_emotes/greetings/greetings_3_1003.mp3", "", "hello", 0, 0, Spawn)
  47. AddConversationOption(conversation, "What Collections?","WhatCollections")
  48. end
  49. if HasCollectionsToHandIn(Spawn) then
  50. AddConversationOption(conversation, "I have a collection for you", "TurnIn")
  51. end
  52. AddConversationOption(conversation, "Goodbye!")
  53. StartConversation(conversation, NPC, Spawn, "Hello, traveler! How I envy you. What I wouldn't give to journey the world as I did in my youth. Alas, my days of adventuring are long past, but at least I can occupy myself with my various trinkets and collections that I picked up in my travels.")
  54. end
  55. function InitialPause(NPC)
  56. local GatherSpawn = GetSpawn(NPC, 2530009) -- Get Paula Marx
  57. math.randomseed(os.time())
  58. local pause = math.random (1, 4)
  59. if pause == 1 then
  60. AddTimer(NPC, 100, "stop_gathering")
  61. else
  62. AddTimer(NPC, 1000, "Gather")
  63. end
  64. end
  65. function Gather(NPC)
  66. local GatherSpawn = GetSpawn(NPC, 2530009) -- Get Paula Marx
  67. SpawnSet(NPC, "visual_state", "2809") -- Start gathering
  68. AddTimer(NPC, 5000, "Collect") -- for 5 seconds, then stop
  69. end
  70. function Collect(NPC)
  71. local GatherSpawn = GetSpawn(NPC, 2530009) -- Get Paula Marx
  72. SpawnSet(NPC, "visual_state", "2810") -- Start gathering
  73. AddTimer(NPC, 2000, "stop_gathering") -- for 5 seconds, then stop
  74. end
  75. function stop_gathering(NPC)
  76. local GatherSpawn = GetSpawn(NPC, 2530009) -- get Paula Marx
  77. SpawnSet(NPC, "visual_state", "0") -- Stop her from gathering
  78. end
  79. function WhatCollections(NPC, Spawn)
  80. FaceTarget(NPC, Spawn)
  81. conversation = CreateConversation()
  82. AddConversationOption(conversation, "I'll keep that in mind.")
  83. StartConversation(conversation, NPC, Spawn, "Why, any sort of collection. There's so much out there to find! Just open your eyes and peek under the rocks. If you find anything interesting, let me have a look. Collecting is the only way I seem to relive my youth!")
  84. end
  85. function TurnIn(NPC, Spawn)
  86. FaceTarget(NPC, Spawn)
  87. HandInCollections(Spawn)
  88. conversation = CreateConversation()
  89. AddConversationOption(conversation, "Okay, bye!")
  90. StartConversation(conversation, NPC, Spawn, "This is a magnificent find! Here, take this for all your hard work.")
  91. end