Bonesnapper.lua 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. --[[
  2. Script Name : SpawnScripts/CrustaceanCave/Bonesnapper.lua
  3. Script Author : jakejp
  4. Script Date : 2018.12.26 08:12:17
  5. Script Purpose : Creating a simple raid for testing purposes
  6. :
  7. --]]
  8. function spawn(NPC)
  9. end
  10. function hailed(NPC, Spawn)
  11. end
  12. function respawn(NPC)
  13. end
  14. function casted_on(Target, Caster, SpellName)
  15. local zone = GetZone(Caster)
  16. local disturbed = 0
  17. if SpellName == "Disturb Crab" and disturbed == 0 then
  18. disturbed = 1
  19. SpawnSet(Target, "targetable", 1)
  20. SpawnSet(Target, "attackable", 1)
  21. SpawnSet(Target, "show_level", 1)
  22. SpawnSet(Target, "faction", 1)
  23. SpawnSet(Target, "command_primary", 11)
  24. Attack(Target, Caster)
  25. SpawnByLocationID(zone, 378748)
  26. end
  27. end
  28. function death(NPC, Spawn)
  29. SpawnSet(Target, "targetable", 1)
  30. SpawnSet(Target, "attackable", 0)
  31. SpawnSet(Target, "show_level", 0)
  32. SpawnSet(Target, "faction", 0)
  33. end
  34. function aggro(NPC, Spawn)
  35. end
  36. function healthchanged(NPC, Spawn)
  37. local zone = GetZone(Spawn)
  38. local addSpawned = 0
  39. local health_percent = GetHP(NPC) / GetMaxHP(NPC)
  40. if health_percent <= 10 and addSpawned == 0 then
  41. addSpawned = 1
  42. ClearHate(NPC)
  43. SpawnByLocationID(zone, 378748)
  44. end
  45. end