TrinityCore
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
ZoneScript.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 ZONE_SCRIPT_H_
19 #define ZONE_SCRIPT_H_
20 
21 #include "Common.h"
22 #include "Creature.h"
23 
24 class GameObject;
25 
27 {
28  public:
29  ZoneScript() { }
30  virtual ~ZoneScript() { }
31 
32  virtual uint32 GetCreatureEntry(ObjectGuid::LowType /*guidLow*/, CreatureData const* data) { return data->id; }
33  virtual uint32 GetGameObjectEntry(ObjectGuid::LowType /*guidLow*/, uint32 entry) { return entry; }
34 
35  virtual void OnCreatureCreate(Creature* ) { }
36  virtual void OnCreatureRemove(Creature* ) { }
37 
38  virtual void OnGameObjectCreate(GameObject* ) { }
39  virtual void OnGameObjectRemove(GameObject* ) { }
40 
41  virtual void OnUnitDeath(Unit*) { }
42 
43  //All-purpose data storage 64 bit
44  virtual ObjectGuid GetGuidData(uint32 /*DataId*/) const { return ObjectGuid::Empty; }
45  virtual void SetGuidData(uint32 /*DataId*/, ObjectGuid /*Value*/) { }
46 
47  virtual uint64 GetData64(uint32 /*DataId*/) const { return 0; }
48  virtual void SetData64(uint32 /*DataId*/, uint64 /*Value*/) { }
49 
50  //All-purpose data storage 32 bit
51  virtual uint32 GetData(uint32 /*DataId*/) const { return 0; }
52  virtual void SetData(uint32 /*DataId*/, uint32 /*Value*/) { }
53 
54  virtual void ProcessEvent(WorldObject* /*obj*/, uint32 /*eventId*/) { }
55 };
56 
57 #endif
Definition: Creature.h:287
static ObjectGuid const Empty
Definition: ObjectGuid.h:196
uint32 id
Definition: Creature.h:293
virtual void OnGameObjectCreate(GameObject *)
Definition: ZoneScript.h:38
virtual uint32 GetData(uint32) const
Definition: ZoneScript.h:51
virtual void SetData64(uint32, uint64)
Definition: ZoneScript.h:48
virtual void SetGuidData(uint32, ObjectGuid)
Definition: ZoneScript.h:45
Definition: Object.h:423
Definition: Creature.h:467
uint64 LowType
Definition: ObjectGuid.h:199
virtual ObjectGuid GetGuidData(uint32) const
Definition: ZoneScript.h:44
virtual uint64 GetData64(uint32) const
Definition: ZoneScript.h:47
ZoneScript()
Definition: ZoneScript.h:29
virtual ~ZoneScript()
Definition: ZoneScript.h:30
Definition: ZoneScript.h:26
virtual void OnGameObjectRemove(GameObject *)
Definition: ZoneScript.h:39
virtual void SetData(uint32, uint32)
Definition: ZoneScript.h:52
virtual uint32 GetCreatureEntry(ObjectGuid::LowType, CreatureData const *data)
Definition: ZoneScript.h:32
uint32_t uint32
Definition: Define.h:150
uint64_t uint64
Definition: Define.h:149
virtual uint32 GetGameObjectEntry(ObjectGuid::LowType, uint32 entry)
Definition: ZoneScript.h:33
Definition: GameObject.h:880
virtual void OnCreatureRemove(Creature *)
Definition: ZoneScript.h:36
Definition: ObjectGuid.h:189
virtual void ProcessEvent(WorldObject *, uint32)
Definition: ZoneScript.h:54
Definition: Unit.h:1305
virtual void OnCreatureCreate(Creature *)
Definition: ZoneScript.h:35
virtual void OnUnitDeath(Unit *)
Definition: ZoneScript.h:41