JenniEverling.lua 804 B

1234567891011121314151617181920212223242526
  1. --[[
  2. Script Name : SpawnScripts/Nektropos1/JenniEverling.lua
  3. Script Author : smash
  4. Script Date : 2016.09.09 05:09:39
  5. Script Purpose : Spawning Jenni's teacher
  6. :
  7. --]]
  8. require "SpawnScripts/Nektropos1/EverlingSisters"
  9. function healthchanged(NPC, Spawn)
  10. local hp = GetHP(NPC)
  11. local max_hp = GetMaxHP(NPC)
  12. --Try to spawn Jenni's teacher at around 70% hp remaining
  13. if hp / max_hp <= .70 and GetTempVariable(NPC, "TeacherSpawned") ~= "true" then
  14. --Spawn Jenni's teacher
  15. local teacher = SpawnByLocationID(GetZone(NPC), 616610)
  16. Attack(teacher, Spawn)
  17. Say(NPC, "Teacher I need your help! Deirdre sent someone to stop me.")
  18. SetTempVariable(NPC, "TeacherSpawned", "true")
  19. end
  20. end
  21. function CombatReset(NPC)
  22. SetTempVariable(NPC, "TeacherSpawned", nil)
  23. end