Hi, how do you add a .lua scrpit to your server? I followed a tutorial that said it's just to put it in the script folder, but then i spawned the mob after restarting the server and the boss didn't start casting spells or anything like that.
Here's the script in case if there's something wrong with it. Please take a look:
--rage3's Doom, Shadow Spirit of Ragedoom--
function Doom_OnEnterCombat(pUnit, Event)
pUnit:SendChatMessage(14, 0, "You will never stand a chance against me, the shadowy part of Ragedoom's spirit! Be prepared, because you will face your greatest nightmare!")
pUnit:RegisterEvent("Doom_Phase1",1000,0)
end
--Spells--
function Doom_Random1(pUnit, Event)
Choice=math.random(1, 3)
if Choice==1 then
pUnit:FullCastSpellOnTarget(36972,pUnit:GetClosestPlayer())
pUnit:SendChatMessage(14, 0, "Feel the power of darkness!")
end
if Choice==2 then
pUnit:FullCastSpellOnTarget(45944,pUnit:GetRandomPlayer(3))
pUnit:SendChatMessage(14, 0, "Curse you!")
end
if Choice==3 then
pUnit:CastSpell(55665)
pUnit:SendChatMessage(14, 0, "I'll drain your souls untill you die!")
end
end
function Doom_Random2(pUnit, Event)
Choice=math.random(1, 3)
if Choice==1 then
pUnit:Castspell(46442)
end
if Choice==2 then
pUnit:CastSpell(33547)
pUnit:SendChatMessage(14, 0, "Flee for your lives, you weaklings!")
end
if Choice==3 then
pUnit:CastSpell(42723)
pUnit:CastSpell(29973)
end
end
function Doom_Random3(pUnit, Event)
choice=math.random(1, 2)
if Choice==1 then
pUnit:FullCastSpellOnTarget(38491,pUnit:GetRandomPlayer(0))
pUnit:SendChatMessage(14, 0, "You cannot do anything to me anyway.")
end
if Choice==2 then
pUnit:FullCastSpellOnTarget(15283,pUnit:GetRandomPlayer(0))
pUnit:SendChatMessage(14, 0, "You cannot do anything to me anyway."
end
end
function Doom_Random4(pUnit, Event)
Choice=math.random(1, 3)
if Choice==1 then
pUnit:CastSpell(59264)
pUnit:SendChatMessage(14, 0, "Die!")
end
if Choice==2 then
pUnit:CastSpell(36972)
end
if Choice==3 then
pUnit:FullCastSpellOnTarget(40585,pUnit:GetRandomPlayer(3))
pUnit:SendChatMessage(14, 0, "Feeling weak? Give up! You will never beat me!")
end
end
function Doom_Random5(pUnit, Event)
Choice=math.random(1, 3)
if Choice==1 then
pUnit:CastSpell(35032)
end
if Choice==2 then
pUnit:FullCastSpellOnTarget(31477,pUnit:GetRandomPlayer(5))
end
if Choice==3 then
pUnit:FullCastSpellOnTarget(7967,pUnit:GetRandomPlayer(6))
end
end
function Doom_SpellAvatar1(pUnit, Event)
pUnit:SendChatMessage(14, 0, "Darkness of the shadows, come to me!")
pUnit:CastSpell(24646)
pUnit:SetScale(1.5)
end
function Doom_SpellAvatar2(pUnit, Event)
pUnit:SendChatMessage(14, 0, "Now, witness my TRUE POWER!!!")
pUnit:CastSpell(19135)
pUnit:SetScale(2)
end
function Doom_SpellShroudOfDarkness(pUnit, Event)
pUnit:FullCastSpellOnTarget(54525,pUnit:GetMainTank())
pUnit:SendChatMessage(14, 0, "Feel how the shroud of darkness drains the heat from your veins.")
end
function Doom_SpellConsumeSoul(pUnit, Event)
pUnit:SendChatMessage(14, 0, "If I'm going to die, I'll take you with me!")
pUnit:CastSpell(34436)
pUnit:FullCastSpellOnTarget(41080,pUnit:GetRandomPlayer(0))
pUnit:FullCastSpellOnTarget(41080,pUnit:GetRandomPlayer(0))
pUnit:FullCastSpellOnTarget(41080,pUnit:GetRandomPlayer(0))
pUnit:FullCastSpellOnTarget(41080,pUnit:GetRandomPlayer(0))
pUnit:FullCastSpellOnTarget(41080,pUnit:GetRandomPlayer(0))
pUnit:FullCastSpellOnTarget(41080,pUnit:GetRandomPlayer(0))
pUnit:FullCastSpellOnTarget(41080,pUnit:GetRandomPlayer(0))
pUnit:FullCastSpellOnTarget(41080,pUnit:GetRandomPlayer(0))
pUnit:FullCastSpellOnTarget(41080,pUnit:GetRandomPlayer(0))
pUnit:FullCastSpellOnTarget(41080,pUnit:GetRandomPlayer(0))
end
--Phases--
function Doom_Phase1(pUnit, Event)
pUnit:RemoveEvents();
pUnit:RegisterEvent("Doom_Phase2",1000,0)
pUnit:RegisterEvent("Doom_Random1",5000,0)
pUnit:RegisterEvent("Doom_SpellAvatar1",1800000,0)
pUnit:RegisterEvent("Doom_SpellAvatar2",3600000,0)
end
end
function Doom_Phase2(pUnit, Event)
if pUnit:GetHealthPct() <= 80
pUnit:RemoveEvents()
pUnit:SendChatMessage(14, 0, "Your struggle is meaningless!")
pUnit:RegisterEvent("Doom_Phase3",1000,0)
pUnit:RegisterEvent("Doom_Random1",5000,0)
pUnit:RegisterEvent("Doom_Random2",20000,0)
pUnit:RegisterEvent("Doom_SpellAvatar1",1800000,0)
pUnit:RegisterEvent("Doom_SpellAvatar2",3600000,0)
end
end
function Doom_Phase3(pUnit, Event)
if pUnit:GetHealthPct() <= 60
pUnit:RemoveEvents()
pUnit:SendChatMessage(14, 0, "You will never prevail over me!")
pUnit:RegisterEvent("Doom_Phase4",1000,0)
pUnit:RegisterEvent("Doom_Random2",20000,0)
pUnit:RegisterEvent("Doom_Random3",10000,0)
pUnit:RegisterEvent("Doom_Random4",15000,0)
pUnit:RegisterEvent("Doom_SpellShroudOfDarkness",1000,1)
pUnit:RegisterEvent("Doom_SpellAvatar1",1800000,0)
pUnit:RegisterEvent("Doom_SpellAvatar2",3600000,0)
end
end
funcion Doom_Phase4(pUnit, Event)
if pUnit:GetHealthPct() <= 40
pUnit:RemoveEvents()
pUnit:SendChatMessage(14, 0, "Your tiny thoothpicks are worthless! Just give up and admit your defeat. You can never stand the power of the lord of the shadow casters!")
pUnit:RegisterEvent("Doom_Phase5",1000,0)
pUnit:RegisterEvent("Doom_Random2",1000,0)
pUnit:RegisterEvent("Doom_Random4",10000,0)
pUnit:RegisterEvent("Doom_Random5",5000,0)
pUnit:RegisterEvent("Doom_SpellAvatar1",1800000,0)
pUnit:RegisterEvent("Doom_SpellAvatar2",3600000,0)
end
end
function Doom_Phase5(pUnit, Event)
if pUnit:GetHealthPct() <= 20
pUnit:RemoveEvents()
pUnit:SendChatMessage(14, 0, "I will never die!")
pUnit:RegisterEvent("Doom_Phase6",1000,0)
pUnit:RegisterEvent("Doom_Random1",10000,0)
pUnit:RegisterEvent("Doom_Random2",15000,0)
pUnit:RegisterEvent("Doom_Random3",30000,0)
pUnit:RegisterEvent("Doom_Radnom4",25000,0)
pUnit:RegisterEvent("Doom_Random5",17000,0)
pUnit:RegisterEvent("Doom_SpellShroudOfDarkness",1000,1)
pUnit:RegisterEvent("Doom_SpellAvatar1",1800000,0)
pUnit:RegisterEvent("Doom_SpellAvatar2",3600000,0)
end
end
function Doom_Phase6(pUnit, Event)
if pUnit:GetHealthPct() <= 1
pUnit:RemoveEvents()
pUnit:SendChatMessage(14, 0, "No! It can't be! I will not die! I will never die! I shall finish you all of! Feel my true power of darkness! DIE!!!")
pUnit:RegisterEvent("Doom_SpellConsumeSoul",5000,1)
pUnit:RegisterEvent("Doom_Random1",10000,0)
pUnit:RegisterEvent("Doom_Random2",15000,0)
pUnit:RegisterEvent("Doom_Random3",30000,0)
pUnit:RegisterEvent("Doom_Radnom4",25000,0)
pUnit:RegisterEvent("Doom_Random5",18000,0)
pUnit:RegisterEvent("Doom_SpellShroudOfDarkness",1000,1)
pUnit:RegisterEvent("Doom_SpellAvatar1",1800000,0)
pUnit:RegisterEvent("Doom_SpellAvatar2",3600000,0)
end
end
--Last piece of script--
function Doom_OnLeaveCombat(pUnit, Event)
pUnit:RemoveEvents()
end
function Doom_OnKilledTarget(pUnit, Event)
pUnit:SendChatMessage(14, 0, "You weakling! You don't deserve that power of yours.")
pUnit:CastSpell(39321)
end
function Doom_OnDeath(pUnit, Event)
pUnit:SendChatMessage(14, 0, "No! How can this be?! You... you have defeated me... the lord of the shadow casters...")
pUnit:SendChatMessage(14, 0, "Well... this is not over yet! By killing me, my released power will make Ragedoom even stronger when he is reborn!")
pUnit:RemoveEvents()
end
RegisterUnitEvent(999997, 1, "Doom_OnEnterCombat")
RegisterUnitEvent(999997, 2, "Doom_OnLeaveCombat")
RegisterUnitEvent(999997, 3, "Doom_OnKilledTarget")
RegisterUnitEvent(999997, 4, "Doom_OnDeath")