LonaDolsar.lua 7.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189
  1. --[[
  2. Script Name : SpawnScripts/Graystone/LonaDolsar.lua
  3. Script Author : Dorbin
  4. Script Date : 2022.03.12 05:03:46
  5. Script Purpose : Ecology script for Lona Dolsar
  6. :
  7. --]]
  8. dofile("SpawnScripts/Generic/UnknownLanguage.lua")
  9. dofile("SpawnScripts/Generic/GenericEcologyVoiceOvers.lua")
  10. function spawn(NPC)
  11. waypoints(NPC)
  12. SetPlayerProximityFunction(NPC, 5, "InRange", "LeaveRange")
  13. end
  14. function hailed(NPC, Spawn)
  15. FaceTarget(NPC, Spawn)
  16. if not HasLanguage(Spawn,1)then
  17. FaceTarget(NPC, Spawn)
  18. Garbled(NPC,Spawn)
  19. else
  20. FaceTarget(NPC, Spawn)
  21. GenericEcologyHail(NPC, Spawn, faction)
  22. end
  23. end
  24. function InRange(NPC, Spawn)
  25. if not HasLanguage(Spawn,1)then
  26. if math.random(1, 100) <= 25 then
  27. Garbled(NPC,Spawn)
  28. end
  29. else
  30. GenericEcologyCallout(NPC, Spawn, faction)
  31. end
  32. end
  33. function respawn(NPC)
  34. end
  35. function waypoints(NPC)
  36. MovementLoopAddLocation(NPC, 820.04, -21.06, -134.46, 2,2)
  37. MovementLoopAddLocation(NPC, 820.04, -21.06, -134.46, 2, math.random(20, 40),"Drink")
  38. MovementLoopAddLocation(NPC, 820.08, -21.06, -134.18, 2, 0)
  39. MovementLoopAddLocation(NPC, 824.23, -21.06, -137.68, 2, 0)
  40. MovementLoopAddLocation(NPC, 833.23, -20.93, -137.54, 2, 0)
  41. MovementLoopAddLocation(NPC, 837.87, -20.93, -133.32, 2, 0)
  42. MovementLoopAddLocation(NPC, 838.54, -20.93, -128.22, 2, 0)
  43. MovementLoopAddLocation(NPC, 833.06, -20.97, -122.85, 2, 0)
  44. MovementLoopAddLocation(NPC, 833.57, -20.97, -118.44, 2, 0)
  45. MovementLoopAddLocation(NPC, 837.42, -20.74, -116.33, 2, 2)
  46. MovementLoopAddLocation(NPC, 837.42, -20.74, -116.33, 2, math.random(15, 20),"Action")
  47. MovementLoopAddLocation(NPC, 842.94, -22.75, -120.25, 2, 0)
  48. MovementLoopAddLocation(NPC, 847.21, -25.38, -132.05, 2, 0)
  49. MovementLoopAddLocation(NPC, 853.74, -24.22, -145.59, 2, 0)
  50. MovementLoopAddLocation(NPC, 858.33, -23.82, -153.42, 2, 0)
  51. MovementLoopAddLocation(NPC, 877.99, -24.92, -153.22, 2,2)
  52. MovementLoopAddLocation(NPC, 877.99, -24.92, -153.22, 2, math.random(15, 18),"Action")
  53. MovementLoopAddLocation(NPC, 893.04, -22.57, -140.35, 2, 0)
  54. MovementLoopAddLocation(NPC, 896.71, -22.49, -130.29, 2, 0)
  55. MovementLoopAddLocation(NPC, 898.5, -22.33, -122.41, 2, 0)
  56. MovementLoopAddLocation(NPC, 893.14, -22.31, -114.26, 2, 0)
  57. MovementLoopAddLocation(NPC, 893.25, -22.3, -107.48, 2, 2)
  58. MovementLoopAddLocation(NPC, 893.25, -22.3, -107.48, 2, 11,"FaceSeer")
  59. MovementLoopAddLocation(NPC, 893.25, -22.3, -107.48, 2, 1)
  60. MovementLoopAddLocation(NPC, 888.56, -22.26, -98.63, 2, 0)
  61. MovementLoopAddLocation(NPC, 884.07, -22.63, -97.91, 2, 0)
  62. MovementLoopAddLocation(NPC, 871.31, -24.95, -101.92, 2, 0)
  63. MovementLoopAddLocation(NPC, 846.94, -23.13, -106.78, 2, 0)
  64. MovementLoopAddLocation(NPC, 844.32, -22.66, -113.49, 2, 0)
  65. MovementLoopAddLocation(NPC, 833.23, -20.93, -111.73, 2, 0)
  66. MovementLoopAddLocation(NPC, 827.57, -20.97, -120.23, 2, math.random(15, 20),"Action")
  67. MovementLoopAddLocation(NPC, 837.96, -20.93, -130.15, 2, 0)
  68. MovementLoopAddLocation(NPC, 837.42, -20.93, -137.06, 2, 0)
  69. MovementLoopAddLocation(NPC, 822.36, -21.06, -138.73, 2, 0)
  70. --loop 2
  71. MovementLoopAddLocation(NPC, 820.04, -21.06, -134.46, 2,2)
  72. MovementLoopAddLocation(NPC, 820.04, -21.06, -134.46, 2, math.random(30, 45),"Drink")
  73. MovementLoopAddLocation(NPC, 820.08, -21.06, -134.18, 2, 0)
  74. MovementLoopAddLocation(NPC, 824.23, -21.06, -137.68, 2, 0)
  75. MovementLoopAddLocation(NPC, 833.23, -20.93, -137.54, 2, 0)
  76. MovementLoopAddLocation(NPC, 837.87, -20.93, -133.32, 2, 0)
  77. MovementLoopAddLocation(NPC, 838.54, -20.93, -128.22, 2, 0)
  78. MovementLoopAddLocation(NPC, 833.06, -20.97, -122.85, 2, 0)
  79. MovementLoopAddLocation(NPC, 833.57, -20.97, -118.44, 2, 0)
  80. MovementLoopAddLocation(NPC, 837.42, -20.74, -116.33, 2, 2)
  81. MovementLoopAddLocation(NPC, 837.42, -20.74, -116.33, 2, math.random(15, 20),"Action")
  82. MovementLoopAddLocation(NPC, 842.94, -22.75, -120.25, 2, 0)
  83. MovementLoopAddLocation(NPC, 847.21, -25.38, -132.05, 2, 0)
  84. MovementLoopAddLocation(NPC, 853.74, -24.22, -145.59, 2, 0)
  85. MovementLoopAddLocation(NPC, 858.33, -23.82, -153.42, 2, 0)
  86. MovementLoopAddLocation(NPC, 877.99, -24.92, -153.22, 2, math.random(15, 20),"Action")
  87. MovementLoopAddLocation(NPC, 893.04, -22.57, -140.35, 2, 0)
  88. MovementLoopAddLocation(NPC, 896.71, -22.49, -130.29, 2, 0)
  89. MovementLoopAddLocation(NPC, 898.5, -22.33, -122.41, 2, 0)
  90. MovementLoopAddLocation(NPC, 893.14, -22.31, -114.26, 2, 0)
  91. MovementLoopAddLocation(NPC, 892.70, -22.31, -111.55, 2, 2)
  92. MovementLoopAddLocation(NPC, 892.70, -22.31, -111.55, 2, 10,"Action")
  93. MovementLoopAddLocation(NPC, 893.12, -22.31, -111.91, 2, 0)
  94. MovementLoopAddLocation(NPC, 893.25, -22.3, -107.48, 2, 0)
  95. MovementLoopAddLocation(NPC, 888.56, -22.26, -98.63, 2, 0)
  96. MovementLoopAddLocation(NPC, 884.07, -22.63, -97.91, 2, 0)
  97. MovementLoopAddLocation(NPC, 871.31, -24.95, -101.92, 2, 0)
  98. MovementLoopAddLocation(NPC, 846.94, -23.13, -106.78, 2, 0)
  99. MovementLoopAddLocation(NPC, 844.32, -22.66, -113.49, 2, 0)
  100. MovementLoopAddLocation(NPC, 833.23, -20.93, -111.73, 2, 0)
  101. MovementLoopAddLocation(NPC, 827.57, -20.97, -120.23, 2, math.random(15, 20),"Action")
  102. MovementLoopAddLocation(NPC, 837.96, -20.93, -130.15, 2, 0)
  103. MovementLoopAddLocation(NPC, 837.42, -20.93, -137.06, 2, 0)
  104. MovementLoopAddLocation(NPC, 822.36, -21.06, -138.73, 2, 0)
  105. end
  106. function Drink(NPC)
  107. PlayAnimation(NPC,11422)
  108. AddTimer(NPC,8000, "Drink2")
  109. end
  110. function Drink2(NPC)
  111. choice = math.random(1,2)
  112. if choice == 1 then
  113. PlayAnimation(NPC,891)
  114. else
  115. PlayAnimation(NPC,11668)
  116. end
  117. AddTimer(NPC,6000, "Drink3")
  118. end
  119. function Drink3(NPC)
  120. PlayAnimation(NPC,11422)
  121. end
  122. function FaceSeer(NPC)
  123. local Reyala = GetSpawn(NPC, 2330137)
  124. if Reyala ~= nil then
  125. FaceTarget(NPC, Reyala)
  126. AddTimer(NPC, 1000, "ReyalaFacesGolan")
  127. end
  128. end
  129. function ReyalaFacesGolan(NPC)
  130. local Reyala = GetSpawn(NPC, 2330137)
  131. if Reyala ~= nil then
  132. FaceTarget(Reyala, NPC)
  133. AddTimer(NPC, 500, "ReyalaSeersGolan")
  134. end
  135. end
  136. function ReyalaSeersGolan(NPC)
  137. local Reyala = GetSpawn(NPC, 2330137)
  138. if Reyala ~= nil then
  139. choice = math.random(1,2)
  140. PlayFlavor(Reyala, "voiceover/english/human_eco_good_seer/ft/eco/good/human_eco_good_seer_barmaid_gf_23d3c5ab.mp3","You seek a life to make yourself happy than trying to please others.", "shame", 2950244318, 54283461)
  141. AddTimer(NPC, 2000, "ConfusedAtReyala")
  142. end
  143. end
  144. function ConfusedAtReyala(NPC)
  145. local Reyala = GetSpawn(NPC, 2330137)
  146. if Reyala ~= nil then
  147. choice = math.random(1,2)
  148. if choice == 1 then
  149. PlayFlavor(NPC, "","", "confused", 0, 0)
  150. else
  151. PlayFlavor(NPC, "","", "whome", 0, 0)
  152. end
  153. AddTimer(NPC, 6000, "ReturnReyala")
  154. end
  155. end
  156. function ReturnReyala(NPC)
  157. local Reyala = GetSpawn(NPC, 2330137)
  158. SpawnSet(Reyala, "heading", "52.65")
  159. end
  160. function Action(NPC)
  161. choice = math.random(1,4)
  162. if choice == 1 then
  163. PlayFlavor(NPC, "","", "stretch", 0, 0)
  164. elseif choice == 2 then
  165. PlayFlavor(NPC, "","", "yawn", 0, 0)
  166. elseif choice == 3 then
  167. PlayFlavor(NPC, "","", "sniff", 0, 0)
  168. else
  169. PlayFlavor(NPC, "","", "tap", 0, 0)
  170. end
  171. end