Thread: LuA Code
View Single Post
Old 06-15-2009, 03:49 PM   #1 (permalink)
UnholyOne
Registered User
 
Join Date: Jun 2009
Posts: 3
OS: WinXP32bit


LuA Code

Code:
-----------------Necromancer-Type Boss------------------
-----------------WoWEmu LuA-----------------------------
----------Credits go to: UnholyOne Of AC-Web------------
--------------------------------------------------------
function NecromancerBoss_OnCombat (pUnit, Event)
local AgroSayChoice = math.random(1, 4)
	if AgroSayChoice==1 then
		pUnit:SendChatMessage(12, 0, "And so you have sealed your fates...")
		pUnit:RegisterEvent("NBoss_Phase1", 1000, 1)
end
	if AgroSayChoice==2 then
		pUnit:SendChatMessage(12, 0, "Why do you even try?")
		pUnit:RegisterEvent("NBoss_Phase1", 1000, 1)
end
	if AgroSayChoice==3 then
		pUnit:SendChatMessage(14, 0, "Fools!")
		pUnit:RegisterEvent("NBoss_Phase1", 1000, 1)
end
	if AgroSayChoice==4 then
		pUnit:SendChatMessage(14, 0, "You will perish!")
		pUnit:RegisterEvent("NBoss_Phase1", 1000, 1)
end
	else
		end
end




-------------------------------------------------------------
------------------------Phase 1:Summon Help------------------
-------------------------------------------------------------

function NBoss_Phase1 (pUnit, Event)
local SpawnAdd1Timing = math.random(5000, 10000)
local SpawnAdd2Timing = math.random(15000, 20000)
local SpawnAdd3Timing = math.random(25000, 30000)
local Phase1SayTiming = math.random(15000, 45000)
	pUnit:RemoveEvents ()
	pUnit:RegisterEvent("NBoss_SpawnAdd1", SpawnAdd1Timing, 0)
	pUnit:RegisterEvent("NBoss_SpawnAdd2", SpawnAdd2Timing, 0)
	pUnit:RegisterEvent("NBoss_SpawnAdd3", SpawnAdd3Timing, 0)
	pUnit:RegisterEvent("NBoss_Phase1Say", Phase1SayTiming, 0)
	pUnit:RegisterEvent("NBoss_Phase2", 1000, 0)
end


--------------------------------------------------------------
-------------------------Phase 1:Add Summons------------------
--------------------------------------------------------------

function NBoss_SpawnAdd1 (pUnit, Event)
local x = pUnit:GetX()
local y = pUnit:GetY()
local z = pUnit:GetZ()
local o = pUnit:GetO()
	if pUnit:GetHealthPct > 80 then
		pUnit:SpawnCreature(60001, x, y, z, o, 14, 15)
end
	else
	end
end


function NBoss_SpawnAdd2 (pUnit, Event)
local x = pUnit:GetX()
local y = pUnit:GetY()
local z = pUnit:GetZ()
local o = pUnit:GetO()
	if pUnit:GetHealthPct > 80 then
		pUnit:SpawnCreature(60002, x, y, z, o, 14, 0)
end
	else
	end
end


function NBoss_SpawnAdd3 (pUnit, Event)
local x = pUnit:GetX()
local y = pUnit:GetY()
local z = pUnit:GetZ()
local o = pUnit:GetO()
	if pUnit:GetHealthPct > 80 then
		pUnit:SpawnCreature(60003, x, y, z, o, 14, 0)
end
	else
	end
end

---------------------------------------------------------------
--------------------------Phase 1:Random Chat------------------
---------------------------------------------------------------

function NBoss_Phase1Say (pUnit, Event)
local Phase1SayChoice = math.random(1, 4)
	if Phase1SayChoice==1 then
		pUnit:SendChatMessage(14, 0, "Destroy Them my minions!")
end
	if Phase1SayChoice==2 then
		pUnit:SendChatMessage(12, 0, "How am I losing...?")
end
	if Phase1SayChoice==3 then
		pUnit:SendChatMessage(14, 0, "Kill Them ALL!")
end
	if Phase1SayChoice==4 then
		pUnit:SendChatMessage(14, 0, "Aid me Spirits of the Nether!")
end
	else
	end
end



