ATaintedSapswillTapper1587662.lua 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. --[[
  2. Script Name : SpawnScripts/QueensColony/ATaintedSapswillTapper1587662.lua
  3. Script Author : Rylec
  4. Script Date : 2020.05.24 11:05:20
  5. Script Purpose : Animations for Sapswills and spawn/despawn of Dead Deer
  6. --]]
  7. function spawn(NPC)
  8. EmoteLoop(NPC)
  9. DeadDeerSpawn(NPC)
  10. end
  11. function hailed(NPC, Spawn)
  12. -- FaceTarget(NPC, Spawn)
  13. end
  14. function respawn(NPC)
  15. spawn(NPC)
  16. end
  17. function EmoteLoop (NPC)
  18. local choice = math.random(1,2)
  19. local timer = math.random(2500,3500)
  20. if choice == 1 then
  21. PlayAnimation(NPC, 11400)
  22. AddTimer(NPC, timer, "EmoteLoop")
  23. else
  24. PlayAnimation(NPC, 11399)
  25. AddTimer(NPC, timer, "EmoteLoop")
  26. end
  27. end
  28. function DeadDeerSpawn(NPC)
  29. local zone = GetZone(NPC)
  30. local deadDeer = GetSpawnByLocationID(zone, 1587664)
  31. if deadDeer == nil then
  32. SpawnByLocationID(zone, 1587664)
  33. end
  34. end
  35. function death(NPC, Spawn)
  36. AddTimer(NPC, 10000, "DespawnDeadDeer")
  37. end
  38. function DespawnDeadDeer(NPC)
  39. local zone = GetZone(NPC)
  40. local deadDeer = GetSpawnByLocationID(zone, 1587664)
  41. if deadDeer ~= nil then
  42. Despawn(deadDeer)
  43. end
  44. end