InitiateLoFan.lua 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. --[[
  2. Script Name : SpawnScripts/ElddarGrove/InitiateLoFan.lua
  3. Script Author : Dorbin
  4. Script Date : 2022.05.09 11:05:18
  5. Script Purpose :
  6. :
  7. --]]
  8. function spawn(NPC)
  9. SpawnSet(NPC, "action_state", 372)
  10. AddTimer(NPC, math.random(2000,5000), "EmoteLoop")
  11. end
  12. function EmoteLoop(NPC)
  13. SpawnSet(NPC, "action_state", 0)
  14. local choice = MakeRandomInt(1,8)
  15. if choice == 1 then
  16. PlayAnimation(NPC, 1644)
  17. AddTimer(NPC, 1550, "Idle")
  18. elseif choice == 2 then
  19. PlayAnimation(NPC, 1646)
  20. AddTimer(NPC, 2100, "Idle")
  21. elseif choice == 3 then
  22. PlayAnimation(NPC, 1284)
  23. AddTimer(NPC, 2050, "Idle")
  24. elseif choice == 4 then
  25. PlayAnimation(NPC, 3021)
  26. AddTimer(NPC, 2100, "Idle")
  27. elseif choice == 5 then
  28. PlayAnimation(NPC, 1201)
  29. AddTimer(NPC, 1450, "Idle")
  30. elseif choice == 6 then
  31. PlayAnimation(NPC, 1181)
  32. AddTimer(NPC, 1550, "Idle")
  33. elseif choice == 7 then
  34. PlayAnimation(NPC, 4506)
  35. AddTimer(NPC, 3400, "Idle")
  36. else
  37. PlayAnimation(NPC, 3037)
  38. AddTimer(NPC, 2300, "Idle")
  39. end
  40. end
  41. function Idle(NPC)
  42. PlayAnimation(NPC, 372)
  43. SpawnSet(NPC, "action_state", 372)
  44. local timer = MakeRandomInt(500,2500)
  45. AddTimer(NPC, timer, "EmoteLoop")
  46. end