Heya!
So I thought also start contributing something to you guys ... and girls?.
Very Simple and customable Lua script for bosses or whatever. Just took some mins.
All in RED do you need to edit.
XXX is the name of the mob. Can be anything. (Recommed having the same name on all of them.)
0000 is the NPC ID. Example = 17854. Must be same everywhere. (Search for ID at wowhead or such.)
YYYY is the ID the Mob will transform into at 75% hp. Just like NPC ID. Must be same everywhere.(Search for ID at wowhead here also.)
Here you go:
Code:
function XXX_OnCombat(Unit, Event)
Unit:SendChatMessage(12, 0, "In the name of Death, You will die!")
end
function XXX_FireBall(pUnit, Event)
pUnit:FullCastSpellOnTarget(31620, pUnit:GetRandomPlayer(7))
end
function XXX_FireVolley(pUnit, Event)
pUnit:CastSpell(37109, pUnit:GetRandomPlayer(0))
end
function XXX_Transform(pUnit, Event)
if pUnit:GetHealthPct() < 75 then
pUnit:RemoveEvents();
pUnit:FullCastSpell(0)
pUnit:SetModel(YYYY)
end
end
function OnLeave_OnLeaveCombat(Unit, Event)
Unit:RemoveEvents()
Unit:SendChatMessage(12, 0, "You're not prepared!")
end
function OnDeath_OnDied(Unit, Event)
Unit:RemoveEvents()
Unit:SendChatMessage(11, 0, "You ...... How?")
end
function KilledTarget_OnKilledTarget(Unit, Event)
Unit:SendChatMessage(12, 0, "Mhmm ... Death!")
end
RegisterUnitEvent(0000, 1, "EnterCombat_OnCombat")
RegisterUnitEvent(0000, 2, "OnLeave_OnLeaveCombat")
RegisterUnitEvent(0000, 3, "KilledTarget_OnKilledTarget")
RegisterUnitEvent(0000, 4, "OnDeath_OnDied")
For those who doesn´t know how you use Lua's. Just put it in the ''scripts'' folder in your compile/server folder. And for those who doesn´t know how to even make a Lua file. Just copy this Lua code I made and paste it into a text document. Then edit the extension to LUA.
Feel free to rep ... Since I could use some. :yuck:
Thanks.