TrinityCore
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
Condition Struct Reference

#include <ConditionMgr.h>

Public Member Functions

 Condition ()
 
bool Meets (ConditionSourceInfo &sourceInfo) const
 
uint32 GetSearcherTypeMaskForCondition () const
 
bool isLoaded () const
 
uint32 GetMaxAvailableConditionTargets () const
 
std::string ToString (bool ext=false) const
 

Public Attributes

ConditionSourceType SourceType
 
uint32 SourceGroup
 
int32 SourceEntry
 
uint32 SourceId
 
uint32 ElseGroup
 
ConditionTypes ConditionType
 
uint32 ConditionValue1
 
uint32 ConditionValue2
 
uint32 ConditionValue3
 
uint32 ErrorType
 
uint32 ErrorTextId
 
uint32 ReferenceId
 
uint32 ScriptId
 
uint8 ConditionTarget
 
bool NegativeCondition
 

Constructor & Destructor Documentation

Condition::Condition ( )
inline
213  {
215  SourceGroup = 0;
216  SourceEntry = 0;
217  SourceId = 0;
218  ElseGroup = 0;
220  ConditionTarget = 0;
221  ConditionValue1 = 0;
222  ConditionValue2 = 0;
223  ConditionValue3 = 0;
224  ReferenceId = 0;
225  ErrorType = 0;
226  ErrorTextId = 0;
227  ScriptId = 0;
228  NegativeCondition = false;
229  }
uint32 ElseGroup
Definition: ConditionMgr.h:200
int32 SourceEntry
Definition: ConditionMgr.h:198
uint32 SourceId
Definition: ConditionMgr.h:199
uint32 ErrorTextId
Definition: ConditionMgr.h:206
uint32 ErrorType
Definition: ConditionMgr.h:205
uint32 SourceGroup
Definition: ConditionMgr.h:197
uint8 ConditionTarget
Definition: ConditionMgr.h:209
Definition: ConditionMgr.h:51
uint32 ConditionValue3
Definition: ConditionMgr.h:204
bool NegativeCondition
Definition: ConditionMgr.h:210
uint32 ConditionValue2
Definition: ConditionMgr.h:203
Definition: ConditionMgr.h:127
uint32 ScriptId
Definition: ConditionMgr.h:208
uint32 ConditionValue1
Definition: ConditionMgr.h:202
uint32 ReferenceId
Definition: ConditionMgr.h:207
ConditionTypes ConditionType
Definition: ConditionMgr.h:201
ConditionSourceType SourceType
Definition: ConditionMgr.h:196

Member Function Documentation

uint32 Condition::GetMaxAvailableConditionTargets ( ) const
629 {
630  // returns number of targets which are available for given source type
631  switch (SourceType)
632  {
643  return 2;
644  default:
645  return 1;
646  }
647 }
Definition: ConditionMgr.h:150
Definition: ConditionMgr.h:151
Definition: ConditionMgr.h:145
Definition: ConditionMgr.h:142
Definition: ConditionMgr.h:149
Definition: ConditionMgr.h:141
Definition: ConditionMgr.h:144
Definition: ConditionMgr.h:140
Definition: ConditionMgr.h:148
ConditionSourceType SourceType
Definition: ConditionMgr.h:196

+ Here is the caller graph for this function:

