2330 if (condition->MinLevel && player->getLevel() < condition->MinLevel)
2333 if (condition->MaxLevel && player->getLevel() > condition->MaxLevel)
2336 if (condition->RaceMask && !(player->getRaceMask() & condition->RaceMask))
2339 if (condition->ClassMask && !(player->getClassMask() & condition->ClassMask))
2342 if (condition->Gender >= 0 && player->getGender() != condition->Gender)
2348 if (condition->PowerType != -1 && condition->PowerTypeComp)
2350 int32 requiredPowerValue = condition->Flags & 4 ? player->GetMaxPower(
Powers(condition->PowerType)) : condition->PowerTypeValue;
2355 if (condition->ChrSpecializationIndex >= 0 || condition->ChrSpecializationRole >= 0)
2359 if (condition->ChrSpecializationIndex >= 0 && spec->OrderIndex !=
uint32(condition->ChrSpecializationIndex))
2362 if (condition->ChrSpecializationRole >= 0 && spec->Role !=
uint32(condition->ChrSpecializationRole))
2367 if (condition->SkillID[0] || condition->SkillID[1] || condition->SkillID[2] || condition->SkillID[3])
2369 using SkillCount = std::extent<decltype(condition->SkillID)>;
2371 std::array<bool, SkillCount::value> results;
2375 if (condition->SkillID[i])
2377 uint16 skillValue = player->GetSkillValue(condition->SkillID[i]);
2378 results[i] = skillValue != 0 && skillValue > condition->MinSkill[i] && skillValue < condition->MaxSkill[i];
2386 if (condition->LanguageID)
2390 uint32 languageSkill = player->GetSkillValue(lang->skill_id);
2392 languageSkill = 300;
2394 if (condition->MinLanguage && languageSkill < condition->MinLanguage)
2397 if (condition->MaxLanguage && languageSkill > condition->MaxLanguage)
2402 if (condition->MinFactionID[0] && condition->MinFactionID[1] && condition->MinFactionID[2] && condition->MaxFactionID)
2404 if (!condition->MinFactionID[0] && !condition->MinFactionID[1] && !condition->MinFactionID[2])
2406 if (
ReputationRank const* forcedRank = player->GetReputationMgr().GetForcedRankIfAny(condition->MaxFactionID))
2411 else if (player->GetReputationRank(condition->MaxFactionID) >
ReputationRank(condition->MaxReputation))
2416 using FactionCount = std::extent<decltype(condition->MinFactionID)>;
2418 std::array<bool, FactionCount::value + 1> results;
2422 if (condition->MinFactionID[i])
2424 if (
ReputationRank const* forcedRank = player->GetReputationMgr().GetForcedRankIfAny(condition->MinFactionID[i]))
2425 results[i] = *forcedRank >=
ReputationRank(condition->MinReputation[i]);
2427 results[i] = player->GetReputationRank(condition->MinFactionID[i]) >=
ReputationRank(condition->MinReputation[i]);
2431 if (
ReputationRank const* forcedRank = player->GetReputationMgr().GetForcedRankIfAny(condition->MaxFactionID))
2432 results[3] = *forcedRank <=
ReputationRank(condition->MaxReputation);
2434 results[3] = player->GetReputationRank(condition->MaxFactionID) <=
ReputationRank(condition->MaxReputation);
2441 if (condition->PvpMedal && !((1 << (condition->PvpMedal - 1)) & player->GetUInt32Value(
PLAYER_FIELD_PVP_MEDALS)))
2447 if (condition->PartyStatus)
2449 Group* group = player->GetGroup();
2450 switch (condition->PartyStatus)
2477 if (condition->PrevQuestID[0])
2479 using PrevQuestCount = std::extent<decltype(condition->PrevQuestID)>;
2481 std::array<bool, PrevQuestCount::value> results;
2484 if (
uint32 questBit =
sDB2Manager.GetQuestUniqueBitFlag(condition->PrevQuestID[i]))
2491 if (condition->CurrQuestID[0])
2493 using CurrQuestCount = std::extent<decltype(condition->CurrQuestID)>;
2495 std::array<bool, CurrQuestCount::value> results;
2498 if (condition->CurrQuestID[i])
2505 if (condition->CurrentCompletedQuestID[0])
2507 using CurrentCompletedQuestCount = std::extent<decltype(condition->CurrentCompletedQuestID)>;
2509 std::array<bool, CurrentCompletedQuestCount::value> results;
2512 if (condition->CurrentCompletedQuestID[i])
2513 results[i] = player->GetQuestStatus(condition->CurrentCompletedQuestID[i]) ==
QUEST_STATUS_COMPLETE;
2520 if (condition->SpellID[0])
2522 using SpellCount = std::extent<decltype(condition->SpellID)>;
2524 std::array<bool, SpellCount::value> results;
2527 if (condition->SpellID[i])
2528 results[i] = player->HasSpell(condition->SpellID[i]);
2534 if (condition->ItemID[0])
2536 using ItemCount = std::extent<decltype(condition->ItemID)>;
2538 std::array<bool, ItemCount::value> results;
2541 if (condition->ItemID[i])
2542 results[i] = player->GetItemCount(condition->ItemID[i], condition->ItemFlags != 0) >= condition->ItemCount[i];
2548 if (condition->CurrencyID[0])
2550 using CurrencyCount = std::extent<decltype(condition->CurrencyID)>;
2552 std::array<bool, CurrencyCount::value> results;
2555 if (condition->CurrencyID[i])
2556 results[i] = player->GetCurrency(condition->CurrencyID[i]) >= condition->CurrencyCount[i];
2562 if (condition->Explored[0] || condition->Explored[1])
2564 using ExploredCount = std::extent<decltype(condition->Explored)>;
2574 if (condition->AuraSpellID[0])
2576 using AuraCount = std::extent<decltype(condition->AuraSpellID)>;
2578 std::array<bool, AuraCount::value> results;
2581 if (condition->AuraSpellID[i])
2582 results[i] = player->HasAura(condition->AuraSpellID[i]);
2592 if (condition->Achievement[0])
2594 using AchievementCount = std::extent<decltype(condition->Achievement)>;
2596 std::array<bool, AchievementCount::value> results;
2600 if (condition->Achievement[i])
2604 results[i] = player->HasAchieved(condition->Achievement[i]);
2614 if (condition->AreaID[0])
2616 using AreaCount = std::extent<decltype(condition->AreaID)>;
2618 std::array<bool, AreaCount::value> results;
2621 if (condition->AreaID[i])
2622 results[i] = player->GetAreaId() == condition->AreaID[i] || player->GetZoneId() == condition->AreaID[i];
2628 if (condition->MinExpansionLevel != -1 && player->GetSession()->GetExpansion() < condition->MinExpansionLevel)
2631 if (condition->MaxExpansionLevel != -1 && player->GetSession()->GetExpansion() > condition->MaxExpansionLevel)
2634 if (condition->MinExpansionLevel != -1 && condition->MinExpansionTier != -1 && !player->IsGameMaster()
2639 if (condition->PhaseID && !player->IsInPhase(condition->PhaseID))
2642 if (condition->PhaseGroupID)
2644 std::set<uint32> phases =
sDB2Manager.GetPhasesForGroup(condition->PhaseGroupID);
2649 if (condition->QuestKillID)
2651 Quest const* quest =
sObjectMgr->GetQuestTemplate(condition->QuestKillID);
2654 using QuestKillCount = std::extent<decltype(condition->QuestKillMonster)>;
2656 std::array<bool, QuestKillCount::value> results;
2660 if (condition->QuestKillMonster[i])
2667 results[i] = player->GetQuestObjectiveData(quest, objectiveItr->StorageIndex) >= objectiveItr->Amount;
static uint16 const FactionCount
Definition: ReputationPackets.h:27
Definition: DBCStructure.h:37
Definition: QuestDef.h:111
#define sDB2Manager
Definition: DB2Stores.h:224
Definition: QuestDef.h:279
ReputationRank
Definition: SharedDefines.h:211
#define MAX_QUEST_LOG_SIZE
Definition: QuestDef.h:43
Definition: UpdateFields.h:269
bool isRaidGroup() const
Definition: Group.cpp:2509
Definition: QuestDef.h:261
static Vector3int16 floor(const Vector3 &v)
Definition: UpdateFields.h:208
QuestObjectives const & GetObjectives() const
Definition: QuestDef.h:345
Definition: SpellAuraDefines.h:304
#define sWorld
Definition: World.h:887
#define sObjectMgr
Definition: ObjectMgr.h:1567
Definition: ObjectMgr.h:660
DBCStorage< AreaTableEntry > sAreaTableStore(AreaTablefmt)
Definition: UpdateFields.h:198
bool PlayerConditionLogic(uint32 logic, std::array< bool, N > &results)
Definition: ConditionMgr.cpp:2301
Powers
Definition: SharedDefines.h:246
Definition: DBCStructure.h:245
Definition: QuestDef.h:220
bool PlayerConditionCompare(int32 comparisonType, int32 value1, int32 value2)
Definition: ConditionMgr.cpp:2278
int32_t int32
Definition: Define.h:146
uint32_t uint32
Definition: Define.h:150
uint16_t uint16
Definition: Define.h:151
Definition: UpdateFields.h:267
bool Intersects(Iterator1 first1, Iterator1 last1, Iterator2 first2, Iterator2 last2)
Definition: Containers.h:133
LanguageDesc const * GetLanguageDescByID(uint32 lang)
Definition: ObjectMgr.cpp:192
DBCStorage< ChrSpecializationEntry > sChrSpecializationStore(ChrSpecializationfmt)
int32_t int32
Definition: g3dmath.h:167
Definition: UpdateFields.h:299
const FieldDescriptor value
Definition: descriptor.h:1522
uint32_t uint32
Definition: g3dmath.h:168
Definition: UpdateFields.h:249