1. local NPC_ID = 90021
  2. function boss_OnCombat(event, creature, target)
  3. creature:SendUnitSay("I KNOW YOU! YOU ARE MEAT!", 1)
  4. creature:CastSpell(target, 64719)
  5. creature:RegisterEvent(spell_90, 10000, 0)
  6. creature:RegisterEvent(spell_60, 1000, 0)
  7. creature:RegisterEvent(spell_50, 4000, 0)
  8. creature:RegisterEvent(spell_30, 4000, 0)
  9. creature:RegisterEvent(spell_10, 12000, 0)
  10. end
  11. function spell_90(eventID, delay, pCall, creature)
  12. if (creature:GetHealthPct() <= 90) then
  13. creature:SendUnitSay("SMASH!", 0)
  14. creature:CastSpell(creature:GetVictim(), 31436)
  15. end
  16. end
  17. function spell_60(eventID, delay, pCall, creature)
  18. if (creature:GetHealthPct() <= 60) then
  19. creature:SetScale(1.5)
  20. end
  21. end
  22. function spell_50(eventID, delay, pCall, creature)
  23. if (creature:GetHealthPct() <= 50) then
  24. creature:CastSpell(creature:GetVictim(), 68969)
  25. end
  26. end
  27. function spell_30(eventID, delay, pCall, creature)
  28. if (creature:GetHealthPct() <= 30) then
  29. creature:CastSpell(creature:GetVictim(), 67634)
  30. end
  31. end
  32. function spell_10(eventID, delay, pCall, creature)
  33. if (creature:GetHealthPct() <= 10) then
  34. creature:SendUnitSay("I don't like you!", 0)
  35. creature:CastSpell(creature:GetVictim(), 70284)
  36. end
  37. end
  38. function boss_OnLeaveCombat(event, creature)
  39. creature:SendUnitSay("Why no meat?", 0)
  40. creature:RemoveEvents()
  41. end
  42. function boss_OnDied(event, creature, killer)
  43. creature:RemoveEvents()
  44. for _,v in ipairs (killer:GetGroup():GetMembers()) do
  45. if (v:GetGroup():IsRaidGroup()) then
  46. if (creature:GetMapId() == v:GetMapId()) then
  47. OnGossipSelect(2, v, v, 0, nil, nil, 1)
  48. end
  49. end
  50. end
  51. end
  52. function OnGossipSelect(event, player, object, sender, intid, code, menu_id)
  53. if not (intid) or (intid < 1) then
  54. player:GossipClearMenu()
  55. player:GossipMenuAddItem(0, "Testing", 0, 1)
  56. player:GossipMenuAddItem(0, "Testing", 0, 1)
  57. player:GossipSendMenu(1, player, 1)
  58. end
  59. if (intid == 1) then
  60. player:SendBroadcastMessage("MENUID 1")
  61. elseif (intid == 2) then
  62. player:SendBroadcastMessage("MENUID 2")
  63. end
  64. end
  65. function boss_OnKilledTarget(event, creature, victim)
  66. creature:SendUnitSay("MEAT!", 0)
  67. end
  68. function boss_OnSpawn(event, creature)
  69. creature:SendUnitSay("I'm hungry", 0)
  70. creature:SetScale(1)
  71. creature:CastSpell(creature, 64842)
  72. end
  73. RegisterCreatureEvent(NPC_ID, 1, boss_OnCombat)
  74. RegisterCreatureEvent(NPC_ID, 2, boss_OnLeaveCombat)
  75. RegisterCreatureEvent(NPC_ID, 3, boss_OnKilledTarget)
  76. RegisterCreatureEvent(NPC_ID, 4, boss_OnDied)
  77. RegisterCreatureEvent(NPC_ID, 5, boss_OnSpawn)
  78. RegisterPlayerGossipEvent(1, 2, OnGossipSelect)