OverlordOxulius.lua 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  1. --[[
  2. Script Name : SpawnScripts/MeetingOfTheMinds/OverlordOxulius.lua
  3. Script Author : Neveruary
  4. Script Date : 2021.10.05 11:10:42
  5. Script Purpose : Governs behavior of Overlord Oxulius in A Meeting of the Minds.
  6. Script Notes : Spell functions de-activated. All spells need implementation.
  7. Boss Mechanics : Boss periodically uses custom spells to attack main threat target. If Pkzwk is killed before Oxulius, then adds will spawn and attack the main threat target.
  8. --]]
  9. -- spells = {Glare of Eradication, Gaze of Writhing Agony, Gaze of Oxulius, Gaze of Destruction}
  10. function spawn(NPC)
  11. SetTempVariable(NPC, "addSpawn", "nil")
  12. end
  13. function aggro(NPC, Spawn)
  14. AddTimer(NPC, 1000, "spellLoop")
  15. AddTimer(NPC, 1000, "tzkrLoop")
  16. end
  17. function spellLoop(NPC, Spawn) -- Loopback function for spellcasts.
  18. AddTimer(NPC, math.random(1500,2500), "spellChoice")
  19. end
  20. function spellChoice(NPC, Spawn) -- select a spell from table.
  21. local hated = GetMostHated(NPC)
  22. if hated ~= nil then
  23. FaceTarget(NPC, hated)
  24. -- CastSpell(hated, spells[math.random(#spells)], 3, NPC)
  25. end
  26. AddTimer(NPC, math.random(1500, 2500), "spellLoop")
  27. end
  28. function tzkrLoop(NPC, Spawn)
  29. if GetTempVariable(NPC, "addSpawn") == "nil" then
  30. AddTimer(NPC, 3000, "tzkrCheck")
  31. elseif GetTempVariable(NPC, "addSpawn") == "0" then
  32. end
  33. end
  34. function tzkrCheck(NPC, Spawn)
  35. tkzr = GetSpawn(NPC, 5560002)
  36. AddTimer(NPC, 1500, "tzkrLoop")
  37. if GetTempVariable(NPC, "addSpawn") == "nil" then
  38. if not IsAlive(tkzr) then
  39. SetTempVariable(NPC, "addSpawn", "1")
  40. AddTimer(NPC, 1000, "summonAdds")
  41. end
  42. end
  43. end
  44. function summonAdds(NPC, Spawn)
  45. local zone = GetZone(NPC) -- grab zone
  46. if GetTempVariable(NPC, "addSpawn") == "1" then
  47. local borxxSpawn = SpawnByLocationID(zone, 133772846)
  48. local braxxSpawn = SpawnByLocationID(zone, 302036)
  49. local brixxSpawn = SpawnByLocationID(zone, 302037)
  50. end
  51. SetTempVariable(NPC, "addSpawn", "0")
  52. AddTimer(NPC, 4000, "overlordConvo1")
  53. end
  54. function overlordConvo1(NPC, Spawn)
  55. local zone = GetZone(NPC)
  56. local borxx = GetSpawn(NPC, 5560006)
  57. if borxx ~= nil then
  58. Say(NPC, "Borxx, you must aid me now. Interlopers have threatened my plans, you owe me!")
  59. AddTimer(borxx, 3000, "borxxConvo1")
  60. end
  61. end
  62. function overlordConvo2(NPC, Spawn)
  63. local borxx = GetSpawn(NPC, 5560006)
  64. AddTimer(borxx, 3000, "borxxConvo2")
  65. Say(NPC, "I am not to be taken lightly. You don't understand! The plan benefits us all. You must aid me NOW!")
  66. end
  67. function overlordConvo3(NPC, Spawn)
  68. local borxx = GetSpawn(NPC, 5560006)
  69. AddTimer(borxx, 3000, "borxxConvo3")
  70. Say(NPC, "If they are audacious enough to attack me, then what is to prevent them from treating you the same way?! You must aid me NOW!")
  71. end
  72. function overlordConvo4(NPC, Spawn)
  73. local borxx = GetSpawn(NPC, 5560006)
  74. AddTimer(borxx, 3000, "borxxConvo4")
  75. Say(NPC, "You know full well I cannot agree to that! Be reasonable, I can make it worth your while! I must have aid NOW!")
  76. end
  77. function overlordConvo5(NPC, Spawn)
  78. local borxx = GetSpawn(NPC, 5560006)
  79. AddTimer(borxx, 3000, "borxxConvo5")
  80. Say(NPC, "Okay! I will meet your demands. Time grows short; I need you now!")
  81. end
  82. function respawn(NPC)
  83. spawn(NPC)
  84. end