uint32 Condition::GetSearcherTypeMaskForCondition ( ) const
459 {
460  // build mask of types for which condition can return true
461  // this is used for speeding up gridsearches
462  if (NegativeCondition)
463  return (GRID_MAP_TYPE_MASK_ALL);
464  uint32 mask = 0;
465  switch (ConditionType)
466  {
467  case CONDITION_NONE:
468  mask |= GRID_MAP_TYPE_MASK_ALL;
469  break;
470  case CONDITION_AURA:
472  break;
473  case CONDITION_ITEM:
475  break;
478  break;
479  case CONDITION_ZONEID:
480  mask |= GRID_MAP_TYPE_MASK_ALL;
481  break;
484  break;
487  break;
488  case CONDITION_TEAM:
490  break;
491  case CONDITION_CLASS:
493  break;
494  case CONDITION_RACE:
496  break;
497  case CONDITION_SKILL:
499  break;
502  break;
505  break;
508  break;
511  break;
513  mask |= GRID_MAP_TYPE_MASK_ALL;
514  break;
516  mask |= GRID_MAP_TYPE_MASK_ALL;
517  break;
518  case CONDITION_MAPID:
519  mask |= GRID_MAP_TYPE_MASK_ALL;
520  break;
521  case CONDITION_AREAID:
522  mask |= GRID_MAP_TYPE_MASK_ALL;
523  break;
524  case CONDITION_SPELL:
526  break;
527  case CONDITION_LEVEL:
529  break;
532  break;
534  mask |= GRID_MAP_TYPE_MASK_ALL;
535  break;
537  mask |= GRID_MAP_TYPE_MASK_ALL;
538  break;
540  switch (ConditionValue1)
541  {
542  case TYPEID_UNIT:
544  break;
545  case TYPEID_PLAYER:
547  break;
548  case TYPEID_GAMEOBJECT:
550  break;
551  case TYPEID_CORPSE:
553  break;
554  case TYPEID_AREATRIGGER:
556  break;
557  default:
558  break;
559  }
560  break;
561  case CONDITION_TYPE_MASK:
572  break;
575  break;
578  break;
580  mask |= GRID_MAP_TYPE_MASK_ALL;
581  break;
582  case CONDITION_ALIVE:
584  break;
585  case CONDITION_HP_VAL:
587  break;
588  case CONDITION_HP_PCT:
590  break;
592  mask |= GRID_MAP_TYPE_MASK_ALL;
593  break;
594  case CONDITION_PHASEID:
595  mask |= GRID_MAP_TYPE_MASK_ALL;
596  break;
597  case CONDITION_TITLE:
599  break;
600  case CONDITION_SPAWNMASK:
601  mask |= GRID_MAP_TYPE_MASK_ALL;
602  break;
603  case CONDITION_GENDER:
605  break;
608  break;
611  break;
613  mask |= GRID_MAP_TYPE_MASK_ALL;
614  break;
615  case CONDITION_IN_WATER:
617  break;
619  mask |= GRID_MAP_TYPE_MASK_ALL;
620  break;
621  default:
622  ASSERT(false && "Condition::GetSearcherTypeMaskForCondition - missing condition handling!");
623  break;
624  }
625  return mask;
626 }
Definition: ConditionMgr.h:67
Definition: ConditionMgr.h:55
Definition: GridDefines.h:78
Definition: ConditionMgr.h:81
Definition: GridDefines.h:79
Definition: ObjectGuid.h:50
Definition: ConditionMgr.h:52
Definition: ConditionMgr.h:83
Definition: ObjectGuid.h:36
Definition: ConditionMgr.h:69
Definition: ConditionMgr.h:75
Definition: ConditionMgr.h:59
Definition: ConditionMgr.h:85
Definition: ConditionMgr.h:91
Definition: ConditionMgr.h:62
Definition: ConditionMgr.h:72
Definition: ConditionMgr.h:92
Definition: ConditionMgr.h:76
Definition: ObjectGuid.h:32
Definition: ConditionMgr.h:56
Definition: GridDefines.h:77
Definition: ConditionMgr.h:80
Definition: ObjectGuid.h:49
Definition: GridDefines.h:76
Definition: ObjectGuid.h:51
Definition: ConditionMgr.h:70
Definition: ConditionMgr.h:54
Definition: ObjectGuid.h:37
Definition: ConditionMgr.h:61
Definition: ConditionMgr.h:73
Definition: ObjectGuid.h:34
Definition: ConditionMgr.h:64
uint32_t uint32
Definition: Define.h:150
Definition: ConditionMgr.h:66
Definition: ConditionMgr.h:51
Definition: ConditionMgr.h:78
Definition: ConditionMgr.h:58
Definition: ConditionMgr.h:57
bool NegativeCondition
Definition: ConditionMgr.h:210
Definition: ConditionMgr.h:90
Definition: ConditionMgr.h:87
Definition: ObjectGuid.h:33
uint32 ConditionValue1
Definition: ConditionMgr.h:202
Definition: ConditionMgr.h:77
Definition: ConditionMgr.h:71
Definition: ObjectGuid.h:54
#define ASSERT
Definition: Errors.h:55
Definition: ConditionMgr.h:86
Definition: GridDefines.h:74
Definition: ConditionMgr.h:79
Definition: ConditionMgr.h:63
Definition: ObjectGuid.h:53
Definition: ConditionMgr.h:88
Definition: ConditionMgr.h:74
ConditionTypes ConditionType
Definition: ConditionMgr.h:201
Definition: ConditionMgr.h:84
Definition: GridDefines.h:73
Definition: ConditionMgr.h:89
Definition: ConditionMgr.h:60
Definition: ConditionMgr.h:53
Definition: ConditionMgr.h:68
Definition: ConditionMgr.h:82
Definition: ConditionMgr.h:65
bool Condition::isLoaded ( ) const
inline
Definition: ConditionMgr.h:51
uint32 ReferenceId
Definition: ConditionMgr.h:207
ConditionTypes ConditionType
Definition: ConditionMgr.h:201

