Project SkyFire Core
SkyFire 5.4.8 server core API documentation
Loading...
Searching...
No Matches
ConditionMgr Class Reference

#include <ConditionMgr.h>

Public Member Functions

bool CanHaveSourceGroupSet (ConditionSourceType sourceType) const
bool CanHaveSourceIdSet (ConditionSourceType sourceType) const
ConditionList GetConditionReferences (uint32 refId)
ConditionList GetConditionsForNotGroupedEntry (ConditionSourceType sourceType, uint32 entry)
ConditionList GetConditionsForNpcVendorEvent (uint32 creatureId, uint32 itemId)
ConditionList GetConditionsForSmartEvent (int32 entryOrGuid, uint32 eventId, uint32 sourceType)
ConditionList GetConditionsForSpellClickEvent (uint32 creatureId, uint32 spellId)
ConditionList GetConditionsForVehicleSpell (uint32 creatureId, uint32 spellId)
uint32 GetSearcherTypeMaskForConditionList (ConditionList const &conditions)
bool isConditionTypeValid (Condition *cond)
bool IsObjectMeetToConditions (ConditionSourceInfo &sourceInfo, ConditionList const &conditions)
bool IsObjectMeetToConditions (WorldObject *object, ConditionList const &conditions)
bool IsObjectMeetToConditions (WorldObject *object1, WorldObject *object2, ConditionList const &conditions)
void LoadConditions (bool isReload=false)

Private Member Functions

bool addToGossipMenuItems (Condition *cond)
bool addToGossipMenus (Condition *cond)
bool addToLootTemplate (Condition *cond, LootTemplate *loot)
bool addToPhases (Condition *cond)
bool addToSpellImplicitTargetConditions (Condition *cond)
bool addToTerrainSwaps (Condition *cond)
void Clean ()
 ConditionMgr ()
bool IsObjectMeetToConditionList (ConditionSourceInfo &sourceInfo, ConditionList const &conditions)
bool isSourceTypeValid (Condition *cond)
 ~ConditionMgr ()

Private Attributes

std::list< Condition * > AllocatedMemoryStore
ConditionReferenceContainer ConditionReferenceStore
ConditionContainer ConditionStore
NpcVendorConditionContainer NpcVendorConditionContainerStore
SmartEventConditionContainer SmartEventConditionStore
CreatureSpellConditionContainer SpellClickEventConditionStore
CreatureSpellConditionContainer VehicleSpellConditionStore

Friends

class Skyfire::Singleton< ConditionMgr, Skyfire::NullMutex >

Detailed Description

Definition at line 214 of file ConditionMgr.h.

Constructor & Destructor Documentation

◆ ConditionMgr()

ConditionMgr::ConditionMgr ( )
private

Definition at line 518 of file ConditionMgr.cpp.

◆ ~ConditionMgr()

ConditionMgr::~ConditionMgr ( )
private

Definition at line 520 of file ConditionMgr.cpp.

References Clean().

Member Function Documentation

◆ addToGossipMenuItems()

bool ConditionMgr::addToGossipMenuItems ( Condition * cond)
private

Definition at line 1085 of file ConditionMgr.cpp.

References SF_LOG_ERROR, sObjectMgr, Condition::SourceEntry, and Condition::SourceGroup.

Referenced by LoadConditions().

◆ addToGossipMenus()

bool ConditionMgr::addToGossipMenus ( Condition * cond)
private

Definition at line 1065 of file ConditionMgr.cpp.

References SF_LOG_ERROR, sObjectMgr, Condition::SourceEntry, and Condition::SourceGroup.

Referenced by LoadConditions().

◆ addToLootTemplate()

bool ConditionMgr::addToLootTemplate ( Condition * cond,
LootTemplate * loot )
private

◆ addToPhases()

bool ConditionMgr::addToPhases ( Condition * cond)
private

◆ addToSpellImplicitTargetConditions()

bool ConditionMgr::addToSpellImplicitTargetConditions ( Condition * cond)
private

◆ addToTerrainSwaps()

bool ConditionMgr::addToTerrainSwaps ( Condition * cond)
private

Definition at line 1199 of file ConditionMgr.cpp.

References addToTerrainSwapStore(), SF_LOG_ERROR, sObjectMgr, and Condition::SourceEntry.

Referenced by LoadConditions().

◆ CanHaveSourceGroupSet()

◆ CanHaveSourceIdSet()

bool ConditionMgr::CanHaveSourceIdSet ( ConditionSourceType sourceType) const

Definition at line 664 of file ConditionMgr.cpp.

References CONDITION_SOURCE_TYPE_SMART_EVENT.

Referenced by LoadConditions().

◆ Clean()

◆ GetConditionReferences()

ConditionList ConditionMgr::GetConditionReferences ( uint32 refId)

Definition at line 525 of file ConditionMgr.cpp.

References ConditionReferenceStore.

◆ GetConditionsForNotGroupedEntry()

