Seeing as I don't hate you so much now, heres that math.random I was talking to you about:
Code:
function NPCNAME_ClassPick(pUnit, Event)
pUnit:RemoveEvents()
Choice=math.random(1, 8)
if Choice==1 then
pUnit:SendChatMessage(14, 0, "Feel the power of the Shaman!")
pUnit:RegisterEvent("NPCNAME_Shaman", 1000, 0)
pUnit:CastSpellOnTarget(34353,pUnit:GetRandomPlayer(0))
end
if Choice==2 then
pUnit:SendChatMessage(14, 0, "Feel the power of the Paladin!")
pUnit:RegisterEvent("NPCNAME_Paladin", 1000, 0)
pUnit:CastSpellOnTarget(27174,pUnit:GetRandomPlayer(0))
end
if Choice==3 then
pUnit:SendChatMessage(14, 0, "Feel the power of the Druid!")
pUnit:RegisterEvent("NPCNAME_Druid", 1000, 0)
pUnit:CastSpell(33763)
pUnit:CastSpell(33763)
pUnit:CastSpell(33763)
end
if Choice==4 then
pUnit:SendChatMessage(14, 0, "Feel the power of the Priest!")
pUnit:RegisterEvent("NPCNAME_Priest", 1000, 0)
pUnit:CastSpellOnTarget(25364,pUnit:GetRandomPlayer(0))
end
if Choice==5 then
pUnit:SendChatMessage(14, 0, "Feel the power of the Rogue!")
pUnit:RegisterEvent("NPCNAME_Rogue", 1000, 0)
pUnit:CastSpellOnTarget(36554,pUnit:GetRandomPlayer(0))
pUnit:CastSpell(43547)
end
if Choice==6 then
pUnit:SendChatMessage(14, 0, "Feel the power of the Warrior!")
pUnit:RegisterEvent("NPCNAME_Warrior", 1000, 0)
pUnit:CastSpellOnTarget(25264,pUnit:GetMainTank())
end
if Choice==7 then
pUnit:SendChatMessage(14, 0, "Feel the power of the Warlock!")
pUnit:RegisterEvent("NPCNAME_Warlock", 1000, 0)
pUnit:CastSpell(27212)
end
if Choice==8 then
pUnit:SendChatMessage(14, 0, "Feel the power of the Mage!")
pUnit:RegisterEvent("NPCNAME_Mage", 1000, 0)
pUnit:CastSpellOnTarget(6131,pUnit:GetMainTank())
end
end
Thats how to do it in Lua
Heres how to do it in Lua++, this allows you to combine it as a percentage:
Code:
function Phase1(pUnit, Event)
if pUnit:GetHealthPct() <=80 then
pUnit:RemoveEvents();
local RandomPick = math.random(1,2)
if RandomPick == 1 then
pUnit:SendChatMessage(14, 0, "Feel my might!")
pUnit:RegisterEvent("RawrBunny", 1000, 0)
end
end
if RandomPick == 2 then
pUnit:RemoveEvents();
pUnit:SendChatMessage(14, 0, "Time to die!")
pUnit:SetScale(2)
pUnit:RegisterEvent("Phase2", 1000, 0)
end
Not too sure about that Lua++ part, don't use it frequent enough to be confident with it.