TrinityCore
ConditionMgr.h
Go to the documentation of this file.
1/*
2 * This file is part of the TrinityCore Project. See AUTHORS file for Copyright information
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 TRINITY_CONDITIONMGR_H
19#define TRINITY_CONDITIONMGR_H
20
21#include "Define.h"
22#include "Hash.h"
23#include <array>
24#include <memory>
25#include <string>
26#include <unordered_map>
27#include <unordered_set>
28#include <vector>
29
30class Creature;
31class Map;
32class Player;
33class Unit;
34class WorldObject;
35class LootTemplate;
36struct Condition;
41
60{ // value1 value2 value3
61 CONDITION_NONE = 0, // 0 0 0 always true
62 CONDITION_AURA = 1, // spell_id effindex 0 true if target has aura of spell_id with effect effindex
63 CONDITION_ITEM = 2, // item_id count bank true if has #count of item_ids (if 'bank' is set it searches in bank slots too)
64 CONDITION_ITEM_EQUIPPED = 3, // item_id 0 0 true if has item_id equipped
65 CONDITION_ZONEID = 4, // zone_id 0 0 true if in zone_id
66 CONDITION_REPUTATION_RANK = 5, // faction_id rankMask 0 true if has min_rank for faction_id
67 CONDITION_TEAM = 6, // player_team 0, 0 469 - Alliance, 67 - Horde)
68 CONDITION_SKILL = 7, // skill_id skill_value 0 true if has skill_value for skill_id
69 CONDITION_QUESTREWARDED = 8, // quest_id 0 0 true if quest_id was rewarded before
70 CONDITION_QUESTTAKEN = 9, // quest_id 0, 0 true while quest active
71 CONDITION_DRUNKENSTATE = 10, // DrunkenState 0, 0 true if player is drunk enough
72 CONDITION_WORLD_STATE = 11, // index value 0 true if world has the value for the index
73 CONDITION_ACTIVE_EVENT = 12, // event_id 0 0 true if event is active
74 CONDITION_INSTANCE_INFO = 13, // entry data type true if the instance info defined by type (enum InstanceInfo) equals data.
75 CONDITION_QUEST_NONE = 14, // quest_id 0 0 true if doesn't have quest saved
76 CONDITION_CLASS = 15, // class 0 0 true if player's class is equal to class
77 CONDITION_RACE = 16, // race 0 0 true if player's race is equal to race
78 CONDITION_ACHIEVEMENT = 17, // achievement_id 0 0 true if achievement is complete
79 CONDITION_TITLE = 18, // title id 0 0 true if player has title
81 CONDITION_GENDER = 20, // gender 0 0 true if player's gender is equal to gender
82 CONDITION_UNIT_STATE = 21, // unitState 0 0 true if unit has unitState
83 CONDITION_MAPID = 22, // map_id 0 0 true if in map_id
84 CONDITION_AREAID = 23, // area_id 0 0 true if in area_id
85 CONDITION_CREATURE_TYPE = 24, // cinfo.type 0 0 true if creature_template.type = value1
86 CONDITION_SPELL = 25, // spell_id 0 0 true if player has learned spell
87 CONDITION_PHASEID = 26, // phaseid 0 0 true if object is in phaseid
88 CONDITION_LEVEL = 27, // level ComparisonType 0 true if unit's level is equal to param1 (param2 can modify the statement)
89 CONDITION_QUEST_COMPLETE = 28, // quest_id 0 0 true if player has quest_id with all objectives complete, but not yet rewarded
90 CONDITION_NEAR_CREATURE = 29, // creature entry distance dead (0/1) true if there is a creature of entry in range
91 CONDITION_NEAR_GAMEOBJECT = 30, // gameobject entry distance 0 true if there is a gameobject of entry in range
92 CONDITION_OBJECT_ENTRY_GUID_LEGACY = 31, // LEGACY_TypeID entry guid true if object is type TypeID and the entry is 0 or matches entry of the object or matches guid of the object
93 CONDITION_TYPE_MASK_LEGACY = 32, // LEGACY_TypeMask 0 0 true if object is type object's TypeMask matches provided TypeMask
94 CONDITION_RELATION_TO = 33, // ConditionTarget RelationType 0 true if object is in given relation with object specified by ConditionTarget
95 CONDITION_REACTION_TO = 34, // ConditionTarget rankMask 0 true if object's reaction matches rankMask object specified by ConditionTarget
96 CONDITION_DISTANCE_TO = 35, // ConditionTarget distance ComparisonType true if object and ConditionTarget are within distance given by parameters
97 CONDITION_ALIVE = 36, // 0 0 0 true if unit is alive
98 CONDITION_HP_VAL = 37, // hpVal ComparisonType 0 true if unit's hp matches given value
99 CONDITION_HP_PCT = 38, // hpPct ComparisonType 0 true if unit's hp matches given pct
100 CONDITION_REALM_ACHIEVEMENT = 39, // achievement_id 0 0 true if realm achievement is complete
101 CONDITION_IN_WATER = 40, // 0 0 0 true if unit in water
102 CONDITION_TERRAIN_SWAP = 41, // terrainSwap 0 0 true if object is in terrainswap
103 CONDITION_STAND_STATE = 42, // stateType state 0 true if unit matches specified sitstate (0,x: has exactly state x; 1,0: any standing state; 1,1: any sitting state;)
104 CONDITION_DAILY_QUEST_DONE = 43, // quest id 0 0 true if daily quest has been completed for the day
105 CONDITION_CHARMED = 44, // 0 0 0 true if unit is currently charmed
106 CONDITION_PET_TYPE = 45, // mask 0 0 true if player has a pet of given type(s)
107 CONDITION_TAXI = 46, // 0 0 0 true if player is on taxi
108 CONDITION_QUESTSTATE = 47, // quest_id state_mask 0 true if player is in any of the provided quest states for the quest (1 = not taken, 2 = completed, 8 = in progress, 32 = failed, 64 = rewarded)
109 CONDITION_QUEST_OBJECTIVE_PROGRESS = 48, // ID 0 progressValue true if player has ID objective progress equal to ConditionValue3 (and quest is in quest log)
110 CONDITION_DIFFICULTY_ID = 49, // Difficulty 0 0 true is map has difficulty id
111 CONDITION_GAMEMASTER = 50, // canBeGM 0 0 true if player is gamemaster (or can be gamemaster)
112 CONDITION_OBJECT_ENTRY_GUID = 51, // TypeID entry guid true if object is type TypeID and the entry is 0 or matches entry of the object or matches guid of the object
113 CONDITION_TYPE_MASK = 52, // TypeMask 0 0 true if object is type object's TypeMask matches provided TypeMask
114 CONDITION_BATTLE_PET_COUNT = 53, // SpecieId count ComparisonType true if player has `count` of battle pet species
115 CONDITION_SCENARIO_STEP = 54, // ScenarioStepId 0 0 true if player is at scenario with current step equal to ScenarioStepID
116 CONDITION_SCENE_IN_PROGRESS = 55, // SceneScriptPackageId 0 0 true if player is playing a scene with ScriptPackageId equal to given value
117 CONDITION_PLAYER_CONDITION = 56, // PlayerConditionId 0 0 true if player satisfies PlayerCondition
118 CONDITION_PRIVATE_OBJECT = 57, // 0 0 0 true if entity is private object
122
153{
174 // Condition source type 20 unused
188
193
195{
204
206{
212
214{
217
219{
220 WorldObject const* mConditionTargets[MAX_CONDITION_TARGETS]; // an array of targets available for conditions
223 ConditionSourceInfo(WorldObject const* target0, WorldObject const* target1 = nullptr, WorldObject const* target2 = nullptr);
224 ConditionSourceInfo(Map const* map);
225};
226
228{
229 uint32 SourceGroup = 0;
230 int32 SourceEntry = 0;
231 uint32 SourceId = 0;
232
233 std::size_t GetHash() const;
234 bool operator==(ConditionId const& right) const = default;
235 std::strong_ordering operator<=>(ConditionId const& right) const = default;
236};
237
238template<>
239struct std::hash<ConditionId>
240{
241 std::size_t operator()(ConditionId const& id) const noexcept { return id.GetHash(); }
242};
243
245{
246 ConditionSourceType SourceType; //SourceTypeOrReferenceId
249 uint32 SourceId; // So far, only used in CONDITION_SOURCE_TYPE_SMART_EVENT
251 ConditionTypes ConditionType; //ConditionTypeOrReference
262
264 {
265 SourceType = CONDITION_SOURCE_TYPE_NONE;
266 SourceGroup = 0;
267 SourceEntry = 0;
268 SourceId = 0;
269 ElseGroup = 0;
270 ConditionType = CONDITION_NONE;
271 ConditionTarget = 0;
272 ConditionValue1 = 0;
273 ConditionValue2 = 0;
274 ConditionValue3 = 0;
275 ReferenceId = 0;
276 ErrorType = 0;
277 ErrorTextId = 0;
278 ScriptId = 0;
279 NegativeCondition = false;
280 }
281
282 bool Meets(ConditionSourceInfo& sourceInfo) const;
283 uint32 GetSearcherTypeMaskForCondition() const;
284 bool isLoaded() const { return ConditionType > CONDITION_NONE || ReferenceId || ScriptId; }
285 uint32 GetMaxAvailableConditionTargets() const;
286
287 std::string ToString(bool ext = false) const;
288};
289
290typedef std::vector<Condition> ConditionContainer;
291typedef std::unordered_map<ConditionId, std::shared_ptr<ConditionContainer>> ConditionsByEntryMap; // stored as shared_ptr to give out weak_ptrs to hold by other code (ownership not shared)
292typedef std::array<ConditionsByEntryMap, CONDITION_SOURCE_TYPE_MAX> ConditionEntriesByTypeArray;
293
295{
296 private:
297 ConditionMgr();
299
300 public:
301 static ConditionMgr* instance();
302
303 void LoadConditions(bool isReload = false);
304 bool isConditionTypeValid(Condition* cond) const;
305
306 uint32 GetSearcherTypeMaskForConditionList(ConditionContainer const& conditions) const;
307 bool IsObjectMeetToConditions(WorldObject const* object, ConditionContainer const& conditions) const;
308 bool IsObjectMeetToConditions(WorldObject const* object1, WorldObject const* object2, ConditionContainer const& conditions) const;
309 bool IsObjectMeetToConditions(ConditionSourceInfo& sourceInfo, ConditionContainer const& conditions) const;
310 static bool CanHaveSourceGroupSet(ConditionSourceType sourceType);
311 static bool CanHaveSourceIdSet(ConditionSourceType sourceType);
312 static bool CanHaveConditionType(ConditionSourceType sourceType, ConditionTypes conditionType);
313 bool IsObjectMeetingNotGroupedConditions(ConditionSourceType sourceType, uint32 entry, ConditionSourceInfo& sourceInfo) const;
314 bool IsObjectMeetingNotGroupedConditions(ConditionSourceType sourceType, uint32 entry, WorldObject const* target0, WorldObject const* target1 = nullptr, WorldObject const* target2 = nullptr) const;
315 bool IsMapMeetingNotGroupedConditions(ConditionSourceType sourceType, uint32 entry, Map const* map) const;
316 bool HasConditionsForNotGroupedEntry(ConditionSourceType sourceType, uint32 entry) const;
317 bool IsObjectMeetingSpellClickConditions(uint32 creatureId, uint32 spellId, WorldObject const* clicker, WorldObject const* target) const;
318 bool HasConditionsForSpellClickEvent(uint32 creatureId, uint32 spellId) const;
319 bool IsObjectMeetingVehicleSpellConditions(uint32 creatureId, uint32 spellId, Player const* player, Unit const* vehicle) const;
320 bool IsObjectMeetingSmartEventConditions(int64 entryOrGuid, uint32 eventId, uint32 sourceType, Unit const* unit, WorldObject const* baseObject) const;
321 bool IsObjectMeetingVendorItemConditions(uint32 creatureId, uint32 itemId, Player const* player, Creature const* vendor) const;
322
323 bool IsSpellUsedInSpellClickConditions(uint32 spellId) const;
324
325 ConditionContainer const* GetConditionsForAreaTrigger(uint32 areaTriggerId, bool isServerSide) const;
326 bool IsObjectMeetingTrainerSpellConditions(uint32 trainerId, uint32 spellId, Player* player) const;
327 bool IsObjectMeetingVisibilityByObjectIdConditions(uint32 objectType, uint32 entry, WorldObject const* seer) const;
328
329 static uint32 GetPlayerConditionLfgValue(Player const* player, PlayerConditionLfgStatus status);
330 static bool IsPlayerMeetingCondition(Player const* player, PlayerConditionEntry const* condition);
331 static bool IsMeetingWorldStateExpression(Map const* map, WorldStateExpressionEntry const* expression);
332 static bool IsUnitMeetingCondition(Unit const* unit, Unit const* otherUnit, UnitConditionEntry const* condition);
333
335 {
336 char const* Name;
341 };
342 static char const* const StaticSourceTypeData[CONDITION_SOURCE_TYPE_MAX_DB_ALLOWED];
343 static ConditionTypeInfo const StaticConditionTypeData[CONDITION_MAX];
344
345 private:
346 bool isSourceTypeValid(Condition* cond) const;
347 void addToLootTemplate(ConditionId const& id, std::shared_ptr<std::vector<Condition>> conditions, LootTemplate* loot) const;
348 void addToGossipMenus(ConditionId const& id, std::shared_ptr<std::vector<Condition>> conditions) const;
349 void addToGossipMenuItems(ConditionId const& id, std::shared_ptr<std::vector<Condition>> conditions) const;
350 void addToSpellImplicitTargetConditions(Condition const& cond) const;
351 void addToPhases(ConditionId const& id, std::shared_ptr<std::vector<Condition>> conditions) const;
352 void addToGraveyardData(ConditionId const& id, std::shared_ptr<std::vector<Condition>> conditions) const;
353 bool IsObjectMeetToConditionList(ConditionSourceInfo& sourceInfo, ConditionContainer const& conditions) const;
354
355 static void LogUselessConditionValue(Condition const* cond, uint8 index, uint32 value);
356 static void LogUselessConditionValue(Condition const* cond, uint8 index, std::string_view value);
357
358 void Clean(); // free up resources
359
361
362 std::unordered_set<uint32> SpellsUsedInSpellClickConditions;
363};
364
365#define sConditionMgr ConditionMgr::instance()
366
368{
369 bool Meets(WorldObject const* object) const
370 {
371 if (std::shared_ptr<std::vector<Condition>> conditions = Conditions.lock())
372 return sConditionMgr->IsObjectMeetToConditions(object, *conditions);
373 return true;
374 }
375
376 bool Meets(WorldObject const* object1, WorldObject const* object2) const
377 {
378 if (std::shared_ptr<std::vector<Condition>> conditions = Conditions.lock())
379 return sConditionMgr->IsObjectMeetToConditions(object1, object2, *conditions);
380 return true;
381 }
382
383 bool Meets(ConditionSourceInfo& sourceInfo) const
384 {
385 if (std::shared_ptr<std::vector<Condition>> conditions = Conditions.lock())
386 return sConditionMgr->IsObjectMeetToConditions(sourceInfo, *conditions);
387 return true;
388 }
389
390 bool IsEmpty() const
391 {
392 if (std::shared_ptr<std::vector<Condition>> conditions = Conditions.lock())
393 return conditions->empty();
394 return true;
395 }
396
397 std::weak_ptr<ConditionContainer> Conditions;
398};
399
400#endif
std::vector< Condition > ConditionContainer
Definition: ConditionMgr.h:290
std::unordered_map< ConditionId, std::shared_ptr< ConditionContainer > > ConditionsByEntryMap
Definition: ConditionMgr.h:291
#define sConditionMgr
Definition: ConditionMgr.h:365
ConditionSourceType
Definition: ConditionMgr.h:153
@ CONDITION_SOURCE_TYPE_MAX
Definition: ConditionMgr.h:191
@ CONDITION_SOURCE_TYPE_CONVERSATION_LINE
Definition: ConditionMgr.h:183
@ CONDITION_SOURCE_TYPE_VEHICLE_SPELL
Definition: ConditionMgr.h:175
@ CONDITION_SOURCE_TYPE_DISENCHANT_LOOT_TEMPLATE
Definition: ConditionMgr.h:156
@ CONDITION_SOURCE_TYPE_REFERENCE_LOOT_TEMPLATE
Definition: ConditionMgr.h:164
@ CONDITION_SOURCE_TYPE_TERRAIN_SWAP
Definition: ConditionMgr.h:179
@ CONDITION_SOURCE_TYPE_NPC_VENDOR
Definition: ConditionMgr.h:177
@ CONDITION_SOURCE_TYPE_GOSSIP_MENU_OPTION
Definition: ConditionMgr.h:169
@ CONDITION_SOURCE_TYPE_SPELL_CLICK_EVENT
Definition: ConditionMgr.h:172
@ CONDITION_SOURCE_TYPE_REFERENCE_CONDITION
Definition: ConditionMgr.h:190
@ CONDITION_SOURCE_TYPE_MAIL_LOOT_TEMPLATE
Definition: ConditionMgr.h:160
@ CONDITION_SOURCE_TYPE_PHASE
Definition: ConditionMgr.h:180
@ CONDITION_SOURCE_TYPE_SPELL_LOOT_TEMPLATE
Definition: ConditionMgr.h:166
@ CONDITION_SOURCE_TYPE_SMART_EVENT
Definition: ConditionMgr.h:176
@ CONDITION_SOURCE_TYPE_PICKPOCKETING_LOOT_TEMPLATE
Definition: ConditionMgr.h:162
@ CONDITION_SOURCE_TYPE_PROSPECTING_LOOT_TEMPLATE
Definition: ConditionMgr.h:163
@ CONDITION_SOURCE_TYPE_AREATRIGGER_CLIENT_TRIGGERED
Definition: ConditionMgr.h:184
@ CONDITION_SOURCE_TYPE_AREATRIGGER
Definition: ConditionMgr.h:182
@ CONDITION_SOURCE_TYPE_SPAWN_GROUP
Definition: ConditionMgr.h:187
@ CONDITION_SOURCE_TYPE_SPELL
Definition: ConditionMgr.h:171
@ CONDITION_SOURCE_TYPE_FISHING_LOOT_TEMPLATE
Definition: ConditionMgr.h:157
@ CONDITION_SOURCE_TYPE_OBJECT_ID_VISIBILITY
Definition: ConditionMgr.h:186
@ CONDITION_SOURCE_TYPE_GOSSIP_MENU
Definition: ConditionMgr.h:168
@ CONDITION_SOURCE_TYPE_CREATURE_TEMPLATE_VEHICLE
Definition: ConditionMgr.h:170
@ CONDITION_SOURCE_TYPE_ITEM_LOOT_TEMPLATE
Definition: ConditionMgr.h:159
@ CONDITION_SOURCE_TYPE_SPELL_IMPLICIT_TARGET
Definition: ConditionMgr.h:167
@ CONDITION_SOURCE_TYPE_GRAVEYARD
Definition: ConditionMgr.h:181
@ CONDITION_SOURCE_TYPE_SKINNING_LOOT_TEMPLATE
Definition: ConditionMgr.h:165
@ CONDITION_SOURCE_TYPE_TRAINER_SPELL
Definition: ConditionMgr.h:185
@ CONDITION_SOURCE_TYPE_CREATURE_LOOT_TEMPLATE
Definition: ConditionMgr.h:155
@ CONDITION_SOURCE_TYPE_GAMEOBJECT_LOOT_TEMPLATE
Definition: ConditionMgr.h:158
@ CONDITION_SOURCE_TYPE_MILLING_LOOT_TEMPLATE
Definition: ConditionMgr.h:161
@ CONDITION_SOURCE_TYPE_SPELL_PROC
Definition: ConditionMgr.h:178
@ CONDITION_SOURCE_TYPE_QUEST_AVAILABLE
Definition: ConditionMgr.h:173
@ CONDITION_SOURCE_TYPE_NONE
Definition: ConditionMgr.h:154
@ CONDITION_SOURCE_TYPE_MAX_DB_ALLOWED
Definition: ConditionMgr.h:189
std::array< ConditionsByEntryMap, CONDITION_SOURCE_TYPE_MAX > ConditionEntriesByTypeArray
Definition: ConditionMgr.h:292
InstanceInfo
Definition: ConditionMgr.h:206
@ INSTANCE_INFO_DATA64
Definition: ConditionMgr.h:210
@ INSTANCE_INFO_DATA
Definition: ConditionMgr.h:207
@ INSTANCE_INFO_BOSS_STATE
Definition: ConditionMgr.h:209
@ INSTANCE_INFO_GUID_DATA
Definition: ConditionMgr.h:208
MaxConditionTargets
Definition: ConditionMgr.h:214
@ MAX_CONDITION_TARGETS
Definition: ConditionMgr.h:215
ConditionTypes
Definition: ConditionMgr.h:60
@ CONDITION_TAXI
Definition: ConditionMgr.h:107
@ CONDITION_MAPID
Definition: ConditionMgr.h:83
@ CONDITION_SKILL
Definition: ConditionMgr.h:68
@ CONDITION_RACE
Definition: ConditionMgr.h:77
@ CONDITION_STRING_ID
Definition: ConditionMgr.h:119
@ CONDITION_PHASEID
Definition: ConditionMgr.h:87
@ CONDITION_REACTION_TO
Definition: ConditionMgr.h:95
@ CONDITION_NEAR_GAMEOBJECT
Definition: ConditionMgr.h:91
@ CONDITION_QUESTREWARDED
Definition: ConditionMgr.h:69
@ CONDITION_REALM_ACHIEVEMENT
Definition: ConditionMgr.h:100
@ CONDITION_QUEST_OBJECTIVE_PROGRESS
Definition: ConditionMgr.h:109
@ CONDITION_DAILY_QUEST_DONE
Definition: ConditionMgr.h:104
@ CONDITION_ACTIVE_EVENT
Definition: ConditionMgr.h:73
@ CONDITION_SPAWNMASK_DEPRECATED
Definition: ConditionMgr.h:80
@ CONDITION_INSTANCE_INFO
Definition: ConditionMgr.h:74
@ CONDITION_RELATION_TO
Definition: ConditionMgr.h:94
@ CONDITION_PRIVATE_OBJECT
Definition: ConditionMgr.h:118
@ CONDITION_STAND_STATE
Definition: ConditionMgr.h:103
@ CONDITION_DRUNKENSTATE
Definition: ConditionMgr.h:71
@ CONDITION_AURA
Definition: ConditionMgr.h:62
@ CONDITION_ACHIEVEMENT
Definition: ConditionMgr.h:78
@ CONDITION_OBJECT_ENTRY_GUID
Definition: ConditionMgr.h:112
@ CONDITION_PET_TYPE
Definition: ConditionMgr.h:106
@ CONDITION_DIFFICULTY_ID
Definition: ConditionMgr.h:110
@ CONDITION_DISTANCE_TO
Definition: ConditionMgr.h:96
@ CONDITION_SCENARIO_STEP
Definition: ConditionMgr.h:115
@ CONDITION_HP_VAL
Definition: ConditionMgr.h:98
@ CONDITION_BATTLE_PET_COUNT
Definition: ConditionMgr.h:114
@ CONDITION_GENDER
Definition: ConditionMgr.h:81
@ CONDITION_GAMEMASTER
Definition: ConditionMgr.h:111
@ CONDITION_TERRAIN_SWAP
Definition: ConditionMgr.h:102
@ CONDITION_REPUTATION_RANK
Definition: ConditionMgr.h:66
@ CONDITION_HP_PCT
Definition: ConditionMgr.h:99
@ CONDITION_QUEST_COMPLETE
Definition: ConditionMgr.h:89
@ CONDITION_MAX
Definition: ConditionMgr.h:120
@ CONDITION_SPELL
Definition: ConditionMgr.h:86
@ CONDITION_ZONEID
Definition: ConditionMgr.h:65
@ CONDITION_OBJECT_ENTRY_GUID_LEGACY
Definition: ConditionMgr.h:92
@ CONDITION_CHARMED
Definition: ConditionMgr.h:105
@ CONDITION_TYPE_MASK
Definition: ConditionMgr.h:113
@ CONDITION_AREAID
Definition: ConditionMgr.h:84
@ CONDITION_IN_WATER
Definition: ConditionMgr.h:101
@ CONDITION_ITEM
Definition: ConditionMgr.h:63
@ CONDITION_WORLD_STATE
Definition: ConditionMgr.h:72
@ CONDITION_CLASS
Definition: ConditionMgr.h:76
@ CONDITION_TEAM
Definition: ConditionMgr.h:67
@ CONDITION_NONE
Definition: ConditionMgr.h:61
@ CONDITION_QUEST_NONE
Definition: ConditionMgr.h:75
@ CONDITION_QUESTSTATE
Definition: ConditionMgr.h:108
@ CONDITION_ITEM_EQUIPPED
Definition: ConditionMgr.h:64
@ CONDITION_SCENE_IN_PROGRESS
Definition: ConditionMgr.h:116
@ CONDITION_LEVEL
Definition: ConditionMgr.h:88
@ CONDITION_QUESTTAKEN
Definition: ConditionMgr.h:70
@ CONDITION_PLAYER_CONDITION
Definition: ConditionMgr.h:117
@ CONDITION_NEAR_CREATURE
Definition: ConditionMgr.h:90
@ CONDITION_TITLE
Definition: ConditionMgr.h:79
@ CONDITION_ALIVE
Definition: ConditionMgr.h:97
@ CONDITION_CREATURE_TYPE
Definition: ConditionMgr.h:85
@ CONDITION_TYPE_MASK_LEGACY
Definition: ConditionMgr.h:93
@ CONDITION_UNIT_STATE
Definition: ConditionMgr.h:82
RelationType
Definition: ConditionMgr.h:195
@ RELATION_IN_PARTY
Definition: ConditionMgr.h:197
@ RELATION_IN_RAID_OR_PARTY
Definition: ConditionMgr.h:198
@ RELATION_CREATED_BY
Definition: ConditionMgr.h:201
@ RELATION_MAX
Definition: ConditionMgr.h:202
@ RELATION_SELF
Definition: ConditionMgr.h:196
@ RELATION_PASSENGER_OF
Definition: ConditionMgr.h:200
@ RELATION_OWNED_BY
Definition: ConditionMgr.h:199
PlayerConditionLfgStatus
Definition: DBCEnums.h:1753
#define TC_GAME_API
Definition: Define.h:123
uint8_t uint8
Definition: Define.h:144
int64_t int64
Definition: Define.h:137
int32_t int32
Definition: Define.h:138
uint32_t uint32
Definition: Define.h:142
std::unordered_set< uint32 > SpellsUsedInSpellClickConditions
Definition: ConditionMgr.h:362
ConditionEntriesByTypeArray ConditionStore
Definition: ConditionMgr.h:360
Definition: Map.h:189
Definition: Unit.h:627
TC_COMMON_API char const * GetHash()
Definition: GitRevision.cpp:21
std::string ToString(Type &&val, Params &&... params)
bool operator==(ConditionId const &right) const =default
std::strong_ordering operator<=>(ConditionId const &right) const =default
Condition const * mLastFailedCondition
Definition: ConditionMgr.h:222
Map const * mConditionMap
Definition: ConditionMgr.h:221
uint32 SourceGroup
Definition: ConditionMgr.h:247
ConditionTypes ConditionType
Definition: ConditionMgr.h:251
std::string ConditionStringValue1
Definition: ConditionMgr.h:255
bool isLoaded() const
Definition: ConditionMgr.h:284
uint32 ErrorType
Definition: ConditionMgr.h:256
uint32 SourceId
Definition: ConditionMgr.h:249
int32 SourceEntry
Definition: ConditionMgr.h:248
uint32 ElseGroup
Definition: ConditionMgr.h:250
uint32 ScriptId
Definition: ConditionMgr.h:259
bool NegativeCondition
Definition: ConditionMgr.h:261
ConditionSourceType SourceType
Definition: ConditionMgr.h:246
uint32 ConditionValue2
Definition: ConditionMgr.h:253
uint8 ConditionTarget
Definition: ConditionMgr.h:260
uint32 ReferenceId
Definition: ConditionMgr.h:258
uint32 ErrorTextId
Definition: ConditionMgr.h:257
uint32 ConditionValue3
Definition: ConditionMgr.h:254
uint32 ConditionValue1
Definition: ConditionMgr.h:252
bool Meets(WorldObject const *object1, WorldObject const *object2) const
Definition: ConditionMgr.h:376
std::weak_ptr< ConditionContainer > Conditions
Definition: ConditionMgr.h:397
bool IsEmpty() const
Definition: ConditionMgr.h:390
bool Meets(ConditionSourceInfo &sourceInfo) const
Definition: ConditionMgr.h:383
bool Meets(WorldObject const *object) const
Definition: ConditionMgr.h:369
std::size_t operator()(ConditionId const &id) const noexcept
Definition: ConditionMgr.h:241