Everything bellow is solved thanks to the elite scripters of MMowned. :)
Keeping the post as it is for others with similar issues.
Not sure if anyone will read this, I don't want to spam the forum with another question thread so I'll just write my second question here and hope for an answer again. :)
This is my try at creating a second phase, I want the mob to yell out TEXT2 at 80% health, what am I doing wrong this time?
Code:
function bossfight(pUnit, event)
pUnit:SendChatMessage(14, 0, "Hm? You dare to challenge me?! Pfah!")
pUnit:RegisterEvent("phase1", 5000, 0)
pUnit:RegisterEvent("phase2", 1000, 0)
end
function phase1 (pUnit, event)
if pUnit:GetHealthPct() < 95 then
pUnit:RemoveEvents()
pUnit:SetModel(27176)
pUnit:SendChatMessage(14, 0, "TEXT1")
pUnit:CastSpell(28498)
end
function phase2(pUnit, event)
if pUnit:GetHealthPct() < 80 then
pUnit:RemoveEvents()
pUnit:SendChatMessage(14, 0, "TEXT2")
end
end
RegisterUnitEvent(NPCID, 1, "bossfight")
Oh hai!
I recently found out about the wonderful world of LUA scripting and I decided to give it a try. I've been playing around in notepad for a hour or two now, just trying out the basics.
But now I'm stuck! I can't seem to get my script running as I want to.
Code:
function Boss7_Test(pUnit, Event)
pUnit:SendChatMessage(14, 1, "RANDOMTEXT")
if pUnit:GetHealthPct() < 95 then
pUnit:RemoveEvents();
pUnit:SendChatMessage(14, 1, "RANDOMTEXT2")
pUnit:SetModel(27176)
end
end
RegisterUnitEvent(50007, 1, "Boss7_Test")
I basically want the mob to first yell out RANDOMTEXT when pulled, and when he's at about 95% I want him to yell out RANDOMTEXT2 AS WELL as change his model to 27176.
When I try it on my private server he only yells out the first text and then nothing happens, any idea how to fix this?
There's obviously 2x+Rep cookies waiting to be eaten, if a decent answer is provided of course! :)