9
3

royalpatriarch.lua 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. --[[
  2. Script Name : SpawnScripts/EchoesOfTimeEpic/KingZalak.lua
  3. Script Purpose : Govern behavior and encounter for royal patriarch in Echoes of Time
  4. Script Author : Neveruary
  5. Script Date : 08/09/2021
  6. Script Notes :
  7. --]]
  8. function spawn(NPC)
  9. end
  10. function runtozalak(NPC, Spawn)
  11. Shout(NPC, "I hear and I obey great king!")
  12. AddTimer(NPC, 1000, "healCheck")
  13. end
  14. function healCheck(NPC, Spawn)
  15. local zalak = GetSpawn(NPC, 5310002)
  16. local x = GetX(zalak)
  17. local y = GetY(zalak)
  18. local z = GetZ(zalak)
  19. MoveToLocation(NPC, x, y, z, 4)
  20. AddTimer(NPC, 1000, "heal")
  21. end
  22. function heal(NPC, Spawn)
  23. local zalak = GetSpawn(NPC, 5310002)
  24. if GetDistance(NPC, zalak) < 4 then
  25. ModifyHP(zalak, 2000)
  26. AddTimer(NPC, 3000, "explode")
  27. else
  28. AddTimer(NPC, 1000, "healCheck")
  29. end
  30. end
  31. function explode(NPC, Spawn)
  32. Shout(NPC, "My life is for you, King Zalak!")
  33. CastSpell(NPC, 5474, 1, NPC)
  34. end
  35. function respawn(NPC)
  36. spawn(NPC)
  37. end