9
3

ashadyfurrier.lua 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  1. --[[
  2. Script Name : SpawnScripts/Oakmyst/ashadyfurrier.lua
  3. Script Author : Dorbin
  4. Script Date : 2022.01.15
  5. Script Purpose : Ground Roaming and emote
  6. :
  7. --]]
  8. function spawn(NPC)
  9. ChooseMovement(NPC)
  10. end
  11. function ChooseMovement(NPC)
  12. local choice = math.random(1, 4)
  13. if choice == 1 then
  14. clockwise1(NPC)
  15. elseif choice == 2 then
  16. clockwise2(NPC)
  17. elseif choice == 3 then
  18. counter_clockwise1(NPC)
  19. elseif choice == 4 then
  20. counter_clockwise2(NPC)
  21. end
  22. end
  23. function respawn(NPC)
  24. spawn(NPC)
  25. end
  26. function gethealth(NPC)
  27. local choice = math.random(1,100)
  28. if choice <=25 and GetMaxHP(NPC) <=25 then
  29. PlayFlavor(NPC, "voiceover/english/optional3/halfelf_base_2/ft/halfelf/halfelf_base_2_1_death_gf_e2b358c4.mp3", "We have no hope. We must withdraw!", "", 3383222805, 3217906425, Spawn)
  30. else
  31. end
  32. end
  33. function Action(NPC)
  34. local choice2 = MakeRandomInt(1, 4)
  35. if choice2 == 1 then
  36. PlayFlavor(NPC, "", "", "peer", 0, 0, Spawn)
  37. elseif choice2 == 2 then
  38. PlayFlavor(NPC, "", "", "stretch", 0, 0, Spawn)
  39. elseif choice2 == 3 then
  40. PlayFlavor(NPC, "", "", "yawn", 0, 0, Spawn)
  41. elseif choice2 == 4 then
  42. PlayFlavor(NPC, "", "", "2809", 0, 0, Spawn)
  43. end
  44. end
  45. function clockwise1(NPC)
  46. local x = GetX(NPC)
  47. local y = GetY(NPC)
  48. local z = GetZ(NPC)
  49. MovementLoopAddLocation(NPC, x + 1.5 , y, z - 2 , 1, math.random(2, 15))
  50. MovementLoopAddLocation(NPC, x - .5 , y, z - 3, 1, math.random(2, 15))
  51. MovementLoopAddLocation(NPC, x - 3, y, z + 2.5 , 1, math.random(2, 15))
  52. MovementLoopAddLocation(NPC, x , y, z , 0 , math.random(5, 15))
  53. AddTimer(NPC, 6, "Action")
  54. MovementLoopAddLocation(NPC, x + .5 , y, z + 2 , 1, math.random(2, 15))
  55. --MovementLoopAddLocation(NPC, x + 3 , y, z - 4 , 1, math.random(2, 5))
  56. --MovementLoopAddLocation(NPC, x - 1 , y, z - 6, 1, math.random(2, 5))
  57. --MovementLoopAddLocation(NPC, x - 6, y, z + 5 , 1, math.random(2, 5))
  58. --MovementLoopAddLocation(NPC, x + 1 , y, z + 4 , 1, math.random(2, 5))
  59. end
  60. function clockwise2(NPC)
  61. local x = GetX(NPC)
  62. local y = GetY(NPC)
  63. local z = GetZ(NPC)
  64. MovementLoopAddLocation(NPC, x + 1 , y, z - 2 , 1, math.random(2, 15))
  65. MovementLoopAddLocation(NPC, x - 3.5 , y, z - .5 , 1, math.random(2, 10))
  66. MovementLoopAddLocation(NPC, x , y, z + 1 , 1, math.random(2, 15))
  67. AddTimer(NPC, 6, "Action")
  68. MovementLoopAddLocation(NPC, x , y, z , 0 , math.random(5, 15))
  69. MovementLoopAddLocation(NPC, x + 2.5 , y, z + .5 , 1, math.random(2, 10))
  70. end
  71. function counter_clockwise1(NPC)
  72. local x = GetX(NPC)
  73. local y = GetY(NPC)
  74. local z = GetZ(NPC)
  75. MovementLoopAddLocation(NPC, x - 1.5 , y, z + 1 , 1, math.random(2, 15))
  76. MovementLoopAddLocation(NPC, x , y, z , 0 , math.random(5, 15))
  77. AddTimer(NPC, 6, "Action")
  78. MovementLoopAddLocation(NPC, x + .5 , y, z + 3, 1, math.random(2, 15))
  79. MovementLoopAddLocation(NPC, x + 2, y, z - 2.5 , 1, math.random(2, 10))
  80. MovementLoopAddLocation(NPC, x - .5 , y, z - 2 , 1, math.random(2, 10))
  81. end
  82. function counter_clockwise2(NPC)
  83. local x = GetX(NPC)
  84. local y = GetY(NPC)
  85. local z = GetZ(NPC)
  86. MovementLoopAddLocation(NPC, x - 1 , y, z + 2 , 1, math.random(2, 10))
  87. MovementLoopAddLocation(NPC, x + 1.5 , y, z + .5 , 1, math.random(2, 10))
  88. MovementLoopAddLocation(NPC, x , y, z - 1 , 1, math.random(2, 15))
  89. MovementLoopAddLocation(NPC, x , y, z , 0 , math.random(5, 15))
  90. AddTimer(NPC, 6, "Action")
  91. MovementLoopAddLocation(NPC, x - 2.5 , y, z - .5 , 1, math.random(2, 10))
  92. end