function Boss_Enrage(pUnit, Event)
if pUnit:GetHealthPct() < 95 then
pUnit:FullCastSpell(34670)
pUnit:SendChatMessage(11, 0, "I have entered the combat...Prepare to die")
pUnit:RegisterEvent("Boss_Shadow_Bolt",10000, 0)
end
end
function Boss_Shadow_Bolt(pUnit, Event)
print "Boss Shadow Bolt"
if pUnit:GetHealthPct() < 70 then
pUnit:RemoveEvents();
pUnit:FullCastSpellOnTarget(29924,Unit:GetClosestPlayer())
pUnit:SendChatMessage(11, 0, "Shadow Bolt on you...Haha Noob")
pUnit:RegisterEvent("Boss_Thunderclap",20000, 0)
end
end
function Boss_Thunderclap(pUnit, Event)
print "Boss Thunderclap"
if pUnit:GetHealthPct() < 50 then
pUnit:RemoveEvents();
pUnit:FullCastSpellOnTarget(36706,Unit:GetClosestPlayer())
pUnit:SendChatMessage(11, 0, "Thunderclap...Feel that you newb")
pUnit:RegisterEvent("Boss_Void_Bolt",30000, 0)
end
end
function Boss_Void_Bolt(pUnit, Event)
print "Boss Void Bolt"
if pUnit:GetHealthPct() < 30 then
pUnit:RemoveEvents();
pUnit:FullCastSpellOnTarget(39329,Unit:GetClosestPlayer())
pUnit:SendChatMessage(11, 0, "Now a good Void Bolt...Muhahaha are you feeling it?")
pUnit:RegisterEvent("Boss_Shadow_Bolt_2",8000, 0)
end
end
function Boss_Shadow_Bolt_2(pUnit, Event)
print "Boss Shadow Bolt 2"
if pUnit:GetHealthPct() < 15 then
pUnit:RemoveEvents();
pUnit:FullCastSpellOnTarget(29924,Unit:GetClosestPlayer())
pUnit:SendChatMessage(11, 0, "Again Shadow Bolt on you...You are dead....")
end
end
function Boss_OnCombat(pUnit, Event)
punit:RegisterEvent("Boss_Enrage",10000,1)
end
end
RegisterUnitEvent(130018,1,"Boss")
I get the error :
Code:
scripts/BOSS_Grol'Mak.lua Expected '<eof>' expected near 'end'
So whats the problem with my script?
Use the "Search" Button, its not hard Everyone who helps and contributes
function Boss_OnCombat(pUnit, Event)
punit:RegisterEvent("Boss_Enrage",10000,1)
end
end
RegisterUnitEvent(130018,1,"Boss")
remove one end you have too many
EDIT: I think you may have some other problems with your script with regards to Unit:GetClosestPlayer(). I think you will need to have it as pUnit:GetClosestPlayer() as you are passing in pUnit.
Well, not sure what ends you deleted as in my second post I put what the end problem was and what you changed doesn't look like that. But I guess if your script is working that is the important thing. I've added what I think the script should have looked like if you have any other problems.
Code:
function Boss_Enrage(pUnit, Event)
if pUnit:GetHealthPct() < 95 then
pUnit:RemoveEvents();
pUnit:FullCastSpell(34670)
pUnit:SendChatMessage(11, 0, "I have entered the combat...Prepare to die")
pUnit:RegisterEvent("Boss_Shadow_Bolt",10000, 0)
end
end
function Boss_Shadow_Bolt(pUnit, Event)
print "Boss Shadow Bolt"
if pUnit:GetHealthPct() < 70 then
pUnit:RemoveEvents();
pUnit:FullCastSpellOnTarget(29924,pUnit:GetClosestPlayer())
pUnit:SendChatMessage(11, 0, "Shadow Bolt on you...Haha Noob")
pUnit:RegisterEvent("Boss_Thunderclap",20000, 0)
end
end
function Boss_Thunderclap(pUnit, Event)
print "Boss Thunderclap"
if pUnit:GetHealthPct() < 50 then
pUnit:RemoveEvents();
pUnit:FullCastSpellOnTarget(36706,pUnit:GetClosestPlayer())
pUnit:SendChatMessage(11, 0, "Thunderclap...Feel that you newb")
pUnit:RegisterEvent("Boss_Void_Bolt",30000, 0)
end
end
function Boss_Void_Bolt(pUnit, Event)
print "Boss Void Bolt"
if pUnit:GetHealthPct() < 30 then
pUnit:RemoveEvents();
pUnit:FullCastSpellOnTarget(39329,pUnit:GetClosestPlayer())
pUnit:SendChatMessage(11, 0, "Now a good Void Bolt...Muhahaha are you feeling it?")
pUnit:RegisterEvent("Boss_Shadow_Bolt_2",8000, 0)
end
end
function Boss_Shadow_Bolt_2(pUnit, Event)
print "Boss Shadow Bolt 2"
if pUnit:GetHealthPct() < 15 then
pUnit:RemoveEvents();
pUnit:FullCastSpellOnTarget(29924,pUnit:GetClosestPlayer())
pUnit:SendChatMessage(11, 0, "Again Shadow Bolt on you...You are dead....")
end
end
function Boss_OnCombat(pUnit, Event)
pUnit:RegisterEvent("Boss_Enrage",10000,1)
end
RegisterUnitEvent(130018,1,"Boss")
Man thanks for help, it worked and seems i dont have any other problems :P, i have another question now, how can i make the mob cast more spells in a phase? So in Shadow Bolt Phase i want the Boss to cast more Shadow Bolts not only one
Use the "Search" Button, its not hard Everyone who helps and contributes
local nSpell = math.random(0,2)
if (nSpell == 0) then
pUnit:FullCastSpellOnTarget(29924,pUnit:GetClosestPlayer())
elseif (nSpell == 1) then
(put some other spell here)
else
(put some other spell here)
end
this would generate a random between 0 and 2 number and cast that spell. Change the random number to suit your needs.
So for instance in your shadow bolt phase it would cast one of 3 spells every 10 seconds.
local nSpell = math.random(0,2)
if (nSpell == 0) then
Unit:FullCastSpellOnTarget(29924,Unit:GetClosestPlayer())
elseif (nSpell == 1) then
Unit:FullCastSepllOnTarget(29924,Unit:GetClosestPlayer())
else
Unit:FullCastSepllOnTarget(29924,Unit:GetClosestPlayer())
end
Il try now in game and see if it works or not
EDIT : lol the boss dont works anymore now
Use the "Search" Button, its not hard Everyone who helps and contributes
Edit... there are some other things that I am seeing that I am wondering about. Think about your logic and what you want the boss to do. If you are wanting the boss to enter combat and just tank till it hits 95% cast spell 34670 then at 70% start casting shadow bolt every 10 seconds until it hits the Thunderclap phase? Is this correct? If so... I would do that like this.
Code:
function Boss_Enrage(pUnit, Event)
if pUnit:GetHealthPct() < 95 then
pUnit:RemoveEvents();
pUnit:FullCastSpell(34670)
pUnit:SendChatMessage(11, 0, "I have entered the combat...Prepare to die")
pUnit:RegisterEvent("Boss_Shadow_Bolt",3000, 0)
end
end
function Boss_Shadow_Bolt(pUnit, Event)
print "Boss Shadow Bolt"
if pUnit:GetHealthPct() < 70 then
pUnit:RemoveEvents();
pUnit:RegisterEvent("ShadowBoltCast",10000,0)
pUnit:RegisterEvent("Boss_Thunderclap",20000, 0)
end
end
function ShadowBoltCast(pUnit,Event)
pUnit:FullCastSpellOnTarget(29924,pUnit:GetClosestPlayer())
pUnit:SendChatMessage(11, 0, "Shadow Bolt on you...Haha Noob")
end
function Boss_OnCombat(pUnit, Event)
pUnit:RegisterEvent("Boss_Enrage",10000,1)
end
RegisterUnitEvent(130018,1,"Boss_OnCombat")
This is not the full code but a change to the first phase. (I want you to see what the difference is and figure out how you would proceed for the rest.
Basically the logic is this...
1) BOss enters combat, checks the even Boss enrage every 10seconds
2) Enter Boss_Enrage section at 95% health cast the spell 34670, send message and check the Boss_Shadow_Bolt_Section every 3 seconds
3) Enter Boss_Shadow_Bolt_Section at less then 70% health and check the ShadowBoltCast section every 10 seconds which will trigger your ShadowBolt Cast and message.
4) Check Boss_Thunderclap phase every 20 seconds.
Thats my script now : (very huge i know, im good )
Code:
function Boss_Enrage(Unit, Event)
if Unit:GetHealthPct() < 95 then
Unit:RemoveEvents();
Unit:FullCastSpell(34670)
Unit:SendChatMessage(11, 0, "I have entered the combat...Prepare to die")
Unit:RegisterEvent("Boss_Shadow_Bolt",3000, 0)
end
end
function Boss_Shadow_Bolt(Unit, Event)
print "Boss Shadow Bolt"
if Unit:GetHealthPct() < 80 then
Unit:RemoveEvents();
Unit:RegisterEvent("ShadowBoltCast",5000,0)
Unit:RegisterEvent("Boss_Thunderclap",5000, 0)
end
end
function ShadowBoltCast(Unit,Event)
Unit:FullCastSpellOnTarget(29924,Unit:GetClosestPlayer())
Unit:SendChatMessage(11, 0, "Shadow Bolt on you...Haha Noob")
end
function Boss_Thunderclap(Unit, Event)
if Unit:GetHealthPct() < 60 then
Unit:RemoveEvents()
Unit:RegisterEvent("ThunderclapCast",10000, 0)
Unit:RegisterEvent("Boss_Void_Bolt",7000, 0)
end
end
function ThunderclapCast(Unit, Event)
Unit:FullCastSpellOnTarget(36706,Unit:GetClosestPlayer())
Unit:SendChatMessage(11, 0, "Thunderclap...Feel that you newb")
end
function Boss_Void_Bolt(Unit, Event)
if Unit:GetHealthPct() < 50 then
Unit:RemoveEvents()
Unit:RegisterEvent("VoidBoltCast",10000, 0)
Unit:RegisterEvent("Boss_Shadow_Bolt_2",5000, 0)
end
function VoidBoltCast(Unit, Event)
Unit:FullCastSpellOnTarget(39329,Unit:GetClosestPlayer())
Unit:SendChatMessage(11, 0, "Now a good Void Bolt...Muhahaha are you feeling it?")
end
end
function Boss_Shadow_Bolt_2(Unit, Event)
if Unit:GetHealthPct() < 40 then
Unit:RemoveEvents()
Unit:RegisterEvent("ShadowBoltCast1",10000, 0)
Unit:RegisterEvent("Boss_Water_Bolt",3000, 0)
end
end
function ShadowBoltCast1(Unit, Event)
Unit:FullCastSpellOnTarget(29924,Unit:GetClosestPlayer())
Unit:SendChatMessage(11, 0, "Again Shadow Bolt on you...You are dead....")
end
function Boss_Water_Bolt(Unit, Event)
if Unit:GetHealthPct() < 30 then
Unit:RemoveEvents()
Unit:RegisterEvent("WaterBoltCast",10000, 0)
Unit:RegisterEvent("Boss_Stun",2000, 0)
end
end
function WaterBoltCast(Unit, Event)
Unit:FullCastSpellOnTarget(31012,Unit:GetClosestPlayer())
Unit:SendChatMessage(11, 0, "Hehe, drink some water, Newb !!!!!!!")
end
function Boss_Stun(Unit, Event)
if Unit:GetHealthPct() < 20 then
Unit:RemoveEvents()
Unit:RegisterEvent("StunCast",10000, 0)
Unit:RegisterEvent("Boss_Wave",1000, 0)
end
end
function StunCast(Unit, Event)
Unit:FullCastSpellOnTarget(20170,Unit:GetClosestPlayer())
Unit:SendChatMessage(11, 0, "Umm, what happened? Cannot move? Hahahahaa.....")
end
function Boss_Wave(Unit, Event)
if Unit:GetHealthPct() < 15 then
Unit:RemoveEvents()
Unit:RegisterEvent("WaveCast",10000, 0)
Unit:RegisterEvent("Boss_Hellfire",1000, 0)
end
end
function WaveCast(Unit, Event)
Unit:FullCastSpellOnTarget(36278,Unit:GetClosestPlayer())
Unit:SendChatMessage(11, 0, "Lets wave, you NOOB........")
end
function Boss_Hellfire(Unit, Event)
if Unit:GetHealthPct() < 10 then
Unit:RemoveEvents()
Unit:RegisterEvent("HellfireCast",10000, 0)
Unit:RegisterEvent("Boss_Holy_Ground",1000, 0)
end
end
function HellFireCast(Unit, Event)
Unit:FullCastSpellOnTarget(43465,Unit:GetClosestPlayer())
Unit:SendChatMessage(11, 0, "Cannot kill me noobs, BURN!!!!!!")
end
function Boss_Holy_Ground(Unit, Event)
if Unit:GetHealthPct() < 5 then
Unit:RemoveEvents()
Unit:RegisterEvent("HolyGroundCast",10000, 0)
end
end
function HolyGroundCast(Unit, Event)
Unit:FullCastSpellOnTarget(29512,Unit:GetClosestPlayer())
Unit:SendChatMessage(11, 0, "And for the finish take a Holy Spell.....")
end
function Boss_OnCombat(Unit, Event)
Unit:RegisterEvent("Boss_Enrage",7000,1)
end
RegisterUnitEvent(130018,1,"Boss_OnCombat")
Semms working for the Shadow bolt but for the others not...have i doed something wrong?
Use the "Search" Button, its not hard Everyone who helps and contributes