mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-03-09 02:30:29 +00:00
fix(Core/Conditions): Limit Oculus' Cache drop to Random Heroic (#24184)
This commit is contained in:
@@ -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))
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user