ConditionList ConditionMgr::GetConditionsForNotGroupedEntry ( ConditionSourceType sourceType,
uint32 entry )

◆ GetConditionsForNpcVendorEvent()

ConditionList ConditionMgr::GetConditionsForNpcVendorEvent ( uint32 creatureId,
uint32 itemId )

Definition at line 736 of file ConditionMgr.cpp.

References NpcVendorConditionContainerStore, and SF_LOG_DEBUG.

◆ GetConditionsForSmartEvent()

ConditionList ConditionMgr::GetConditionsForSmartEvent ( int32 entryOrGuid,
uint32 eventId,
uint32 sourceType )

Definition at line 720 of file ConditionMgr.cpp.

References SF_LOG_DEBUG, and SmartEventConditionStore.

◆ GetConditionsForSpellClickEvent()

ConditionList ConditionMgr::GetConditionsForSpellClickEvent ( uint32 creatureId,
uint32 spellId )

Definition at line 688 of file ConditionMgr.cpp.

References SF_LOG_DEBUG, and SpellClickEventConditionStore.

◆ GetConditionsForVehicleSpell()

ConditionList ConditionMgr::GetConditionsForVehicleSpell ( uint32 creatureId,
uint32 spellId )

Definition at line 704 of file ConditionMgr.cpp.

References SF_LOG_DEBUG, and VehicleSpellConditionStore.

◆ GetSearcherTypeMaskForConditionList()

uint32 ConditionMgr::GetSearcherTypeMaskForConditionList ( ConditionList const & conditions)

◆ isConditionTypeValid()

bool ConditionMgr::isConditionTypeValid ( Condition * cond)

Definition at line 1612 of file ConditionMgr.cpp.

References ALLIANCE, CLASSMASK_ALL_PLAYABLE, COMP_TYPE_MAX, CONDITION_ACHIEVEMENT, CONDITION_ACTIVE_EVENT, CONDITION_ALIVE, CONDITION_AREAID, CONDITION_AURA, CONDITION_CLASS, CONDITION_CREATURE_TYPE, CONDITION_DISTANCE_TO, CONDITION_DRUNKENSTATE, CONDITION_GENDER, CONDITION_HP_PCT, CONDITION_HP_VAL, CONDITION_INSTANCE_INFO, CONDITION_ITEM, CONDITION_ITEM_EQUIPPED, CONDITION_LEVEL, CONDITION_MAPID, CONDITION_MAX, CONDITION_NEAR_CREATURE, CONDITION_NEAR_GAMEOBJECT, CONDITION_NONE, CONDITION_OBJECT_ENTRY, CONDITION_PHASEID, CONDITION_QUEST_COMPLETE, CONDITION_QUEST_NONE, CONDITION_QUESTREWARDED, CONDITION_QUESTTAKEN, CONDITION_RACE, CONDITION_REACTION_TO, CONDITION_RELATION_TO, CONDITION_REPUTATION_RANK, CONDITION_SKILL, CONDITION_SPAWNMASK, CONDITION_SPELL, CONDITION_TEAM, CONDITION_TERRAIN_SWAP, CONDITION_TITLE, CONDITION_TYPE_MASK, CONDITION_UNIT_STATE, CONDITION_WORLD_STATE, CONDITION_ZONEID, Condition::ConditionTarget, Condition::ConditionType, Condition::ConditionValue1, Condition::ConditionValue2, Condition::ConditionValue3, CREATURE_TYPE_GAS_CLOUD, EFFECT_2, GetAreaEntryByAreaID(), Condition::GetMaxAvailableConditionTargets(), HORDE, Player::IsValidGender(), AreaTableEntry::m_ParentAreaID, MAX_DRUNKEN, RACEMASK_ALL_PLAYABLE, RELATION_MAX, sAchievementMgr, sCharTitlesStore, SF_LOG_ERROR, sFactionStore, sGameEventMgr, sMapStore, sObjectMgr, Condition::SourceEntry, Condition::SourceGroup, Condition::SourceType, SPAWNMASK_RAID_ALL, sPhaseStore, sSkillLineStore, sSpellMgr, sWorld, TYPEID_CORPSE, TYPEID_GAMEOBJECT, TYPEID_PLAYER, TYPEID_UNIT, TYPEMASK_CORPSE, TYPEMASK_GAMEOBJECT, TYPEMASK_PLAYER, TYPEMASK_UNIT, and UNIT_STATE_ALL_STATE.

Referenced by LoadConditions().

◆ IsObjectMeetToConditionList()

bool ConditionMgr::IsObjectMeetToConditionList ( ConditionSourceInfo & sourceInfo,
ConditionList const & conditions )
private

Find ElseGroup in ElseGroupStore

If not found, add an entry in the store and set to true (placeholder)

Definition at line 574 of file ConditionMgr.cpp.

References ConditionReferenceStore, IsObjectMeetToConditionList(), and SF_LOG_DEBUG.

Referenced by IsObjectMeetToConditionList(), and IsObjectMeetToConditions().

◆ IsObjectMeetToConditions() [1/3]

