9
3

royalpatriarch.lua 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. --[[
  2. Script Name : SpawnScripts/EchoesOfTimeEpic/royalpatriarch.lua
  3. Script Purpose : royal patriarch in Echoes of Time: Epic
  4. Script Author : alfa24t
  5. Script Date : 03/09/2022
  6. Script Notes : spawnID 5310004
  7. --]]
  8. function spawn(NPC)
  9. AddTimer(NPC, 1500, "gotoKingZalak")
  10. end
  11. function gotoKingZalak(NPC) -- Loopback function for King Zalak current location.
  12. local zone = GetZone(NPC)
  13. local spawnKingZalak = GetSpawn(NPC, 5310002)
  14. Shout(NPC, "I hear and I obey great king!")
  15. SetFollowTarget(NPC, spawnKingZalak, 5)
  16. ToggleFollow(NPC)
  17. AddTimer(NPC, 2500, "checkgotoKingZalak")
  18. end
  19. function checkgotoKingZalak(NPC) -- Loopback function for King Zalak current location.
  20. local zone = GetZone(NPC)
  21. local spawnKingZalak = GetSpawn(NPC, 5310002)
  22. if GetDistance(NPC, spawnKingZalak) > 4 then
  23. AddTimer(NPC, 2500, "checkgotoKingZalak")
  24. else
  25. AddTimer(NPC, 10, "heal")
  26. end
  27. end
  28. function heal(NPC, Spawn)
  29. local zalak = GetSpawn(NPC, 5310002)
  30. if GetDistance(NPC, zalak) < 4 then
  31. ModifyHP(zalak, 2000)-- Heal value not good, need to parse fight on live
  32. AddTimer(NPC, 10, "explode")
  33. else
  34. AddTimer(NPC, 2500, "heal")
  35. end
  36. end
  37. function explode(NPC, Spawn)
  38. npctxt = {"My life is for you King Zalak!", "My life ends in a blaze of glory for you Oh King!"}
  39. Shout(NPC, npctxt[math.random(#npctxt)])
  40. -- Should be an AOE of FOCUS about 70k reparted on raid members in range
  41. CastSpell(NPC, 5474, 1, NPC)
  42. end
  43. function respawn(NPC)
  44. spawn(NPC)
  45. end
  46. function hailed(NPC, Spawn)
  47. end
  48. function hailed_busy(NPC, Spawn)
  49. end
  50. function casted_on(NPC, Spawn, Message)
  51. end
  52. function targeted(NPC, Spawn)
  53. end
  54. function attacked(NPC, Spawn)
  55. ToggleFollow(NPC)
  56. end
  57. function aggro(NPC, Spawn)
  58. end
  59. function healthchanged(NPC, Spawn)
  60. end
  61. function auto_attack_tick(NPC, Spawn)
  62. end
  63. function death(NPC, Spawn)
  64. end
  65. function killed(NPC, Spawn)
  66. end
  67. function CombatReset(NPC)
  68. end
  69. function randomchat(NPC, Message)
  70. end