adistraughtbartender.lua 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127
  1. --[[
  2. Script Name : SpawnScripts/WayfarersRest/adistraughtbartender.lua
  3. Script Author : Dorbin
  4. Script Date : 2022.11.14 05:11:10
  5. Script Purpose :
  6. :
  7. --]]
  8. require "SpawnScripts/Generic/CombatModule"
  9. require "SpawnScripts/Generic/DialogModule"
  10. function hailed(NPC, Spawn)
  11. local zone = GetZone(NPC)
  12. local Darkelf = GetSpawnByLocationID(zone, 133780688)
  13. if IsAlive(Darkelf) then
  14. Dialog1(NPC, Spawn)
  15. else
  16. Dialog2(NPC, Spawn)
  17. end
  18. end
  19. function Dialog1(NPC, Spawn)
  20. FaceTarget(NPC, Spawn)
  21. Dialog.New(NPC, Spawn)
  22. Dialog.AddDialog("I don't know what happened! Suddenly all my regulars started tearing up the place!")
  23. PlayFlavor(NPC, "", "", "confused", 0, 0, Spawn)
  24. Dialog.AddOption("I'm here to see what there is to be done.","BeDone")
  25. Dialog.AddOption("Perhaps a round of drinks will calm their nerves?","Round")
  26. Dialog.AddOption("This is my kind of party!","Boot")
  27. Dialog.AddOption("Well, good luck with all this.")
  28. Dialog.Start()
  29. end
  30. function BeDone(NPC,Spawn)
  31. FaceTarget(NPC, Spawn)
  32. Dialog.New(NPC, Spawn)
  33. Dialog.AddDialog("Something has got them all riled up. It happened so suddenly, perhaps its the ale or some sort of magic!")
  34. PlayFlavor(NPC, "", "", "thanks", 0, 0, Spawn)
  35. Dialog.AddOption("Anything else I should know?","SomethingElse")
  36. Dialog.AddOption("Perhaps a round of drinks will calm their nerves?","Round")
  37. Dialog.AddOption("This is my kind of party!","Boot")
  38. Dialog.AddOption("I'll see what I can do.")
  39. Dialog.Start()
  40. end
  41. function SomethingElse(NPC,Spawn)
  42. FaceTarget(NPC, Spawn)
  43. Dialog.New(NPC, Spawn)
  44. Dialog.AddDialog("Now that you mention it... I've heard someone cackling, but it sure isn't coming from someone I can see!")
  45. PlayFlavor(NPC, "", "", "shrug", 0, 0, Spawn)
  46. Dialog.AddOption("Perhaps a round of drinks will calm their nerves?","Round")
  47. Dialog.AddOption("This is my kind of party!","Boot")
  48. Dialog.AddOption("I'll see what I can do.")
  49. Dialog.Start()
  50. end
  51. function Round(NPC,Spawn)
  52. FaceTarget(NPC, Spawn)
  53. Dialog.New(NPC, Spawn)
  54. Dialog.AddDialog("I already tried that! They just threw the mugs at eachother. Please, you must do something!")
  55. PlayFlavor(NPC, "", "", "heckno", 0, 0, Spawn)
  56. Dialog.AddOption("I'm here to see what there is to be done.","BeDone")
  57. Dialog.AddOption("This is my kind of party!","Boot")
  58. Dialog.AddOption("Alright.")
  59. Dialog.Start()
  60. end
  61. function Boot(NPC,Spawn)
  62. SendPopUpMessage(Spawn,"You have been kicked out!",255,0,0)
  63. PlaySound(Spawn,"sounds/ui/ui_warning.wav", GetX(NPC), GetY(NPC), GetZ(NPC))
  64. FaceTarget(NPC, Spawn)
  65. Dialog.New(NPC, Spawn)
  66. Dialog.AddDialog("Get out! NOW! I have no time for you!")
  67. PlayFlavor(NPC, "", "", "shakefist", 0, 0, Spawn)
  68. Dialog.AddOption("Noo! I want to join the fun!")
  69. Dialog.Start()
  70. AddTimer(NPC,4000,"Kick",1,Spawn)
  71. end
  72. function Kick(NPC,Spawn)
  73. SQ = GetZone("SouthQeynos")
  74. Zone(SQ,Spawn,590.25, -17.22, 245.18, 10)
  75. end
  76. function Dialog2(NPC, Spawn)
  77. FaceTarget(NPC, Spawn)
  78. PlayFlavor(NPC,"","Thank you for all your help! Now I just have to clean up this mess...","thanks",0,0)
  79. end
  80. function spawn(NPC, Spawn)
  81. combatModule(NPC, Spawn)
  82. AddTimer(NPC,MakeRandomInt(2000,5000),"EmoteLoop")
  83. end
  84. function EmoteLoop(NPC)
  85. local zone = GetZone(NPC)
  86. local Darkelf = GetSpawnByLocationID(zone, 133780688)
  87. if not IsAlive(Darkelf) then
  88. SpawnSet(NPC,"mood_state",0)
  89. SpawnSet(NPC,"name","a relieved bartender")
  90. choice = MakeRandomInt(1,5)
  91. if choice ==1 then
  92. PlayFlavor(NPC,"","","shame",0,0)
  93. elseif choice ==2 then
  94. PlayFlavor(NPC,"","","sigh",0,0)
  95. elseif choice ==3 then
  96. PlayFlavor(NPC,"","","agree",0,0)
  97. elseif choice ==4 then
  98. PlayFlavor(NPC,"","","thanks",0,0)
  99. elseif choice ==5 then
  100. PlayFlavor(NPC,"","","glare",0,0)
  101. end
  102. end
  103. AddTimer(NPC,7000,"EmoteLoop")
  104. end
  105. function respawn(NPC)
  106. spawn(NPC)
  107. end