TrinityCore
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
GameObject.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 TRINITYCORE_GAMEOBJECT_H
20 #define TRINITYCORE_GAMEOBJECT_H
21 
22 #include "Common.h"
23 #include "SharedDefines.h"
24 #include "Unit.h"
25 #include "Object.h"
26 #include "LootMgr.h"
27 #include "DatabaseEnv.h"
28 
29 class GameObjectAI;
30 class Group;
31 class Transport;
32 
33 // from `gameobject_template`
35 {
39  std::string name;
40  std::string IconName;
41  std::string castBarCaption;
42  std::string unk1;
45  float size;
47  union
48  {
49  // 0 GAMEOBJECT_TYPE_DOOR
50  struct
51  {
52  uint32 startOpen; // 0 startOpen, enum { false, true, }; Default: false
53  uint32 open; // 1 open, References: Lock_, NoValue = 0
54  uint32 autoClose; // 2 autoClose (ms), int, Min value: 0, Max value: 2147483647, Default value: 3000
55  uint32 noDamageImmune; // 3 noDamageImmune, enum { false, true, }; Default: false
56  uint32 openTextID; // 4 openTextID, References: BroadcastText, NoValue = 0
57  uint32 closeTextID; // 5 closeTextID, References: BroadcastText, NoValue = 0
58  uint32 IgnoredByPathing; // 6 Ignored By Pathing, enum { false, true, }; Default: false
59  uint32 conditionID1; // 7 conditionID1, References: PlayerCondition, NoValue = 0
60  uint32 EnablePortalsonopen; // 8 Enable Portals on open, enum { false, true, }; Default: false
61  uint32 GiganticAOI; // 9 Gigantic AOI, enum { false, true, }; Default: false
62  uint32 InfiniteAOI; // 10 Infinite AOI, enum { false, true, }; Default: false
63  } door;
64  // 1 GAMEOBJECT_TYPE_BUTTON
65  struct
66  {
67  uint32 startOpen; // 0 startOpen, enum { false, true, }; Default: false
68  uint32 open; // 1 open, References: Lock_, NoValue = 0
69  uint32 autoClose; // 2 autoClose (ms), int, Min value: 0, Max value: 2147483647, Default value: 3000
70  uint32 linkedTrap; // 3 linkedTrap, References: GameObjects, NoValue = 0
71  uint32 noDamageImmune; // 4 noDamageImmune, enum { false, true, }; Default: false
72  uint32 GiganticAOI; // 5 Gigantic AOI, enum { false, true, }; Default: false
73  uint32 openTextID; // 6 openTextID, References: BroadcastText, NoValue = 0
74  uint32 closeTextID; // 7 closeTextID, References: BroadcastText, NoValue = 0
75  uint32 requireLOS; // 8 require LOS, enum { false, true, }; Default: false
76  uint32 conditionID1; // 9 conditionID1, References: PlayerCondition, NoValue = 0
77  } button;
78  // 2 GAMEOBJECT_TYPE_QUESTGIVER
79  struct
80  {
81  uint32 open; // 0 open, References: Lock_, NoValue = 0
82  uint32 questGiver; // 1 questGiver, References: QuestGiver, NoValue = 0
83  uint32 pageMaterial; // 2 pageMaterial, References: PageTextMaterial, NoValue = 0
84  uint32 gossipID; // 3 gossipID, References: Gossip, NoValue = 0
85  uint32 customAnim; // 4 customAnim, int, Min value: 0, Max value: 4, Default value: 0
86  uint32 noDamageImmune; // 5 noDamageImmune, enum { false, true, }; Default: false
87  uint32 openTextID; // 6 openTextID, References: BroadcastText, NoValue = 0
88  uint32 requireLOS; // 7 require LOS, enum { false, true, }; Default: false
89  uint32 allowMounted; // 8 allowMounted, enum { false, true, }; Default: false
90  uint32 GiganticAOI; // 9 Gigantic AOI, enum { false, true, }; Default: false
91  uint32 conditionID1; // 10 conditionID1, References: PlayerCondition, NoValue = 0
92  uint32 NeverUsableWhileMounted; // 11 Never Usable While Mounted, enum { false, true, }; Default: false
93  } questgiver;
94  // 3 GAMEOBJECT_TYPE_CHEST
95  struct
96  {
97  uint32 open; // 0 open, References: Lock_, NoValue = 0
98  uint32 chestLoot; // 1 chestLoot, References: Treasure, NoValue = 0
99  uint32 chestRestockTime; // 2 chestRestockTime, int, Min value: 0, Max value: 1800000, Default value: 0
100  uint32 consumable; // 3 consumable, enum { false, true, }; Default: false
101  uint32 minRestock; // 4 minRestock, int, Min value: 0, Max value: 65535, Default value: 0
102  uint32 maxRestock; // 5 maxRestock, int, Min value: 0, Max value: 65535, Default value: 0
103  uint32 triggeredEvent; // 6 triggeredEvent, References: GameEvents, NoValue = 0
104  uint32 linkedTrap; // 7 linkedTrap, References: GameObjects, NoValue = 0
105  uint32 questID; // 8 questID, References: QuestV2, NoValue = 0
106  uint32 level; // 9 level, int, Min value: 0, Max value: 65535, Default value: 0
107  uint32 requireLOS; // 10 require LOS, enum { false, true, }; Default: false
108  uint32 leaveLoot; // 11 leaveLoot, enum { false, true, }; Default: false
109  uint32 notInCombat; // 12 notInCombat, enum { false, true, }; Default: false
110  uint32 logloot; // 13 log loot, enum { false, true, }; Default: false
111  uint32 openTextID; // 14 openTextID, References: BroadcastText, NoValue = 0
112  uint32 usegrouplootrules; // 15 use group loot rules, enum { false, true, }; Default: false
113  uint32 floatingTooltip; // 16 floatingTooltip, enum { false, true, }; Default: false
114  uint32 conditionID1; // 17 conditionID1, References: PlayerCondition, NoValue = 0
115  int32 xpLevel; // 18 xpLevel, int, Min value: -1, Max value: 100, Default value: 0
116  uint32 xpDifficulty; // 19 xpDifficulty, enum { No Exp, Trivial, Very Small, Small, Substandard, Standard, High, Epic, Dungeon, Placeholder2, }; Default: No Exp
117  uint32 lootLevel; // 20 lootLevel, int, Min value: 0, Max value: 100, Default value: 0
118  uint32 GroupXP; // 21 Group XP, enum { false, true, }; Default: false
119  uint32 DamageImmuneOK; // 22 Damage Immune OK, enum { false, true, }; Default: false
120  uint32 trivialSkillLow; // 23 trivialSkillLow, int, Min value: 0, Max value: 65535, Default value: 0
121  uint32 trivialSkillHigh; // 24 trivialSkillHigh, int, Min value: 0, Max value: 65535, Default value: 0
122  uint32 DungeonEncounter; // 25 Dungeon Encounter, References: DungeonEncounter, NoValue = 0
123  uint32 spell; // 26 spell, References: Spell, NoValue = 0
124  uint32 GiganticAOI; // 27 Gigantic AOI, enum { false, true, }; Default: false
125  uint32 LargeAOI; // 28 Large AOI, enum { false, true, }; Default: false
126  uint32 SpawnVignette; // 29 Spawn Vignette, References: vignette, NoValue = 0
127  uint32 chestPersonalLoot; // 30 chest Personal Loot, References: Treasure, NoValue = 0
128  uint32 turnpersonallootsecurityoff; // 31 turn personal loot security off, enum { false, true, }; Default: false
129  uint32 ChestProperties; // 32 Chest Properties, References: ChestProperties, NoValue = 0
130  } chest;
131  // 4 GAMEOBJECT_TYPE_BINDER
132  struct
133  {
134  } binder;
135  // 5 GAMEOBJECT_TYPE_GENERIC
136  struct
137  {
138  uint32 floatingTooltip; // 0 floatingTooltip, enum { false, true, }; Default: false
139  uint32 highlight; // 1 highlight, enum { false, true, }; Default: true
140  uint32 serverOnly; // 2 serverOnly, enum { false, true, }; Default: false
141  uint32 GiganticAOI; // 3 Gigantic AOI, enum { false, true, }; Default: false
142  uint32 floatOnWater; // 4 floatOnWater, enum { false, true, }; Default: false
143  uint32 questID; // 5 questID, References: QuestV2, NoValue = 0
144  uint32 conditionID1; // 6 conditionID1, References: PlayerCondition, NoValue = 0
145  uint32 LargeAOI; // 7 Large AOI, enum { false, true, }; Default: false
146  uint32 UseGarrisonOwnerGuildColors; // 8 Use Garrison Owner Guild Colors, enum { false, true, }; Default: false
147  } generic;
148  // 6 GAMEOBJECT_TYPE_TRAP
149  struct
150  {
151  uint32 open; // 0 open, References: Lock_, NoValue = 0
152  uint32 level; // 1 level, int, Min value: 0, Max value: 65535, Default value: 0
153  uint32 radius; // 2 radius, int, Min value: 0, Max value: 100, Default value: 0
154  uint32 spell; // 3 spell, References: Spell, NoValue = 0
155  uint32 charges; // 4 charges, int, Min value: 0, Max value: 65535, Default value: 1
156  uint32 cooldown; // 5 cooldown, int, Min value: 0, Max value: 65535, Default value: 0
157  uint32 autoClose; // 6 autoClose (ms), int, Min value: 0, Max value: 2147483647, Default value: 0
158  uint32 startDelay; // 7 startDelay, int, Min value: 0, Max value: 65535, Default value: 0
159  uint32 serverOnly; // 8 serverOnly, enum { false, true, }; Default: false
160  uint32 stealthed; // 9 stealthed, enum { false, true, }; Default: false
161  uint32 GiganticAOI; // 10 Gigantic AOI, enum { false, true, }; Default: false
162  uint32 stealthAffected; // 11 stealthAffected, enum { false, true, }; Default: false
163  uint32 openTextID; // 12 openTextID, References: BroadcastText, NoValue = 0
164  uint32 closeTextID; // 13 closeTextID, References: BroadcastText, NoValue = 0
165  uint32 IgnoreTotems; // 14 Ignore Totems, enum { false, true, }; Default: false
166  uint32 conditionID1; // 15 conditionID1, References: PlayerCondition, NoValue = 0
167  uint32 playerCast; // 16 playerCast, enum { false, true, }; Default: false
168  uint32 SummonerTriggered; // 17 Summoner Triggered, enum { false, true, }; Default: false
169  } trap;
170  // 7 GAMEOBJECT_TYPE_CHAIR
171  struct
172  {
173  uint32 chairslots; // 0 chairslots, int, Min value: 1, Max value: 5, Default value: 1
174  uint32 chairheight; // 1 chairheight, int, Min value: 0, Max value: 2, Default value: 1
175  uint32 onlyCreatorUse; // 2 onlyCreatorUse, enum { false, true, }; Default: false
176  uint32 triggeredEvent; // 3 triggeredEvent, References: GameEvents, NoValue = 0
177  uint32 conditionID1; // 4 conditionID1, References: PlayerCondition, NoValue = 0
178  } chair;
179  // 8 GAMEOBJECT_TYPE_SPELL_FOCUS
180  struct
181  {
182  uint32 spellFocusType; // 0 spellFocusType, References: SpellFocusObject, NoValue = 0
183  uint32 radius; // 1 radius, int, Min value: 0, Max value: 50, Default value: 10
184  uint32 linkedTrap; // 2 linkedTrap, References: GameObjects, NoValue = 0
185  uint32 serverOnly; // 3 serverOnly, enum { false, true, }; Default: false
186  uint32 questID; // 4 questID, References: QuestV2, NoValue = 0
187  uint32 GiganticAOI; // 5 Gigantic AOI, enum { false, true, }; Default: false
188  uint32 floatingTooltip; // 6 floatingTooltip, enum { false, true, }; Default: false
189  uint32 floatOnWater; // 7 floatOnWater, enum { false, true, }; Default: false
190  uint32 conditionID1; // 8 conditionID1, References: PlayerCondition, NoValue = 0
191  } spellFocus;
192  // 9 GAMEOBJECT_TYPE_TEXT
193  struct
194  {
195  uint32 pageID; // 0 pageID, References: PageText, NoValue = 0
196  uint32 language; // 1 language, References: Languages, NoValue = 0
197  uint32 pageMaterial; // 2 pageMaterial, References: PageTextMaterial, NoValue = 0
198  uint32 allowMounted; // 3 allowMounted, enum { false, true, }; Default: false
199  uint32 conditionID1; // 4 conditionID1, References: PlayerCondition, NoValue = 0
200  uint32 NeverUsableWhileMounted; // 5 Never Usable While Mounted, enum { false, true, }; Default: false
201  } text;
202  // 10 GAMEOBJECT_TYPE_GOOBER
203  struct
204  {
205  uint32 open; // 0 open, References: Lock_, NoValue = 0
206  uint32 questID; // 1 questID, References: QuestV2, NoValue = 0
207  uint32 eventID; // 2 eventID, References: GameEvents, NoValue = 0
208  uint32 autoClose; // 3 autoClose (ms), int, Min value: 0, Max value: 2147483647, Default value: 3000
209  uint32 customAnim; // 4 customAnim, int, Min value: 0, Max value: 4, Default value: 0
210  uint32 consumable; // 5 consumable, enum { false, true, }; Default: false
211  uint32 cooldown; // 6 cooldown, int, Min value: 0, Max value: 65535, Default value: 0
212  uint32 pageID; // 7 pageID, References: PageText, NoValue = 0
213  uint32 language; // 8 language, References: Languages, NoValue = 0
214  uint32 pageMaterial; // 9 pageMaterial, References: PageTextMaterial, NoValue = 0
215  uint32 spell; // 10 spell, References: Spell, NoValue = 0
216  uint32 noDamageImmune; // 11 noDamageImmune, enum { false, true, }; Default: false
217  uint32 linkedTrap; // 12 linkedTrap, References: GameObjects, NoValue = 0
218  uint32 GiganticAOI; // 13 Gigantic AOI, enum { false, true, }; Default: false
219  uint32 openTextID; // 14 openTextID, References: BroadcastText, NoValue = 0
220  uint32 closeTextID; // 15 closeTextID, References: BroadcastText, NoValue = 0
221  uint32 requireLOS; // 16 require LOS, enum { false, true, }; Default: false
222  uint32 allowMounted; // 17 allowMounted, enum { false, true, }; Default: false
223  uint32 floatingTooltip; // 18 floatingTooltip, enum { false, true, }; Default: false
224  uint32 gossipID; // 19 gossipID, References: Gossip, NoValue = 0
225  uint32 WorldStateSetsState; // 20 WorldStateSetsState, enum { false, true, }; Default: false
226  uint32 floatOnWater; // 21 floatOnWater, enum { false, true, }; Default: false
227  uint32 conditionID1; // 22 conditionID1, References: PlayerCondition, NoValue = 0
228  uint32 playerCast; // 23 playerCast, enum { false, true, }; Default: false
229  uint32 SpawnVignette; // 24 Spawn Vignette, References: vignette, NoValue = 0
230  uint32 startOpen; // 25 startOpen, enum { false, true, }; Default: false
231  uint32 DontPlayOpenAnim; // 26 Dont Play Open Anim, enum { false, true, }; Default: false
232  uint32 IgnoreBoundingBox; // 27 Ignore Bounding Box, enum { false, true, }; Default: false
233  uint32 NeverUsableWhileMounted; // 28 Never Usable While Mounted, enum { false, true, }; Default: false
234  uint32 SortFarZ; // 29 Sort Far Z, enum { false, true, }; Default: false
235  uint32 SyncAnimationtoObjectLifetime; // 30 Sync Animation to Object Lifetime (global track only), enum { false, true, }; Default: false
236  } goober;
237  // 11 GAMEOBJECT_TYPE_TRANSPORT
238  struct
239  {
240  uint32 Timeto2ndfloor; // 0 Time to 2nd floor (ms), int, Min value: 0, Max value: 2147483647, Default value: 0
241  uint32 startOpen; // 1 startOpen, enum { false, true, }; Default: false
242  uint32 autoClose; // 2 autoClose (ms), int, Min value: 0, Max value: 2147483647, Default value: 0
243  uint32 Reached1stfloor; // 3 Reached 1st floor, References: GameEvents, NoValue = 0
244  uint32 Reached2ndfloor; // 4 Reached 2nd floor, References: GameEvents, NoValue = 0
245  int32 mapID; // 5 mapID, References: Map, NoValue = -1
246  uint32 Timeto3rdfloor; // 6 Time to 3rd floor (ms), int, Min value: 0, Max value: 2147483647, Default value: 0
247  uint32 Reached3rdfloor; // 7 Reached 3rd floor, References: GameEvents, NoValue = 0
248  uint32 Timeto4thfloor; // 8 Time to 4th floor (ms), int, Min value: 0, Max value: 2147483647, Default value: 0
249  uint32 Reached4thfloor; // 9 Reached 4th floor, References: GameEvents, NoValue = 0
250  uint32 Timeto5thfloor; // 10 Time to 5th floor (ms), int, Min value: 0, Max value: 2147483647, Default value: 0
251  uint32 Reached5thfloor; // 11 Reached 5th floor, References: GameEvents, NoValue = 0
252  uint32 Timeto6thfloor; // 12 Time to 6th floor (ms), int, Min value: 0, Max value: 2147483647, Default value: 0
253  uint32 Reached6thfloor; // 13 Reached 6th floor, References: GameEvents, NoValue = 0
254  uint32 Timeto7thfloor; // 14 Time to 7th floor (ms), int, Min value: 0, Max value: 2147483647, Default value: 0
255  uint32 Reached7thfloor; // 15 Reached 7th floor, References: GameEvents, NoValue = 0
256  uint32 Timeto8thfloor; // 16 Time to 8th floor (ms), int, Min value: 0, Max value: 2147483647, Default value: 0
257  uint32 Reached8thfloor; // 17 Reached 8th floor, References: GameEvents, NoValue = 0
258  uint32 Timeto9thfloor; // 18 Time to 9th floor (ms), int, Min value: 0, Max value: 2147483647, Default value: 0
259  uint32 Reached9thfloor; // 19 Reached 9th floor, References: GameEvents, NoValue = 0
260  uint32 Timeto10thfloor; // 20 Time to 10th floor (ms), int, Min value: 0, Max value: 2147483647, Default value: 0
261  uint32 Reached10thfloor; // 21 Reached 10th floor, References: GameEvents, NoValue = 0
262  uint32 onlychargeheightcheck; // 22 only charge height check. (yards), int, Min value: 0, Max value: 65535, Default value: 0
263  uint32 onlychargetimecheck; // 23 only charge time check, int, Min value: 0, Max value: 65535, Default value: 0
264  } transport;
265  // 12 GAMEOBJECT_TYPE_AREADAMAGE
266  struct
267  {
268  uint32 open; // 0 open, References: Lock_, NoValue = 0
269  uint32 radius; // 1 radius, int, Min value: 0, Max value: 50, Default value: 3
270  uint32 damageMin; // 2 damageMin, int, Min value: 0, Max value: 65535, Default value: 0
271  uint32 damageMax; // 3 damageMax, int, Min value: 0, Max value: 65535, Default value: 0
272  uint32 damageSchool; // 4 damageSchool, int, Min value: 0, Max value: 65535, Default value: 0
273  uint32 autoClose; // 5 autoClose (ms), int, Min value: 0, Max value: 2147483647, Default value: 0
274  uint32 openTextID; // 6 openTextID, References: BroadcastText, NoValue = 0
275  uint32 closeTextID; // 7 closeTextID, References: BroadcastText, NoValue = 0
276  } areaDamage;
277  // 13 GAMEOBJECT_TYPE_CAMERA
278  struct
279  {
280  uint32 open; // 0 open, References: Lock_, NoValue = 0
281  uint32 camera; // 1 camera, References: CinematicSequences, NoValue = 0
282  uint32 eventID; // 2 eventID, References: GameEvents, NoValue = 0
283  uint32 openTextID; // 3 openTextID, References: BroadcastText, NoValue = 0
284  uint32 conditionID1; // 4 conditionID1, References: PlayerCondition, NoValue = 0
285  } camera;
286  // 14 GAMEOBJECT_TYPE_MAP_OBJECT
287  struct
288  {
289  } mapobject;
290  // 15 GAMEOBJECT_TYPE_MAP_OBJ_TRANSPORT
291  struct
292  {
293  uint32 taxiPathID; // 0 taxiPathID, References: TaxiPath, NoValue = 0
294  uint32 moveSpeed; // 1 moveSpeed, int, Min value: 1, Max value: 60, Default value: 1
295  uint32 accelRate; // 2 accelRate, int, Min value: 1, Max value: 20, Default value: 1
296  uint32 startEventID; // 3 startEventID, References: GameEvents, NoValue = 0
297  uint32 stopEventID; // 4 stopEventID, References: GameEvents, NoValue = 0
298  uint32 transportPhysics; // 5 transportPhysics, References: TransportPhysics, NoValue = 0
299  int32 mapID; // 6 mapID, References: Map, NoValue = -1
300  uint32 worldState1; // 7 worldState1, References: WorldState, NoValue = 0
301  uint32 allowstopping; // 8 allow stopping, enum { false, true, }; Default: false
302  uint32 InitStopped; // 9 Init Stopped, enum { false, true, }; Default: false
303  uint32 TrueInfiniteAOI; // 10 True Infinite AOI (programmer only!), enum { false, true, }; Default: false
304  } moTransport;
305  // 16 GAMEOBJECT_TYPE_DUEL_ARBITER
306  struct
307  {
308  } duelFlag;
309  // 17 GAMEOBJECT_TYPE_FISHINGNODE
310  struct
311  {
312  } fishingNode;
313  // 18 GAMEOBJECT_TYPE_RITUAL
314  struct
315  {
316  uint32 casters; // 0 casters, int, Min value: 1, Max value: 10, Default value: 1
317  uint32 spell; // 1 spell, References: Spell, NoValue = 0
318  uint32 animSpell; // 2 animSpell, References: Spell, NoValue = 0
319  uint32 ritualPersistent; // 3 ritualPersistent, enum { false, true, }; Default: false
320  uint32 casterTargetSpell; // 4 casterTargetSpell, References: Spell, NoValue = 0
321  uint32 casterTargetSpellTargets; // 5 casterTargetSpellTargets, int, Min value: 1, Max value: 10, Default value: 1
322  uint32 castersGrouped; // 6 castersGrouped, enum { false, true, }; Default: true
323  uint32 ritualNoTargetCheck; // 7 ritualNoTargetCheck, enum { false, true, }; Default: true
324  uint32 conditionID1; // 8 conditionID1, References: PlayerCondition, NoValue = 0
325  } ritual;
326  // 19 GAMEOBJECT_TYPE_MAILBOX
327  struct
328  {
329  uint32 conditionID1; // 0 conditionID1, References: PlayerCondition, NoValue = 0
330  } mailbox;
331  // 20 GAMEOBJECT_TYPE_DO_NOT_USE
332  struct
333  {
334  } DONOTUSE;
335  // 21 GAMEOBJECT_TYPE_GUARDPOST
336  struct
337  {
338  uint32 creatureID; // 0 creatureID, References: Creature, NoValue = 0
339  uint32 charges; // 1 charges, int, Min value: 0, Max value: 65535, Default value: 1
340  } guardPost;
341  // 22 GAMEOBJECT_TYPE_SPELLCASTER
342  struct
343  {
344  uint32 spell; // 0 spell, References: Spell, NoValue = 0
345  int32 charges; // 1 charges, int, Min value: -1, Max value: 65535, Default value: 1
346  uint32 partyOnly; // 2 partyOnly, enum { false, true, }; Default: false
347  uint32 allowMounted; // 3 allowMounted, enum { false, true, }; Default: false
348  uint32 GiganticAOI; // 4 Gigantic AOI, enum { false, true, }; Default: false
349  uint32 conditionID1; // 5 conditionID1, References: PlayerCondition, NoValue = 0
350  uint32 playerCast; // 6 playerCast, enum { false, true, }; Default: false
351  uint32 NeverUsableWhileMounted; // 7 Never Usable While Mounted, enum { false, true, }; Default: false
352  } spellCaster;
353  // 23 GAMEOBJECT_TYPE_MEETINGSTONE
354  struct
355  {
356  uint32 minLevel; // 0 minLevel, int, Min value: 0, Max value: 65535, Default value: 1
357  uint32 maxLevel; // 1 maxLevel, int, Min value: 1, Max value: 65535, Default value: 60
358  uint32 areaID; // 2 areaID, References: AreaTable, NoValue = 0
359  } meetingStone;
360  // 24 GAMEOBJECT_TYPE_FLAGSTAND
361  struct
362  {
363  uint32 open; // 0 open, References: Lock_, NoValue = 0
364  uint32 pickupSpell; // 1 pickupSpell, References: Spell, NoValue = 0
365  uint32 radius; // 2 radius, int, Min value: 0, Max value: 50, Default value: 0
366  uint32 returnAura; // 3 returnAura, References: Spell, NoValue = 0
367  uint32 returnSpell; // 4 returnSpell, References: Spell, NoValue = 0
368  uint32 noDamageImmune; // 5 noDamageImmune, enum { false, true, }; Default: false
369  uint32 openTextID; // 6 openTextID, References: BroadcastText, NoValue = 0
370  uint32 requireLOS; // 7 require LOS, enum { false, true, }; Default: true
371  uint32 conditionID1; // 8 conditionID1, References: PlayerCondition, NoValue = 0
372  uint32 playerCast; // 9 playerCast, enum { false, true, }; Default: false
373  uint32 GiganticAOI; // 10 Gigantic AOI, enum { false, true, }; Default: false
374  uint32 InfiniteAOI; // 11 Infinite AOI, enum { false, true, }; Default: false
375  uint32 cooldown; // 12 cooldown, int, Min value: 0, Max value: 2147483647, Default value: 3000
376  } flagStand;
377  // 25 GAMEOBJECT_TYPE_FISHINGHOLE
378  struct
379  {
380  uint32 radius; // 0 radius, int, Min value: 0, Max value: 50, Default value: 0
381  uint32 chestLoot; // 1 chestLoot, References: Treasure, NoValue = 0
382  uint32 minRestock; // 2 minRestock, int, Min value: 0, Max value: 65535, Default value: 0
383  uint32 maxRestock; // 3 maxRestock, int, Min value: 0, Max value: 65535, Default value: 0
384  uint32 open; // 4 open, References: Lock_, NoValue = 0
385  } fishingHole;
386  // 26 GAMEOBJECT_TYPE_FLAGDROP
387  struct
388  {
389  uint32 open; // 0 open, References: Lock_, NoValue = 0
390  uint32 eventID; // 1 eventID, References: GameEvents, NoValue = 0
391  uint32 pickupSpell; // 2 pickupSpell, References: Spell, NoValue = 0
392  uint32 noDamageImmune; // 3 noDamageImmune, enum { false, true, }; Default: false
393  uint32 openTextID; // 4 openTextID, References: BroadcastText, NoValue = 0
394  uint32 playerCast; // 5 playerCast, enum { false, true, }; Default: false
395  uint32 ExpireDuration; // 6 Expire Duration, int, Min value: 0, Max value: 60000, Default value: 10000
396  uint32 GiganticAOI; // 7 Gigantic AOI, enum { false, true, }; Default: false
397  uint32 InfiniteAOI; // 8 Infinite AOI, enum { false, true, }; Default: false
398  uint32 cooldown; // 9 cooldown, int, Min value: 0, Max value: 2147483647, Default value: 3000
399  } flagDrop;
400  // 27 GAMEOBJECT_TYPE_MINI_GAME
401  struct
402  {
403  } miniGame;
404  // 28 GAMEOBJECT_TYPE_DO_NOT_USE_2
405  struct
406  {
407  } DONOTUSE2;
408  // 29 GAMEOBJECT_TYPE_CONTROL_ZONE
409  struct
410  {
411  uint32 radius; // 0 radius, int, Min value: 0, Max value: 100, Default value: 10
412  uint32 spell; // 1 spell, References: Spell, NoValue = 0
413  uint32 worldState1; // 2 worldState1, References: WorldState, NoValue = 0
414  uint32 worldstate2; // 3 worldstate2, References: WorldState, NoValue = 0
415  uint32 CaptureEventHorde; // 4 Capture Event (Horde), References: GameEvents, NoValue = 0
416  uint32 CaptureEventAlliance; // 5 Capture Event (Alliance), References: GameEvents, NoValue = 0
417  uint32 ContestedEventHorde; // 6 Contested Event (Horde), References: GameEvents, NoValue = 0
418  uint32 ContestedEventAlliance; // 7 Contested Event (Alliance), References: GameEvents, NoValue = 0
419  uint32 ProgressEventHorde; // 8 Progress Event (Horde), References: GameEvents, NoValue = 0
420  uint32 ProgressEventAlliance; // 9 Progress Event (Alliance), References: GameEvents, NoValue = 0
421  uint32 NeutralEventHorde; // 10 Neutral Event (Horde), References: GameEvents, NoValue = 0
422  uint32 NeutralEventAlliance; // 11 Neutral Event (Alliance), References: GameEvents, NoValue = 0
423  uint32 neutralPercent; // 12 neutralPercent, int, Min value: 0, Max value: 100, Default value: 0
424  uint32 worldstate3; // 13 worldstate3, References: WorldState, NoValue = 0
425  uint32 minSuperiority; // 14 minSuperiority, int, Min value: 1, Max value: 65535, Default value: 1
426  uint32 maxSuperiority; // 15 maxSuperiority, int, Min value: 1, Max value: 65535, Default value: 1
427  uint32 minTime; // 16 minTime, int, Min value: 1, Max value: 65535, Default value: 1
428  uint32 maxTime; // 17 maxTime, int, Min value: 1, Max value: 65535, Default value: 1
429  uint32 GiganticAOI; // 18 Gigantic AOI, enum { false, true, }; Default: false
430  uint32 highlight; // 19 highlight, enum { false, true, }; Default: true
431  uint32 startingValue; // 20 startingValue, int, Min value: 0, Max value: 100, Default value: 50
432  uint32 unidirectional; // 21 unidirectional, enum { false, true, }; Default: false
433  uint32 killbonustime; // 22 kill bonus time %, int, Min value: 0, Max value: 100, Default value: 0
434  uint32 speedWorldState1; // 23 speedWorldState1, References: WorldState, NoValue = 0
435  uint32 speedWorldState2; // 24 speedWorldState2, References: WorldState, NoValue = 0
436  uint32 UncontestedTime; // 25 Uncontested Time, int, Min value: 0, Max value: 65535, Default value: 0
437  uint32 FrequentHeartbeat; // 26 Frequent Heartbeat, enum { false, true, }; Default: false
438  } controlZone;
439  // 30 GAMEOBJECT_TYPE_AURA_GENERATOR
440  struct
441  {
442  uint32 startOpen; // 0 startOpen, enum { false, true, }; Default: true
443  uint32 radius; // 1 radius, int, Min value: 0, Max value: 100, Default value: 10
444  uint32 auraID1; // 2 auraID1, References: Spell, NoValue = 0
445  uint32 conditionID1; // 3 conditionID1, References: PlayerCondition, NoValue = 0
446  uint32 auraID2; // 4 auraID2, References: Spell, NoValue = 0
447  uint32 conditionID2; // 5 conditionID2, References: PlayerCondition, NoValue = 0
448  uint32 serverOnly; // 6 serverOnly, enum { false, true, }; Default: false
449  } auraGenerator;
450  // 31 GAMEOBJECT_TYPE_DUNGEON_DIFFICULTY
451  struct
452  {
453  uint32 InstanceType; // 0 Instance Type, enum { Not Instanced, Party Dungeon, Raid Dungeon, PVP Battlefield, Arena Battlefield, Scenario, }; Default: Party Dungeon
454  uint32 DifficultyNormal; // 1 Difficulty Normal, References: animationdata, NoValue = 0
455  uint32 DifficultyHeroic; // 2 Difficulty Heroic, References: animationdata, NoValue = 0
456  uint32 DifficultyEpic; // 3 Difficulty Epic, References: animationdata, NoValue = 0
457  uint32 DifficultyLegendary; // 4 Difficulty Legendary, References: animationdata, NoValue = 0
458  uint32 HeroicAttachment; // 5 Heroic Attachment, References: gameobjectdisplayinfo, NoValue = 0
459  uint32 ChallengeAttachment; // 6 Challenge Attachment, References: gameobjectdisplayinfo, NoValue = 0
460  uint32 DifficultyAnimations; // 7 Difficulty Animations, References: GameObjectDiffAnim, NoValue = 0
461  uint32 LargeAOI; // 8 Large AOI, enum { false, true, }; Default: false
462  uint32 GiganticAOI; // 9 Gigantic AOI, enum { false, true, }; Default: false
463  uint32 Legacy; // 10 Legacy, enum { false, true, }; Default: false
465  // 32 GAMEOBJECT_TYPE_BARBER_CHAIR
466  struct
467  {
468  uint32 chairheight; // 0 chairheight, int, Min value: 0, Max value: 2, Default value: 1
469  int32 HeightOffset; // 1 Height Offset (inches), int, Min value: -100, Max value: 100, Default value: 0
470  uint32 SitAnimKit; // 2 Sit Anim Kit, References: AnimKit, NoValue = 0
471  } barberChair;
472  // 33 GAMEOBJECT_TYPE_DESTRUCTIBLE_BUILDING
473  struct
474  {
475  int32 Unused; // 0 Unused, int, Min value: -2147483648, Max value: 2147483647, Default value: 0
476  uint32 CreditProxyCreature; // 1 Credit Proxy Creature, References: Creature, NoValue = 0
477  uint32 HealthRec; // 2 Health Rec, References: DestructibleHitpoint, NoValue = 0
478  uint32 IntactEvent; // 3 Intact Event, References: GameEvents, NoValue = 0
479  uint32 PVPEnabling; // 4 PVP Enabling, enum { false, true, }; Default: false
480  uint32 InteriorVisible; // 5 Interior Visible, enum { false, true, }; Default: false
481  uint32 InteriorLight; // 6 Interior Light, enum { false, true, }; Default: false
482  int32 Unused1; // 7 Unused, int, Min value: -2147483648, Max value: 2147483647, Default value: 0
483  int32 Unused2; // 8 Unused, int, Min value: -2147483648, Max value: 2147483647, Default value: 0
484  uint32 DamagedEvent; // 9 Damaged Event, References: GameEvents, NoValue = 0
485  int32 Unused3; // 10 Unused, int, Min value: -2147483648, Max value: 2147483647, Default value: 0
486  int32 Unused4; // 11 Unused, int, Min value: -2147483648, Max value: 2147483647, Default value: 0
487  int32 Unused5; // 12 Unused, int, Min value: -2147483648, Max value: 2147483647, Default value: 0
488  int32 Unused6; // 13 Unused, int, Min value: -2147483648, Max value: 2147483647, Default value: 0
489  uint32 DestroyedEvent; // 14 Destroyed Event, References: GameEvents, NoValue = 0
490  int32 Unused7; // 15 Unused, int, Min value: -2147483648, Max value: 2147483647, Default value: 0
491  uint32 RebuildingTime; // 16 Rebuilding: Time (secs), int, Min value: 0, Max value: 65535, Default value: 0
492  int32 Unused8; // 17 Unused, int, Min value: -2147483648, Max value: 2147483647, Default value: 0
493  uint32 DestructibleModelRec; // 18 Destructible Model Rec, References: DestructibleModelData, NoValue = 0
494  uint32 RebuildingEvent; // 19 Rebuilding: Event, References: GameEvents, NoValue = 0
495  int32 Unused9; // 20 Unused, int, Min value: -2147483648, Max value: 2147483647, Default value: 0
496  int32 Unused10; // 21 Unused, int, Min value: -2147483648, Max value: 2147483647, Default value: 0
497  uint32 DamageEvent; // 22 Damage Event, References: GameEvents, NoValue = 0
499  // 34 GAMEOBJECT_TYPE_GUILD_BANK
500  struct
501  {
502  uint32 conditionID1; // 0 conditionID1, References: PlayerCondition, NoValue = 0
503  } guildbank;
504  // 35 GAMEOBJECT_TYPE_TRAPDOOR
505  struct
506  {
507  int32 Unused; // 0 Unused, int, Min value: -2147483648, Max value: 2147483647, Default value: 0
508  uint32 startOpen; // 1 startOpen, enum { false, true, }; Default: false
509  uint32 autoClose; // 2 autoClose (ms), int, Min value: 0, Max value: 2147483647, Default value: 0
510  uint32 BlocksPathsDown; // 3 Blocks Paths Down, enum { false, true, }; Default: false
511  } trapdoor;
512  // 36 GAMEOBJECT_TYPE_NEW_FLAG
513  struct
514  {
515  uint32 open; // 0 open, References: Lock_, NoValue = 0
516  uint32 pickupSpell; // 1 pickupSpell, References: Spell, NoValue = 0
517  uint32 openTextID; // 2 openTextID, References: BroadcastText, NoValue = 0
518  uint32 requireLOS; // 3 require LOS, enum { false, true, }; Default: true
519  uint32 conditionID1; // 4 conditionID1, References: PlayerCondition, NoValue = 0
520  uint32 GiganticAOI; // 5 Gigantic AOI, enum { false, true, }; Default: false
521  uint32 InfiniteAOI; // 6 Infinite AOI, enum { false, true, }; Default: false
522  uint32 ExpireDuration; // 7 Expire Duration, int, Min value: 0, Max value: 3600000, Default value: 10000
523  uint32 RespawnTime; // 8 Respawn Time, int, Min value: 0, Max value: 3600000, Default value: 20000
524  uint32 FlagDrop; // 9 Flag Drop, References: GameObjects, NoValue = 0
525  int32 ExclusiveCategory; // 10 Exclusive Category (BGs Only), int, Min value: -2147483648, Max value: 2147483647, Default value: 0
526  uint32 worldState1; // 11 worldState1, References: WorldState, NoValue = 0
527  uint32 ReturnonDefenderInteract; // 12 Return on Defender Interact, enum { false, true, }; Default: false
528  } newflag;
529  // 37 GAMEOBJECT_TYPE_NEW_FLAG_DROP
530  struct
531  {
532  uint32 open; // 0 open, References: Lock_, NoValue = 0
533  } newflagdrop;
534  // 38 GAMEOBJECT_TYPE_GARRISON_BUILDING
535  struct
536  {
537  int32 mapID; // 0 mapID, References: Map, NoValue = -1
539  // 39 GAMEOBJECT_TYPE_GARRISON_PLOT
540  struct
541  {
542  uint32 PlotInstance; // 0 Plot Instance, References: GarrPlotInstance, NoValue = 0
543  int32 mapID; // 1 mapID, References: Map, NoValue = -1
544  } garrisonPlot;
545  // 40 GAMEOBJECT_TYPE_CLIENT_CREATURE
546  struct
547  {
548  uint32 CreatureDisplayInfo; // 0 Creature Display Info, References: CreatureDisplayInfo, NoValue = 0
549  uint32 AnimKit; // 1 Anim Kit, References: AnimKit, NoValue = 0
550  uint32 creatureID; // 2 creatureID, References: Creature, NoValue = 0
551  } clientCreature;
552  // 41 GAMEOBJECT_TYPE_CLIENT_ITEM
553  struct
554  {
555  uint32 Item; // 0 Item, References: Item, NoValue = 0
556  } clientItem;
557  // 42 GAMEOBJECT_TYPE_CAPTURE_POINT
558  struct
559  {
560  uint32 CaptureTime; // 0 Capture Time (ms), int, Min value: 0, Max value: 2147483647, Default value: 60000
561  uint32 GiganticAOI; // 1 Gigantic AOI, enum { false, true, }; Default: false
562  uint32 highlight; // 2 highlight, enum { false, true, }; Default: true
563  uint32 open; // 3 open, References: Lock_, NoValue = 0
564  uint32 AssaultBroadcastHorde; // 4 Assault Broadcast (Horde), References: BroadcastText, NoValue = 0
565  uint32 CaptureBroadcastHorde; // 5 Capture Broadcast (Horde), References: BroadcastText, NoValue = 0
566  uint32 DefendedBroadcastHorde; // 6 Defended Broadcast (Horde), References: BroadcastText, NoValue = 0
567  uint32 AssaultBroadcastAlliance; // 7 Assault Broadcast (Alliance), References: BroadcastText, NoValue = 0
568  uint32 CaptureBroadcastAlliance; // 8 Capture Broadcast (Alliance), References: BroadcastText, NoValue = 0
569  uint32 DefendedBroadcastAlliance; // 9 Defended Broadcast (Alliance), References: BroadcastText, NoValue = 0
570  uint32 worldState1; // 10 worldState1, References: WorldState, NoValue = 0
571  uint32 ContestedEventHorde; // 11 Contested Event (Horde), References: GameEvents, NoValue = 0
572  uint32 CaptureEventHorde; // 12 Capture Event (Horde), References: GameEvents, NoValue = 0
573  uint32 DefendedEventHorde; // 13 Defended Event (Horde), References: GameEvents, NoValue = 0
574  uint32 ContestedEventAlliance; // 14 Contested Event (Alliance), References: GameEvents, NoValue = 0
575  uint32 CaptureEventAlliance; // 15 Capture Event (Alliance), References: GameEvents, NoValue = 0
576  uint32 DefendedEventAlliance; // 16 Defended Event (Alliance), References: GameEvents, NoValue = 0
577  uint32 SpellVisual1; // 17 Spell Visual 1, References: SpellVisual, NoValue = 0
578  uint32 SpellVisual2; // 18 Spell Visual 2, References: SpellVisual, NoValue = 0
579  uint32 SpellVisual3; // 19 Spell Visual 3, References: SpellVisual, NoValue = 0
580  uint32 SpellVisual4; // 20 Spell Visual 4, References: SpellVisual, NoValue = 0
581  uint32 SpellVisual5; // 21 Spell Visual 5, References: SpellVisual, NoValue = 0
582  } capturePoint;
583  // 43 GAMEOBJECT_TYPE_PHASEABLE_MO
584  struct
585  {
586  int32 mapID; // 0 mapID, References: Map, NoValue = -1
587  int32 namedset; // 1 named set (Area Names), int, Min value: -2147483648, Max value: 2147483647, Default value: 0
588  uint32 Primarydoodadset; // 2 Primary doodad set, int, Min value: -2147483648, Max value: 2147483647, Default value: 0
589  uint32 Secondarydoodadset; // 3 Secondary doodad set, int, Min value: -2147483648, Max value: 2147483647, Default value: 0
590  } phaseableMO;
591  // 44 GAMEOBJECT_TYPE_GARRISON_MONUMENT
592  struct
593  {
594  uint32 TrophyTypeID; // 0 Trophy Type ID, References: TrophyType, NoValue = 0
595  uint32 TrophyInstanceID; // 1 Trophy Instance ID, References: TrophyInstance, NoValue = 0
597  // 45 GAMEOBJECT_TYPE_GARRISON_SHIPMENT
598  struct
599  {
600  uint32 ShipmentContainer; // 0 Shipment Container, References: CharShipmentContainer, NoValue = 0
601  uint32 GiganticAOI; // 1 Gigantic AOI, enum { false, true, }; Default: false
602  uint32 LargeAOI; // 2 Large AOI, enum { false, true, }; Default: false
604  // 46 GAMEOBJECT_TYPE_GARRISON_MONUMENT_PLAQUE
605  struct
606  {
607  uint32 TrophyInstanceID; // 0 Trophy Instance ID, References: TrophyInstance, NoValue = 0
609  // 47 GAMEOBJECT_TYPE_DO_NOT_USE_3
610  struct
611  {
612  } DONOTUSE3;
613  // 48 GAMEOBJECT_TYPE_UI_LINK
614  struct
615  {
616  uint32 UILinkType; // 0 UI Link Type, Type id: 10
617  } UILink;
618  struct
619  {
621  } raw;
622  };
623 
624  std::string AIName;
626 
627  // helpers
628  bool IsDespawnAtAction() const
629  {
630  switch (type)
631  {
632  case GAMEOBJECT_TYPE_CHEST: return chest.consumable != 0;
633  case GAMEOBJECT_TYPE_GOOBER: return goober.consumable != 0;
634  default: return false;
635  }
636  }
637 
638  bool IsUsableMounted() const
639  {
640  switch (type)
641  {
642  case GAMEOBJECT_TYPE_QUESTGIVER: return questgiver.allowMounted != 0;
643  case GAMEOBJECT_TYPE_TEXT: return text.allowMounted != 0;
644  case GAMEOBJECT_TYPE_GOOBER: return goober.allowMounted != 0;
645  case GAMEOBJECT_TYPE_SPELLCASTER: return spellCaster.allowMounted != 0;
646  default: return false;
647  }
648  }
649 
651  {
652  switch (type)
653  {
654  case GAMEOBJECT_TYPE_DOOR: return door.open;
655  case GAMEOBJECT_TYPE_BUTTON: return button.open;
656  case GAMEOBJECT_TYPE_QUESTGIVER: return questgiver.open;
657  case GAMEOBJECT_TYPE_CHEST: return chest.open;
658  case GAMEOBJECT_TYPE_TRAP: return trap.open;
659  case GAMEOBJECT_TYPE_GOOBER: return goober.open;
660  case GAMEOBJECT_TYPE_AREADAMAGE: return areaDamage.open;
661  case GAMEOBJECT_TYPE_CAMERA: return camera.open;
662  case GAMEOBJECT_TYPE_FLAGSTAND: return flagStand.open;
663  case GAMEOBJECT_TYPE_FISHINGHOLE: return fishingHole.open;
664  case GAMEOBJECT_TYPE_FLAGDROP: return flagDrop.open;
665  case GAMEOBJECT_TYPE_NEW_FLAG: return newflag.open;
666  case GAMEOBJECT_TYPE_NEW_FLAG_DROP: return newflagdrop.open;
668  default: return 0;
669  }
670  }
671 
672  bool GetDespawnPossibility() const // despawn at targeting of cast?
673  {
674  switch (type)
675  {
676  case GAMEOBJECT_TYPE_DOOR: return door.noDamageImmune != 0;
677  case GAMEOBJECT_TYPE_BUTTON: return button.noDamageImmune != 0;
678  case GAMEOBJECT_TYPE_QUESTGIVER: return questgiver.noDamageImmune != 0;
679  case GAMEOBJECT_TYPE_GOOBER: return goober.noDamageImmune != 0;
680  case GAMEOBJECT_TYPE_FLAGSTAND: return flagStand.noDamageImmune != 0;
681  case GAMEOBJECT_TYPE_FLAGDROP: return flagDrop.noDamageImmune != 0;
682  default: return true;
683  }
684  }
685 
686  uint32 GetCharges() const // despawn at uses amount
687  {
688  switch (type)
689  {
690  //case GAMEOBJECT_TYPE_TRAP: return trap.charges;
691  case GAMEOBJECT_TYPE_GUARDPOST: return guardPost.charges;
692  case GAMEOBJECT_TYPE_SPELLCASTER: return spellCaster.charges;
693  default: return 0;
694  }
695  }
696 
698  {
699  switch (type)
700  {
701  case GAMEOBJECT_TYPE_BUTTON: return button.linkedTrap;
702  case GAMEOBJECT_TYPE_CHEST: return chest.linkedTrap;
703  case GAMEOBJECT_TYPE_SPELL_FOCUS: return spellFocus.linkedTrap;
704  case GAMEOBJECT_TYPE_GOOBER: return goober.linkedTrap;
705  default: return 0;
706  }
707  }
708 
710  {
711  uint32 autoCloseTime = 0;
712  switch (type)
713  {
714  case GAMEOBJECT_TYPE_DOOR: autoCloseTime = door.autoClose; break;
715  case GAMEOBJECT_TYPE_BUTTON: autoCloseTime = button.autoClose; break;
716  case GAMEOBJECT_TYPE_TRAP: autoCloseTime = trap.autoClose; break;
717  case GAMEOBJECT_TYPE_GOOBER: autoCloseTime = goober.autoClose; break;
718  case GAMEOBJECT_TYPE_TRANSPORT: autoCloseTime = transport.autoClose; break;
719  case GAMEOBJECT_TYPE_AREADAMAGE: autoCloseTime = areaDamage.autoClose; break;
720  case GAMEOBJECT_TYPE_TRAPDOOR: autoCloseTime = trapdoor.autoClose; break;
721  default: break;
722  }
723  return autoCloseTime / IN_MILLISECONDS; // prior to 3.0.3, conversion was / 0x10000;
724  }
725 
727  {
728  switch (type)
729  {
730  case GAMEOBJECT_TYPE_CHEST: return chest.chestLoot;
731  case GAMEOBJECT_TYPE_FISHINGHOLE: return fishingHole.chestLoot;
732  default: return 0;
733  }
734  }
735 
737  {
738  switch (type)
739  {
740  case GAMEOBJECT_TYPE_QUESTGIVER: return questgiver.gossipID;
741  case GAMEOBJECT_TYPE_GOOBER: return goober.gossipID;
742  default: return 0;
743  }
744  }
745 
747  {
748  switch (type)
749  {
750  case GAMEOBJECT_TYPE_GOOBER: return goober.eventID;
751  case GAMEOBJECT_TYPE_CHEST: return chest.triggeredEvent;
752  case GAMEOBJECT_TYPE_CAMERA: return camera.eventID;
753  default: return 0;
754  }
755  }
756 
757  uint32 GetCooldown() const // Cooldown preventing goober and traps to cast spell
758  {
759  switch (type)
760  {
761  case GAMEOBJECT_TYPE_TRAP: return trap.cooldown;
762  case GAMEOBJECT_TYPE_GOOBER: return goober.cooldown;
763  default: return 0;
764  }
765  }
766 };
767 
768 // Benchmarked: Faster than std::map (insert/find)
769 typedef std::unordered_map<uint32, GameObjectTemplate> GameObjectTemplateContainer;
770 
771 class OPvPCapturePoint;
772 struct TransportAnimation;
773 
775 {
776  //11 GAMEOBJECT_TYPE_TRANSPORT
777  struct
778  {
782  std::vector<uint32>* StopFrames;
784  } Transport;
785  //25 GAMEOBJECT_TYPE_FISHINGHOLE
786  struct
787  {
789  } FishingHole;
790  //29 GAMEOBJECT_TYPE_CONTROL_ZONE
791  struct
792  {
794  } ControlZone;
795  //33 GAMEOBJECT_TYPE_DESTRUCTIBLE_BUILDING
796  struct
797  {
800  } Building;
801 };
802 
804 {
808 };
809 
810 // `gameobject_addon` table
812 {
815 };
816 
817 typedef std::unordered_map<ObjectGuid::LowType, GameObjectAddon> GameObjectAddonContainer;
818 
819 // client side GO show states
821 {
822  GO_STATE_ACTIVE = 0, // show in world as used and not reset (closed door open)
823  GO_STATE_READY = 1, // show in world as ready (closed door close)
824  GO_STATE_ACTIVE_ALTERNATIVE = 2, // show in world as used in alt way and not reset (closed door open by cannon fire)
827 };
828 
829 #define MAX_GO_STATE 3
830 #define MAX_GO_STATE_TRANSPORT_STOP_FRAMES 9
831 
832 // from `gameobject`
834 {
835  explicit GameObjectData() : id(0), mapid(0), phaseMask(0), posX(0.0f), posY(0.0f), posZ(0.0f), orientation(0.0f),
836  rotation0(0.0f), rotation1(0.0f), rotation2(0.0f), rotation3(0.0f), spawntimesecs(0),
837  animprogress(0), go_state(GO_STATE_ACTIVE), spawnMask(0), artKit(0), phaseid(0), phaseGroup(0), dbData(true) { }
838  uint32 id; // entry in gamobject_template
841  float posX;
842  float posY;
843  float posZ;
844  float orientation;
845  float rotation0;
846  float rotation1;
847  float rotation2;
848  float rotation3;
856  bool dbData;
857 };
858 
859 typedef std::vector<uint32> GameObjectQuestItemList;
860 typedef std::unordered_map<uint32, GameObjectQuestItemList> GameObjectQuestItemMap;
861 
862 // For containers: [GO_NOT_READY]->GO_READY (close)->GO_ACTIVATED (open) ->GO_JUST_DEACTIVATED->GO_READY -> ...
863 // For bobber: GO_NOT_READY ->GO_READY (close)->GO_ACTIVATED (open) ->GO_JUST_DEACTIVATED-><deleted>
864 // For door(closed):[GO_NOT_READY]->GO_READY (close)->GO_ACTIVATED (open) ->GO_JUST_DEACTIVATED->GO_READY(close) -> ...
865 // For door(open): [GO_NOT_READY]->GO_READY (open) ->GO_ACTIVATED (close)->GO_JUST_DEACTIVATED->GO_READY(open) -> ...
867 {
869  GO_READY, // can be ready but despawned, and then not possible activate until spawn
872 };
873 
874 class Unit;
875 class GameObjectModel;
876 
877 // 5 sec for bobber catch
878 #define FISHING_BOBBER_READY_TIME 5
879 
881 {
882  public:
883  explicit GameObject();
884  ~GameObject();
885 
886  void BuildValuesUpdate(uint8 updatetype, ByteBuffer* data, Player* target) const override;
887 
888  void AddToWorld() override;
889  void RemoveFromWorld() override;
890  void CleanupsBeforeDelete(bool finalCleanup = true) override;
891 
892  bool Create(ObjectGuid::LowType guidlow, uint32 name_id, Map* map, uint32 phaseMask, float x, float y, float z, float ang, float rotation0, float rotation1, float rotation2, float rotation3, uint32 animprogress, GOState go_state, uint32 artKit = 0);
893  void Update(uint32 p_time) override;
894  GameObjectTemplate const* GetGOInfo() const { return m_goInfo; }
895  GameObjectData const* GetGOData() const { return m_goData; }
896  GameObjectValue const* GetGOValue() const { return &m_goValue; }
897 
898  bool IsTransport() const;
899  bool IsDynTransport() const;
900  bool IsDestructibleBuilding() const;
901 
902  ObjectGuid::LowType GetSpawnId() const { return m_spawnId; }
903 
904  void UpdateRotationFields(float rotation2 = 0.0f, float rotation3 = 0.0f);
905 
906  // overwrite WorldObject function for proper name localization
907  std::string const& GetNameForLocaleIdx(LocaleConstant locale_idx) const override;
908 
909  void SaveToDB();
910  void SaveToDB(uint32 mapid, uint32 spawnMask, uint32 phaseMask);
911  bool LoadFromDB(ObjectGuid::LowType spawnId, Map* map) { return LoadGameObjectFromDB(spawnId, map, false); }
912  bool LoadGameObjectFromDB(ObjectGuid::LowType spawnId, Map* map, bool addToMap = true);
913  void DeleteFromDB();
914 
916  {
917  // Owner already found and different than expected owner - remove object from old owner
918  if (!owner.IsEmpty() && !GetOwnerGUID().IsEmpty() && GetOwnerGUID() != owner)
919  {
920  ABORT();
921  }
922  m_spawnedByDefault = false; // all object with owner is despawned after delay
923  SetGuidValue(GAMEOBJECT_FIELD_CREATED_BY, owner);
924  }
925  ObjectGuid GetOwnerGUID() const { return GetGuidValue(GAMEOBJECT_FIELD_CREATED_BY); }
926  Unit* GetOwner() const;
927 
929  {
930  m_spawnedByDefault = false; // all summoned object is despawned after delay
931  m_spellId = id;
932  }
933  uint32 GetSpellId() const { return m_spellId;}
934 
935  time_t GetRespawnTime() const { return m_respawnTime; }
936  time_t GetRespawnTimeEx() const
937  {
938  time_t now = time(NULL);
939  if (m_respawnTime > now)
940  return m_respawnTime;
941  else
942  return now;
943  }
944 
945  void SetRespawnTime(int32 respawn)
946  {
947  m_respawnTime = respawn > 0 ? time(NULL) + respawn : 0;
948  m_respawnDelayTime = respawn > 0 ? respawn : 0;
949  }
950  void Respawn();
951  bool isSpawned() const
952  {
953  return m_respawnDelayTime == 0 ||
954  (m_respawnTime > 0 && !m_spawnedByDefault) ||
955  (m_respawnTime == 0 && m_spawnedByDefault);
956  }
957  bool isSpawnedByDefault() const { return m_spawnedByDefault; }
958  void SetSpawnedByDefault(bool b) { m_spawnedByDefault = b; }
959  uint32 GetRespawnDelay() const { return m_respawnDelayTime; }
960  void Refresh();
961  void Delete();
962  void getFishLoot(Loot* loot, Player* loot_owner);
963  void getFishLootJunk(Loot* loot, Player* loot_owner);
964  GameobjectTypes GetGoType() const { return GameobjectTypes(GetByteValue(GAMEOBJECT_BYTES_1, 1)); }
965  void SetGoType(GameobjectTypes type) { SetByteValue(GAMEOBJECT_BYTES_1, 1, type); }
966  GOState GetGoState() const { return GOState(GetByteValue(GAMEOBJECT_BYTES_1, 0)); }
967  void SetGoState(GOState state);
968  virtual uint32 GetTransportPeriod() const;
969  void SetTransportState(GOState state, uint32 stopFrame = 0);
970  uint8 GetGoArtKit() const { return GetByteValue(GAMEOBJECT_BYTES_1, 2); }
971  void SetGoArtKit(uint8 artkit);
972  uint8 GetGoAnimProgress() const { return GetByteValue(GAMEOBJECT_BYTES_1, 3); }
973  void SetGoAnimProgress(uint8 animprogress) { SetByteValue(GAMEOBJECT_BYTES_1, 3, animprogress); }
974  static void SetGoArtKit(uint8 artkit, GameObject* go, ObjectGuid::LowType lowguid = UI64LIT(0));
975 
976  bool SetInPhase(uint32 id, bool update, bool apply) override;
977  void EnableCollision(bool enable);
978 
979  void Use(Unit* user);
980 
981  LootState getLootState() const { return m_lootState; }
982  // Note: unit is only used when s = GO_ACTIVATED
983  void SetLootState(LootState s, Unit* unit = NULL);
984 
985  uint16 GetLootMode() const { return m_LootMode; }
986  bool HasLootMode(uint16 lootMode) const { return (m_LootMode & lootMode) != 0; }
987  void SetLootMode(uint16 lootMode) { m_LootMode = lootMode; }
988  void AddLootMode(uint16 lootMode) { m_LootMode |= lootMode; }
989  void RemoveLootMode(uint16 lootMode) { m_LootMode &= ~lootMode; }
990  void ResetLootMode() { m_LootMode = LOOT_MODE_DEFAULT; }
991 
992  void AddToSkillupList(ObjectGuid const& PlayerGuidLow) { m_SkillupList.insert(PlayerGuidLow); }
993  bool IsInSkillupList(ObjectGuid const& playerGuid) const
994  {
995  return m_SkillupList.count(playerGuid) > 0;
996  }
997  void ClearSkillupList() { m_SkillupList.clear(); }
998 
999  void AddUniqueUse(Player* player);
1000  void AddUse() { ++m_usetimes; }
1001 
1002  uint32 GetUseCount() const { return m_usetimes; }
1003  uint32 GetUniqueUseCount() const { return uint32(m_unique_users.size()); }
1004 
1005  void SaveRespawnTime() override;
1006 
1008 
1009  Player* GetLootRecipient() const;
1010  Group* GetLootRecipientGroup() const;
1011  void SetLootRecipient(Unit* unit);
1012  bool IsLootAllowedFor(Player const* player) const;
1013  bool HasLootRecipient() const { return !m_lootRecipient.IsEmpty() || !m_lootRecipientGroup.IsEmpty(); }
1014  uint32 m_groupLootTimer; // (msecs)timer used for group loot
1015  ObjectGuid lootingGroupLowGUID; // used to find group which is looting
1016 
1017  bool hasQuest(uint32 quest_id) const override;
1018  bool hasInvolvedQuest(uint32 quest_id) const override;
1019  bool ActivateToQuest(Player* target) const;
1020  void UseDoorOrButton(uint32 time_to_restore = 0, bool alternative = false, Unit* user = NULL);
1021  // 0 = use `gameobject`.`spawntimesecs`
1022  void ResetDoorOrButton();
1023 
1024  void TriggeringLinkedGameObject(uint32 trapEntry, Unit* target);
1025 
1026  bool IsNeverVisible() const override;
1027 
1028  bool IsAlwaysVisibleFor(WorldObject const* seer) const override;
1029  bool IsInvisibleDueToDespawn() const override;
1030 
1031  uint8 getLevelForTarget(WorldObject const* target) const override
1032  {
1033  if (Unit* owner = GetOwner())
1034  return owner->getLevelForTarget(target);
1035 
1036  return 1;
1037  }
1038 
1039  GameObject* LookupFishingHoleAround(float range);
1040 
1041  void CastSpell(Unit* target, uint32 spell, bool triggered = true);
1042  void SendCustomAnim(uint32 anim);
1043  bool IsInRange(float x, float y, float z, float radius) const;
1044 
1045  void ModifyHealth(int32 change, Unit* attackerOrHealer = NULL, uint32 spellId = 0);
1046  // sets GameObject type 33 destruction flags and optionally default health for that state
1047  void SetDestructibleState(GameObjectDestructibleState state, Player* eventInvoker = NULL, bool setHealth = false);
1049  {
1050  if (HasFlag(GAMEOBJECT_FLAGS, GO_FLAG_DESTROYED))
1052  if (HasFlag(GAMEOBJECT_FLAGS, GO_FLAG_DAMAGED))
1053  return GO_DESTRUCTIBLE_DAMAGED;
1054  return GO_DESTRUCTIBLE_INTACT;
1055  }
1056 
1057  void EventInform(uint32 eventId, WorldObject* invoker = NULL);
1058 
1059  uint64 GetRotation() const { return m_rotation; }
1060  virtual uint32 GetScriptId() const { return GetGOInfo()->ScriptId; }
1061  GameObjectAI* AI() const { return m_AI; }
1062 
1063  std::string GetAIName() const;
1064  void SetDisplayId(uint32 displayid);
1065  uint32 GetDisplayId() const { return GetUInt32Value(GAMEOBJECT_DISPLAYID); }
1066 
1067  uint32 GetFaction() const { return GetUInt32Value(GAMEOBJECT_FACTION); }
1068  void SetFaction(uint32 faction) { SetUInt32Value(GAMEOBJECT_FACTION, faction); }
1069 
1071  void GetRespawnPosition(float &x, float &y, float &z, float* ori = NULL) const;
1072 
1073  Transport* ToTransport() { if (GetGOInfo()->type == GAMEOBJECT_TYPE_MAP_OBJ_TRANSPORT) return reinterpret_cast<Transport*>(this); else return NULL; }
1074  Transport const* ToTransport() const { if (GetGOInfo()->type == GAMEOBJECT_TYPE_MAP_OBJ_TRANSPORT) return reinterpret_cast<Transport const*>(this); else return NULL; }
1075 
1076  float GetStationaryX() const override { if (GetGOInfo()->type != GAMEOBJECT_TYPE_MAP_OBJ_TRANSPORT) return m_stationaryPosition.GetPositionX(); return GetPositionX(); }
1077  float GetStationaryY() const override { if (GetGOInfo()->type != GAMEOBJECT_TYPE_MAP_OBJ_TRANSPORT) return m_stationaryPosition.GetPositionY(); return GetPositionY(); }
1078  float GetStationaryZ() const override { if (GetGOInfo()->type != GAMEOBJECT_TYPE_MAP_OBJ_TRANSPORT) return m_stationaryPosition.GetPositionZ(); return GetPositionZ(); }
1079  float GetStationaryO() const override { if (GetGOInfo()->type != GAMEOBJECT_TYPE_MAP_OBJ_TRANSPORT) return m_stationaryPosition.GetOrientation(); return GetOrientation(); }
1080  void RelocateStationaryPosition(float x, float y, float z, float o) { m_stationaryPosition.Relocate(x, y, z, o); }
1081 
1082  float GetInteractionDistance() const;
1083 
1084  void UpdateModelPosition();
1085 
1086  uint16 GetAIAnimKitId() const override { return _animKitId; }
1087  void SetAnimKitId(uint16 animKitId, bool oneshot);
1088 
1089  protected:
1090  bool AIM_Initialize();
1091  GameObjectModel* CreateModel();
1092  void UpdateModel(); // updates model in case displayId were changed
1094  time_t m_respawnTime; // (secs) time of next respawn (or despawn if GO have owner()),
1095  uint32 m_respawnDelayTime; // (secs) if 0 then current GO state no dependent from timer
1097  ObjectGuid m_lootStateUnitGUID; // GUID of the unit passed with SetLootState(LootState, Unit*)
1099  time_t m_cooldownTime; // used as internal reaction delay time store (not state change reaction).
1100  // For traps this: spell casting cooldown, for doors/buttons: reset time.
1102 
1103  ObjectGuid m_ritualOwnerGUID; // used for GAMEOBJECT_TYPE_RITUAL where GO is not summoned (no owner)
1106 
1107  typedef std::map<uint32, ObjectGuid> ChairSlotAndUser;
1108  ChairSlotAndUser ChairListSlots;
1109 
1114 
1117 
1120  uint16 m_LootMode; // bitmask, default LOOT_MODE_DEFAULT, determines what loot will be lootable
1121  private:
1122  void RemoveFromOwner();
1123  void SwitchDoorOrButton(bool activate, bool alternative = false);
1124 
1126  bool _IsWithinDist(WorldObject const* obj, float dist2compare, bool /*is3D*/) const override
1127  {
1129  return IsInRange(obj->GetPositionX(), obj->GetPositionY(), obj->GetPositionZ(), dist2compare);
1130  }
1131 
1134 };
1135 #endif
struct GameObjectTemplate::@221::@255 barberChair
LootState m_lootState
Definition: GameObject.h:1096
uint32 chestLoot
Definition: GameObject.h:98
struct GameObjectTemplate::@221::@239 duelFlag
std::string castBarCaption
Definition: GameObject.h:41
GameObjectAI * AI() const
Definition: GameObject.h:1061
uint32 RespawnTime
Definition: GameObject.h:523
struct GameObjectTemplate::@221::@253 auraGenerator
struct GameObjectTemplate::@221::@240 fishingNode
uint32 NeutralEventHorde
Definition: GameObject.h:421
uint32 LargeAOI
Definition: GameObject.h:125
uint32 InteriorVisible
Definition: GameObject.h:480
uint32 Reached7thfloor
Definition: GameObject.h:255
uint32 spawnMask
Definition: GameObject.h:852
std::string unk1
Definition: GameObject.h:42
uint32 RebuildingTime
Definition: GameObject.h:491
std::vector< uint32 > GameObjectQuestItemList
Definition: GameObject.h:859
uint32 Timeto2ndfloor
Definition: GameObject.h:240
uint32 minSuperiority
Definition: GameObject.h:425
float posZ
Definition: GameObject.h:843
uint32 camera
Definition: GameObject.h:281
int32 Unused
Definition: GameObject.h:475
uint32 GetCharges() const
Definition: GameObject.h:686
uint32 GetLinkedGameObjectEntry() const
Definition: GameObject.h:697
Definition: GameObject.h:825
uint32 requireLOS
Definition: GameObject.h:75
Definition: ByteBuffer.h:70
Definition: SharedDefines.h:2107
StringVector CastBarCaption
Definition: GameObject.h:806
struct GameObjectTemplate::@221::@261 garrisonBuilding
float rotation0
Definition: GameObject.h:845
TransportAnimation const * AnimationInfo
Definition: GameObject.h:780
struct GameObjectTemplate::@221::@230 chair
Definition: GameObject.h:871
GuidSet m_unique_users
Definition: GameObject.h:1104
GOState GetGoState() const
Definition: GameObject.h:966
uint32 DamageImmuneOK
Definition: GameObject.h:119
Definition: SharedDefines.h:2101
Definition: TransportMgr.h:86
uint32 DifficultyAnimations
Definition: GameObject.h:460
LootState
Definition: GameObject.h:866
LootState getLootState() const
Definition: GameObject.h:981
ObjectGuid m_lootStateUnitGUID
Definition: GameObject.h:1097
uint32 Reached5thfloor
Definition: GameObject.h:251
uint32 worldstate3
Definition: GameObject.h:424
int32 spawntimesecs
Definition: GameObject.h:849
uint32 data[MAX_GAMEOBJECT_DATA]
Definition: GameObject.h:620
uint32 minRestock
Definition: GameObject.h:101
struct GameObjectTemplate::@221::@271 UILink
uint32 m_usetimes
Definition: GameObject.h:1105
uint32 RebuildingEvent
Definition: GameObject.h:494
uint32 trivialSkillLow
Definition: GameObject.h:120
Definition: GameObject.h:811
uint32 ExpireDuration
Definition: GameObject.h:395
Definition: OutdoorPvP.h:87
int32 Unused6
Definition: GameObject.h:488
uint32 BlocksPathsDown
Definition: GameObject.h:510
uint32 allowstopping
Definition: GameObject.h:301
uint32 m_respawnDelayTime
Definition: GameObject.h:1095
struct GameObjectTemplate::@221::@243 DONOTUSE
struct GameObjectTemplate::@221::@235 areaDamage
struct GameObjectTemplate::@221::@270 DONOTUSE3
struct GameObjectTemplate::@221::@244 guardPost
float rotation2
Definition: GameObject.h:847
uint32 gossipID
Definition: GameObject.h:84
uint32 DestructibleModelRec
Definition: GameObject.h:493
struct GameObjectTemplate::@221::@269 garrisonMonumentPlaque
GameObjectData const * GetGOData() const
Definition: GameObject.h:895
Definition: GameObject.h:870
void SetGoType(GameobjectTypes type)
Definition: GameObject.h:965
struct GameObjectTemplate::@221::@249 flagDrop
uint32 WorldStateSetsState
Definition: GameObject.h:225
uint32 auraID2
Definition: GameObject.h:446
uint32 FrequentHeartbeat
Definition: GameObject.h:437
uint32 moveSpeed
Definition: GameObject.h:294
uint32 unidirectional
Definition: GameObject.h:432
uint32 IgnoreBoundingBox
Definition: GameObject.h:232
Position m_stationaryPosition
Definition: GameObject.h:1116
time_t GetRespawnTime() const
Definition: GameObject.h:935
GameObjectData()
Definition: GameObject.h:835
std::string AIName
Definition: GameObject.h:624
struct GameObjectTemplate::@221::@232 text
struct GameObjectTemplate::@221::@224 button
uint32 creatureID
Definition: GameObject.h:338
uint32 stopEventID
Definition: GameObject.h:297
float rotation3
Definition: GameObject.h:848
int32 Unused10
Definition: GameObject.h:496
uint32 damageMax
Definition: GameObject.h:271
Definition: GameObject.h:826
uint32 InteriorLight
Definition: GameObject.h:481
uint32 areaID
Definition: GameObject.h:358
GameObjectAI * m_AI
Definition: GameObject.h:1132
Definition: UpdateFields.h:317
uint32 SpawnVignette
Definition: GameObject.h:126
uint32 GetCooldown() const
Definition: GameObject.h:757
uint32 Reached8thfloor
Definition: GameObject.h:257
uint32 Reached10thfloor
Definition: GameObject.h:261
Definition: SharedDefines.h:2074
StringVector Name
Definition: GameObject.h:805
uint32 DefendedEventHorde
Definition: GameObject.h:573
uint32 maxSuperiority
Definition: GameObject.h:426
#define UI64LIT(N)
Definition: Define.h:138
Definition: GameObject.h:34
uint32 ShipmentContainer
Definition: GameObject.h:600
int32 Unused9
Definition: GameObject.h:495
uint32 minTime
Definition: GameObject.h:427
struct GameObjectTemplate::@221::@264 clientItem
int32 charges
Definition: GameObject.h:345
uint32 onlychargeheightcheck
Definition: GameObject.h:262
uint32 DifficultyEpic
Definition: GameObject.h:456
arena_t NULL
Definition: jemalloc_internal.h:624
struct GameObjectTemplate::@221::@262 garrisonPlot
uint32 SpellVisual2
Definition: GameObject.h:578
time_t GetRespawnTimeEx() const
Definition: GameObject.h:936
Definition: SharedDefines.h:2091
struct GameObjectTemplate::@221::@258 trapdoor
uint32 SpellVisual3
Definition: GameObject.h:579
Definition: Transport.h:28
struct GameObjectTemplate::@221::@247 flagStand
uint32 AssaultBroadcastHorde
Definition: GameObject.h:564
GameObjectDestructibleState GetDestructibleState() const
Definition: GameObject.h:1048
Definition: SharedDefines.h:2073
struct GameObjectTemplate::@221::@267 garrisonMonument
uint32 phaseid
Definition: GameObject.h:854
uint32 ProgressEventHorde
Definition: GameObject.h:419
uint32 InstanceType
Definition: GameObject.h:453
Definition: Object.h:423
uint32 auraID1
Definition: GameObject.h:444
uint32 Timeto10thfloor
Definition: GameObject.h:260
void RemoveLootMode(uint16 lootMode)
Definition: GameObject.h:989
uint32 StateUpdateTimer
Definition: GameObject.h:783
void SetRespawnTime(int32 respawn)
Definition: GameObject.h:945
uint32 displayId
Definition: GameObject.h:38
uint32 AssaultBroadcastAlliance
Definition: GameObject.h:567
uint32 DontPlayOpenAnim
Definition: GameObject.h:231
struct GameObjectTemplate::@221::@227 binder
uint32 faction
Definition: GameObject.h:43
ObjectGuid::LowType GetSpawnId() const
Definition: GameObject.h:902
uint32 DamagedEvent
Definition: GameObject.h:484
uint32 pageMaterial
Definition: GameObject.h:83
uint32 DifficultyNormal
Definition: GameObject.h:454
GameObjectData const * m_goData
Definition: GameObject.h:1112
uint32 linkedTrap
Definition: GameObject.h:70
struct GameObjectTemplate::@221::@265 capturePoint
uint32 pickupSpell
Definition: GameObject.h:364
uint64 LowType
Definition: ObjectGuid.h:199
float size
Definition: GameObject.h:45
void SetGoAnimProgress(uint8 animprogress)
Definition: GameObject.h:973
void apply(T *val)
Definition: ByteConverter.h:41
float orientation
Definition: GameObject.h:844
uint32 Timeto7thfloor
Definition: GameObject.h:254
bool LoadFromDB(ObjectGuid::LowType spawnId, Map *map)
Definition: GameObject.h:911
uint32 GroupXP
Definition: GameObject.h:118
uint32 DifficultyLegendary
Definition: GameObject.h:457
Definition: GameObjectAI.h:29
GameObjectTemplate const * m_goInfo
Definition: GameObject.h:1111
int32 Unused3
Definition: GameObject.h:485
struct GameObjectTemplate::@221::@246 meetingStone
float GetStationaryZ() const override
Definition: GameObject.h:1078
std::string IconName
Definition: GameObject.h:40
uint32 UILinkType
Definition: GameObject.h:616
GameobjectTypes
Definition: SharedDefines.h:2063
time_t m_cooldownTime
Definition: GameObject.h:1099
uint32 Reached9thfloor
Definition: GameObject.h:259
uint32 questID
Definition: GameObject.h:105
Definition: SharedDefines.h:69
uint32 GetRespawnDelay() const
Definition: GameObject.h:959
InvisibilityType
Definition: SharedDefines.h:1695
uint32 CaptureEventAlliance
Definition: GameObject.h:416
struct GameObjectTemplate::@221::@250 miniGame
std::unordered_map< ObjectGuid::LowType, GameObjectAddon > GameObjectAddonContainer
Definition: GameObject.h:817
uint32 Secondarydoodadset
Definition: GameObject.h:589
#define true
Definition: CascPort.h:17
uint32 language
Definition: GameObject.h:196
Definition: SharedDefines.h:2128
Definition: SharedDefines.h:2145
Definition: GameObject.h:824
GuidSet m_SkillupList
Definition: GameObject.h:1101
uint32 returnAura
Definition: GameObject.h:366
uint64 GetRotation() const
Definition: GameObject.h:1059
uint32 CurrentSeg
Definition: GameObject.h:781
struct GameObjectTemplate::@221::@237 mapobject
uint32 Reached1stfloor
Definition: GameObject.h:243
uint32 questGiver
Definition: GameObject.h:82
uint16 m_LootMode
Definition: GameObject.h:1120
std::unordered_map< uint32, GameObjectQuestItemList > GameObjectQuestItemMap
Definition: GameObject.h:860
Definition: SharedDefines.h:2102
uint32 worldstate2
Definition: GameObject.h:414
uint32 highlight
Definition: GameObject.h:139
uint8 getLevelForTarget(WorldObject const *target) const override
Definition: GameObject.h:1031
Definition: SharedDefines.h:2144
uint32 startDelay
Definition: GameObject.h:158
uint32 DifficultyHeroic
Definition: GameObject.h:455
uint32 GetLockId() const
Definition: GameObject.h:650
struct GameObjectTemplate::@221::@225 questgiver
uint32 Timeto5thfloor
Definition: GameObject.h:250
struct GameObjectTemplate::@221::@234 transport
uint32 UncontestedTime
Definition: GameObject.h:436
uint32 allowMounted
Definition: GameObject.h:89
uint32 DefendedBroadcastAlliance
Definition: GameObject.h:569
uint32 logloot
Definition: GameObject.h:110
uint32 onlychargetimecheck
Definition: GameObject.h:263
uint32 onlyCreatorUse
Definition: GameObject.h:175
int32 ExclusiveCategory
Definition: GameObject.h:525
time_t m_respawnTime
Definition: GameObject.h:1094
uint32 IntactEvent
Definition: GameObject.h:478
GameObjectModel * m_model
Definition: GameObject.h:1070
uint32 openTextID
Definition: GameObject.h:56
uint32 DungeonEncounter
Definition: GameObject.h:122
uint32 transportPhysics
Definition: GameObject.h:298
uint32 DamageEvent
Definition: GameObject.h:497
uint32 SummonerTriggered
Definition: GameObject.h:168
struct GameObjectTemplate::@221::@229 trap
uint32 SpellVisual1
Definition: GameObject.h:577
Definition: SharedDefines.h:2078
uint8 artKit
Definition: GameObject.h:853
uint32 ContestedEventAlliance
Definition: GameObject.h:418
uint32 stealthAffected
Definition: GameObject.h:162
uint32 FlagDrop
Definition: GameObject.h:524
struct GameObjectTemplate::@221::@259 newflag
Definition: SharedDefines.h:2066
ObjectGuid lootingGroupLowGUID
Definition: GameObject.h:1015
uint32 spell
Definition: GameObject.h:123
uint32 serverOnly
Definition: GameObject.h:140
uint32 MaxOpens
Definition: GameObject.h:788
uint32 SyncAnimationtoObjectLifetime
Definition: GameObject.h:235
int32 Unused1
Definition: GameObject.h:482
uint32 ContestedEventHorde
Definition: GameObject.h:417
Definition: UpdateFields.h:323
uint32 maxLevel
Definition: GameObject.h:357
int32 Unused4
Definition: GameObject.h:486
uint32 conditionID2
Definition: GameObject.h:447
StringVector Unk1
Definition: GameObject.h:807
bool _IsWithinDist(WorldObject const *obj, float dist2compare, bool) const override
Object distance/size - overridden from Object::_IsWithinDist. Needs to take in account proper GO size...
Definition: GameObject.h:1126
LocaleConstant
Definition: Common.h:115
uint32 maxRestock
Definition: GameObject.h:102
Definition: SharedDefines.h:2080
uint32 chairslots
Definition: GameObject.h:173
uint32 Timeto8thfloor
Definition: GameObject.h:256
uint32 chestRestockTime
Definition: GameObject.h:99
Definition: LootMgr.h:314
uint32 CaptureBroadcastAlliance
Definition: GameObject.h:568
uint32 Legacy
Definition: GameObject.h:463
uint32 TrophyTypeID
Definition: GameObject.h:594
uint32 PlotInstance
Definition: GameObject.h:542
Definition: SharedDefines.h:2146
GameObjectValue m_goValue
Definition: GameObject.h:1113
Definition: SharedDefines.h:2129
uint32 floatingTooltip
Definition: GameObject.h:113
float GetPositionY() const
Definition: Position.h:105
uint32 NeutralEventAlliance
Definition: GameObject.h:422
G3D::int16 z
Definition: Vector3int16.h:46
int32 namedset
Definition: GameObject.h:587
void SetSpawnedByDefault(bool b)
Definition: GameObject.h:958
uint32 open
Definition: GameObject.h:53
Transport const * ToTransport() const
Definition: GameObject.h:1074
bool GetDespawnPossibility() const
Definition: GameObject.h:672
Definition: Object.h:398
struct GameObjectTemplate::@221::@226 chest
void AddToSkillupList(ObjectGuid const &PlayerGuidLow)
Definition: GameObject.h:992
uint32 Reached2ndfloor
Definition: GameObject.h:244
uint32 IgnoredByPathing
Definition: GameObject.h:58
int32 HeightOffset
Definition: GameObject.h:469
uint32 speedWorldState2
Definition: GameObject.h:435
int32 Unused2
Definition: GameObject.h:483
uint32 GetEventScriptId() const
Definition: GameObject.h:746
uint32 floatOnWater
Definition: GameObject.h:142
float GetPositionZ() const
Definition: Position.h:106
int32_t int32
Definition: Define.h:146
Definition: SharedDefines.h:2089
Definition: GameObject.h:803
uint32 GetLootId() const
Definition: GameObject.h:726
uint32_t uint32
Definition: Define.h:150
uint32 eventID
Definition: GameObject.h:207
Definition: GameObject.h:774
uint64_t uint64
Definition: Define.h:149
struct GameObjectTemplate::@221::@254 dungeonDifficulty
uint32 ChestProperties
Definition: GameObject.h:129
void RelocateStationaryPosition(float x, float y, float z, float o)
Definition: GameObject.h:1080
Transport * ToTransport()
Definition: GameObject.h:1073
GameObjectTemplate const * GetGOInfo() const
Definition: GameObject.h:894
float GetStationaryX() const override
Definition: GameObject.h:1076
uint32 pageID
Definition: GameObject.h:195
float GetStationaryO() const override
Definition: GameObject.h:1079
uint32 id
Definition: GameObject.h:838
G3D::int16 y
Definition: Vector2int16.h:38
uint32 autoClose
Definition: GameObject.h:54
uint16_t uint16
Definition: Define.h:151
int32 unkInt32
Definition: GameObject.h:46
uint32 casterTargetSpell
Definition: GameObject.h:320
Loot loot
Definition: GameObject.h:1007
struct GameObjectTemplate::@221::@245 spellCaster
Definition: GameObject.h:880
int32 mapID
Definition: GameObject.h:245
bool IsUsableMounted() const
Definition: GameObject.h:638
float GetStationaryY() const override
Definition: GameObject.h:1077
uint32 cooldown
Definition: GameObject.h:156
uint32 returnSpell
Definition: GameObject.h:367
uint32 entry
Definition: GameObject.h:36
uint32 xpDifficulty
Definition: GameObject.h:116
uint32 AnimKit
Definition: GameObject.h:549
std::vector< uint32 > * StopFrames
Definition: GameObject.h:782
uint32 ScriptId
Definition: GameObject.h:625
Definition: Map.h:259
uint32 maxTime
Definition: GameObject.h:428
uint32 startingValue
Definition: GameObject.h:431
InvisibilityType invisibilityType
Definition: GameObject.h:813
struct GameObjectTemplate::@221::@233 goober
uint32 casters
Definition: GameObject.h:316
ObjectGuid GetOwnerGUID() const
Definition: GameObject.h:925
Definition: UpdateFields.h:321
uint32 worldState1
Definition: GameObject.h:300
uint32 CaptureEventHorde
Definition: GameObject.h:415
uint32 level
Definition: GameObject.h:106
Definition: UpdateFields.h:319
uint32 TrophyInstanceID
Definition: GameObject.h:595
Definition: GameObject.h:822
void AddLootMode(uint16 lootMode)
Definition: GameObject.h:988
Definition: SharedDefines.h:2090
struct GameObjectTemplate::@221::@256 destructibleBuilding
struct GameObjectTemplate::@221::@257 guildbank
uint32 m_groupLootTimer
Definition: GameObject.h:1014
uint32 HeroicAttachment
Definition: GameObject.h:458
Definition: GameObject.h:823
bool IsDespawnAtAction() const
Definition: GameObject.h:628
GOState
Definition: GameObject.h:820
uint32 GetGossipMenuId() const
Definition: GameObject.h:736
uint32 startEventID
Definition: GameObject.h:296
struct GameObjectTemplate::@221::@251 DONOTUSE2
uint32 usegrouplootrules
Definition: GameObject.h:112
uint32 playerCast
Definition: GameObject.h:167
uint32 castersGrouped
Definition: GameObject.h:322
Definition: GameObjectModel.h:50
uint32 ChallengeAttachment
Definition: GameObject.h:459
Definition: GameObject.h:833
uint32 InitStopped
Definition: GameObject.h:302
bool HasLootRecipient() const
Definition: GameObject.h:1013
uint64 m_rotation
Definition: GameObject.h:1115
uint32 IgnoreTotems
Definition: GameObject.h:165
OPvPCapturePoint * OPvPObj
Definition: GameObject.h:793
uint32 damageSchool
Definition: GameObject.h:272
uint32 SitAnimKit
Definition: GameObject.h:470
uint32 Item
Definition: GameObject.h:555
uint32 ritualPersistent
Definition: GameObject.h:319
Definition: UpdateFields.h:318
bool isSpawned() const
Definition: GameObject.h:951
std::vector< std::string > StringVector
Definition: Common.h:142
uint32 GetFaction() const
Definition: GameObject.h:1067
uint32 CaptureTime
Definition: GameObject.h:560
uint32 startOpen
Definition: GameObject.h:52
uint32 ProgressEventAlliance
Definition: GameObject.h:420
uint32 chestPersonalLoot
Definition: GameObject.h:127
Definition: SharedDefines.h:2067
uint32 ritualNoTargetCheck
Definition: GameObject.h:323
bool m_spawnedByDefault
Definition: GameObject.h:1098
GameobjectTypes GetGoType() const
Definition: GameObject.h:964
struct GameObjectTemplate::@221::@266 phaseableMO
uint32 CreatureDisplayInfo
Definition: GameObject.h:548
uint32 SortFarZ
Definition: GameObject.h:234
uint8 GetGoAnimProgress() const
Definition: GameObject.h:972
uint32 charges
Definition: GameObject.h:155
uint32 CaptureBroadcastHorde
Definition: GameObject.h:565
uint32 m_spellId
Definition: GameObject.h:1093
Definition: SharedDefines.h:2075
void AddUse()
Definition: GameObject.h:1000
uint16 mapid
Definition: GameObject.h:839
Definition: GameObject.h:868
uint32 ReturnonDefenderInteract
Definition: GameObject.h:527
std::string name
Definition: GameObject.h:39
uint32 GetDisplayId() const
Definition: GameObject.h:1065
std::set< ObjectGuid > GuidSet
Definition: ObjectGuid.h:332
uint32 Reached6thfloor
Definition: GameObject.h:253
uint32 GiganticAOI
Definition: GameObject.h:61
uint32 noDamageImmune
Definition: GameObject.h:55
#define TC_GAME_API
Definition: Define.h:134
struct GameObjectTemplate::@221::@272 raw
Definition: Common.h:103
#define ABORT
Definition: Errors.h:56
struct GameObjectTemplate::@221::@242 mailbox
uint32 customAnim
Definition: GameObject.h:85
uint32 animprogress
Definition: GameObject.h:850
void SetSpellId(uint32 id)
Definition: GameObject.h:928
uint32 killbonustime
Definition: GameObject.h:433
uint32 neutralPercent
Definition: GameObject.h:423
uint32 Health
Definition: GameObject.h:798
uint8 GetGoArtKit() const
Definition: GameObject.h:970
struct GameObjectTemplate::@221::@238 moTransport
ChairSlotAndUser ChairListSlots
Definition: GameObject.h:1108
ObjectGuid m_lootRecipientGroup
Definition: GameObject.h:1119
uint32 DefendedBroadcastHorde
Definition: GameObject.h:566
float rotation1
Definition: GameObject.h:846
std::unordered_map< uint32, GameObjectTemplate > GameObjectTemplateContainer
Definition: GameObject.h:769
uint32 minLevel
Definition: GameObject.h:356
uint8_t uint8
Definition: Define.h:152
uint32 spellFocusType
Definition: GameObject.h:182
Definition: Position.h:27
uint32 UseGarrisonOwnerGuildColors
Definition: GameObject.h:146
uint32 accelRate
Definition: GameObject.h:295
uint32 closeTextID
Definition: GameObject.h:57
uint32 DestroyedEvent
Definition: GameObject.h:489
uint32 CreditProxyCreature
Definition: GameObject.h:476
ObjectGuid m_lootRecipient
Definition: GameObject.h:1118
uint32 Reached3rdfloor
Definition: GameObject.h:247
uint32 PathProgress
Definition: GameObject.h:779
Definition: SharedDefines.h:2100
ObjectGuid m_ritualOwnerGUID
Definition: GameObject.h:1103
Definition: SharedDefines.h:2068
struct GameObjectTemplate::@221::@252 controlZone
uint32 HealthRec
Definition: GameObject.h:477
bool dbData
Definition: GameObject.h:856
uint32 GetUniqueUseCount() const
Definition: GameObject.h:1003
int32 Unused7
Definition: GameObject.h:490
uint32 GetAutoCloseTime() const
Definition: GameObject.h:709
uint32 GetSpellId() const
Definition: GameObject.h:933
uint32 phaseGroup
Definition: GameObject.h:855
GameObjectDestructibleState
Definition: SharedDefines.h:2142
GameObjectValue const * GetGOValue() const
Definition: GameObject.h:896
void SetLootMode(uint16 lootMode)
Definition: GameObject.h:987
uint32 TrueInfiniteAOI
Definition: GameObject.h:303
struct GameObjectTemplate::@221::@248 fishingHole
Definition: ObjectGuid.h:189
struct GameObjectTemplate::@221::@223 door
uint32 partyOnly
Definition: GameObject.h:346
uint32_t uint32
Definition: g3dmath.h:168
uint32 flags
Definition: GameObject.h:44
uint32 conditionID1
Definition: GameObject.h:59
#define const
Definition: zconf.h:217
Definition: SharedDefines.h:2087
uint32 PVPEnabling
Definition: GameObject.h:479
G3D::int16 x
Definition: Vector2int16.h:37
uint32 Reached4thfloor
Definition: GameObject.h:249
uint32 DefendedEventAlliance
Definition: GameObject.h:576
struct GameObjectTemplate::@221::@268 garrisonShipment
struct GameObjectTemplate::@221::@231 spellFocus
uint32 speedWorldState1
Definition: GameObject.h:434
void ResetLootMode()
Definition: GameObject.h:990
uint32 turnpersonallootsecurityoff
Definition: GameObject.h:128
bool HasLootMode(uint16 lootMode) const
Definition: GameObject.h:986
uint32 triggeredEvent
Definition: GameObject.h:103
float posX
Definition: GameObject.h:841
float GetPositionX() const
Definition: Position.h:104
uint32 trivialSkillHigh
Definition: GameObject.h:121
uint32 Timeto3rdfloor
Definition: GameObject.h:246
int32 Unused8
Definition: GameObject.h:492
bool isSpawnedByDefault() const
Definition: GameObject.h:957
Definition: SharedDefines.h:2086
uint32 damageMin
Definition: GameObject.h:270
struct GameObjectTemplate::@221::@263 clientCreature
uint32 lootLevel
Definition: GameObject.h:117
uint32 stealthed
Definition: GameObject.h:160
struct GameObjectTemplate::@221::@241 ritual
uint32 taxiPathID
Definition: GameObject.h:293
uint16 GetLootMode() const
Definition: GameObject.h:985
Definition: Unit.h:1305
uint32 Timeto4thfloor
Definition: GameObject.h:248
uint32 animSpell
Definition: GameObject.h:318
Definition: GameObject.h:869
uint32 phaseMask
Definition: GameObject.h:840
uint32 casterTargetSpellTargets
Definition: GameObject.h:321
Definition: SharedDefines.h:2077
virtual uint32 GetScriptId() const
Definition: GameObject.h:1060
Definition: SharedDefines.h:2076
Definition: SharedDefines.h:2071
uint32 SpellVisual5
Definition: GameObject.h:581
float posY
Definition: GameObject.h:842
uint32 consumable
Definition: GameObject.h:100
uint32 Primarydoodadset
Definition: GameObject.h:588
uint32 MaxHealth
Definition: GameObject.h:799
uint32 type
Definition: GameObject.h:37
ObjectGuid::LowType m_spawnId
For new or temporary gameobjects is 0 for saved it is lowguid.
Definition: GameObject.h:1110
int32 Unused5
Definition: GameObject.h:487
std::map< uint32, ObjectGuid > ChairSlotAndUser
Definition: GameObject.h:1107
uint32 InvisibilityValue
Definition: GameObject.h:814
uint32 InfiniteAOI
Definition: GameObject.h:62
bool IsEmpty() const
Definition: ObjectGuid.h:242
void SetFaction(uint32 faction)
Definition: GameObject.h:1068
void SetOwnerGUID(ObjectGuid owner)
Definition: GameObject.h:915
uint16 GetAIAnimKitId() const override
Definition: GameObject.h:1086
GOState go_state
Definition: GameObject.h:851
uint32 Timeto6thfloor
Definition: GameObject.h:252
uint16 _animKitId
Definition: GameObject.h:1133
struct GameObjectTemplate::@221::@260 newflagdrop
void Update(uint32 diff)
Definition: WeatherMgr.cpp:150
uint32 notInCombat
Definition: GameObject.h:109
uint32 SpellVisual4
Definition: GameObject.h:580
bool IsInSkillupList(ObjectGuid const &playerGuid) const
Definition: GameObject.h:993
Definition: Group.h:191
uint32 radius
Definition: GameObject.h:153
int32 xpLevel
Definition: GameObject.h:115
uint32 Timeto9thfloor
Definition: GameObject.h:258
uint32 chairheight
Definition: GameObject.h:174
Definition: SharedDefines.h:2065
uint32 EnablePortalsonopen
Definition: GameObject.h:60
#define MAX_GAMEOBJECT_DATA
Definition: SharedDefines.h:2117
uint32 leaveLoot
Definition: GameObject.h:108
uint32 NeverUsableWhileMounted
Definition: GameObject.h:92
void ClearSkillupList()
Definition: GameObject.h:997
uint32 GetUseCount() const
Definition: GameObject.h:1002