Small cleanup in boss Ouro script.
[scriptdev2-git.git] / scripts / eastern_kingdoms / dun_morogh.cpp
blobac2f7c64ba81cf6f26c87c87e3ca42df0f6b8c25
1 /* Copyright (C) 2006 - 2010 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
2 * This program is free software; you can redistribute it and/or modify
3 * it under the terms of the GNU General Public License as published by
4 * the Free Software Foundation; either version 2 of the License, or
5 * (at your option) any later version.
7 * This program is distributed in the hope that it will be useful,
8 * but WITHOUT ANY WARRANTY; without even the implied warranty of
9 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10 * GNU General Public License for more details.
12 * You should have received a copy of the GNU General Public License
13 * along with this program; if not, write to the Free Software
14 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 /* ScriptData
18 SDName: Dun_Morogh
19 SD%Complete: 50
20 SDComment: Quest support: 1783
21 SDCategory: Dun Morogh
22 EndScriptData */
24 /* ContentData
25 npc_narm_faulk
26 EndContentData */
28 #include "precompiled.h"
30 /*######
31 ## npc_narm_faulk
32 ######*/
34 #define SAY_HEAL -1000187
36 struct MANGOS_DLL_DECL npc_narm_faulkAI : public ScriptedAI
38 uint32 lifeTimer;
39 bool spellHit;
41 npc_narm_faulkAI(Creature* pCreature) : ScriptedAI(pCreature) {Reset();}
43 void Reset()
45 lifeTimer = 120000;
46 m_creature->SetUInt32Value(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_DEAD);
47 m_creature->SetStandState(UNIT_STAND_STATE_DEAD);
48 spellHit = false;
51 void MoveInLineOfSight(Unit *who) { }
53 void UpdateAI(const uint32 diff)
55 if (m_creature->IsStandState())
57 if (lifeTimer < diff)
58 m_creature->AI()->EnterEvadeMode();
59 else
60 lifeTimer -= diff;
64 void SpellHit(Unit *Hitter, const SpellEntry *Spellkind)
66 if (Spellkind->Id == 8593 && !spellHit)
68 DoCastSpellIfCan(m_creature,32343);
69 m_creature->SetStandState(UNIT_STAND_STATE_STAND);
70 m_creature->SetUInt32Value(UNIT_DYNAMIC_FLAGS, 0);
71 //m_creature->RemoveAllAuras();
72 DoScriptText(SAY_HEAL, m_creature, Hitter);
73 spellHit = true;
78 CreatureAI* GetAI_npc_narm_faulk(Creature* pCreature)
80 return new npc_narm_faulkAI(pCreature);
83 void AddSC_dun_morogh()
85 Script *newscript;
87 newscript = new Script;
88 newscript->Name = "npc_narm_faulk";
89 newscript->GetAI = &GetAI_npc_narm_faulk;
90 newscript->RegisterSelf();