I made a boss script and im trying to figure out why my boss keeps spawning dead here is a copy of the script
local NAME = "Lord Punisher"
local NPCID = 99956
function Lord Punisher_OnSpawn(Unit, event)
Unit:RemoveEvents()
Unit:SetFaction(35)
Unit:EquipWeapons(34247, 0, 0)
Unit:RegisterEvent("Lord Punisher.MoveRandomArea", 3500, 0)
end
function Lord Punisher_OnCombat(pUnit, event, player)
pUnit:SendChatMessage(12, 0, "Die you ugly humans!")
pUnit:RegisterEvent("Lord Punisher_Phase1", 1000, 0)
end
function Lord Punisher_OnLeaveCombat(pUnit, event, player)
pUnit:RemoveEvents()
pUnit:SendChatMessage(14, 0, "You know nothing of power!")
pUnit:SetScale(1)
pUniteMorph()
end
function Lord Punisher_OnDeath(pUnit, event, player)
pUnit:RemoveEvents()
pUnit:SetScale(1)
pUniteMorph()
end
function Lord Punisher_Phase1(pUnit, event, player)
if pUnit:GetHealthPct() <= 65 then
pUnit:SendChatMessage(12, 0, "I see that you want a true battle.")
pUnit:CastSpell(56359)
pUnit:RemoveEvents()
pUnit:RegisterEvent("Lord Punisher_Phase2", 1000, 0)
end
end
function Lord Punisher_Phase2(pUnit, event, player)
if pUnit:GetHealthPct() <= 35 then
pUnit:SendChatMessage(14, 0 , "This is impossible. I am immortal, NOW DIE!")
pUnit:SetScale(4)
pUnit:SetModel(21135)
pUnit:CastSpell(68145)
pUnit:CastSpellAoF(pUnit:GetX(), pUnit:GetY(), pUnit:GetZ(), 58936)
pUnit:CastSpell(57083)
pUnit:RemoveEvents()
end
end
RegisterUnitEvent(NPCID, 1, "Lord Punisher_OnCombat")
RegisterUnitEvent(NPCID, 2, "Lord Punisher_OnLeaveCombat")
RegisterUnitEvent(NPCID, 4, "Lord Punisher_OnDeath")
can someone please tell me if i need to change something
---------- Post added at 09:37 AM ---------- Previous post was at 09:34 AM ----------
ignore the smiley faces idk why its doing that