9
3

Vandis.lua 2.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  1. --[[
  2. Script Name : SpawnScripts/Starcrest/Vandis.lua
  3. Script Purpose : Vandis
  4. Script Author : Dorbin
  5. Script Date : 06.29.2022
  6. Script Notes :
  7. --]]
  8. local HailCheck = false
  9. require "SpawnScripts/Generic/DialogModule"
  10. function spawn(NPC)
  11. AddTimer(NPC, 5000, "EmoteLoop")
  12. end
  13. function respawn(NPC)
  14. spawn(NPC)
  15. end
  16. function hailed(NPC, Spawn)
  17. SetTarget(NPC,Spawn)
  18. FaceTarget(NPC, Spawn)
  19. if GetFactionAmount(Spawn,11)<0 then
  20. PlayFlavor(NPC, "", "", "shakefist", 0, 0, Spawn)
  21. else
  22. HailCheck = true
  23. Dialog1(NPC, Spawn)
  24. AddTimer(NPC,26000,"HailReset")
  25. end
  26. end
  27. function HailReset(NPC)
  28. HailCheck = false
  29. end
  30. function Dialog1(NPC, Spawn)
  31. FaceTarget(NPC, Spawn)
  32. Dialog.New(NPC, Spawn)
  33. PlayFlavor(NPC, "", "", "no", 0, 0, Spawn)
  34. Dialog.AddDialog("Can't you see I'm in the middle of a game of King's Field? And no, you can't help!")
  35. Dialog.AddVoiceover("voiceover/english/vandis/qey_village02/vandis.mp3", 555689921, 1189263301)
  36. if GetQuestStep (Spawn, 245)==1 then
  37. Dialog.AddOption("Molly's cat found this. Is it part of your King's Field game?","Done")
  38. end
  39. Dialog.AddOption("I'm not going to say anything. I can see you are losing well enough on your own. ")
  40. Dialog.Start()
  41. end
  42. function Done(NPC, Spawn)
  43. FaceTarget(NPC, Spawn)
  44. Dialog.New(NPC, Spawn)
  45. PlayFlavor(NPC, "", "", "boggle", 0, 0, Spawn)
  46. SetStepComplete(Spawn, 245, 1)
  47. Dialog.AddDialog("What is this? A missing piece? And from my color?! Hey! I've been playing without this piece! No wonder I've been doing so badly!")
  48. Dialog.AddVoiceover("voiceover/english/vandis/qey_village02/vandis000.mp3", 1565383947, 2869392251)
  49. Dialog.AddOption("Well, I hope it helps!")
  50. Dialog.AddOption("There may be more than just that piece influcing your game.")
  51. Dialog.Start()
  52. end
  53. function EmoteLoop(NPC)
  54. if HailCheck == true then
  55. AddTimer(NPC,26100,"EmoteLoop")
  56. else
  57. local emoteChoice = MakeRandomInt(1,6)
  58. if emoteChoice == 1 then
  59. -- confused
  60. PlayAnimation(NPC, 11214)
  61. AddTimer(NPC, MakeRandomInt(11000,12000), "EmoteLoop")
  62. elseif emoteChoice == 2 then
  63. -- doh
  64. PlayAnimation(NPC, 11410)
  65. AddTimer(NPC, MakeRandomInt(6000,8000), "EmoteLoop")
  66. elseif emoteChoice == 3 then
  67. -- ponder
  68. PlayAnimation(NPC, 12030)
  69. AddTimer(NPC, MakeRandomInt(12000,14000), "EmoteLoop")
  70. elseif emoteChoice == 4 then
  71. -- agree
  72. PlayAnimation(NPC, 10745)
  73. AddTimer(NPC, MakeRandomInt(5000,6000), "EmoteLoop")
  74. elseif emoteChoice == 5 then
  75. -- no
  76. PlayAnimation(NPC, 11881)
  77. AddTimer(NPC, MakeRandomInt(5000,6000), "EmoteLoop")
  78. elseif emoteChoice == 6 then
  79. -- whome
  80. PlayAnimation(NPC, 13295)
  81. AddTimer(NPC, MakeRandomInt(7000,8000), "EmoteLoop")
  82. end
  83. end
  84. end