Code:
function RemoteControlledDwarf_OnKill(pUnit,Event)
pUnit:SendChatMessage(14, 0, "Rauckiss the Controller: Wha- That's Imposs......")
end
function RemoteControlledDwarf_EnterCombat(pUnit,Event)
pUnit:SendChatMessage(14, 0, "Rauckiss the Controller: You fools wont make it passed our high technology equiptment!") -- You had two "" at the start of this
pUnit:RegisterEvent("phase_1",1000, 0) -- You need to check every few seconds
end
-- +25% damage
function phase_1(pUnit, Event)
if pUnit:GetHealthPct() < 99 then
pUnit:RemoveEvents() -- this is not C++, we do not need ;
if pUnit:GetMainTank() ~= nil then -- Checking to see if there is a tank else it will error
pUnit:FullCastSpellOnTarget(61902,pUnit:GetMainTank())
end
pUnit:SendChatMessage(14, 0, "Rauckiss the Controller: Activating Electrical System!")
pUnit:RegisterEvent("phase_2",2000, 0)
end
end
-- electrical Field
function phase_2(pUnit, Event)
if pUnit:GetHealthPct() < 90 then
pUnit:RemoveEvents() -- this is not C++, we do not need ;
pUnit:SendChatMessage(14, 0, "Rauckiss the Controller: Fully powered!")
if pUnit:GetClosestPlayer() ~= nil then -- Checking to see if there is a tank else it will error
pUnit:FullCastSpellOnTarget(43648,pUnit:GetClosestPlayer())
pUnit:RegisterEvent("phase_3",2000, 0)
end
end
-- De-Power
function phase_3(pUnit, Event)
if pUnit:GetHealthPct() < 80 then
pUnit:RemoveEvents() -- this is not C++, we do not need ;
if pUnit:GetClosestPlayer() ~= nil then -- Checking to see if there is a tank else it will error
pUnit:FullCastSpellOnTarget(61570,pUnit:GetClosestPlayer())
end
pUnit:RegisterEvent("phase_4",2000, 0)
end
end
-- Rinse and Repeat!
function phase_4(pUnit, Event)
if pUnit:GetHealthPct() < 70 then
pUnit:RemoveEvents() -- this is not C++, we do not need ;
if pUnit:GetRandomFriend() ~= nil then -- Checking to see if there is a tank else it will error
pUnit:FullCastSpellOnTarget(43648,pUnit:GetRandomFriend()) -- I think this is broken (The command) so it will do nothing
end
pUnit:SendChatMessage(14, 0, "Rauckiss the Controller: Fully powered!")
pUnit:RegisterEvent("phase_5",2000, 0)
end
end
function phase_5(pUnit, Event)
if pUnit:GetHealthPct() < 60 then
pUnit:RemoveEvents() -- this is not C++, we do not need ;
if pUnit:GetClosestPlayer() ~= nil then -- Checking to see if there is a tank else it will error
pUnit:FullCastSpellOnTarget(33183,pUnit:GetClosestPlayer())
end
pUnit:RegisterEvent("phase_6",2000, 0)
end
end
function phase_6(pUnit, Event)
if pUnit:GetHealthPct() < 50 then
pUnit:RemoveEvents()
pUnit:SendChatMessage(14, 0, "Rauckiss the Controller: Fully powered!")
if pUnit:GetClosestPlayer() ~= nil then -- Checking to see if there is a tank else it will error
pUnit:FullCastSpellOnTarget(43648,pUnit:GetClosestPlayer())
end
pUnit:RegisterEvent("phase_7",2000, 0)
end
end
function phase_7(pUnit, Event)
if pUnit:GetHealthPct() < 40 then
pUnit:RemoveEvents()
if pUnit:GetClosestPlayer() ~= nil then -- Checking to see if there is a tank else it will error
pUnit:FullCastSpellOnTarget(45589,pUnit:GetClosestPlayer())
end
pUnit:RegisterEvent("phase_8",2000, 0)
end
end
function phase_8(pUnit, Event)
if pUnit:GetHealthPct() < 30 then
pUnit:RemoveEvents()
pUnit:SendChatMessage(14, 0, "Rauckiss the Controller: Fully powered!")
if pUnit:GetClosestPlayer() ~= nil then -- Checking to see if there is a tank else it will error
pUnit:FullCastSpellOnTarget(43648,pUnit:GetClosestPlayer())
end
pUnit:RegisterEvent("phase_9",2000, 0)
end
end
function phase_9(pUnit, Event)
if pUnit:GetHealthPct() < 20 then
pUnit:RemoveEvents()
if pUnit:GetClosestPlayer() ~= nil then -- Checking to see if there is a tank else it will error
pUnit:FullCastSpellOnTarget(45589,pUnit:GetClosestPlayer())
end
pUnit:RegisterEvent("phase_10",2000, 0)
end
end
function phase_10(pUnit, Event)
if pUnit:GetHealthPct() < 10 then
pUnit:RemoveEvents()
pUnit:SendChatMessage(14, 0, "Rauckiss the Controller: Fully powered!")
if pUnit:GetClosestPlayer() ~= nil then -- Checking to see if there is a tank else it will error
pUnit:FullCastSpellOnTarget(43648,pUnit:GetClosestPlayer())
end
pUnit:RegisterEvent("phase_11",2000, 0)
end
end
function phase_11(pUnit, Event)
if pUnit:GetHealthPct() < 9 then
pUnit:RemoveEvents()
if pUnit:GetRandomPlayer(0) ~= nil then -- Checking to see if there is a tank else it will error
pUnit:FullCastSpellOnTarget(64970,pUnit:GetRandomPlayer(0)) -- You missed a )
end
pUnit:SendChatMessage(14, 0, "Rauckiss the Controller: THIS IS THE END!!!!")
pUnit:RegisterEvent("phase_12",2000, 0)
end
end
function phase_12(pUnit, Event)
if pUnit:GetHealthPct() < 8 then
pUnit:RemoveEvents()
if pUnit:GetRandomPlayer(0) ~= nil then -- Checking to see if there is a tank else it will error
pUnit:FullCastSpellOnTarget(64970,pUnit:GetRandomPlayer(0)
end
pUnit:RegisterEvent("phase_13",2000, 0)
end
end
function phase_13(pUnit, Event)
if pUnit:GetHealthPct() < 7 then
pUnit:RemoveEvents()
if pUnit:GetRandomPlayer(0) ~= nil then -- Checking to see if there is a tank else it will error
pUnit:FullCastSpellOnTarget(64970,pUnit:GetRandomPlayer(0)
end
pUnit:RegisterEvent("phase_14",2000, 0)
end
end
function phase_14(pUnit, Event)
if pUnit:GetHealthPct() < 6 then
pUnit:RemoveEvents()
if pUnit:GetRandomPlayer(0) ~= nil then -- Checking to see if there is a tank else it will error
pUnit:FullCastSpellOnTarget(64970,pUnit:GetRandomPlayer(0)
end
pUnit:RegisterEvent("RemoteControlledDwarf_Start",2000, 0)
end
end
function RemoteControlledDwarf_Start(pUnit, Event)
pUnit:RegisterEvent("phase_1",2000, 0)
end
RegisterUnitEvent(24723, 1, "RemoteControlledDwarf_Start")
RegisterUnitEvent(24723, 3, "RemoteControlledDwarf_OnKill")
RegisterUnitEvent(24723, 1, "RemoteControlledDwarf_EnterCombat")