-------------------------------------------------------------------
-----------------------Phase 1: End; Phase 2: Begin----------------
-------------------------------------------------------------------
function NBoss_Phase2 (pUnit, Event)
local Phase2Ready = pUnit:GetHealthPct ()
local FrostboltTiming = math.random(15000, 25000)
local ShadowboltTiming = math.random(8500, 13000)
local FireballTiming = math.random(25000, 35000)
local Phase2SayTiming = math.random(15000, 45000)
	if Phase2Ready <= 80 then
		pUnit:RemoveEvents ()
		pUnit:PlaySoundToSet(8554)
		pUnit:RegisterEvent("NBoss_Frostbolt", FrostboltTiming, 0)
		pUnit:RegisterEvent("NBoss_Shadowbolt", ShadowboltTiming, 0)
		pUnit:RegisterEvent("NBoss_Fireball", FireballTiming, 0)
		pUnit:RegisterEvent("NBoss_Phase2Say", Phase2SayTiming, 0)
		pUnit:RegisterEvent("NBoss_Phase3", 1000, 0)	
end	
	else
	end
end

--------------------------------------------------------------------
-------------------------Phase 2:Spells-----------------------------
--------------------------------------------------------------------
function NBoss_Frostbolt (pUnit, Event)
local plr = pUnit:GetMainTank()
	if (plr ~= nil) then
		pUnit:FullCastSpellOnTarget(FrostboltID, plr)
end
	else
	end
end


function NBoss_Shadowbolt (pUnit, Event)
local plr = pUnit:GetMainTank()
	if (plr ~= nil) then
		pUnit:FullCastSpellOnTarget(ShadowboltID, plr)
end
	else
	end
end


function NBoss_Fireball (pUnit, Event)
local plr = pUnit:GetMainTank()
	if (plr ~= nil) then
		pUnit:FullCastSpellOnTarget(FireballID, plr)
end
	else
	end
end


---------------------------------------------------------------------
--------------------------Phase 2:Random Chat------------------------
---------------------------------------------------------------------
function NBoss_Phase2Say (pUnit, Event)
local Phase2SayChoice = math.random(1, 4)
	if Phase2SayChoice==1 then
		pUnit:SendChatMessage(12, 0, "How will you fair against the elements?")
end
	if Phase2SayChoice==2 then
		pUnit:SendChatMessage(14, 0, "DIE!")
end
	if Phase2SayChoice==3 then
		pUnit:SendChatMessage(14, 0, "I will Freeze the blood in your veins!")
end
	if Phase2SayChoice==4 then
		pUnit:SendChatMessage(14, 0, "When all is lost, there is only shadow!")
end
	else
	end
end


---------------------------------------------------------------------
-------------------------Phase 2:End; Phase 3:Begin------------------
---------------------------------------------------------------------
function NBoss_Phase3 (pUnit, Event)
local Phase3Ready = pUnit:GetHealthPct ()
local RandomKillTiming = math.random(3000, 60000)
local Phase3SayTiming = math.random(15000, 45000)
	if Phase3ready <= 40 then
		pUnit:RemoveEvents ()
		pUnit:RegisterEvent("NBoss_SpawnAdd4", 1000, 1)
		pUnit:RegisterEvent("NBoss_SpawnAdd5", 1000, 1)
		pUnit:RegisterEvent("NBoss_RandomKill", RandomKillTiming, 0)
		pUnit:RegisterEvent("NBoss_Phase3Say", Phase3SayTiming, 0)
end
	else
	end
end


--------------------------------------------------------------------------
------------------------Phase 3:Summoning Adds----------------------------
--------------------------------------------------------------------------
function NBoss_SpawnAdd4 (pUnit, Event)
local x = pUnit:GetX()
local y = pUnit:GetY()
local z = pUnit:GetZ()
local o = pUnit:GetO()
		pUnit:SpawnCreature(60004, x, y, z, o, 14, 0)
end
	else
	end
end


function NBoss_SpawnAdd5 (pUnit, Event)
local x = pUnit:GetX()
local y = pUnit:GetY()
local z = pUnit:GetZ()
local o = pUnit:GetO()
		pUnit:SpawnCreature(60005, x, y, z, o, 14, 0)
end
	else
	end
end


