Code:
function world_OnEnterCombat(pUnit, Event)
pUnit:SendChatMessage(12, 0, "what do you want him to say")
pUnit:RegisterEvent("world_p1",1000, 0)
end
function world_p1(pUnit, Event)
if pUnit:GetHealthPct() < 90 then
pUnit:RemoveEvents()
pUnit:SendChatMessage (12, 0, "what do you want him to say")
pUnit:RegisterEvent("world_Spell1", casttime, 0)
pUnit:RegisterEvent("world_Spell2", casttime, 0)
pUnit:RegisterEvent("world_Spell3", casttime, 0)
pUnit:RegisterEvent("world_p2",1000, 0)
end
end
function world_p2(pUnit, Event)
if pUnit:GetHealthPct() < 70 then
pUnit:RemoveEvents()
pUnit:SendChatMessage (12, 0, "what do you want him to say")
pUnit:RegisterEvent("world_Spell1", casttime, 0)
pUnit:RegisterEvent("world_Spell3", casttime, 0)
pUnit:RegisterEvent("world_Spell5", casttime, 0)
pUnit:RegisterEvent("world_p3",1000, 0)
end
end
function world_p3(pUnit, Event)
if pUnit:GetHealthPct() < 50 then
pUnit:RemoveEvents()
pUnit:SendChatMessage (12, 0, "what do you want him to say")
pUnit:RegisterEvent("world_Spell4", casttime, 0)
pUnit:RegisterEvent("world_Spell4", casttime, 0)
pUnit:RegisterEvent("world_Spell3", casttime, 0)
pUnit:RegisterEvent("world_p4",1000, 0)
end
end
function world_p4(pUnit, Event)
if pUnit:GetHealthPct() < 30 then
pUnit:RemoveEvents()
pUnit:SendChatMessage (12, 0, "what do you want him to say")
pUnit:RegisterEvent("world_Spell2", casttime, 0)
pUnit:RegisterEvent("world_Spell5", casttime, 0)
pUnit:RegisterEvent("world_Spell6", casttime, 0)
pUnit:RegisterEvent("boss_p5",1000, 0)
end
end
function world_p5(pUnit, Event)
if pUnit:GetHealthPct() < 10 then
pUnit:RemoveEvents()
pUnit:SendChatMessage (12, 0, "what do you want him to say")
pUnit:RegisterEvent("world_Spell6", casttime, 0)
pUnit:RegisterEvent("world_Spell6", casttime, 0)
pUnit:RegisterEvent("world_Spell1", casttime, 0)
pUnit:RegisterEvent("world_p6",1000, 0)
end
end
function world_p6(pUnit, Event)
if pUnit:GetHealthPct() < 5 then
pUnit:RemoveEvents()
pUnit:SendChatMessage (12, 0, "what do you want him to say")
Choice=Math.Random(1, 6)
if Choice==1 then
pUnit:RegisterEvent("world_Spell1", casttime, 0)
end
if Choice==2 then
pUnit:RegisterEvent("world_Spell2", casttime, 0)
end
if Choice==3 then
pUnit:RegisterEvent("world_Spell3", casttime, 0)
end
if Choice==4 then
pUnit:RegisterEvent("world_Spell4", casttime, 0)
end
if Choice==5 then
pUnit:RegisterEvent("world_Spell5", casttime, 0)
end
if Choice==6 then
pUnit:RegisterEvent("world_Spell6", casttime, 0)
end
pUnit:RegisterEvent("world_Died",1000, 0)
end
end
function world_Spell1(pUnit, Event)
pUnit:FullCastSpell(spellid, pUnit:GetMainTank())
end
function world_Spell2(pUnit, Event)
pUnit:FullCastSpell(spellid, pUnit:GetMainTank())
end
function world_Spell1(pUnit, Event)
pUnit:FullCastSpell(spellid, pUnit:GetRandomPlayer(0))
end
function world_Spell3(pUnit, Event)
pUnit:FullCastSpell(spellid, pUnit:GetRandomPlayer(0))
end
function world_Spell4(pUnit, Event)
pUnit:FullCastSpell(spellid, pUnit:GetRandomPlayer(0))
end
function world_Spell5(pUnit, Event)
pUnit:FullCastSpell(spellid, pUnit:GetMainTank())
end
function world_Spell6(pUnit, Event)
pUnit:FullCastSpell(spellid, pUnit:GetRandomPlayer(0))
end
function world_Spell7(pUnit, Event)
pUnit:FullCastSpell(spellid, pUnit:GetRandomPlayer(0))
end
function world_OnKill(pUnit, Event)
pUnit:RemoveEvents()
pUnit:SendChatMessage(12, 0, "what do you want him to say")
end
function world_Died(pUnit, Event)
pUnit:RemoveEvents()
if pUnit:GetFaction() = 1801
pUnit:SpawnCreature(entryID, x, y, z, o, faction, duration)
pUnit:SpawnCreature(entryID, x, y, z, o, faction, duration)
pUnit:SpawnCreature(entryID, x, y, z, o, faction, duration)
pUnit:SpawnCreature(entryID, x, y, z, o, faction, duration)
pUnit:SpawnCreature(entryID, x, y, z, o, faction, duration)
end
if pUnit:GetFaction() = 1802
pUnit:SpawnCreature(entryID, x, y, z, o, faction, duration)
pUnit:SpawnCreature(entryID, x, y, z, o, faction, duration)
pUnit:SpawnCreature(entryID, x, y, z, o, faction, duration)
pUnit:SpawnCreature(entryID, x, y, z, o, faction, duration)
pUnit:SpawnCreature(entryID, x, y, z, o, faction, duration)
end
pUnit:SendChatMessage(12, 0, "what do you want him to say")
end
function world_OnLeaveCombat(pUnit, Event)
pUnit:RemoveEvents()
pUnit:SendChatMessage(12, 0, "what do you want him to say")
end
RegisterUnitEvent(95438, 1, "world_OnEnterCombat")
RegisterUnitEvent(95438, 2, "world_OnLeaveCombat")
RegisterUnitEvent(95438, 3, "world_OnKill")
RegisterUnitEvent(95438, 4, "world_Died")
just copy the stuff in code tags and place it in a test file named "world.lua" without the "". Hope this helps. Here is a guide on how to create an npc to go along with this customizable boss script.