PDA

View Full Version : The Immortal Boss Script - My First!


spasm
05-30-2009, 03:13 AM
My first boss script!

My Trainer: Hammer of Ac-Web :D He taught me everything that i could know as up from now... but he has been busy and not on MSN so i had to try this alone!

-Some is from his example that he gave to me... I am giving him credits too-

function boss_OnEnterCombat(pUnit, Event)
pUnit:SendChatMessage(12, 0, "This... This is so hard to believe, Mortals challenging and Immortal?! I will make short work of this! ")
pUnit:RegisterEvent("The Immortal_1",1000, 0)
end

function The_Immortal_2(pUnit, Event)
if pUnit:GetHealthPct() < 95 then
pUnit:RemoveEvents()
pUnit:SendChatMessage (12, 0, "Maybe a curse will frighten you off!")
pUnit:FullCastSpell(47864, pUnit:GetRandomPlayer(0))
pUnit:RegisterEvent("The Immortal_2",1000, 0)
end
end

function The_Immortal_3(pUnit, Event)
if pUnit:GetHealthPct() < 75 then
pUnit:RemoveEvents()
pUnit:SendChatMessage (12, 0, "What are you using to hit me! Plastic Swords and Arrows? Weaklings!")
pUnit:FullCastSpell(52717)
pUnit:RegisterEvent("The Immortal_3",1000, 0)
end
end

function The_Immortal_4(pUnit, Event)
if pUnit:GetHealthPct() < 45 then
pUnit:RemoveEvents()
pUnit:SendChatMessage (12, 0, "Just die you filthy Bastards!!!")
pUnit:CastSpellOnTarget(59521, pUnit:GetRandomPlayer(0))
pUnit:CastSpellOnTarget(19813, pUnit:GetRandomPlayer(0))
pUnit:RegisterEvent("The Immortal_4",1000, 0)
end
end

function The_Immortal_5(pUnit, Event)
if pUnit:GetHealthPct() < 25 then
pUnit:RemoveEvents()
pUnit:SendChatMessage (12, 0, "No!!! This isnt the end!!! I have one more trick up my sleeve!")
pUnit:FullCastSpell(52717)
pUnit:FullCastSpell(49273)
pUnit:FullCastSpell(49273)
pUnit:FullCastSpell(49273)
pUnit:FullCastSpell(49273)
pUnit:FullCastSpell(49273)
pUnit:FullCastSpell(49273)
pUnit:FullCastSpell(49273)
pUnit:RegisterEvent("The Immortal_5",1000, 0)
end
end

function The_Immortal_6(pUnit, Event)
if pUnit:GetHealthPct() <= 1 then
pUnit:RemoveEvents()
pUnit:SendChatMessage (12, 0, "You have won... You are now the Immortal...")
pUnit:CastSpellOnTarget(58912, pUnit:GetRandomPlayer(0))
pUnit:RegisterEvent("boss_Died",1000, 0)
end
end

function boss_OnKill(pUnit, Event)
pUnit:SendChatMessage(12, 0, "Death was the last thing he would conquer... Get your loot. - Made by Spasm of Ac-Web")
end

function boss_Death(pUnit, Event)
pUnit:RemoveEvents()
end

function boss_OnLeave(pUnit, Event)
pUnit:RemoveEvents()
end

RegisterUnitEvent(95439, 1, "boss_OnEnterCombat")
RegisterUnitEvent(95439, 2, "boss_OnLeaveCombat")
RegisterUnitEvent(95439, 3, "boss_OnKill")
RegisterUnitEvent(95439, 4, "boss_Died")

candyisgood
05-30-2009, 03:21 AM
"This... This is so hard to believe, Mortals challenging and Immortal?! I will make short work of this!"

Should Be:

"This... This is so hard to believe, Mortals challenging an Immortal?! I will make short work of this!"

Your function "The Immortal_1" is non-existent and invalid, you can't use spaces in LuA Events.

All your RegisterUnitEvents don't correspond to the auctual events in the script.

All of your events just loop themselves so nothing will Go past the first event, if it was valid.

Not for sure but I don't think that you can Fully cast ten spells instantly, you'd need to make seperate functions for each one.


Other than that pretty decent for a beginner, keep practicing. Practice makes perfect ^^

spasm
05-30-2009, 03:26 AM
Thanks i will work on it.

candyisgood
05-30-2009, 03:30 AM
No problem ^.^