abulkybrinesifter.lua 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. --[[
  2. Script Name : SpawnScripts/SunkenCity_Classic/abulkybrinesifter.lua
  3. Script Author : LordPazuzu
  4. Script Date : 2023.10.12 04:10:04
  5. Script Purpose :
  6. :
  7. --]]
  8. require "SpawnScripts/Generic/NPCModule"
  9. function spawn(NPC, Spawn)
  10. NPCModule(NPC, Spawn)
  11. local SpawnID = GetSpawnLocationID(NPC)
  12. if SpawnID < 133787438 or SpawnID > 133787441 then
  13. RandomMovement(NPC, Spawn, 5, -5, 2, 8, 15)
  14. else --TABLE SPAWNING CRABS
  15. -- SetInfoStructString(NPC, "action_state", "combat_idle")
  16. AddTimer(NPC,MakeRandomInt(1000,4000),"CombatScream") --TABLE SPAWNING CRABS ATTACK CRY
  17. AddTimer(NPC,5000,"CombatCheck")
  18. end
  19. end
  20. function CombatScream(NPC)
  21. PlaySound(NPC,"sounds/critters/crab/crab_scream01.wav",GetX(NPC),GetY(NPC),GetZ(NPC))
  22. end
  23. function CombatCheck(NPC) --TABLE SPAWNING CRABS CHECKS FOR COMBAT
  24. if IsInCombat(NPC)== true then
  25. AddTimer(NPC,30000,"CombatCheck")
  26. else
  27. Despawn(NPC)
  28. end
  29. end
  30. function respawn(NPC, Spawn)
  31. spawn(NPC)
  32. end
  33. function hailed(NPC, Spawn)
  34. FaceTarget(NPC, Spawn)
  35. end