runiker
14-01-09, 10:30 AM
Hey all i pulled it off again this time i took a basic script and made it for the primary use of grunts in some type of pvp zone these grunts if you get them below 10% health they will turn into your faction. this would make for a very interesting pvp zone. Just change the spawn ids one for the primary horde (starts out horde) and one for the primary ally.
function LordCyran_EnterCombat (pUnit, event)
pUnit:RegisterEvent("LordCyran_Phase4", 1000, 0)
end
function Gruntworker_Phase4 (pUnit, event)
if pUnit:GetHealthPct() < 10 then
pUnit:RemoveEvents()
pUnit:RegisterEvent("getplayerclass", 3000, 0)
end
end
function Gruntworker_LeaveCombat (pUnit, event)
pUnit:RemoveEvents()
end
function getplayerclass (pUnit, event)
local faction = pUnit:GetFaction()
if faction = 1052 then
pUnit:SetFaction(1036)
else
pUnit:SetFaction(1052)
pUnit:RemoveEvents()
end
end
RegisterUnitEnt(Allygruntid, 1, "Gruntworker_EnterCombat")
RegisterUnitEvent(AllyGruntid, 2, "Gruntworker_LeaveCombat")
RegisterUnitEvent(Hordegruntid, 1, "Gruntworker_EnterCombat")
RegisterUnitEvent(Hordegruntid, 2, "Gruntworker_LeaveCombat")
function LordCyran_EnterCombat (pUnit, event)
pUnit:RegisterEvent("LordCyran_Phase4", 1000, 0)
end
function Gruntworker_Phase4 (pUnit, event)
if pUnit:GetHealthPct() < 10 then
pUnit:RemoveEvents()
pUnit:RegisterEvent("getplayerclass", 3000, 0)
end
end
function Gruntworker_LeaveCombat (pUnit, event)
pUnit:RemoveEvents()
end
function getplayerclass (pUnit, event)
local faction = pUnit:GetFaction()
if faction = 1052 then
pUnit:SetFaction(1036)
else
pUnit:SetFaction(1052)
pUnit:RemoveEvents()
end
end
RegisterUnitEnt(Allygruntid, 1, "Gruntworker_EnterCombat")
RegisterUnitEvent(AllyGruntid, 2, "Gruntworker_LeaveCombat")
RegisterUnitEvent(Hordegruntid, 1, "Gruntworker_EnterCombat")
RegisterUnitEvent(Hordegruntid, 2, "Gruntworker_LeaveCombat")