9
3

aTunarianmourner.lua 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. --[[
  2. Script Name : SpawnScripts/OutpostOverlord/aTunarianMourner.lua
  3. Script Author : Lemmeron
  4. Script Date : 21.08.2020
  5. Script Purpose : To make the mourners cry randomly
  6. :
  7. --]]
  8. local Mourner1LocID = 394723
  9. local Mourner2LocID = 394725
  10. local MournerID = 2780007
  11. function spawn(NPC)
  12. AddTimer(NPC, 5000, "EmoteLoop")
  13. end
  14. function respawn(NPC)
  15. spawn(NPC)
  16. end
  17. function EmoteLoop(NPC)
  18. local WhichOne = GetSpawnLocationID(NPC)
  19. if WhichOne == Mourner1LocID then
  20. local emote1 = math.random(1, 2)
  21. if emote1 == 1 then
  22. PlayAnimation(NPC, 11275) -- Cry
  23. AddTimer(NPC, ((math.random(4, 9)*2000)+10000) , "EmoteLoop")
  24. elseif emote1 == 2 then
  25. PlayAnimation(NPC, 12166) -- Sad
  26. AddTimer(NPC, ((math.random(4, 9)*2000)+10000) , "EmoteLoop")
  27. end
  28. local WhichOne = nil
  29. end
  30. if WhichOne == Mourner2LocID then
  31. local emote1 = math.random(1, 2)
  32. if emote1 == 1 then
  33. PlayAnimation(NPC, 11275) -- Cry
  34. AddTimer(NPC, ((math.random(3, 8)*1800)+11000) , "EmoteLoop")
  35. elseif emote1 == 2 then
  36. PlayAnimation(NPC, 11628) -- Frustrated
  37. AddTimer(NPC, (math.random(4, 9)*2500) , "EmoteLoop")
  38. end
  39. local WhichOne = nil
  40. end
  41. end