+ Here is the caller graph for this function:

bool Condition::Meets ( ConditionSourceInfo sourceInfo) const
112 {
114  WorldObject* object = sourceInfo.mConditionTargets[ConditionTarget];
115  // object not present, return false
116  if (!object)
117  {
118  TC_LOG_DEBUG("condition", "Condition object not found for %s", ToString().c_str());
119  return false;
120  }
121  bool condMeets = false;
122  switch (ConditionType)
123  {
124  case CONDITION_NONE:
125  condMeets = true; // empty condition, always met
126  break;
127  case CONDITION_AURA:
128  {
129  if (Unit* unit = object->ToUnit())
130  condMeets = unit->HasAuraEffect(ConditionValue1, ConditionValue2);
131  break;
132  }
133  case CONDITION_ITEM:
134  {
135  if (Player* player = object->ToPlayer())
136  {
137  // don't allow 0 items (it's checked during table load)
139  bool checkBank = ConditionValue3 ? true : false;
140  condMeets = player->HasItemCount(ConditionValue1, ConditionValue2, checkBank);
141  }
142  break;
143  }
145  {
146  if (Player* player = object->ToPlayer())
147  condMeets = player->HasItemOrGemWithIdEquipped(ConditionValue1, 1);
148  break;
149  }
150  case CONDITION_ZONEID:
151  condMeets = object->GetZoneId() == ConditionValue1;
152  break;
154  {
155  if (Player* player = object->ToPlayer())
156  {
157  if (FactionEntry const* faction = sFactionStore.LookupEntry(ConditionValue1))
158  condMeets = (ConditionValue2 & (1 << player->GetReputationMgr().GetRank(faction))) != 0;
159  }
160  break;
161  }
163  {
164  if (Player* player = object->ToPlayer())
165  condMeets = player->HasAchieved(ConditionValue1);
166  break;
167  }
168  case CONDITION_TEAM:
169  {
170  if (Player* player = object->ToPlayer())
171  condMeets = player->GetTeam() == ConditionValue1;
172  break;
173  }
174  case CONDITION_CLASS:
175  {
176  if (Unit* unit = object->ToUnit())
177  condMeets = (unit->getClassMask() & ConditionValue1) != 0;
178  break;
179  }
180  case CONDITION_RACE:
181  {
182  if (Unit* unit = object->ToUnit())
183  condMeets = (unit->getRaceMask() & ConditionValue1) != 0;
184  break;
185  }
186  case CONDITION_GENDER:
187  {
188  if (Player* player = object->ToPlayer())
189  condMeets = player->getGender() == ConditionValue1;
190  break;
191  }
192  case CONDITION_SKILL:
193  {
194  if (Player* player = object->ToPlayer())
195  condMeets = player->HasSkill(ConditionValue1) && player->GetBaseSkillValue(ConditionValue1) >= ConditionValue2;
196  break;
197  }
199  {
200  if (Player* player = object->ToPlayer())
201  condMeets = player->GetQuestRewardStatus(ConditionValue1);
202  break;
203  }
205  {
206  if (Player* player = object->ToPlayer())
207  {
208  QuestStatus status = player->GetQuestStatus(ConditionValue1);
209  condMeets = (status == QUEST_STATUS_INCOMPLETE);
210  }
211  break;
212  }
214  {
215  if (Player* player = object->ToPlayer())
216  {
217  QuestStatus status = player->GetQuestStatus(ConditionValue1);
218  condMeets = (status == QUEST_STATUS_COMPLETE && !player->GetQuestRewardStatus(ConditionValue1));
219  }
220  break;
221  }
223  {
224  if (Player* player = object->ToPlayer())
225  {
226  QuestStatus status = player->GetQuestStatus(ConditionValue1);
227  condMeets = (status == QUEST_STATUS_NONE);
228  }
229  break;
230  }
232  condMeets = sGameEventMgr->IsActiveEvent(ConditionValue1);
233  break;
235  {
236  Map* map = object->GetMap();
237  if (map->IsDungeon())
238  {
239  if (InstanceScript const* instance = ((InstanceMap*)map)->GetInstanceScript())
240  {
241  switch (ConditionValue3)
242  {
243  case INSTANCE_INFO_DATA:
244  condMeets = instance->GetData(ConditionValue1) == ConditionValue2;
245  break;
246  //case INSTANCE_INFO_GUID_DATA:
247  // condMeets = instance->GetGuidData(ConditionValue1) == ObjectGuid(uint64(ConditionValue2));
248  // break;
250  condMeets = instance->GetBossState(ConditionValue1) == EncounterState(ConditionValue2);
251  break;
253  condMeets = instance->GetData64(ConditionValue1) == ConditionValue2;
254  break;
255  }
256  }
257  }
258  break;
259  }
260  case CONDITION_MAPID:
261  condMeets = object->GetMapId() == ConditionValue1;
262  break;
263  case CONDITION_AREAID:
264  condMeets = object->GetAreaId() == ConditionValue1;
265  break;
266  case CONDITION_SPELL:
267  {
268  if (Player* player = object->ToPlayer())
269  condMeets = player->HasSpell(ConditionValue1);
270  break;
271  }
272  case CONDITION_LEVEL:
273  {
274  if (Unit* unit = object->ToUnit())
275  condMeets = CompareValues(static_cast<ComparisionType>(ConditionValue2), static_cast<uint32>(unit->getLevel()), ConditionValue1);
276  break;
277  }
279  {
280  if (Player* player = object->ToPlayer())
281  condMeets = (uint32)Player::GetDrunkenstateByValue(player->GetDrunkValue()) >= ConditionValue1;
282  break;
283  }
285  {
286  condMeets = GetClosestCreatureWithEntry(object, ConditionValue1, (float)ConditionValue2, bool(!ConditionValue3)) ? true : false;
287  break;
288  }
290  {
291  condMeets = GetClosestGameObjectWithEntry(object, ConditionValue1, (float)ConditionValue2) ? true : false;
292  break;
293  }
295  {
296  if (uint32(object->GetTypeId()) == ConditionValue1)
297  {
298  condMeets = !ConditionValue2 || (object->GetEntry() == ConditionValue2);
299 
300  if (ConditionValue3)
301  {
302  switch (object->GetTypeId())
303  {
304  case TYPEID_UNIT:
305  condMeets &= object->ToCreature()->GetSpawnId() == ConditionValue3;
306  break;
307  case TYPEID_GAMEOBJECT:
308  condMeets &= object->ToGameObject()->GetSpawnId() == ConditionValue3;
309  break;
310  default:
311  break;
312  }
313  }
314  }
315  break;
316  }
317  case CONDITION_TYPE_MASK:
318  {
319  condMeets = object->isType(ConditionValue1);
320  break;
321  }
323  {
324  if (WorldObject* toObject = sourceInfo.mConditionTargets[ConditionValue1])
325  {
326  Unit* toUnit = toObject->ToUnit();
327  Unit* unit = object->ToUnit();
328  if (toUnit && unit)
329  {
330  switch (static_cast<RelationType>(ConditionValue2))
331  {
332  case RELATION_SELF:
333  condMeets = unit == toUnit;
334  break;
335  case RELATION_IN_PARTY:
336  condMeets = unit->IsInPartyWith(toUnit);
337  break;
339  condMeets = unit->IsInRaidWith(toUnit);
340  break;
341  case RELATION_OWNED_BY:
342  condMeets = unit->GetOwnerGUID() == toUnit->GetGUID();
343  break;
345  condMeets = unit->IsOnVehicle(toUnit);
346  break;
347  case RELATION_CREATED_BY:
348  condMeets = unit->GetCreatorGUID() == toUnit->GetGUID();
349  break;
350  default:
351  break;
352  }
353  }
354  }
355  break;
356  }
358  {
359  if (WorldObject* toObject = sourceInfo.mConditionTargets[ConditionValue1])
360  {
361  Unit* toUnit = toObject->ToUnit();
362  Unit* unit = object->ToUnit();
363  if (toUnit && unit)
364  condMeets = ((1 << unit->GetReactionTo(toUnit)) & ConditionValue2) != 0;
365  }
366  break;
367  }
369  {
370  if (WorldObject* toObject = sourceInfo.mConditionTargets[ConditionValue1])
371  condMeets = CompareValues(static_cast<ComparisionType>(ConditionValue3), object->GetDistance(toObject), static_cast<float>(ConditionValue2));
372  break;
373  }
374  case CONDITION_ALIVE:
375  {
376  if (Unit* unit = object->ToUnit())
377  condMeets = unit->IsAlive();
378  break;
379  }
380  case CONDITION_HP_VAL:
381  {
382  if (Unit* unit = object->ToUnit())
383  condMeets = CompareValues(static_cast<ComparisionType>(ConditionValue2), unit->GetHealth(), static_cast<uint32>(ConditionValue1));
384  break;
385  }
386  case CONDITION_HP_PCT:
387  {
388  if (Unit* unit = object->ToUnit())
389  condMeets = CompareValues(static_cast<ComparisionType>(ConditionValue2), unit->GetHealthPct(), static_cast<float>(ConditionValue1));
390  break;
391  }
393  {
394  condMeets = ConditionValue2 == sWorld->getWorldState(ConditionValue1);
395  break;
396  }
397  case CONDITION_PHASEID:
398  {
399  condMeets = object->IsInPhase(ConditionValue1);
400  break;
401  }
402  case CONDITION_TITLE:
403  {
404  if (Player* player = object->ToPlayer())
405  condMeets = player->HasTitle(ConditionValue1);
406  break;
407  }
408  case CONDITION_SPAWNMASK:
409  {
410  condMeets = ((1 << object->GetMap()->GetSpawnMode()) & ConditionValue1) != 0;
411  break;
412  }
414  {
415  if (Unit* unit = object->ToUnit())
416  condMeets = unit->HasUnitState(ConditionValue1);
417  break;
418  }
420  {
421  if (Creature* creature = object->ToCreature())
422  condMeets = creature->GetCreatureTemplate()->type == ConditionValue1;
423  break;
424  }
426  {
427  AchievementEntry const* achievement = sAchievementMgr->GetAchievement(ConditionValue1);
428  if (achievement && sAchievementMgr->IsRealmCompleted(achievement, std::numeric_limits<uint32>::max()))
429  condMeets = true;
430  break;
431  }
432  case CONDITION_IN_WATER:
433  {
434  if (Unit* unit = object->ToUnit())
435  condMeets = unit->IsInWater();
436  break;
437  }
439  {
440  condMeets = object->IsInTerrainSwap(ConditionValue1);
441  break;
442  }
443  default:
444  condMeets = false;
445  break;
446  }
447 
448  if (NegativeCondition)
449  condMeets = !condMeets;
450 
451  if (!condMeets)
452  sourceInfo.mLastFailedCondition = this;
453 
454  bool script = sScriptMgr->OnConditionCheck(this, sourceInfo); // Returns true by default.
455  return condMeets && script;
456 }
Definition: ConditionMgr.h:67
Definition: ConditionMgr.h:173
Definition: ConditionMgr.h:55
Definition: QuestDef.h:111
Definition: ConditionMgr.h:81
bool IsOnVehicle(const Unit *vehicle) const
Definition: Unit.cpp:14336
ReputationRank GetReactionTo(Unit const *target) const
Definition: Unit.cpp:7035
bool CompareValues(ComparisionType type, T val1, T val2)
Definition: Util.h:513
Definition: ConditionMgr.h:52
Definition: ConditionMgr.h:83
Definition: ConditionMgr.h:69
Definition: ConditionMgr.h:75
TC_GAME_API Creature * GetClosestCreatureWithEntry(WorldObject *source, uint32 entry, float maxSearchRange, bool alive)
Definition: ScriptedCreature.cpp:611
Definition: ConditionMgr.h:59
Definition: ConditionMgr.h:162
Definition: ConditionMgr.h:85
bool IsInPartyWith(Unit const *unit) const
Definition: Unit.cpp:14372
Definition: ConditionMgr.h:91
Definition: ConditionMgr.h:62
Definition: ConditionMgr.h:72
Definition: ConditionMgr.h:92
QuestStatus
Definition: QuestDef.h:108
Definition: ConditionMgr.h:76
Definition: ObjectGuid.h:32
bool IsDungeon() const
Definition: Map.h:395
Definition: ConditionMgr.h:172
#define TC_LOG_DEBUG(filterType__,...)
Definition: Log.h:198
Definition: Object.h:423
Definition: Creature.h:467
EncounterState
Definition: InstanceScript.h:56
#define sWorld
Definition: World.h:887
Definition: ConditionMgr.h:56
Definition: QuestDef.h:110
Definition: ConditionMgr.h:80
T max(const T &x, const T &y)
Definition: g3dmath.h:320
Player * ToPlayer()
Definition: Object.h:191
TypeID GetTypeId() const
Definition: Object.h:113
Definition: Map.h:758
Definition: ConditionMgr.h:70
Definition: ConditionMgr.h:54
Definition: DB2Structure.h:27
float GetDistance(WorldObject const *obj) const
Definition: Object.cpp:1594
Definition: ConditionMgr.h:163
bool IsAlive() const
Definition: Unit.h:1692
Definition: ConditionMgr.h:61
std::string ToString(bool ext=false) const
Definition: ConditionMgr.cpp:649
Definition: ConditionMgr.h:73
Definition: ObjectGuid.h:34
uint8 ConditionTarget
Definition: ConditionMgr.h:209
Definition: ConditionMgr.h:64
uint32_t uint32
Definition: Define.h:150
Definition: ConditionMgr.h:66
Definition: ConditionMgr.h:159
Definition: ConditionMgr.h:51
Definition: ConditionMgr.h:78
Definition: ConditionMgr.h:58
uint32 ConditionValue3
Definition: ConditionMgr.h:204
Definition: ConditionMgr.h:57
Definition: Map.h:259
Definition: ConditionMgr.h:161
bool NegativeCondition
Definition: ConditionMgr.h:210
Definition: ConditionMgr.h:90
uint32 ConditionValue2
Definition: ConditionMgr.h:203
Definition: DBCStructure.h:405
Definition: ConditionMgr.h:87
ObjectGuid const & GetGUID() const
Definition: Object.h:105
#define sGameEventMgr
Definition: GameEventMgr.h:184
ObjectGuid GetCreatorGUID() const
Definition: Unit.h:1700
uint32 ConditionValue1
Definition: ConditionMgr.h:202
Definition: ConditionMgr.h:77
Creature * ToCreature()
Definition: Object.h:194
Definition: ConditionMgr.h:71
Definition: QuestDef.h:113
virtual bool IsInWater() const
Definition: Unit.cpp:2964
Definition: InstanceScript.h:141
bool HasUnitState(const uint32 f) const
Definition: Unit.h:1395
#define ASSERT
Definition: Errors.h:55
Definition: ConditionMgr.h:86
Definition: ConditionMgr.h:79
DBCStorage< FactionEntry > sFactionStore(Factionfmt)
#define sScriptMgr
Definition: ScriptMgr.h:837
WorldObject * mConditionTargets[MAX_CONDITION_TARGETS]
Definition: ConditionMgr.h:183
uint32_t uint32
Definition: g3dmath.h:168
Definition: ConditionMgr.h:160
Definition: ConditionMgr.h:164
Definition: ConditionMgr.h:63
ObjectGuid GetOwnerGUID() const
Definition: Unit.h:1698
bool IsInRaidWith(Unit const *unit) const
Definition: Unit.cpp:14391
uint32 GetHealth() const
Definition: Unit.h:1426
Definition: ConditionMgr.h:170
Definition: ConditionMgr.h:88
Definition: Unit.h:1305
Definition: ConditionMgr.h:178
Definition: ConditionMgr.h:74
TC_GAME_API GameObject * GetClosestGameObjectWithEntry(WorldObject *source, uint32 entry, float maxSearchRange)
Definition: ScriptedCreature.cpp:616
Unit * ToUnit()
Definition: Object.h:197
ConditionTypes ConditionType
Definition: ConditionMgr.h:201
Definition: ConditionMgr.h:84
#define sAchievementMgr
Definition: AchievementMgr.h:501
Definition: ConditionMgr.h:89
Condition const * mLastFailedCondition
Definition: ConditionMgr.h:184
Definition: ConditionMgr.h:60
float GetHealthPct() const
Definition: Unit.h:1434
Definition: ConditionMgr.h:53
Definition: ConditionMgr.h:68
Definition: ConditionMgr.h:82
Definition: ConditionMgr.h:65

