9
3

DrunkArtorius.lua 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116
  1. --[[
  2. Script Name : SpawnScripts/BeggarsCourt/DrunkArtorius.lua
  3. Script Author : Dorbin
  4. Script Date : 2023.11.27 04:11:56
  5. Script Purpose :
  6. :
  7. --]]
  8. dofile("SpawnScripts/Generic/GenericEcologyVoiceOvers.lua")
  9. function spawn(NPC)
  10. waypoints(NPC)
  11. SetPlayerProximityFunction(NPC, 5, "InRange", "LeaveRange")
  12. end
  13. function InRange(NPC, Spawn)
  14. -- GenericDrunkCallout(NPC, Spawn, faction)
  15. end
  16. function hailed(NPC, Spawn)
  17. FaceTarget(NPC, Spawn)
  18. GenericDrunkHail(NPC, Spawn, faction)
  19. end
  20. function respawn(NPC)
  21. spawn(NPC)
  22. end
  23. function Drink(NPC)
  24. PlayFlavor(NPC,"","","drinking_idle",0,0)
  25. AddTimer(NPC,8000, "Drink2")
  26. end
  27. function Drink2(NPC)
  28. choice = math.random(1,4)
  29. if choice == 1 then
  30. PlayFlavor(NPC,"","","yawn",0,0)
  31. elseif choice == 2 then
  32. PlayFlavor(NPC,"","","drinking_idle",0,0)
  33. elseif choice == 3 then
  34. PlayFlavor(NPC,"","","hungry",0,0)
  35. else
  36. PlayFlavor(NPC,"","","happy",0,0)
  37. end
  38. AddTimer(NPC,6000, "Drink3")
  39. end
  40. function Drink3(NPC) -- Checks if the guard is near
  41. local zone = GetZone(NPC)
  42. local Guard = GetSpawnByLocationID(zone, 403010)
  43. local Distance = GetDistance(NPC,Guard)
  44. if Distance>5 then
  45. PlayFlavor(NPC,"","","drinking_idle",0,0)
  46. else
  47. PlayFlavor(NPC,"","","sniff",0,0)
  48. end
  49. end
  50. function waypoints(NPC)
  51. MovementLoopAddLocation(NPC, 82.03, -7.08, 102.12, 2, 0)
  52. MovementLoopAddLocation(NPC, 81.23, -7.08, 100.5, 2, MakeRandomInt(7,13))
  53. MovementLoopAddLocation(NPC, 81.23, -7.08, 100.5, 2, 0)
  54. MovementLoopAddLocation(NPC, 80.05, -7.08, 103.32, 2, 1)
  55. MovementLoopAddLocation(NPC, 80.05, -7.08, 103.32, 2, MakeRandomInt(10,13),"Drink3")
  56. MovementLoopAddLocation(NPC, 82.53, -7.08, 103.57, 2, 1)
  57. MovementLoopAddLocation(NPC, 82.53, -7.08, 103.57, 2, MakeRandomInt(7,13),"Drink3")
  58. MovementLoopAddLocation(NPC, 80.79, -7.08, 102.37, 2, MakeRandomInt(7,13))
  59. MovementLoopAddLocation(NPC, 80.79, -7.08, 102.37, 2, 1)
  60. MovementLoopAddLocation(NPC, 80.62, -7.08, 99.52, 2, MakeRandomInt(10,13),"Drink3")
  61. MovementLoopAddLocation(NPC, 80.29, -7.08, 104.09, 2, 1)
  62. MovementLoopAddLocation(NPC, 80.29, -7.08, 104.09, 2, MakeRandomInt(10,13),"Drink3")
  63. MovementLoopAddLocation(NPC, 78.36, -7.08, 106.45, 2, 0)
  64. MovementLoopAddLocation(NPC, 76.59, -7.08, 106.76, 2, MakeRandomInt(7,13))
  65. MovementLoopAddLocation(NPC, 76.76, -7.08, 104.63, 2, MakeRandomInt(7,13))
  66. MovementLoopAddLocation(NPC, 81.06, -7.08, 102.97, 2, 1)
  67. MovementLoopAddLocation(NPC, 81.06, -7.08, 102.97, 2, MakeRandomInt(10,13),"Drink3")
  68. MovementLoopAddLocation(NPC, 77.14, -7.08, 104, 2, MakeRandomInt(7,13))
  69. MovementLoopAddLocation(NPC, 75.78, -7.08, 106.22, 2, 1)
  70. MovementLoopAddLocation(NPC, 75.78, -7.08, 106.22, 2, MakeRandomInt(10,13),"Drink3")
  71. --[[
  72. MovementLoopAddLocation(NPC, 56.11, 3.75, 3.2, 2, 0)
  73. MovementLoopAddLocation(NPC, 57.67, 3.75, 2.29, 2, 1)
  74. MovementLoopAddLocation(NPC, 57.67, 3.75, 2.29, 2, 30,"Drink")
  75. MovementLoopAddLocation(NPC, 57.67, 3.75, 2.29, 2, 0)
  76. MovementLoopAddLocation(NPC, 55.42, 3.5, 6.09, 2, 0)
  77. MovementLoopAddLocation(NPC, 53.94, 3.25, 7.23, 2, 1)
  78. MovementLoopAddLocation(NPC, 53.94, 3.25, 7.23, 2, 30,"Drink")
  79. MovementLoopAddLocation(NPC, 53.94, 3.25, 7.23, 2, 0)
  80. MovementLoopAddLocation(NPC, 51.7, 3, 6.61, 2, 4)
  81. MovementLoopAddLocation(NPC, 53.21, 3.25, 5.09, 2, 0)
  82. MovementLoopAddLocation(NPC, 54.95, 3.5, 4.58, 2, 0)
  83. MovementLoopAddLocation(NPC, 57.96, 3.75, 2.31, 2, 0)
  84. MovementLoopAddLocation(NPC, 61.03, 4.03, -0.82, 2, 1)
  85. MovementLoopAddLocation(NPC, 61.03, 4.03, -0.82, 2, 30,"Drink")
  86. MovementLoopAddLocation(NPC, 59.2, 3.75, 1.12, 2, 0)
  87. MovementLoopAddLocation(NPC, 57.38, 4, -0.45, 2, 0)
  88. MovementLoopAddLocation(NPC, 58.03, 4, -2.76, 2, 0)
  89. MovementLoopAddLocation(NPC, 56.89, 4.25, -6.52, 2, 0)
  90. MovementLoopAddLocation(NPC, 60.23, 5, -13.88, 2, 1)
  91. MovementLoopAddLocation(NPC, 61.85, 5, -23.46, 2, 30,"Drink")
  92. MovementLoopAddLocation(NPC, 61.74, 5, -23.56, 2, 0)
  93. MovementLoopAddLocation(NPC, 62.2, 5, -22.15, 2, 0)
  94. MovementLoopAddLocation(NPC, 58.93, 5, -15.42, 2, 0)
  95. MovementLoopAddLocation(NPC, 54.5, 4.38, -7.86, 2, 0)
  96. MovementLoopAddLocation(NPC, 53.25, 4, -4.82, 2, 0)
  97. MovementLoopAddLocation(NPC, 53.16, 4, -3.62, 2, 1)
  98. MovementLoopAddLocation(NPC, 53.16, 4, -3.62, 2, 30,"Drink")
  99. MovementLoopAddLocation(NPC, 53.16, 4, -3.62, 2, 0)
  100. MovementLoopAddLocation(NPC, 52.99, 4, -1.23, 2, 0)
  101. MovementLoopAddLocation(NPC, 57.73, 3.75, 4.32, 2, 1)
  102. MovementLoopAddLocation(NPC, 57.73, 3.75, 4.32, 2, 30,"Drink")]]--
  103. end