--------------------------------------------------------------------------
--------------------------------Phase 3:InstaKill-------------------------
--------------------------------------------------------------------------
function NBoss_RandomKill (pUnit, Event)
local plr = pUnit:GetRandomPlayer (0)
	if (plr ~= nil) then
		pUnit:FullCastSpellOnTarget(7, plr)
end
	else
	end
end




--------------------------------------------------------------------------
------------------------------Phase 3:Random Chat-------------------------
--------------------------------------------------------------------------
function NBoss_Phase3Say (pUnit, Event)
local Phase3SayChoice = math.random(1, 4)
	if PhaseSayChoice==1 then
		pUnit:SendChatMessage(14, 0, "Embrace your own destruction!")
end
	if Phase3SayChoice==2 then
		pUnit:SendChatMessage(12, 0, "There is no escape")
end
	if Phase3SayChoice==3 then
		pUnit:SendChatMessage(14, 0, "None may survive the ancients!")
end
	if Phase3SayChoice==4 then
		pUnit:SendChatMessage(14, 0, "The End is near! Aid me, Spirits!")
end
	else
	end
end


---------------------------------------------------------------------------
---------------------------------------Misc.-------------------------------
---------------------------------------------------------------------------
function NBoss_OnLeaveCombat (pUnit, Event)
		pUnit:RemoveEvents ()
end



function NBoss_OnDeath (pUnit, Event)
	pUnit:RemoveEvents ()
	pUnit:SendChatMessage(12, 0, "")
end



function NBoss_OnKilledTarget (pUnit, Event)
local OKT = math.random(1, 2)
	if OKT==1 then
		pUnit:SendChatMessage(14, 0, "You will rot in the ground!")
end
	else
	end
end

RegisterUnitEvent(60000, 1, "NecromancerBoss_OnCombat")
RegisterUnitEvent(60000, 2, "NBoss_OnLeaveCombat")
RegisterUnitEvent(60000, 3, "NBoss_OnKilledTarget")
RegisterUnitEvent(60000, 4, "NBoss_OnDeath")



--------------------------------------------------------------------
--------------------------Add 1:Self-Destruct-----------------------
--------------------------------------------------------------------
function Add1_OnCombat (pUnit, Event)
pUnit:RegisterEvent("Add1_Say10", 1000, 1)
pUnit:RegisterEvent("Add1_Say9", 2000, 1)
pUnit:RegisterEvent("Add1_Say8", 3000, 1)
pUnit:RegisterEvent("Add1_Say7", 4000, 1)
pUnit:RegisterEvent("Add1_Say6", 5000, 1)
pUnit:RegisterEvent("Add1_Say5", 6000, 1)
pUnit:RegisterEvent("Add1_Say4", 7000, 1)
pUnit:RegisterEvent("Add1_Say3", 8000, 1)
pUnit:RegisterEvent("Add1_Say2", 9000, 1)
pUnit:RegisterEvent("Add1_Say1", 10000, 1)
end
end



function Add1_Say10 (pUnit, Event)
pUnit:SendChatMessage(12, 0, "10...")
end

function Add1_Say9 (pUnit, Event)
pUnit:SendChatMessage(12, 0, "9...")
end

function Add1_Say8 (pUnit, Event)
pUnit:SendChatMessage(12, 0, "8...")
end


function Add1_Say7 (pUnit, Event)
pUnit:SendChatMessage(12, 0, "7...")
end

function Add1_Say6 (pUnit, Event)
pUnit:SendChatMessage(12, 0, "6...")
end

function Add1_Say5 (pUnit, Event)
pUnit:SendChatMessage(12, 0, "5...")
end


function Add1_Say4 (pUnit, Event)
pUnit:SendChatMessage(12, 0, "4...")
end



function Add1_Say3 (pUnit, Event)
pUnit:SendChatMessage(12, 0, "3...")
end



function Add1_Say2 (pUnit, Event)
pUnit:SendChatMessage(12, 0, "2...")
end



function Add1_Say1 (pUnit, Event)
pUnit:SendChatMessage(14, 0, "1!")
pUnit:FullCastSpell(AoEDamage)
end

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

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

RegisterUnitEvent(60001, 1, "Add1_OnCombat")
RegisterUnitEvent(60001, 2, "Add1_OnLeaveCombat")
RegisterUnitEvent(60001, 4, "Add1_OnDeath")



