9
3

KingZalak.lua 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109
  1. --[[
  2. Script Name : SpawnScripts/EchoesOfTimeEpic/KingZalaktheAncient.lua
  3. Script Purpose : King Zalak the Ancient in Echoes of Time: Epic
  4. Script Author : alfa24t & older, wiser Neveruary
  5. Script Date : 03/09/2022
  6. Boss Mechanics : Boss periodically call Royal Patriarch that can spawn in 3 different spot. If Royal P come near Zalak it cast AOE on raid and heal Zalak
  7. Buff
  8. UnholyBlessing -- 90195
  9. InnoruuksCaress -- 90130
  10. Spell
  11. Grave Sacrament III -- 90105
  12. SiphonStrength -- 90174
  13. --]]
  14. buffs = {90195, 90130}
  15. groupspawn = {365523, 365519, 365524, 365521, 365522} --need to remove 365520 from zone spwns
  16. adds = {365525, 365526, 133772501, 133772502, 133772503, 133772504, 133772505, 133772506, 133772507}
  17. function spawn(NPC)
  18. AddTimer(NPC, 1500, "spellbuffloop")
  19. --NPCModule(NPC, Spawn)
  20. end
  21. function respawn(NPC)
  22. spawn(NPC)
  23. end
  24. function hailed(NPC, Spawn)
  25. end
  26. function hailed_busy(NPC, Spawn)
  27. end
  28. function casted_on(NPC, Spawn, Message)
  29. end
  30. function targeted(NPC, Spawn)
  31. end
  32. function attacked(NPC, Spawn)
  33. end
  34. function aggro(NPC, Spawn)
  35. AddTimer(NPC, math.random(15000, 25000), "spellattackloop")
  36. AddTimer(NPC, 30000, "addsloop")
  37. end
  38. function spellbuffloop(NPC, Spawn) -- Loopback function for spellcasts.
  39. if IsAlive(NPC) then
  40. CastSpell(NPC, buffs[math.random(#buffs)], 3, NPC)
  41. AddTimer(NPC, math.random(15000, 25000), "spellbuffloop")
  42. end
  43. end
  44. function addsloop(NPC, Spawn)
  45. zone = GetZone(NPC)
  46. if IsAlive(NPC) then
  47. if IsInCombat(NPC) then
  48. Shout(NPC, "Royal Patriarchs come aid your king!")
  49. SpawnByLocationID(zone, adds[math.random(#adds)])
  50. SpawnByLocationID(zone, adds[math.random(#adds)])
  51. SpawnByLocationID(zone, adds[math.random(#adds)])
  52. AddTimer(NPC, 30000, "addsloop")
  53. end
  54. end
  55. end
  56. function death(NPC, Spawn)
  57. --StopTimer(NPC, "spellbuffloop")
  58. --StopTimer(NPC, "spellattackloop")
  59. --StopTimer(NPC, "addsloop")
  60. for k,v in ipairs(adds) do
  61. if IsAlive(GetSpawnByLocationID(zone, v)) then
  62. Despawn(GetSpawnByLocationID(zone, v), 1)
  63. end
  64. end
  65. end
  66. function killed(NPC, Spawn)
  67. --StopTimer(NPC, "spellbuffloop")
  68. --StopTimer(NPC, "spellattackloop")
  69. --StopTimer(NPC, "addsloop")
  70. for k,v in ipairs(adds) do
  71. if IsAlive(GetSpawnByLocationID(zone, v)) then
  72. Despawn(GetSpawnByLocationID(zone, v), 1)
  73. end
  74. end
  75. end
  76. function CombatReset(NPC)
  77. --StopTimer(NPC, "spellbuffloop")
  78. --StopTimer(NPC, "spellattackloop")
  79. --StopTimer(NPC, "addsloop")
  80. local zone = GetZone(NPC)
  81. for k,v in ipairs(adds) do
  82. if IsAlive(GetSpawnByLocationID(zone, v)) then
  83. Despawn(GetSpawnByLocationID(zone, v), 1)
  84. end
  85. end
  86. for k,v in ipairs(groupspawn) do
  87. if IsAlive(GetSpawnByLocationID(zone, v)) then
  88. Despawn(GetSpawnByLocationID(zone, v), 1)
  89. end
  90. end
  91. SpawnGroupByID(zone, 9116)
  92. Despawn(NPC)
  93. end