bool ConditionMgr::IsObjectMeetToConditions ( ConditionSourceInfo & sourceInfo,
ConditionList const & conditions )

Definition at line 631 of file ConditionMgr.cpp.

References IsObjectMeetToConditionList(), and SF_LOG_DEBUG.

◆ IsObjectMeetToConditions() [2/3]

bool ConditionMgr::IsObjectMeetToConditions ( WorldObject * object,
ConditionList const & conditions )

Definition at line 619 of file ConditionMgr.cpp.

References IsObjectMeetToConditions().

Referenced by IsObjectMeetToConditions(), and IsObjectMeetToConditions().

◆ IsObjectMeetToConditions() [3/3]

bool ConditionMgr::IsObjectMeetToConditions ( WorldObject * object1,
WorldObject * object2,
ConditionList const & conditions )

Definition at line 625 of file ConditionMgr.cpp.

References IsObjectMeetToConditions().

◆ isSourceTypeValid()

bool ConditionMgr::isSourceTypeValid ( Condition * cond)
private

Definition at line 1244 of file ConditionMgr.cpp.

References 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_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_ACCEPT, CONDITION_SOURCE_TYPE_QUEST_SHOW_MARK, 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::Effects, GetAreaEntryByAreaID(), SpellImplicitTargetInfo::GetSelectionCategory(), 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, MAX_SPELL_EFFECTS, SF_LOG_ERROR, sMapStore, sObjectMgr, Condition::SourceEntry, Condition::SourceGroup, Condition::SourceType, sSpellMgr, TARGET_SELECT_CATEGORY_AREA, TARGET_SELECT_CATEGORY_CONE, TARGET_SELECT_CATEGORY_NEARBY, SpellEffectInfo::TargetA, and SpellEffectInfo::TargetB.

Referenced by LoadConditions().

◆ LoadConditions()

void ConditionMgr::LoadConditions ( bool isReload = false)

TODO: PAIR_32 ?

Definition at line 752 of file ConditionMgr.cpp.

References addToGossipMenuItems(), addToGossipMenus(), addToLootTemplate(), addToPhases(), addToSpellImplicitTargetConditions(), addToTerrainSwaps(), AllocatedMemoryStore, CanHaveSourceGroupSet(), CanHaveSourceIdSet(), Clean(), 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_PHASE, 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_TERRAIN_SWAP, CONDITION_SOURCE_TYPE_VEHICLE_SPELL, ConditionReferenceStore, ConditionStore, Condition::ConditionTarget, Condition::ConditionType, Condition::ConditionValue1, Condition::ConditionValue2, Condition::ConditionValue3, Condition::ElseGroup, Condition::ErrorTextId, Condition::ErrorType, Field::GetInt32(), getMSTime(), GetMSTimeDiffToNow(), 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, Condition::ScriptId, SF_LOG_ERROR, SF_LOG_INFO, SmartEventConditionStore, sObjectMgr, Condition::SourceEntry, Condition::SourceGroup, Condition::SourceId, Condition::SourceType, SPELL_FAILED_SUCCESS, SpellClickEventConditionStore, sSpellMgr, VehicleSpellConditionStore, and WorldDatabase.

◆ Skyfire::Singleton< ConditionMgr, Skyfire::NullMutex >

Definition at line 202 of file ConditionMgr.h.

Member Data Documentation

◆ AllocatedMemoryStore

std::list<Condition*> ConditionMgr::AllocatedMemoryStore
private

Definition at line 250 of file ConditionMgr.h.

Referenced by Clean(), and LoadConditions().

◆ ConditionReferenceStore

ConditionReferenceContainer ConditionMgr::ConditionReferenceStore
private

◆ ConditionStore

ConditionContainer ConditionMgr::ConditionStore
private

Definition at line 252 of file ConditionMgr.h.

Referenced by Clean(), GetConditionsForNotGroupedEntry(), and LoadConditions().

◆ NpcVendorConditionContainerStore

NpcVendorConditionContainer ConditionMgr::NpcVendorConditionContainerStore
private

Definition at line 256 of file ConditionMgr.h.

Referenced by Clean(), GetConditionsForNpcVendorEvent(), and LoadConditions().

◆ SmartEventConditionStore

SmartEventConditionContainer ConditionMgr::SmartEventConditionStore
private

Definition at line 257 of file ConditionMgr.h.

Referenced by Clean(), GetConditionsForSmartEvent(), and LoadConditions().

◆ SpellClickEventConditionStore

CreatureSpellConditionContainer ConditionMgr::SpellClickEventConditionStore
private

Definition at line 255 of file ConditionMgr.h.

Referenced by Clean(), GetConditionsForSpellClickEvent(), and LoadConditions().

◆ VehicleSpellConditionStore

CreatureSpellConditionContainer ConditionMgr::VehicleSpellConditionStore
private

Definition at line 254 of file ConditionMgr.h.

Referenced by Clean(), GetConditionsForVehicleSpell(), and LoadConditions().


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