Hey there guys, I just started getting into Lua about a week ago, and I would like to share with you my first boss script.
This is for Varous Cloudstrider. He has all his spells that he does on retail, with a bunch of others that I threw in to make him harder. I changed his entry ID, so if you kill him, you will not get credit for the achievement.
First phase - Melee attacks, Thunder Clap, Amplify Magic, Energize Cores (these will go off throughout the whole fight).
Second phase - Spawns 1 add, does 2 new spells, Arcane Blast, and Brood Power:Bronze.
Third phase - Morphs into a dragon, 2 new spells, Arcane Barrier, Arcane Discharge.
Last phase - Back into original form, spawns 3 more adds, 2 new spells, Enlarge, Crystal Prison.
Here's the SQL for him. He hits pretty hard and has about 1.8 mil HP.
Code:
INSERT INTO creature_names VALUES ('145005','Varos Cloudstrider','Azure-Lord of the Blue Dragonflight','','104','2','0','3','0','0','27033','0','0','0','32','1','0','0');
INSERT INTO creature_proto VALUES ('145005','80','80','22','1837973','1837973','0','0.8','0','1800','0','4865.29','6728.47','0','0','0','0','2000','10000','35','35','35','35','35','35','1.5','0','0','0','0','0','0','2.5','8','14','0','0','0','0','0','0','0');
Here's the script:
Code:
function VarousCloudstrider_ThunderClap(pUnit, Event)
pUnit:CastSpell(58975)
end
function VarousCloudstrider_AmplifyMagic(pUnit, Event)
pUnit:FullCastSpellOnTarget(59371, pUnit:GetRandomPlayer(0))
end
function VarousCloudstrider_EnergizeCores(pUnit, Event)
pUnit:GetRandomPlayer(0)
pUnit:CastSpell(50785)
end
function VarousCloudstrider_OnCombat(pUnit, Event)
pUnit:PlaySoundToSet(13649)
pUnit:SendChatMessage(14, 0, "There will be no mercy!")
pUnit:RegisterEvent("VarousCloudstrider_ThunderClap", 12000, 0)
pUnit:RegisterEvent("VarousCloudstrider_AmplifyMagic", 10000, 0)
pUnit:RegisterEvent("VarousCloudstrider_EnergizeCores", 17000, 0)
pUnit:RegisterEvent("VarousCloudstrider_Phase2",1000,0)
end
function VarousCloudstrider_Phase2(pUnit, Event)
if pUnit:GetHealthPct() <= 75 then
pUnit:RemoveEvents()
pUnit:PlaySoundToSet(13650)
pUnit:SendChatMessage(14, 0, "Blast them! Destroy them!")
pUnit:SpawnCreature(145000, 1073.96, 1049.11, 606.02, 0.03, 22, 20000)
pUnit:RegisterEvent("VarousCloudstrider_2Moves", 1000, 1)
end
end
function VarousCloudstrider_BroodPower(pUnit, Event)
pUnit:CastSpell(22642)
end
function VarousCloudstrider_ArcaneBlast(pUnit, Event)
pUnit:FullCastSpellOnTarget(37126, pUnit:GetRandomPlayer(0))
end
function VarousCloudstrider_2Moves(pUnit, Event)
pUnit:RegisterEvent("VarousCloudstrider_ThunderClap", 8000, 0)
pUnit:RegisterEvent("VarousCloudstrider_AmplifyMagic", 6000, 0)
pUnit:RegisterEvent("VarousCloudstrider_EnergizeCores", 16000, 0)
pUnit:RegisterEvent("VarousCloudstrider_BroodPower", 9000, 0)
pUnit:RegisterEvent("VarousCloudstrider_ArcaneBlast", 13000, 0)
pUnit:RegisterEvent("VarousCloudstrider_Phase3",1000,0)
end
function VarousCloudstrider_Phase3(pUnit, Event)
if pUnit:GetHealthPct() <= 50 then
pUnit:RemoveEvents()
pUnit:PlaySoundToSet(13652)
pUnit:SendChatMessage(14, 0, "Strike now! Obliterate them!")
pUnit:SetModel(23487)
pUnit:RegisterEvent("VarousCloudstrider_3Moves", 3000, 1)
end
end
function VarousCloudstrider_ArcaneDischarge(pUnit, Event)
pUnit:CastSpellOnTarget(31472)
end
function VarousCloudstrider_ArcaneBarrier(pUnit, Event)
pUnit:CastSpell(36481)
end
function VarousCloudstrider_3Moves(pUnit, Event)
pUnit:RegisterEvent("VarousCloudstrider_ThunderClap", 10000, 0)
pUnit:RegisterEvent("VarousCloudstrider_AmplifyMagic", 6000, 0)
pUnit:RegisterEvent("VarousCloudstrider_EnergizeCores", 18000, 0)
pUnit:RegisterEvent("VarousCloudstrider_ArcaneDischarge", 12000, 0)
pUnit:RegisterEvent("VarousCloudstrider_ArcaneBarrier", 10000, 0)
pUnit:RegisterEvent("VarousCloudstrider_Phase4", 1000, 0)
end
function VarousCloudstrider_Phase4(pUnit, Event)
if pUnit:GetHealthPct() <= 35 then
pUnit:RemoveEvents()
pUnit:PlaySoundToSet(13651)
pUnit:SendChatMessage(14, 0, "Take no prisoners! Attack!")
pUnit:SetModel(27033)
pUnit:SpawnCreature(145000, 1123.51, 1021.58, 606.02, 2.14, 22, 20000)
pUnit:SpawnCreature(145000, 1073.96, 1049.11, 606.02, 0.03, 22, 20000)
pUnit:SpawnCreature(145000, 1121.07, 1080.54, 606.02, 4.26, 22, 20000)
pUnit:RegisterEvent("VarousCloudstrider_4Moves",1000,1)
end
end
function VarousCloudstrider_CrystalPrison(pUnit, Event)
pUnit:FullCastSpellOnTarget(32361, pUnit:GetRandomPlayer(0))
end
function VarousCloudstrider_Enlarge(pUnit, Event)
pUnit:CastSpell(25462)
end
function VarousCloudstrider_4Moves(pUnit, Event)
pUnit:RemoveEvents()
pUnit:RegisterEvent("VarousCloudstrider_ThunderClap", 12000, 0)
pUnit:RegisterEvent("VarousCloudstrider_AmplifyMagic", 6000, 0)
pUnit:RegisterEvent("VarousCloudstrider_EnergizeCores", 16000, 0)
pUnit:RegisterEvent("VarousCloudstrider_Enlarge", 20000, 0)
pUnit:RegisterEvent("VarousCloudstrider_CrystalPrison", 25000, 0)
end
function VarousCloudstrider_OnLeaveCombat(pUnit, Event)
pUnit:RemoveEvents()
pUnit:SetModel (27033)
end
function VarousCloudstrider_OnDied(pUnit, Event)
pUnit:PlaySoundToSet(13655)
pUnit:SendChatMessage(14, 0, "They are... too strong... under estimated... aargh.. fortitude...")
pUnit:RemoveEvents()
pUnit:RemoveAura(25462)
end
function VarousCloudstrider_OnKilledTarget(pUnit, Event)
pUnit:PlaySoundToSet(13653)
pUnit:SendChatMessage(14, 0, "You were warned...")
end
RegisterUnitEvent(145005, 1, "VarousCloudstrider_OnCombat")
RegisterUnitEvent(145005, 2, "VarousCloudstrider_OnLeaveCombat")
RegisterUnitEvent(145005, 3, "VarousCloudstrider_OnKilledTarget")
RegisterUnitEvent(145005, 4, "VarousCloudstrider_OnDied")
Now, for the adds to work, he must be spawned in The Oculus, at the very top (where there are those 3 platform kinda things). The coords for where he should be spawned - Map: 578, X: 1073.51, Y: 1049.12, Z: 602.697, O: 0.0125551.
Since this isn't retail, I suggest to make a portal teleporting you up to him and stuff like that.
Here's the SQL for his adds.
Code:
INSERT INTO creature_names VALUES ('145000','Azure Ring Captain','','','8','2','0','1','0','0','28046','0','0','0','10','5','0','0');
INSERT INTO creature_proto VALUES ('145000','80','80','22','126089','126089','19970','1','0','2000','0','1278','3785','0','0','0','0','0','3000','20','20','20','20','20','20','1','20','0','0','0','0','0','2.5','8','14','0','0','0','0','0','0','0');
You will probably have to mess around with the adds bounding radius, so they attack when spawned. They do attack, but only if you're close to them.
If any problems occur, please let me know. I am not a master at this yet, but I will try to help the best I can.
So, there ya go, enjoy.
Edit: Screen shots
Varous Himself (yeah I know, he doesn't have a weapon) - http://i39.tinypic.com/2dh7k78.jpg
Deadly Boss Mods works on the Amplify Magic he does, lol - http://i40.tinypic.com/mikj9h.jpg
Getting knocked back - http://i44.tinypic.com/5m9tfq.jpg
Dragon Form - http://i43.tinypic.com/141m4ww.jpg
Last Phase (notice how none of the adds were charging me, gotta fix their bounding radius) - http://i42.tinypic.com/dndax1.jpg
Enlarging - http://i41.tinypic.com/9r0e1x.jpg
Where to spawn him in The Oculus (anywhere up there) - http://i39.tinypic.com/1husdl.jpg