Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class npc_fight_example : public CreatureScript
- {
- public:
- npc_fight_example() : CreatureScript("npc_fight_example") { }
- struct npc_fight_exampleAI : public ScriptedAI
- {
- npc_fight_example(Creature* creature) : ScriptedAI(creature) { }
- uint32 getTimeStart;
- uint32 getTimeDifference;
- void Reset()
- {
- getTimeStart = 0;
- getTimeEnd = 0;
- }
- void EnterCombat(Unit* /* target */)
- {
- getTimeStart = getMSTime();
- }
- void JustDied(Unit* /* killer */)
- {
- getTimeEnd = getMSTime();
- }
- }
- CreatureAI* GetAI(Creature* creature) const
- {
- return new npc_fight_exampleAI(creature);
- }
- };
- void AddSC_example_boss_timer()
- {
- new npc_fight_example;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement