Here is a LUA Template I did up for some of the learners of LUA out there.
Enjoy. Edit the bold red areas with your own information... read below the code for more info on the edit spots.
---
Code:
--[[ Boss - NPCNAME
INFORMATION ABOUT NPC
~~End of Script Forenote
-- Hellgawd, September 5th, 2008. ]]
function NPCNAME_OnEnterCombat(pUnit,Event)
pUnit:RegisterEvent("NPCNAME_Spell2", 20000,1)
pUnit:RegisterEvent("NPCNAME_Spell3", 35000, 0)
pUnit:RegisterEvent("NPCNAME_Spell", 25000, 0)
end
function NPCNAME_Spell2(pUnit,Event)
if pUnit:GetHealthPct() > 20 then
pUnit:FullCastSpellOnTarget(ATTACKSPELLPOWERFUL,pUnit:GetClosestPlayer())
end
end
function NPCNAME_Spell3(pUnit,Event)
pUnit:FullCastSpellOnTarget(ATTACKSPELL,pUnit:GetClosestPlayer())
end
function NPCNAME_Spell(pUnit,Event)
pUnit:CastSpell(SELFBUFFSPELL)
pUnit:CastSpell(SELFHEALSPELL)
end
RegisterUnitEvent(NPCID, 1, "NPCNAME_OnEnterCombat")
STUFF TO EDIT:
Hellgawd, September 5th, 2008. - Edit this with your name, and the current date.
NPCNAME - edit this with the name of the npc, for example, Nayule.
NPCID - put the entry id of the npc in question here.
INFORMATION ABOUT NPC - put all information about the script / npc itslef here.
SELFBUFFSPELL - replace this with the spell id (GOTTEN FROM WOWHEAD) of a random good buff.
SELFHEALSPELL - replace this with the spell id (GOTTEN FROM WOWHEAD) of a self-healing spell.
ATTACKSPELL - replace this with the spell id ( GOTTEN FROM WOWHEAD) of an offensive spell.
ATTACKSPELLPOWERFUL - this spell is used not until later on the fight, so replace this with a really powerful spell id ( GOTTEN FROM WOWHEAD ) make sure it's an offensive spell!
Cheers,
Hellgawd.