9
3

DimalBOrin.lua 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142
  1. --[[
  2. Script Name : SpawnScripts/Longshadow/DimalBOrin.lua
  3. Script Author : Dorbin
  4. Script Date : 2023.10.14 07:10:02
  5. Script Purpose :
  6. :
  7. --]]
  8. dofile("SpawnScripts/Generic/GenericEcologyVoiceOvers.lua")
  9. dofile("SpawnScripts/Generic/UnknownLanguage.lua")
  10. function spawn(NPC)
  11. SetPlayerProximityFunction(NPC, 7, "InRange", "LeaveRange")
  12. waypoints(NPC)
  13. end
  14. function hailed(NPC, Spawn)
  15. FaceTarget(NPC, Spawn)
  16. if not HasLanguage(Spawn,2)then
  17. Garbled(NPC,Spawn)
  18. --PlayFlavor(NPC,"","","shrug",0,0,Spawn)
  19. else
  20. GenericEcologyHail(NPC, Spawn, faction)
  21. end
  22. end
  23. function InRange(NPC,Spawn)
  24. if GetFactionAmount(Spawn,12)<0 then
  25. FactionCheckCallout(NPC,Spawn,faction)
  26. else
  27. if not HasLanguage(Spawn,2)then
  28. if math.random(0,100)<40 then
  29. FaceTarget(NPC, Spawn)
  30. Garbled(NPC,Spawn)
  31. end
  32. else
  33. GenericEcologyHail(NPC, Spawn, faction)
  34. end
  35. end
  36. end
  37. function respawn(NPC)
  38. spawn(NPC)
  39. end
  40. function Door(NPC,Spawn)
  41. local door = GetSpawn(NPC, 1380083)
  42. UseWidget(door)
  43. end
  44. function Action(NPC)
  45. local choice = MakeRandomInt(1, 4)
  46. if choice == 1 then
  47. PlayFlavor(NPC, "", "", "mood_angry", 0, 0)
  48. elseif choice == 2 then
  49. PlayFlavor(NPC, "", "", "ponder", 0, 0)
  50. elseif choice == 3 then
  51. PlayFlavor(NPC, "", "", "sniff", 0, 0)
  52. elseif choice == 4 then
  53. PlayFlavor(NPC, "", "", "tapfoot", 0, 0)
  54. end
  55. end
  56. function waypoints(NPC)
  57. MovementLoopAddLocation(NPC, -5.64, 3, 71.95, 2, 1)
  58. MovementLoopAddLocation(NPC, -5.64, 3, 71.95, 2, MakeRandomInt(20,30),"Action")
  59. MovementLoopAddLocation(NPC, -3.33, 3, 66.71, 2, 0)
  60. MovementLoopAddLocation(NPC, -0.33, 3, 57.94, 2, 0)
  61. MovementLoopAddLocation(NPC, 6.91, 3, 53.28, 2, 0)
  62. MovementLoopAddLocation(NPC, 6.97, 3, 51.69, 2, 0)
  63. MovementLoopAddLocation(NPC, 3.44, 3, 37.48, 2, 0)
  64. MovementLoopAddLocation(NPC, 2.75, 2.98, 33.01, 2, 0)
  65. MovementLoopAddLocation(NPC, 1.73, 2.98, 32.97, 2, 0)
  66. MovementLoopAddLocation(NPC, -7.37, 3, 33.77, 2, 0)
  67. MovementLoopAddLocation(NPC, -26.37, 4.21, 27.5, 2, 0)
  68. MovementLoopAddLocation(NPC, -43.72, 4.09, 20.05, 2, 0)
  69. MovementLoopAddLocation(NPC, -52.25, 4.16, 15.67, 2, 0)
  70. MovementLoopAddLocation(NPC, -55.56, 4, 15.67, 2, 1)
  71. MovementLoopAddLocation(NPC, -55.56, 4, 15.67, 2, MakeRandomInt(15,30),"Action")
  72. MovementLoopAddLocation(NPC, -54.98, 3.8, 13.49, 2, 0)
  73. MovementLoopAddLocation(NPC, -56.13, 3.02, 7.88, 2, 0)
  74. MovementLoopAddLocation(NPC, -57.44, 2.32, 1.96, 2, 2,"Door")
  75. MovementLoopAddLocation(NPC, -62.04, 2.5, 1.3, 2, 0)
  76. MovementLoopAddLocation(NPC, -62.88, 2.5, -0.25, 2, 1,"Door")
  77. MovementLoopAddLocation(NPC, -62.88, 2.5, -0.25, 2, MakeRandomInt(15,30),"Action")
  78. MovementLoopAddLocation(NPC, -62.79, 2.5, 2, 2, 1)
  79. MovementLoopAddLocation(NPC, -62.79, 2.5, 2, 2, 20,"Action")
  80. MovementLoopAddLocation(NPC, -61.01, 2.5, 1.46, 2, 2,"Door")
  81. MovementLoopAddLocation(NPC, -57.9, 2.4, 1.61, 2, 0,"Door")
  82. MovementLoopAddLocation(NPC, -57.38, 2.31, 1.6, 2, 0)
  83. MovementLoopAddLocation(NPC, -52.25, 3.58, 10.09, 2, 0)
  84. MovementLoopAddLocation(NPC, -50.49, 4.19, 14.02, 2, 0)
  85. MovementLoopAddLocation(NPC, -42.15, 4.05, 18.54, 2, 0)
  86. MovementLoopAddLocation(NPC, -34.44, 4.42, 22.51, 2, 0)
  87. MovementLoopAddLocation(NPC, -19.58, 3.92, 27.71, 2, 0)
  88. MovementLoopAddLocation(NPC, -12.95, 3.4, 30.12, 2, 0)
  89. MovementLoopAddLocation(NPC, -3.44, 2.97, 30.88, 2, 0)
  90. MovementLoopAddLocation(NPC, 7.15, 2.82, 28.05, 2, 0)
  91. MovementLoopAddLocation(NPC, 13.93, 2.16, 24.98, 2, 0)
  92. MovementLoopAddLocation(NPC, 15.64, 1.86, 24.19, 2, 0)
  93. MovementLoopAddLocation(NPC, 15.13, 1.94, 22.4, 2, 0)
  94. MovementLoopAddLocation(NPC, 9.65, 0.67, 15.41, 2, 0)
  95. MovementLoopAddLocation(NPC, 8.12, 0, 11.94, 2, 0)
  96. MovementLoopAddLocation(NPC, 7.18, 0, 8.8, 2, 0)
  97. MovementLoopAddLocation(NPC, 9.55, 0, 4.49, 2, 0)
  98. MovementLoopAddLocation(NPC, 10.14, 0, -0.9, 2, 0)
  99. MovementLoopAddLocation(NPC, 7.17, 0.04, -21.59, 2, 1)
  100. MovementLoopAddLocation(NPC, 7.17, 0.04, -21.59, 2, 30,"Action")
  101. MovementLoopAddLocation(NPC, 5.5, 0.04, -19.47, 2, 0)
  102. MovementLoopAddLocation(NPC, -0.28, 0, -14.19, 2, 0)
  103. MovementLoopAddLocation(NPC, -6.51, 0.09, -11.75, 2, 0)
  104. MovementLoopAddLocation(NPC, -17.94, 0.08, -14.58, 2, 0)
  105. MovementLoopAddLocation(NPC, -25.99, 0.02, -18.93, 2, 0)
  106. MovementLoopAddLocation(NPC, -31.88, -0.08, -22.43, 2, 0)
  107. MovementLoopAddLocation(NPC, -35.26, -1, -27.91, 2, 1)
  108. MovementLoopAddLocation(NPC, -35.26, -1, -27.91, 2, MakeRandomInt(10,20),"Action")
  109. MovementLoopAddLocation(NPC, -34.13, -1.02, -26.75, 2, 0)
  110. MovementLoopAddLocation(NPC, -32.93, -1.73, -30.89, 2, 0)
  111. MovementLoopAddLocation(NPC, -33.52, -2.14, -35.16, 2, 0)
  112. MovementLoopAddLocation(NPC, -37.78, -1.63, -32.35, 2, 0)
  113. MovementLoopAddLocation(NPC, -39.73, -1.15, -31.44, 2, 0)
  114. MovementLoopAddLocation(NPC, -43.56, -0.39, -27.35, 2, 0)
  115. MovementLoopAddLocation(NPC, -49.45, 0.24, -11.32, 2, 0)
  116. MovementLoopAddLocation(NPC, -51.79, 1.71, -0.98, 2, 0)
  117. MovementLoopAddLocation(NPC, -53.79, 2.48, 5.75, 2, 0)
  118. MovementLoopAddLocation(NPC, -51.87, 3.73, 12.09, 2, 0)
  119. MovementLoopAddLocation(NPC, -48.9, 4.06, 15.16, 2, 0)
  120. MovementLoopAddLocation(NPC, -38.9, 4.37, 20.72, 2, 0)
  121. MovementLoopAddLocation(NPC, -24.29, 4.31, 25.98, 2, 0)
  122. MovementLoopAddLocation(NPC, -14.9, 3.45, 29.35, 2, 0)
  123. MovementLoopAddLocation(NPC, -8.13, 3, 31.19, 2, 0)
  124. MovementLoopAddLocation(NPC, -1.41, 2.94, 30.52, 2, 0)
  125. MovementLoopAddLocation(NPC, 3.33, 3, 34.36, 2, 0)
  126. MovementLoopAddLocation(NPC, 7.72, 3, 39.72, 2, 0)
  127. MovementLoopAddLocation(NPC, 10.75, 3, 48.38, 2, 0)
  128. MovementLoopAddLocation(NPC, 7.87, 3, 52.45, 2, 0)
  129. MovementLoopAddLocation(NPC, 4.14, 3, 54.61, 2, 0)
  130. MovementLoopAddLocation(NPC, 0.18, 3, 56.98, 2, 0)
  131. MovementLoopAddLocation(NPC, -4.11, 3, 70.72, 2, 0)
  132. end