BarmaidMelia.lua 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138
  1. --[[
  2. Script Name : SpawnScripts/BeggarsCourt/BarmaidMelia.lua
  3. Script Author : Dorbin
  4. Script Date : 2023.11.28 05:11:26
  5. Script Purpose :
  6. :
  7. --]]
  8. function spawn(NPC)
  9. waypoints(NPC)
  10. SetTempVariable(NPC,"BartenderCallout","false")
  11. end
  12. function hailed(NPC, Spawn)
  13. FaceTarget(NPC, Spawn)
  14. local choice = MakeRandomInt(1, 3)
  15. if choice == 1 then
  16. PlayFlavor(NPC, "voiceover/english/human_eco_evil_barmaid/ft/eco/evil/human_eco_evil_barmaid_hail_gf_1be602a.mp3", "What will it be? A short beer or ale to get you started?", "tapfoot", 1335469253, 604669752)
  17. elseif choice == 2 then
  18. PlayFlavor(NPC, "voiceover/english/human_eco_evil_barmaid/ft/eco/evil/human_eco_evil_barmaid_hail_gf_2d4c7e27.mp3", "It's hard to keep folks like you happy around here. If someone's not yelling for more, they're yelling to get a mess cleaned.", "shrug", 1592395791, 2626505941)
  19. elseif choice == 3 then
  20. PlayFlavor(NPC, "voiceover/english/human_eco_evil_barmaid/ft/eco/evil/human_eco_evil_barmaid_hail_gf_3c0b7748.mp3", "Too many of those refugees pouring in lately, and they almost never tip. I'm ready to complain to the Far Seas that they need to train their castaways better.", "scold", 3617439192, 3468220606)
  21. end
  22. end
  23. function respawn(NPC)
  24. spawn(NPC)
  25. end
  26. function BartenderCall(NPC,Spawn)
  27. if GetTempVariable(NPC,"BartenderCallout")== "false" and MakeRandomInt(0,100) <=66 then
  28. local zone = GetZone(NPC)
  29. local Bartender = GetSpawnByLocationID(zone, 402926)
  30. SetTempVariable(NPC,"BartenderCallout","true")
  31. local choice = MakeRandomInt(1,3)
  32. if choice== 1 then
  33. SetTarget(Bartender,NPC)
  34. FaceTarget(Bartender,NPC)
  35. PlayFlavor(Bartender, "voiceover/english/human_eco_evil_bartender/ft/eco/evil/human_eco_evil_bartender_barmaid_gm_fce6ec9a.mp3", "I can't tell this pub from a pigsty. Get to work and clean this mess!", "scold", 1129202055, 4037261409)
  36. AddTimer(NPC,1500,"Turn")
  37. AddTimer(NPC,4500,"Reset")
  38. AddTimer(NPC,6500,"Reset2")
  39. elseif choice == 2 then
  40. PlayFlavor(NPC, "voiceover/english/human_eco_good_bartender/ft/eco/good/human_eco_good_bartender_drunk_gf_a8ee7698.mp3", "I don't have much patience for you today. Watch yourself.", "glare", 3292238371, 2757124824)
  41. SetTarget(NPC,Bartender)
  42. FaceTarget(NPC,Bartender)
  43. AddTimer(NPC,1500,"Turn_2")
  44. AddTimer(NPC,4500,"Reset")
  45. AddTimer(NPC,6500,"Reset2")
  46. elseif choice == 3 then
  47. Action(NPC)
  48. end
  49. else
  50. Action(NPC)
  51. SetTempVariable(NPC,"BartenderCallout","false")
  52. end
  53. end
  54. function Turn(NPC,Spawn)
  55. local zone = GetZone(NPC)
  56. local Bartender = GetSpawnByLocationID(zone, 402926)
  57. SetTarget(NPC,Bartender)
  58. FaceTarget(NPC,Bartender)
  59. local choice = MakeRandomInt(1, 2)
  60. if choice == 1 then
  61. PlayFlavor(NPC, "", "", "grumble", 0, 0)
  62. elseif choice == 2 then
  63. PlayFlavor(NPC, "", "", "shakefist", 0, 0)
  64. end
  65. end
  66. function Turn_2(NPC,Spawn)
  67. local zone = GetZone(NPC)
  68. local Bartender = GetSpawnByLocationID(zone, 402926)
  69. SetTarget(Bartender,NPC)
  70. FaceTarget(Bartender,NPC)
  71. local choice = MakeRandomInt(1, 2)
  72. if choice == 1 then
  73. PlayFlavor(Bartender, "", "", "grumble", 0, 0)
  74. elseif choice == 2 then
  75. PlayFlavor(Bartender, "", "", "whome", 0, 0)
  76. end
  77. end
  78. function Reset(NPC,Spawn)
  79. local zone = GetZone(NPC)
  80. local Bartender = GetSpawnByLocationID(zone, 402926)
  81. SetTarget(NPC,nil)
  82. SetTarget(Bartender,nil)
  83. end
  84. function Reset2(NPC,Spawn)
  85. local zone = GetZone(NPC)
  86. local Bartender = GetSpawnByLocationID(zone, 402926)
  87. SetHeading(Bartender,106)
  88. end
  89. function waypoints(NPC)
  90. MovementLoopAddLocation(NPC, 3.9, 4.75, -48.17, 2, 0)
  91. MovementLoopAddLocation(NPC, 3.99, 4.75, -50.82, 2, 1)
  92. MovementLoopAddLocation(NPC, 3.99, 4.75, -50.82, 2, 15,"Action")
  93. MovementLoopAddLocation(NPC, 3.51, 4.75, -50.43, 2, 0)
  94. MovementLoopAddLocation(NPC, 4.13, 4.75, -49.54, 2, 1)
  95. MovementLoopAddLocation(NPC, 4.13, 4.75, -49.54, 2, 15,"Action")
  96. MovementLoopAddLocation(NPC, 4.13, 4.75, -49.54, 2, 0)
  97. MovementLoopAddLocation(NPC, 3.81, 4.75, -48.49, 2, 0)
  98. MovementLoopAddLocation(NPC, 2.91, 4.75, -46.28, 2, 1)
  99. MovementLoopAddLocation(NPC, 2.91, 4.75, -46.28, 2, 15,"Action")
  100. MovementLoopAddLocation(NPC, 1.85, 4.75, -45.73, 2, 0)
  101. MovementLoopAddLocation(NPC, 2.38, 5, -43.5, 2, 0)
  102. MovementLoopAddLocation(NPC, 4.62, 5, -41.65, 2, 1)
  103. MovementLoopAddLocation(NPC, 4.62, 5, -41.65, 2, 15,"BartenderCall")
  104. MovementLoopAddLocation(NPC, 4.62, 5, -41.65, 2, 0)
  105. MovementLoopAddLocation(NPC, 3.4, 5, -43.81, 2, 0)
  106. MovementLoopAddLocation(NPC, 3.05, 4.75, -45.58, 2, 1)
  107. MovementLoopAddLocation(NPC, 3.05, 4.75, -45.58, 2, 15,"Action")
  108. MovementLoopAddLocation(NPC, 3.62, 4.75, -49.13, 2, 0)
  109. MovementLoopAddLocation(NPC, 4.45, 4.75, -51.45, 2, 1)
  110. MovementLoopAddLocation(NPC, 4.45, 4.75, -51.45, 2, 15,"Action")
  111. MovementLoopAddLocation(NPC, 3.53, 4.75, -48.48, 2, 0)
  112. MovementLoopAddLocation(NPC, 4, 4.75, -46.28, 2, 1)
  113. MovementLoopAddLocation(NPC, 4, 4.75, -46.28, 2, 15,"Action")
  114. end
  115. function Action(NPC)
  116. local choice = MakeRandomInt(1, 4)
  117. if choice == 1 then
  118. PlayFlavor(NPC, "", "", "confused", 0, 0)
  119. elseif choice == 2 then
  120. PlayFlavor(NPC, "", "", "ponder", 0, 0)
  121. elseif choice == 3 then
  122. PlayFlavor(NPC, "", "", "sniff", 0, 0)
  123. elseif choice == 4 then
  124. PlayFlavor(NPC, "", "", "tapfoot", 0, 0)
  125. end
  126. end