Groak.lua 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. --[[
  2. Script Name : SpawnScripts/QueensColony/Groak.lua
  3. Script Author : Zcoretri
  4. Script Date : 2015.07.30
  5. Script Purpose : Groak dialog | Rylec update: Visual state added (2020.10.16)
  6. Note : Rylec note: InRange PlayFlavor (and that function in general) seems to be bugged
  7. --]]
  8. function spawn(NPC)
  9. AddTimer(NPC, 1000, "visualstate")
  10. end
  11. function respawn(NPC)
  12. spawn(NPC)
  13. end
  14. function hailed(NPC, Spawn)
  15. FaceTarget(NPC, Spawn)
  16. math.randomseed(os.time())
  17. voice = math.random(1,3)
  18. if voice == 1 then
  19. PlayFlavor(NPC, "voiceover/english/voice_emotes/greetings/greetings_1_1018.mp3", "", "", 0, 0, Spawn)
  20. elseif voice == 2 then
  21. PlayFlavor(NPC, "voiceover/english/voice_emotes/greetings/greetings_2_1018.mp3", "", "", 0, 0, Spawn)
  22. else
  23. PlayFlavor(NPC, "voiceover/english/voice_emotes/greetings/greetings_3_1018.mp3", "", "", 0, 0, Spawn)
  24. end
  25. text = math.random(1,3)
  26. if text == 1 then
  27. Say(NPC, "Good thing Murrar Shar is here!")
  28. elseif text == 2 then
  29. Say(NPC, "The finest delights you'll find here.")
  30. else
  31. Say(NPC, "It's amazing what you can make from a fish.")
  32. end
  33. end
  34. function visualstate(NPC)
  35. math.randomseed(os.time())
  36. local choice = math.random (1,2)
  37. if choice == 1 then
  38. SpawnSet(NPC, "visual_state", 12182)
  39. AddTimer(NPC, 5000, "resetvisualstate")
  40. elseif choice == 2 then
  41. SpawnSet(NPC, "visual_state", 11976)
  42. AddTimer(NPC, 7600, "visualstate")
  43. end
  44. end
  45. function resetvisualstate(NPC)
  46. SpawnSet(NPC, "visual_state", 0)
  47. local time = math.random (2500,3500)
  48. AddTimer(NPC, time, "visualstate")
  49. end