------------------------------------------------------------
--------------------Add 2:Reduce Tank Healing---------------
------------------------------------------------------------
function Add2_OnCombat (pUnit, Event)
pUnit:RegisterEvent("Add2_MS", 4500, 0)
end


function Add2_MS (pUnit, Event)
local plr = pUnit:GetMainTank()
	if (plr ~= nil) then
		pUnit:FullCastSpellOnTarget(MortalStrikeID, plr)
end
	else
	end
end


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


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

RegisterUnitEvent(60002, 1, "Add2_OnCombat")
RegisterUnitEvent(60002, 2, "Add2_OnLeaveCombat")
RegisterUnitEvent(60002, 4, "Add2_OnDeath")


-------------------------------------------------------------
--------------------Add 3:Heals Main Boss--------------------
-------------------------------------------------------------
function Add3_OnCombat (pUnit, Event)
pUnit:RegisterEvent("Add3_Heal", 2000, 0)
end

function Add3_Heal (pUnit, Event)
local Healtarg = pUnit:GetRandomFriendly()
	if (Healtarg ~= nil) then
		pUnit:FullCastSpellOnTarget(GreaterHeal, Healtarg)
end
	else
	end
end

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


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

RegisterUnitEvent(60003, 1, "Add3_OnCombat")
RegisterUnitEvent(60003, 2, "Add3_OnLeaveCombat")
RegisterUnitEvent(60003, 4, "Add3_OnDeath")


------------------------------------------------------
--------------Adds 4 and 5 do ONLY Melee DPS----------
------------------------------------------------------



------------------------------------------------------
-----------------------Mob Stats----------------------
------------------------------------------------------

----------------------
-Necromancer         -
-10m HP              -
-9.5m Mana           -
-6k-8k Melee DMG     -
-1.5s Attack Speed   -
-40 to all Resistance-
----------------------



----------------------
-Add1                -
-10k HP              -
-5k Mana             -
-300-500 Melee DMG   -
-1.0s Attack Speed   -
-15 to all Resistance-
----------------------



----------------------
-Add2                -
-120k HP             -
-30k Mana            -
-1000-2000 Melee DMG -
-1.25 Attack Speed   -
-20 to all Resistance-
----------------------



----------------------
-Add3                -
-360k HP             -
-600k Mana           -
-200-400 Melee DMG   -
-3.0 Attack Speed    -
-30 to all Resistance-
----------------------



----------------------
-Add4                -
-2.5m HP             -
-1m Mana             -
-4000-6000 Melee DMG -
-1.4 Attack Speed    -
-Immune to Frost     -
----------------------



----------------------
-Add5                -
-2.5m HP             -
-1m Mana             -
-4000-6000 Melee DMG -
-1.4 Attack Speed    -
-Immune to Shadow    -
----------------------




----------------------------------------------------------
-----------------------Fight Tactics----------------------
----------------------------------------------------------

-During Phase 1 the boss will Constantly be summoning adds,-
-The adds MUST be killed as fast as possible.-
-The first add has the capability of wiping out half the raid if it isnt killed within ten seconds-
-The second add reduces all healing to the tank by 75% as long as it is alive-
-And the Third add will Heal the Boss.-


-When Phase 2 Comes around Just keep the main tank always at full HP and he must have above 40k hp or-
-he can get killed in one hit. DPS but don't pull agro.-


-In the last Phase the boss will summon 2 adds, both hitting for above 5k damage. These must be Tanked by 2 off-tanks-
-or They will tear the raid apart.-


---------------------------------------------------------
------------------Recommended Setup----------------------
---------------------------------------------------------


-5 Healers-
-One Main Tank-
-Two Off Tanks-
-12 DPS-
-5 Your Choice (Healers Recommended)-
---------------------------------------
Wrote it while I was in the hospital. It's designed for use with Sun++ LuA Engine and WoW ArcEmu Private server.

Feedback/Comments appreciated
UnholyOne is offline   Reply With Quote
Important Information
Join the #1 Tech Support Forum Today - It's Totally Free!

TechSupportForum.com is a leading support website for your computer needs. We offer free, friendly and personalized computer support. Why pay to have your computer fixed when you can do it for free.

Join TechSupportforum.com Today - Click Here