---------------- Boss Fight ------------------- Variableslocal NPC_ID = 90016--------------------- Combat States -------------------function Lorean_OnEnterCombat(Unit, Event)Unit:CastSpell(48469) -- MOTWUnit:CastSpell(53307) -- ThornsUnit:CastSpell(768) -- CatformUnit:RegisterEvent("MangleCat", 1500, 0)Unit:RegisterEvent("RakeCat", 2000, 0)Unit:RegisterEvent("FerociousBite", 5000, 0)Unit:RegisterEvent("TigersFury", 10000, 0)Unit:SendChatMessage(14,0,"So you wish to challenge me !")Unit:SendChatMessage(14,0,"Powers of the Ancestors I invoke the !")Unit:RegisterEvent("Lorean_Phase1", 2000, 0) -- Phase begint na 2 seconden Zoals het moet.Unit:SendChatMessage(14,0,"Fase 1 Gestart")endfunction Lorean_OnLeaveCombat(Unit, Event, player)Unit:RemoveEvents()endfunction Lorean_OnKilledTarget(Unit, Event, player)Unit:SendChatMessage(14,0,"You will not break this dream !")endfunction Lorean_OnDeath(Unit, Event, player)Unit:SendChatMessage(14,0,"NOOOO !!!!")Unit:RemoveEvents()end--------------- Phases -------------------function Lorean_Phase1(Unit, Event)if Unit:GetHealthPct() <= 90 thenUnit:RemoveEvents()Unit:RegisterEvent("MoonkinForm", 1000, 1)Unit:RegisterEvent("Roots", 6000, 0)Unit:RegisterEvent("Moonfire", 2000, 0)Unit:RegisterEvent("Starfire", 11000, 0)Unit:RegisterEvent("Wrath", 2500, 0)Unit:RegisterEvent("Hurricane", 15000, 0)Unit:RegisterEvent("Lorean_Phase2", 1000, 0)Unit:SendChatMessage(14,0,"Fase 2 Gestart")endendfunction Lorean_Phase2(Unit, Event)if Unit:GetHealthPct() <= 80 thenUnit:RemoveEvents()Unit:RegisterEvent("Lorean_Phase3", 1000, 0)Unit:SendChatMessage(14,0,"Fase 3 Gestart")endendfunction Lorean_Phase3(Unit, Event, player)Unit:SendChatMessage(14,0,"Fase 3 Gestart")if Unit:GetHealthPct() <= 70 thenUnit:RemoveEvents()Unit:RegisterEvent("Lorean_Phase4", 1000, 0)endendfunction Lorean_Phase4(Unit, Event, player)Unit:SendChatMessage(14,0,"Fase 4 Gestart")if Unit:GetHealthPct() <= 50 thenUnit:RemoveEvents()Unit:RegisterEvent("Lorean_Phase5", 1000, 0)endendfunction Lorean_Phase5(Unit, Event, player)Unit:SendChatMessage(14,0,"Fase 5 Gestart")if Unit:GetHealthPct() <= 30 thenUnit:RemoveEvents()Unit:RegisterEvent("Lorean_Phase6", 1000, 0)endendfunction Lorean_Phase6(Unit, Event, player)Unit:SendChatMessage(14,0,"Fase 6 Gestart")if Unit:GetHealthPct() <= 10 thenUnit:RemoveEvents()endend-------- Cat Spells -----function Catform(Unit, Event)Unit:CastSpell(768)endfunction MangleCat(Unit, Event, player)Unit:CastSpellOnTarget(42389, Unit:GetMainTank())endfunction RakeCat(Unit, Event)Unit:CastSpell(27638)endfunction TigersFury(Unit, Event)Unit:CastSpell(9845)endfunction FerociousBite(Unit, Event)Unit:CastSpell(27557)end-------- Bear Spells -----function Bearform(Unit, Event)Unit:CastSpell(9634) endfunction MangleBear(Unit, Event)Unit:CastSpell(42389) endfunction Barkskin(Unit, Event)Unit:CastSpell(22812) endfunction Demo_Roar(Unit, Event)Unit:CastSpell(9898) endfunction FaerieFireFeral(Unit, Event)Unit:CastSpell(16857) endfunction Bash(Unit, Event)Unit:CastSpell(8983) endfunction FrenzyRegen(Unit, Event)Unit:CastSpell(22842) end-------- Healing Spells -----function Regrowth(Unit, Event)Unit:CastSpell(48443) end-------- Attack Spells -----function MoonkinForm(Unit, Event, player)Unit:CastSpell(24858) endfunction Moonfire(Unit, Event)Unit:CastSpell(48469) endfunction Roots(Unit, Event)Unit:CastSpell(21331) endfunction Wrath(Unit, Event)Unit:CastSpell(48461) endfunction Starfire(Unit, Event)Unit:CastSpell(48465) endfunction Hurricane(Unit, Event)Unit:CastSpell(48467) endRegisterUnitEvent(90016, 1, "Lorean_OnEnterCombat")RegisterUnitEvent(90016, 2, "Lorean_OnLeaveCombat")RegisterUnitEvent(90016, 3, "Lorean_OnKilledTarget")RegisterUnitEvent(90016, 4, "Lorean_OnDeath")
Could it be that the Lua Engine i have in my server does not support this feature ? ( this could be the only thing i could think of at the moment.)
function enter_combat (Unit, Event) Unit:RegisterEvent ("health_check", 1000, 0)endfunction leave_combat (Unit, Event, player) Unit:RemoveEvents()endfunction health_check (Unit, Event) Unit:SendChatMessage (14, 0, "GetHealthPct: " .. Unit::GetHealthPct()) if Unit:GetHealthPct() <= 50 then Unit:SendChatMessage (14, 0, "health below 50%") endendRegisterUnitEvent (90016, 1, "enter_combat")RegisterUnitEvent (90016, 2, "leave_combat")RegisterUnitEvent (90016, 4, "leave_combat")