diff options
author | Shauren <shauren.trinity@gmail.com> | 2020-12-01 21:08:06 +0100 |
---|---|---|
committer | Shauren <shauren.trinity@gmail.com> | 2020-12-08 18:16:47 +0100 |
commit | b82a3a557a7bf13d48342ea189325550059b622d (patch) | |
tree | 014fd20fae16fab1da1f056850348282b0e5e331 /src/server/game/Conditions/ConditionMgr.cpp | |
parent | 426cb31676338cf6e5411d38f645f98a7e6ccb91 (diff) |
Core/DataStores: Updated db2 structures to 9.0.2
* Includes support for new character customization
Diffstat (limited to 'src/server/game/Conditions/ConditionMgr.cpp')
-rw-r--r-- | src/server/game/Conditions/ConditionMgr.cpp | 32 |
1 files changed, 27 insertions, 5 deletions
diff --git a/src/server/game/Conditions/ConditionMgr.cpp b/src/server/game/Conditions/ConditionMgr.cpp index 03c75df9348..bc0e8f64742 100644 --- a/src/server/game/Conditions/ConditionMgr.cpp +++ b/src/server/game/Conditions/ConditionMgr.cpp @@ -2547,11 +2547,30 @@ uint32 ConditionMgr::GetPlayerConditionLfgValue(Player const* player, PlayerCond bool ConditionMgr::IsPlayerMeetingCondition(Player const* player, PlayerConditionEntry const* condition) { - if (condition->MinLevel && player->getLevel() < condition->MinLevel) - return false; + if (Optional<ContentTuningLevels> levels = sDB2Manager.GetContentTuningData(condition->ContentTuningID, player->m_playerData->CtrOptions->ContentTuningConditionMask)) + { + uint8 minLevel = condition->Flags & 0x800 ? levels->MinLevelWithDelta : levels->MinLevel; + uint8 maxLevel = 0; + if (!(condition->Flags & 0x20)) + maxLevel = condition->Flags & 0x800 ? levels->MaxLevelWithDelta : levels->MaxLevel; - if (condition->MaxLevel && player->getLevel() > condition->MaxLevel) - return false; + if (condition->Flags & 0x80) + { + if (minLevel && player->getLevel() >= minLevel && (!maxLevel || player->getLevel() <= maxLevel)) + return false; + + if (maxLevel && player->getLevel() <= maxLevel && (!minLevel || player->getLevel() >= minLevel)) + return false; + } + else + { + if (minLevel && player->getLevel() < minLevel) + return false; + + if (maxLevel && player->getLevel() > maxLevel) + return false; + } + } if (condition->RaceMask && !condition->RaceMask.HasRace(player->getRace())) return false; @@ -2562,7 +2581,7 @@ bool ConditionMgr::IsPlayerMeetingCondition(Player const* player, PlayerConditio if (condition->Gender >= 0 && player->getGender() != condition->Gender) return false; - if (condition->NativeGender >= 0 && player->m_playerData->NativeSex != condition->NativeGender) + if (condition->NativeGender >= 0 && player->GetNativeSex() != condition->NativeGender) return false; if (condition->PowerType != -1 && condition->PowerTypeComp) @@ -2946,6 +2965,9 @@ bool ConditionMgr::IsPlayerMeetingCondition(Player const* player, PlayerConditio if (condition->ModifierTreeID && !player->ModifierTreeSatisfied(condition->ModifierTreeID)) return false; + if (condition->CovenantID && player->m_playerData->CovenantID != condition->CovenantID) + return false; + return true; } |