9
3

aDesk.lua 757 B

1234567891011121314151617181920212223242526272829303132333435
  1. --[[
  2. Script Name : SpawnScripts/TroubledHaunt/aDesk.lua
  3. Script Author : Dorbin
  4. Script Date : 2022.11.23 12:11:56
  5. Script Purpose :
  6. :
  7. --]]
  8. function spawn(NPC)
  9. local zone = GetZone(NPC)
  10. if GetSpawnLocationID(NPC)==133780834 then
  11. AddTimer(NPC,1500,"Spin")
  12. end
  13. end
  14. function Spin(NPC)
  15. local zone = GetZone(NPC)
  16. if IsAlive(GetSpawnByLocationID(zone,133780857))==true then
  17. Head = GetHeading(NPC)
  18. SetHeading(NPC,(Head+5))
  19. AddTimer(NPC,100,"Spin")
  20. else
  21. SpawnByLocationID(zone,133780854)
  22. Despawn(GetSpawnByLocationID(zone,133780834))
  23. PlaySound(NPC,"sounds/ui/place_item.wav",GetX(NPC), GetY(NPC), GetZ(NPC))
  24. end
  25. end
  26. function respawn(NPC)
  27. spawn(NPC)
  28. end