![]() |
TrinityCore
|
#include <ConditionMgr.h>
Classes | |
| struct | ConditionTypeInfo |
Static Public Member Functions | |
| static ConditionMgr * | instance () |
| static bool | CanHaveSourceGroupSet (ConditionSourceType sourceType) |
| static bool | CanHaveSourceIdSet (ConditionSourceType sourceType) |
Static Public Attributes | |
| static char const *const | StaticSourceTypeData [CONDITION_SOURCE_TYPE_MAX] |
| static ConditionTypeInfo const | StaticConditionTypeData [CONDITION_MAX] |
Private Member Functions | |
| ConditionMgr () | |
| ~ConditionMgr () | |
| bool | isSourceTypeValid (Condition *cond) const |
| bool | addToLootTemplate (Condition *cond, LootTemplate *loot) const |
| bool | addToGossipMenus (Condition *cond) const |
| bool | addToGossipMenuItems (Condition *cond) const |
| bool | addToSpellImplicitTargetConditions (Condition *cond) const |
| bool | IsObjectMeetToConditionList (ConditionSourceInfo &sourceInfo, ConditionContainer const &conditions) const |
| void | Clean () |
Static Private Member Functions | |
| static void | LogUselessConditionValue (Condition const *cond, uint8 index, uint32 value) |
| static void | LogUselessConditionValue (Condition const *cond, uint8 index, std::string_view value) |
Definition at line 267 of file ConditionMgr.h.
|
private |
Definition at line 839 of file ConditionMgr.cpp.
|
private |
Definition at line 841 of file ConditionMgr.cpp.
References Clean().
|
private |
Definition at line 1393 of file ConditionMgr.cpp.
References sObjectMgr, Condition::SourceEntry, Condition::SourceGroup, TC_LOG_ERROR, and Condition::ToString().
Referenced by LoadConditions().
|
private |
Definition at line 1373 of file ConditionMgr.cpp.
References sObjectMgr, Condition::SourceEntry, Condition::SourceGroup, TC_LOG_ERROR, and Condition::ToString().
Referenced by LoadConditions().
|
private |
Definition at line 1358 of file ConditionMgr.cpp.
References LootTemplate::addConditionItem(), Condition::SourceEntry, Condition::SourceGroup, TC_LOG_ERROR, and Condition::ToString().
Referenced by LoadConditions().
|
private |
Definition at line 1412 of file ConditionMgr.cpp.
References CONDITION_OBJECT_ENTRY_GUID, Condition::ConditionType, Condition::ConditionValue1, SpellInfo::GetEffect(), SpellInfo::GetEffects(), GetTargetFlagMask(), SpellInfo::Id, SpellEffectInfo::ImplicitTargetConditions, Condition::SourceEntry, Condition::SourceGroup, sSpellMgr, TARGET_FLAG_CORPSE_MASK, TARGET_FLAG_GAMEOBJECT_MASK, TARGET_FLAG_UNIT_MASK, TC_LOG_ERROR, Condition::ToString(), TYPEID_CORPSE, TYPEID_GAMEOBJECT, TYPEID_PLAYER, and TYPEID_UNIT.
Referenced by LoadConditions().
|
static |
Definition at line 953 of file ConditionMgr.cpp.
References CONDITION_SOURCE_TYPE_CREATURE_LOOT_TEMPLATE, CONDITION_SOURCE_TYPE_DISENCHANT_LOOT_TEMPLATE, CONDITION_SOURCE_TYPE_FISHING_LOOT_TEMPLATE, CONDITION_SOURCE_TYPE_GAMEOBJECT_LOOT_TEMPLATE, CONDITION_SOURCE_TYPE_GOSSIP_MENU, CONDITION_SOURCE_TYPE_GOSSIP_MENU_OPTION, CONDITION_SOURCE_TYPE_ITEM_LOOT_TEMPLATE, CONDITION_SOURCE_TYPE_MAIL_LOOT_TEMPLATE, CONDITION_SOURCE_TYPE_MILLING_LOOT_TEMPLATE, CONDITION_SOURCE_TYPE_NPC_VENDOR, CONDITION_SOURCE_TYPE_PICKPOCKETING_LOOT_TEMPLATE, CONDITION_SOURCE_TYPE_PROSPECTING_LOOT_TEMPLATE, CONDITION_SOURCE_TYPE_REFERENCE_LOOT_TEMPLATE, CONDITION_SOURCE_TYPE_SKINNING_LOOT_TEMPLATE, CONDITION_SOURCE_TYPE_SMART_EVENT, CONDITION_SOURCE_TYPE_SPELL_CLICK_EVENT, CONDITION_SOURCE_TYPE_SPELL_IMPLICIT_TARGET, CONDITION_SOURCE_TYPE_SPELL_LOOT_TEMPLATE, and CONDITION_SOURCE_TYPE_VEHICLE_SPELL.
Referenced by LoadConditions(), and Condition::ToString().
|
static |
Definition at line 976 of file ConditionMgr.cpp.
References CONDITION_SOURCE_TYPE_SMART_EVENT.
Referenced by LoadConditions(), and Condition::ToString().
|
private |
Definition at line 2480 of file ConditionMgr.cpp.
References AllocatedMemoryStore, CONDITION_SOURCE_TYPE_MAX, ConditionReferenceStore, ConditionStore, NpcVendorConditionContainerStore, SmartEventConditionStore, SpellClickEventConditionStore, SpellsUsedInSpellClickConditions, and VehicleSpellConditionStore.
Referenced by LoadConditions(), and ~ConditionMgr().
| ConditionContainer const * ConditionMgr::GetConditionsForSpellClickEvent | ( | uint32 | creatureId, |
| uint32 | spellId | ||
| ) | const |
Definition at line 1027 of file ConditionMgr.cpp.
References SpellClickEventConditionStore, and TC_LOG_DEBUG.
| uint32 ConditionMgr::GetSearcherTypeMaskForConditionList | ( | ConditionContainer const & | conditions | ) | const |
Definition at line 846 of file ConditionMgr.cpp.
References ASSERT, ConditionReferenceStore, GetSearcherTypeMaskForConditionList(), and GRID_MAP_TYPE_MASK_ALL.
Referenced by GetSearcherTypeMaskForConditionList().
| bool ConditionMgr::HasConditionsForNotGroupedEntry | ( | ConditionSourceType | sourceType, |
| uint32 | entry | ||
| ) | const |
Definition at line 1002 of file ConditionMgr.cpp.
References CONDITION_SOURCE_TYPE_MAX, CONDITION_SOURCE_TYPE_NONE, and ConditionStore.
|
static |
| bool ConditionMgr::isConditionTypeValid | ( | Condition * | cond | ) | const |
Definition at line 1920 of file ConditionMgr.cpp.
References ALLIANCE, CLASSMASK_ALL_PLAYABLE, COMP_TYPE_MAX, CONDITION_ACHIEVEMENT, CONDITION_ACTIVE_EVENT, CONDITION_ALIVE, CONDITION_AREAID, CONDITION_AURA, CONDITION_BATTLE_PET_COUNT, CONDITION_CHARMED, CONDITION_CLASS, CONDITION_CREATURE_TYPE, CONDITION_DAILY_QUEST_DONE, CONDITION_DIFFICULTY_ID, CONDITION_DISTANCE_TO, CONDITION_DRUNKENSTATE, CONDITION_GAMEMASTER, CONDITION_GENDER, CONDITION_GROUP_STATUS, CONDITION_HP_PCT, CONDITION_HP_VAL, CONDITION_IN_WATER, CONDITION_INSTANCE_INFO, CONDITION_ITEM, CONDITION_ITEM_EQUIPPED, CONDITION_LABEL, CONDITION_LEVEL, CONDITION_MAPID, CONDITION_MAX, CONDITION_NEAR_CREATURE, CONDITION_NEAR_GAMEOBJECT, CONDITION_NONE, CONDITION_OBJECT_ENTRY_GUID, CONDITION_PET_TYPE, CONDITION_PHASEMASK, CONDITION_PLAYER_CONDITION, CONDITION_PRIVATE_OBJECT, CONDITION_QUEST_COMPLETE, CONDITION_QUEST_NONE, CONDITION_QUEST_OBJECTIVE_PROGRESS, CONDITION_QUESTREWARDED, CONDITION_QUESTSTATE, CONDITION_QUESTTAKEN, CONDITION_RACE, CONDITION_REACTION_TO, CONDITION_REALM_ACHIEVEMENT, CONDITION_RELATION_TO, CONDITION_REPUTATION_RANK, CONDITION_SCENARIO_STEP, CONDITION_SCENE_IN_PROGRESS, CONDITION_SKILL, CONDITION_SPAWNMASK, CONDITION_SPELL, CONDITION_STAND_STATE, CONDITION_STRING_ID, CONDITION_TAXI, CONDITION_TEAM, CONDITION_TERRAIN_SWAP, CONDITION_TITLE, CONDITION_TYPE_MASK, CONDITION_UNIT_STATE, CONDITION_WORLD_STATE, CONDITION_ZONEID, Condition::ConditionStringValue1, Condition::ConditionTarget, Condition::ConditionType, Condition::ConditionValue1, Condition::ConditionValue2, Condition::ConditionValue3, CREATURE_TYPE_GAS_CLOUD, creatureData, DRUNKEN_SMASHED, EFFECT_2, Condition::GetMaxAvailableConditionTargets(), ConditionMgr::ConditionTypeInfo::HasConditionStringValue1, ConditionMgr::ConditionTypeInfo::HasConditionValue1, ConditionMgr::ConditionTypeInfo::HasConditionValue2, ConditionMgr::ConditionTypeInfo::HasConditionValue3, HORDE, Player::IsValidGender(), LogUselessConditionValue(), MAX_DIFFICULTY, MAX_PET_TYPE, MAX_QUEST_STATUS, NotInGroupOrNotInRaid, AreaTableEntry::ParentAreaID, RACEMASK_ALL_PLAYABLE, RELATION_MAX, Quest::RequiredNpcOrGo, Quest::RequiredNpcOrGoCount, sAchievementStore, sAreaTableStore, sCharTitlesStore, sFactionStore, sGameEventMgr, sMapStore, sObjectMgr, SPAWNMASK_RAID_ALL, sSkillLineStore, sSpellMgr, StaticConditionTypeData, sWorld, TC_LOG_ERROR, Condition::ToString(), TYPEID_CORPSE, TYPEID_GAMEOBJECT, TYPEID_PLAYER, TYPEID_UNIT, TYPEMASK_CORPSE, TYPEMASK_GAMEOBJECT, TYPEMASK_PLAYER, TYPEMASK_UNIT, UNIT_STAND_STATE_SUBMERGED, and UNIT_STATE_ALL_STATE_SUPPORTED.
Referenced by LoadConditions().
| bool ConditionMgr::IsObjectMeetingNotGroupedConditions | ( | ConditionSourceType | sourceType, |
| uint32 | entry, | ||
| ConditionSourceInfo & | sourceInfo | ||
| ) | const |
Definition at line 981 of file ConditionMgr.cpp.
References CONDITION_SOURCE_TYPE_MAX, CONDITION_SOURCE_TYPE_NONE, ConditionStore, IsObjectMeetToConditions(), and TC_LOG_DEBUG.
Referenced by IsObjectMeetingNotGroupedConditions().
| bool ConditionMgr::IsObjectMeetingNotGroupedConditions | ( | ConditionSourceType | sourceType, |
| uint32 | entry, | ||
| WorldObject * | target0, | ||
| WorldObject * | target1 = nullptr, |
||
| WorldObject * | target2 = nullptr |
||
| ) | const |
Definition at line 996 of file ConditionMgr.cpp.
References IsObjectMeetingNotGroupedConditions().
| bool ConditionMgr::IsObjectMeetingSmartEventConditions | ( | int32 | entryOrGuid, |
| uint32 | eventId, | ||
| uint32 | sourceType, | ||
| Unit * | unit, | ||
| WorldObject * | baseObject | ||
| ) | const |
Definition at line 1058 of file ConditionMgr.cpp.
References IsObjectMeetToConditions(), SmartEventConditionStore, and TC_LOG_DEBUG.
| bool ConditionMgr::IsObjectMeetingSpellClickConditions | ( | uint32 | creatureId, |
| uint32 | spellId, | ||
| WorldObject * | clicker, | ||
| WorldObject * | target | ||
| ) | const |
Definition at line 1011 of file ConditionMgr.cpp.
References IsObjectMeetToConditions(), SpellClickEventConditionStore, and TC_LOG_DEBUG.
| bool ConditionMgr::IsObjectMeetingVehicleSpellConditions | ( | uint32 | creatureId, |
| uint32 | spellId, | ||
| Player * | player, | ||
| Unit * | vehicle | ||
| ) | const |
Definition at line 1042 of file ConditionMgr.cpp.
References IsObjectMeetToConditions(), TC_LOG_DEBUG, and VehicleSpellConditionStore.
| bool ConditionMgr::IsObjectMeetingVendorItemConditions | ( | uint32 | creatureId, |
| uint32 | itemId, | ||
| Player * | player, | ||
| Creature * | vendor | ||
| ) | const |
Definition at line 1074 of file ConditionMgr.cpp.
References IsObjectMeetToConditions(), NpcVendorConditionContainerStore, and TC_LOG_DEBUG.
|
private |
Find ElseGroup in ElseGroupStore
If not found, add an entry in the store and set to true (placeholder)
If another condition in this group was unmatched before this, don't bother checking (the group is false anyway)
Definition at line 886 of file ConditionMgr.cpp.
References ConditionReferenceStore, IsObjectMeetToConditionList(), and TC_LOG_DEBUG.
Referenced by IsObjectMeetToConditionList(), and IsObjectMeetToConditions().
| bool ConditionMgr::IsObjectMeetToConditions | ( | ConditionSourceInfo & | sourceInfo, |
| ConditionContainer const & | conditions | ||
| ) | const |
Definition at line 944 of file ConditionMgr.cpp.
References IsObjectMeetToConditionList(), and TC_LOG_DEBUG.
| bool ConditionMgr::IsObjectMeetToConditions | ( | WorldObject * | object, |
| ConditionContainer const & | conditions | ||
| ) | const |
Definition at line 932 of file ConditionMgr.cpp.
References IsObjectMeetToConditions().
Referenced by IsObjectMeetingNotGroupedConditions(), IsObjectMeetingSmartEventConditions(), IsObjectMeetingSpellClickConditions(), IsObjectMeetingVehicleSpellConditions(), IsObjectMeetingVendorItemConditions(), IsObjectMeetToConditions(), and IsObjectMeetToConditions().
| bool ConditionMgr::IsObjectMeetToConditions | ( | WorldObject * | object1, |
| WorldObject * | object2, | ||
| ConditionContainer const & | conditions | ||
| ) | const |
Definition at line 938 of file ConditionMgr.cpp.
References IsObjectMeetToConditions().
|
private |
Definition at line 1524 of file ConditionMgr.cpp.
References CONDITION_SOURCE_TYPE_AREATRIGGER, CONDITION_SOURCE_TYPE_AREATRIGGER_CLIENT_TRIGGERED, CONDITION_SOURCE_TYPE_CONVERSATION_LINE, CONDITION_SOURCE_TYPE_CREATURE_LOOT_TEMPLATE, CONDITION_SOURCE_TYPE_CREATURE_TEMPLATE_VEHICLE, CONDITION_SOURCE_TYPE_DISENCHANT_LOOT_TEMPLATE, CONDITION_SOURCE_TYPE_FISHING_LOOT_TEMPLATE, CONDITION_SOURCE_TYPE_GAMEOBJECT_LOOT_TEMPLATE, CONDITION_SOURCE_TYPE_GOSSIP_MENU, CONDITION_SOURCE_TYPE_GOSSIP_MENU_OPTION, CONDITION_SOURCE_TYPE_GRAVEYARD, CONDITION_SOURCE_TYPE_ITEM_LOOT_TEMPLATE, CONDITION_SOURCE_TYPE_MAIL_LOOT_TEMPLATE, CONDITION_SOURCE_TYPE_MAX, CONDITION_SOURCE_TYPE_MILLING_LOOT_TEMPLATE, CONDITION_SOURCE_TYPE_NONE, CONDITION_SOURCE_TYPE_NPC_VENDOR, CONDITION_SOURCE_TYPE_PHASE, CONDITION_SOURCE_TYPE_PICKPOCKETING_LOOT_TEMPLATE, CONDITION_SOURCE_TYPE_PROSPECTING_LOOT_TEMPLATE, CONDITION_SOURCE_TYPE_QUEST_AVAILABLE, CONDITION_SOURCE_TYPE_REFERENCE_LOOT_TEMPLATE, CONDITION_SOURCE_TYPE_SKINNING_LOOT_TEMPLATE, CONDITION_SOURCE_TYPE_SMART_EVENT, CONDITION_SOURCE_TYPE_SPELL, CONDITION_SOURCE_TYPE_SPELL_CLICK_EVENT, CONDITION_SOURCE_TYPE_SPELL_IMPLICIT_TARGET, CONDITION_SOURCE_TYPE_SPELL_LOOT_TEMPLATE, CONDITION_SOURCE_TYPE_SPELL_PROC, CONDITION_SOURCE_TYPE_TERRAIN_SWAP, CONDITION_SOURCE_TYPE_VEHICLE_SPELL, SpellInfo::GetEffects(), LootStore::GetLootForConditionFill(), LootStore::HaveLootFor(), LootTemplate::isReference(), LootTemplates_Creature, LootTemplates_Disenchant, LootTemplates_Fishing, LootTemplates_Gameobject, LootTemplates_Item, LootTemplates_Mail, LootTemplates_Milling, LootTemplates_Pickpocketing, LootTemplates_Prospecting, LootTemplates_Reference, LootTemplates_Skinning, LootTemplates_Spell, MAX_EFFECT_MASK, sAreaTriggerStore, sObjectMgr, Condition::SourceEntry, Condition::SourceGroup, Condition::SourceType, SPELL_EFFECT_APPLY_AREA_AURA_ENEMY, SPELL_EFFECT_APPLY_AREA_AURA_FRIEND, SPELL_EFFECT_APPLY_AREA_AURA_OWNER, SPELL_EFFECT_APPLY_AREA_AURA_PARTY, SPELL_EFFECT_APPLY_AREA_AURA_PET, SPELL_EFFECT_APPLY_AREA_AURA_RAID, SPELL_EFFECT_PERSISTENT_AREA_AURA, sSpellMgr, TARGET_SELECT_CATEGORY_AREA, TARGET_SELECT_CATEGORY_CONE, TARGET_SELECT_CATEGORY_NEARBY, TARGET_SELECT_CATEGORY_TRAJ, TC_LOG_ERROR, and Condition::ToString().
Referenced by LoadConditions().
| bool ConditionMgr::IsSpellUsedInSpellClickConditions | ( | uint32 | spellId | ) | const |
Definition at line 1090 of file ConditionMgr.cpp.
References SpellsUsedInSpellClickConditions.
| void ConditionMgr::LoadConditions | ( | bool | isReload = false | ) |
TODO: PAIR_32 ?
Definition at line 1101 of file ConditionMgr.cpp.
References addToGossipMenuItems(), addToGossipMenus(), addToLootTemplate(), addToSpellImplicitTargetConditions(), AllocatedMemoryStore, CanHaveSourceGroupSet(), CanHaveSourceIdSet(), Clean(), CONDITION_AURA, CONDITION_SOURCE_TYPE_CREATURE_LOOT_TEMPLATE, CONDITION_SOURCE_TYPE_DISENCHANT_LOOT_TEMPLATE, CONDITION_SOURCE_TYPE_FISHING_LOOT_TEMPLATE, CONDITION_SOURCE_TYPE_GAMEOBJECT_LOOT_TEMPLATE, CONDITION_SOURCE_TYPE_GOSSIP_MENU, CONDITION_SOURCE_TYPE_GOSSIP_MENU_OPTION, CONDITION_SOURCE_TYPE_ITEM_LOOT_TEMPLATE, CONDITION_SOURCE_TYPE_MAIL_LOOT_TEMPLATE, CONDITION_SOURCE_TYPE_MILLING_LOOT_TEMPLATE, CONDITION_SOURCE_TYPE_NPC_VENDOR, CONDITION_SOURCE_TYPE_PICKPOCKETING_LOOT_TEMPLATE, CONDITION_SOURCE_TYPE_PROSPECTING_LOOT_TEMPLATE, CONDITION_SOURCE_TYPE_REFERENCE_LOOT_TEMPLATE, CONDITION_SOURCE_TYPE_SKINNING_LOOT_TEMPLATE, CONDITION_SOURCE_TYPE_SMART_EVENT, CONDITION_SOURCE_TYPE_SPELL, CONDITION_SOURCE_TYPE_SPELL_CLICK_EVENT, CONDITION_SOURCE_TYPE_SPELL_IMPLICIT_TARGET, CONDITION_SOURCE_TYPE_SPELL_LOOT_TEMPLATE, CONDITION_SOURCE_TYPE_VEHICLE_SPELL, ConditionReferenceStore, ConditionStore, Condition::ConditionStringValue1, Condition::ConditionTarget, Condition::ConditionType, Condition::ConditionValue1, Condition::ConditionValue2, Condition::ConditionValue3, Condition::ElseGroup, Condition::ErrorTextId, Condition::ErrorType, Field::GetBool(), Field::GetInt32(), LootStore::GetLootForConditionFill(), getMSTime(), GetMSTimeDiffToNow(), Field::GetString(), Field::GetUInt32(), Field::GetUInt8(), isConditionTypeValid(), isSourceTypeValid(), LootTemplates_Creature, LootTemplates_Disenchant, LootTemplates_Fishing, LootTemplates_Gameobject, LootTemplates_Item, LootTemplates_Mail, LootTemplates_Milling, LootTemplates_Pickpocketing, LootTemplates_Prospecting, LootTemplates_Reference, LootTemplates_Skinning, LootTemplates_Spell, Condition::NegativeCondition, NpcVendorConditionContainerStore, Condition::ReferenceId, LootStore::ResetConditions(), Condition::ScriptId, SmartEventConditionStore, sObjectMgr, Condition::SourceEntry, Condition::SourceGroup, Condition::SourceId, Condition::SourceType, SpellClickEventConditionStore, SpellsUsedInSpellClickConditions, sSpellMgr, TC_LOG_ERROR, TC_LOG_INFO, Condition::ToString(), VehicleSpellConditionStore, and WorldDatabase.
|
staticprivate |
Definition at line 2475 of file ConditionMgr.cpp.
References TC_LOG_ERROR, and Condition::ToString().
|
staticprivate |
Definition at line 2470 of file ConditionMgr.cpp.
References TC_LOG_ERROR, and Condition::ToString().
Referenced by isConditionTypeValid().
|
private |
Definition at line 319 of file ConditionMgr.h.
Referenced by Clean(), and LoadConditions().
|
private |
Definition at line 322 of file ConditionMgr.h.
Referenced by Clean(), GetSearcherTypeMaskForConditionList(), IsObjectMeetToConditionList(), and LoadConditions().
|
private |
Definition at line 321 of file ConditionMgr.h.
Referenced by Clean(), HasConditionsForNotGroupedEntry(), IsObjectMeetingNotGroupedConditions(), and LoadConditions().
|
private |
Definition at line 325 of file ConditionMgr.h.
Referenced by Clean(), IsObjectMeetingVendorItemConditions(), and LoadConditions().
|
private |
Definition at line 326 of file ConditionMgr.h.
Referenced by Clean(), IsObjectMeetingSmartEventConditions(), and LoadConditions().
|
private |
Definition at line 324 of file ConditionMgr.h.
Referenced by Clean(), GetConditionsForSpellClickEvent(), IsObjectMeetingSpellClickConditions(), and LoadConditions().
|
private |
Definition at line 328 of file ConditionMgr.h.
Referenced by Clean(), IsSpellUsedInSpellClickConditions(), and LoadConditions().
|
static |
Definition at line 69 of file ConditionMgr.h.
Referenced by isConditionTypeValid(), and Condition::ToString().
|
static |
Definition at line 38 of file ConditionMgr.h.
Referenced by Condition::ToString().
|
private |
Definition at line 323 of file ConditionMgr.h.
Referenced by Clean(), IsObjectMeetingVehicleSpellConditions(), and LoadConditions().