Code:
function GodOfWar_OnCombat(Unit, Event)
Unit:SendChatMessage(12, 0, "i will crush everybody in my way! you are finished!")
Unit:RegisterEvent("GodOfWar_Stomp", 50000, 3)
Unit:RegisterEvent("GodOfWar_Earthquake", 120000, 5)
Unit:RegisterEvent("GodOfWar_Crushing Leap", 90000, 6)
Unit:RegisterEvent("GodOfWar_Summon Player", 60000, 2)
end
function GodOfWar_OnLeaveCombat(Unit, Event)
Unit:RemoveEvents()
Unit:SendChatMessage(12, 0, "Run like chickens! like i allways say, you are no match for my! and my power!")
end
function GodOfWar_OnDied(Unit, Event)
Unit:RemoveEvents()
Unit:SendChatMessage(12, 0, "NO! this cannot been ture? how did a failed!")
end
function GodOfWar_OnKilledTarget(Unit, Event)
Unit:SendChatMessage(12, 0, "HaHa! Rest in hell!")
end
function GodOfWar_Stomp(Unit, Event)
Unit:FullCastSpellOnTarget(58663, Unit:GetRandomPlayer(0))
end
function GodOfWar_CrushingLeap(Unit, Event)
Unit:FullCastSpellOnTarget(58963, Unit:GetRandomPlayer(7))
end
function GodOfWar_sunbeam(Unit, Event)
Unit:CastSpell(62872, Unit:GetMainTank())
end
Unit:RegisterEvent("GodOfWar_sunbeam", 50000, 3)
function GodOfWar_Earthquake(Unit, Event)
Unit:FullCastSpellOnTarget(19798, Unit:GetRandomPlayer(7))
end
function GodOfWar_Summon Player(Unit, Event)
Unit:FullCastSpellOnTarget(20477, Unit:GetRandomPlayer(6))
end
RegisterUnitEvent(NPCENTRYID, 3,"GodOfWar_OnKilledTarger")
RegisterUnitEvent(NPCENTRYID, 4,"GodOfWar_OnDied")
RegisterUnitEvent(NPCENTRYID, 2,"GodOfWar_OnLeaveCombat")
RegisterUnitEvent(NPCENTRYID, 1,"GodOfWar_OnCombat")
Replacing NPCENTRYID with your creatues entryid of course.
Code:
CREATURE_EVENT_ON_ENTER_COMBAT = 1,
CREATURE_EVENT_ON_LEAVE_COMBAT = 2,
CREATURE_EVENT_ON_TARGET_DIED = 3,
CREATURE_EVENT_ON_DIED = 4,
CREATURE_EVENT_ON_TARGET_PARRIED = 5,
CREATURE_EVENT_ON_TARGET_DODGED = 6,
CREATURE_EVENT_ON_TARGET_BLOCKED = 7,
CREATURE_EVENT_ON_TARGET_CRIT_HIT = 8,
CREATURE_EVENT_ON_PARRY = 9,
CREATURE_EVENT_ON_DODGED = 10,
CREATURE_EVENT_ON_BLOCKED = 11,
CREATURE_EVENT_ON_CRIT_HIT = 12,
CREATURE_EVENT_ON_HIT = 13,
CREATURE_EVENT_ON_ASSIST_TARGET_DIED = 14,
CREATURE_EVENT_ON_FEAR = 15,
CREATURE_EVENT_ON_FLEE = 16,
CREATURE_EVENT_ON_CALL_FOR_HELP = 17,
CREATURE_EVENT_ON_LOAD = 18,
CREATURE_EVENT_ON_REACH_WP = 19,
CREATURE_EVENT_ON_LOOT_TAKEN = 20,
CREATURE_EVENT_ON_AIUPDATE = 21,
CREATURE_EVENT_ON_EMOTE = 22,
Those are creature flags for RegisterUnitEvent(NPCID, FLAG, "FunctionName").