TrinityCore
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
firelands.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2008-2016 TrinityCore <http://www.trinitycore.org/>
3  *
4  * This program is free software; you can redistribute it and/or modify it
5  * under the terms of the GNU General Public License as published by the
6  * Free Software Foundation; either version 2 of the License, or (at your
7  * option) any later version.
8  *
9  * This program is distributed in the hope that it will be useful, but WITHOUT
10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11  * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
12  * more details.
13  *
14  * You should have received a copy of the GNU General Public License along
15  * with this program. If not, see <http://www.gnu.org/licenses/>.
16  */
17 
18 #ifndef FIRELANDS_H_
19 #define FIRELANDS_H_
20 
21 #include "Map.h"
22 #include "CreatureAI.h"
23 
24 #define DataHeader "FL"
25 #define FirelandsScriptName "instance_firelands"
26 
28 
30 {
38 };
39 
41 {
44  NPC_EGG_PILE = 53795,
48 };
49 
51 {
52  public:
54 
55  bool Execute(uint64 /*e_time*/, uint32 /*p_time*/) override
56  {
57  _owner->AI()->DoZoneInCombat(_owner, 200.0f);
58  return true;
59  }
60 
61  private:
63 };
64 
65 template<class AI>
67 {
68  if (InstanceMap* instance = creature->GetMap()->ToInstanceMap())
69  if (instance->GetInstanceScript())
70  if (instance->GetScriptId() == sObjectMgr->GetScriptId(FirelandsScriptName))
71  return new AI(creature);
72  return NULL;
73 }
74 
75 #endif // FIRELANDS_H_
Definition: firelands.h:43
Definition: firelands.h:31
Map * GetMap() const
Definition: Object.h:543
Definition: firelands.h:32
void DoZoneInCombat(Creature *creature=NULL, float maxRangeToNearestTarget=50.0f)
Definition: CreatureAI.cpp:47
arena_t NULL
Definition: jemalloc_internal.h:624
DataTypes
Definition: baradin_hold.h:30
Definition: firelands.h:50
CreatureAI * GetFirelandsAI(Creature *creature)
Definition: firelands.h:66
Definition: Creature.h:467
Creature * _owner
Definition: firelands.h:62
#define sObjectMgr
Definition: ObjectMgr.h:1567
Definition: firelands.h:37
Definition: firelands.h:34
#define FirelandsScriptName
Definition: firelands.h:25
Definition: Map.h:758
Definition: firelands.h:36
Definition: firelands.h:42
Definition: firelands.h:33
Definition: firelands.h:46
CreatureAI * AI() const
Definition: Creature.h:525
InstanceMap * ToInstanceMap()
Definition: Map.h:495
Definition: CreatureAI.h:68
uint32_t uint32
Definition: Define.h:150
uint64_t uint64
Definition: Define.h:149
Definition: firelands.h:44
Definition: EventProcessor.h:28
bool Execute(uint64, uint32) override
Definition: firelands.h:55
Definition: firelands.h:35
Definition: firelands.h:47
uint32 const EncounterCount
Definition: firelands.h:27
DelayedAttackStartEvent(Creature *owner)
Definition: firelands.h:53
CreatureIds
Definition: baradin_hold.h:37
Definition: firelands.h:45