LUA mob cast spell after x% of health
Hello! i made a lua script which works (sorta)
i am trying to make the mob cast spells on x% of health. how would i do that?
i have tried all the spells after x% and they work, how would i put them all togeather :D
if needed i can post the script
Would it be
Code:
function Mob_onCombat(pUnit, event)
pUnit:SendChatMessage(11, 0, "You are mine!")
pUnit:RegisterEvent("Mob_Enrage",1000,0)
end
or
Code:
ffunction Mob_onCombat(pUnit, event)
pUnit:SendChatMessage(11, 0, "You are mine!")
pUnit:RegisterEvent("Mob_Enrage",1000,0)
pUnit:RegisterEvent("Mob_Enrage"2,1000,0)
pUnit:RegisterEvent("Mob_Enrage3",1000,0)
end
Re: LUA mob cast spell after x% of health
function Mob_onCombat(pUnit, event)
if pUnit:GetHealthPct() < 90 then
pUnit:SendChatMessage(11, 0, "You are mine!")
end
end
RegisterUnitEvent(NPC ID, "Mob_onCombat ")
Re: LUA mob cast spell after x% of health
still not working :S how do i make it do every 10% also? would it be the same thing but like
function Mob_onCombat(pUnit, event)
if pUnit:GetHealthPct() < 90 then
pUnit:SendChatMessage(11, 0, "You are mine!")
end
end
function Mob_onCombat2(pUnit, event)
if pUnit:GetHealthPct() < 80 then
pUnit:SendChatMessage(11, 0, "You are mine lol !")
end
end
RegisterUnitEvent(NPC ID, "Mob_onCombat ")
RegisterUnitEvent(NPC ID, "Mob_onCombat2 ")
or what?
Re: LUA mob cast spell after x% of health
Quote:
Originally Posted by
insain3338
still not working :S how do i make it do every 10% also? would it be the same thing but like
function Mob_onCombat(pUnit, event)
if pUnit:GetHealthPct() < 90 then
pUnit:SendChatMessage(11, 0, "You are mine!")
end
end
function Mob_onCombat2(pUnit, event)
if pUnit:GetHealthPct() < 80 then
pUnit:SendChatMessage(11, 0, "You are mine lol !")
end
end
RegisterUnitEvent(NPC ID, "Mob_onCombat ")
RegisterUnitEvent(NPC ID, "Mob_onCombat2 ")
or what?
Code:
function Mob_OnCombat(pUnit, event)
pUnit:RegisterEvent("Mob_Enrage", 100, 1)
pUnit:RegisterEvent("Mob_Enrage2", 100, 1)
end
function Mob_Enrage(pUnit, event)
if pUnit:GetHealthPct() < 90 then
pUnit:SendChatMessage(11, 0, "You are mine!")
pUnit:FullCastSpell(spell id here)
pUnit:RemoveEvents
pUnit:RegisterEvent("Mob_Enrage2", 100, 1)
end
else
end
function Mob_Enrage2(pUnit, event)
if pUnit:GetHealthPct() < 80 then
pUnit:SendChatMessage(11, 0, "You are mine!")
pUnit:FullCastSpell(spell id here)
pUnit:RemoveEvents
end
else
end
RegisterUnitEvent(Mobs ID Here, "Mob_onCombat ")
This. Btw arent u the admin on Insain Funservers?