+ Here is the call graph for this function:

std::string Condition::ToString ( bool  ext = false) const
650 {
651  std::ostringstream ss;
652  ss << "[Condition ";
653  ss << "SourceType: " << SourceType;
654  if (SourceType < CONDITION_SOURCE_TYPE_MAX)
655  ss << " (" << ConditionMgr::StaticSourceTypeData[SourceType] << ")";
656  else
657  ss << " (Unknown)";
658  if (ConditionMgr::CanHaveSourceGroupSet(SourceType))
659  ss << ", SourceGroup: " << SourceGroup;
660  ss << ", SourceEntry: " << SourceEntry;
661  if (ConditionMgr::CanHaveSourceIdSet(SourceType))
662  ss << ", SourceId: " << SourceId;
663 
664  if (ext)
665  {
666  ss << ", ConditionType: " << ConditionType;
667  if (ConditionType < CONDITION_MAX)
669  else
670  ss << " (Unknown)";
671  }
672 
673  ss << "]";
674  return ss.str();
675 }
static ConditionTypeInfo const StaticConditionTypeData[CONDITION_MAX]
Definition: ConditionMgr.h:283
int32 SourceEntry
Definition: ConditionMgr.h:198
uint32 SourceId
Definition: ConditionMgr.h:199
Definition: ConditionMgr.h:93
uint32 SourceGroup
Definition: ConditionMgr.h:197
Definition: ConditionMgr.h:154
static bool CanHaveSourceGroupSet(ConditionSourceType sourceType)
Definition: ConditionMgr.cpp:791
static bool CanHaveSourceIdSet(ConditionSourceType sourceType)
Definition: ConditionMgr.cpp:815
static char const *const StaticSourceTypeData[CONDITION_SOURCE_TYPE_MAX]
Definition: ConditionMgr.h:282
ConditionTypes ConditionType
Definition: ConditionMgr.h:201
ConditionSourceType SourceType
Definition: ConditionMgr.h:196
char const * Name
Definition: ConditionMgr.h:277

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

Member Data Documentation

uint8 Condition::ConditionTarget
ConditionTypes Condition::ConditionType
uint32 Condition::ConditionValue1
uint32 Condition::ConditionValue2
uint32 Condition::ConditionValue3
uint32 Condition::ElseGroup
uint32 Condition::ErrorTextId
uint32 Condition::ErrorType
bool Condition::NegativeCondition
uint32 Condition::ReferenceId
uint32 Condition::ScriptId
int32 Condition::SourceEntry
uint32 Condition::SourceGroup
uint32 Condition::SourceId
ConditionSourceType Condition::SourceType

The documentation for this struct was generated from the following files: