fix(Core/Conditions): Limit Oculus' Cache drop to Random Heroic (#24184)

This commit is contained in:
sogladev
2025-12-29 05:21:13 +01:00
committed by GitHub
parent 67e64bb6b3
commit a848bb9edc
3 changed files with 35 additions and 1 deletions

View File

@@ -0,0 +1,2 @@
--
UPDATE `conditions` SET `ConditionTypeOrReference` = 105, `ConditionValue1` = 1, `ConditionValue2` = 0, `ConditionValue3` = 0, `Comment` = 'Loot Cache of the Ley-Guardian only when the player is queued via Random Heroic' WHERE `SourceTypeOrReferenceId` = 4 AND `SourceGroup` = 24524 AND `SourceEntry` = 52676 AND `SourceId` = 0 AND `ElseGroup` = 0 AND `ConditionTarget` = 0 AND `ConditionTypeOrReference` = 1;

View File

@@ -542,6 +542,23 @@ bool Condition::Meets(ConditionSourceInfo& sourceInfo)
condMeets = object->GetMap()->GetDifficulty() == ConditionValue1;
break;
}
case CONDITION_RANDOM_DUNGEON:
{
if (Unit* unit = object->ToUnit())
{
if (Player* player = unit->GetCharmerOrOwnerPlayerOrPlayerItself())
{
if (sLFGMgr->selectedRandomLfgDungeon(player->GetGUID()))
{
if (!ConditionValue1)
condMeets = true;
else if (Map* map = player->GetMap())
condMeets = map->GetDifficulty() == Difficulty(ConditionValue1);
}
}
}
break;
}
case CONDITION_PET_TYPE:
{
if (Unit* unit = object->ToUnit())
@@ -786,6 +803,9 @@ uint32 Condition::GetSearcherTypeMaskForCondition()
case CONDITION_CHARMED:
mask |= GRID_MAP_TYPE_MASK_CREATURE | GRID_MAP_TYPE_MASK_PLAYER;
break;
case CONDITION_RANDOM_DUNGEON:
mask |= GRID_MAP_TYPE_MASK_PLAYER;
break;
case CONDITION_WORLD_SCRIPT:
mask |= GRID_MAP_TYPE_MASK_ALL;
break;
@@ -2466,6 +2486,17 @@ bool ConditionMgr::isConditionTypeValid(Condition* cond)
return false;
}
break;
case CONDITION_RANDOM_DUNGEON:
if (cond->ConditionValue1 >= MAX_DIFFICULTY)
{
LOG_ERROR("sql.sql", "RandomDungeon condition has invalid difficulty in value1 ({}).", cond->ConditionValue1);
return false;
}
if (cond->ConditionValue2)
LOG_ERROR("sql.sql", "RandomDungeon condition has useless data in value2 ({}).", cond->ConditionValue2);
if (cond->ConditionValue3)
LOG_ERROR("sql.sql", "RandomDungeon condition has useless data in value3 ({}).", cond->ConditionValue3);
break;
case CONDITION_PET_TYPE:
if (cond->ConditionValue1 >= (1 << MAX_PET_TYPE))
{

View File

@@ -88,8 +88,9 @@ enum ConditionTypes
CONDITION_HAS_AURA_TYPE = 102, // aura_type 0 0 true if has aura type
CONDITION_WORLD_SCRIPT = 103, // conditionId state 0 true if WorldState::IsConditionFulfilled returns true
CONDITION_AI_DATA = 104, // dataId value 0 true if AI::GetData returns value
CONDITION_RANDOM_DUNGEON = 105, // difficulty (0 = any) 0 0 true if player is queued for a random dungeon via RDF (param1 = Difficulty)
CONDITION_AC_END = 105 // placeholder
CONDITION_AC_END = 106 // placeholder
};
/*! Documentation on implementing a new ConditionSourceType: