TrinityCore
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
PassiveAI.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2008-2016 TrinityCore <http://www.trinitycore.org/>
3  * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
4  *
5  * This program is free software; you can redistribute it and/or modify it
6  * under the terms of the GNU General Public License as published by the
7  * Free Software Foundation; either version 2 of the License, or (at your
8  * option) any later version.
9  *
10  * This program is distributed in the hope that it will be useful, but WITHOUT
11  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12  * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
13  * more details.
14  *
15  * You should have received a copy of the GNU General Public License along
16  * with this program. If not, see <http://www.gnu.org/licenses/>.
17  */
18 
19 #ifndef TRINITY_PASSIVEAI_H
20 #define TRINITY_PASSIVEAI_H
21 
22 #include "CreatureAI.h"
23 
25 {
26  public:
27  explicit PassiveAI(Creature* c);
28 
29  void MoveInLineOfSight(Unit*) override { }
30  void AttackStart(Unit*) override { }
31  void UpdateAI(uint32) override;
32 
33  static int Permissible(const Creature*) { return PERMIT_BASE_IDLE; }
34 };
35 
37 {
38  public:
39  explicit PossessedAI(Creature* c);
40 
41  void MoveInLineOfSight(Unit*) override { }
42  void AttackStart(Unit* target) override;
43  void UpdateAI(uint32) override;
44  void EnterEvadeMode(EvadeReason /*why*/) override { }
45 
46  void JustDied(Unit*) override;
47  void KilledUnit(Unit* victim) override;
48 
49  static int Permissible(const Creature*) { return PERMIT_BASE_IDLE; }
50 };
51 
53 {
54  public:
55  explicit NullCreatureAI(Creature* c);
56 
57  void MoveInLineOfSight(Unit*) override { }
58  void AttackStart(Unit*) override { }
59  void UpdateAI(uint32) override { }
60  void EnterEvadeMode(EvadeReason /*why*/) override { }
61  void OnCharmed(bool /*apply*/) override { }
62 
63  static int Permissible(const Creature*) { return PERMIT_BASE_IDLE; }
64 };
65 
67 {
68  public:
69  explicit CritterAI(Creature* c) : PassiveAI(c) { }
70 
71  void DamageTaken(Unit* done_by, uint32& /*damage*/) override;
72  void EnterEvadeMode(EvadeReason why) override;
73 };
74 
76 {
77  public:
78  explicit TriggerAI(Creature* c) : NullCreatureAI(c) { }
79  void IsSummonedBy(Unit* summoner) override;
80 };
81 
82 #endif
83 
CritterAI(Creature *c)
Definition: PassiveAI.h:69
virtual void EnterEvadeMode(EvadeReason why=EVADE_REASON_OTHER)
Definition: CreatureAI.cpp:168
virtual void IsSummonedBy(Unit *)
Definition: CreatureAI.h:124
EvadeReason
Definition: CreatureAI.h:85
void MoveInLineOfSight(Unit *) override
Definition: PassiveAI.h:29
virtual void UpdateAI(uint32 diff)=0
Definition: Creature.h:467
void MoveInLineOfSight(Unit *) override
Definition: PassiveAI.h:41
Definition: PassiveAI.h:36
virtual void DamageTaken(Unit *, uint32 &)
Definition: UnitAI.h:228
TriggerAI(Creature *c)
Definition: PassiveAI.h:78
void AttackStart(Unit *) override
Definition: PassiveAI.h:30
static int Permissible(const Creature *)
Definition: PassiveAI.h:63
Definition: CreatureAI.h:208
virtual void KilledUnit(Unit *)
Definition: CreatureAI.h:120
Definition: CreatureAI.h:68
virtual void JustDied(Unit *)
Definition: CreatureAI.h:117
uint32_t uint32
Definition: Define.h:150
Definition: PassiveAI.h:24
Definition: PassiveAI.h:75
void AttackStart(Unit *) override
Definition: PassiveAI.h:58
void UpdateAI(uint32) override
Definition: PassiveAI.h:59
void EnterEvadeMode(EvadeReason) override
Definition: PassiveAI.h:44
void EnterEvadeMode(EvadeReason) override
Definition: PassiveAI.h:60
static int Permissible(const Creature *)
Definition: PassiveAI.h:33
#define TC_GAME_API
Definition: Define.h:134
static int Permissible(const Creature *)
Definition: PassiveAI.h:49
Definition: PassiveAI.h:52
void MoveInLineOfSight(Unit *) override
Definition: PassiveAI.h:57
Definition: Unit.h:1305
virtual void AttackStart(Unit *)
Definition: UnitAI.cpp:29
void OnCharmed(bool) override
Definition: PassiveAI.h:61
Definition: PassiveAI.h:66