mirror of
https://github.com/liyunfan1223/azerothcore-wotlk.git
synced 2026-08-09 00:08:01 +00:00
feat(Core/Conditions): CONDITION_DIFFICULTY_ID (#10332)
This commit is contained in:
committed by
GitHub
parent
01c0d046ff
commit
e85e556d19
@@ -420,6 +420,11 @@ bool Condition::Meets(ConditionSourceInfo& sourceInfo)
|
|||||||
condMeets = unit->HasAuraType(AuraType(ConditionValue1));
|
condMeets = unit->HasAuraType(AuraType(ConditionValue1));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
case CONDITION_DIFFICULTY_ID:
|
||||||
|
{
|
||||||
|
condMeets = object->GetMap()->GetDifficulty() == ConditionValue1;
|
||||||
|
break;
|
||||||
|
}
|
||||||
case CONDITION_PET_TYPE:
|
case CONDITION_PET_TYPE:
|
||||||
{
|
{
|
||||||
if (Player* player = object->ToPlayer())
|
if (Player* player = object->ToPlayer())
|
||||||
@@ -624,6 +629,9 @@ uint32 Condition::GetSearcherTypeMaskForCondition()
|
|||||||
case CONDITION_HAS_AURA_TYPE:
|
case CONDITION_HAS_AURA_TYPE:
|
||||||
mask |= GRID_MAP_TYPE_MASK_CREATURE | GRID_MAP_TYPE_MASK_PLAYER;
|
mask |= GRID_MAP_TYPE_MASK_CREATURE | GRID_MAP_TYPE_MASK_PLAYER;
|
||||||
break;
|
break;
|
||||||
|
case CONDITION_DIFFICULTY_ID:
|
||||||
|
mask |= GRID_MAP_TYPE_MASK_ALL;
|
||||||
|
break;
|
||||||
case CONDITION_PET_TYPE:
|
case CONDITION_PET_TYPE:
|
||||||
mask |= GRID_MAP_TYPE_MASK_PLAYER;
|
mask |= GRID_MAP_TYPE_MASK_PLAYER;
|
||||||
break;
|
break;
|
||||||
@@ -1687,7 +1695,6 @@ bool ConditionMgr::isConditionTypeValid(Condition* cond)
|
|||||||
switch (cond->ConditionType)
|
switch (cond->ConditionType)
|
||||||
{
|
{
|
||||||
case CONDITION_TERRAIN_SWAP:
|
case CONDITION_TERRAIN_SWAP:
|
||||||
case CONDITION_DIFFICULTY_ID:
|
|
||||||
LOG_ERROR("sql.sql", "SourceEntry {} in `condition` table has a ConditionType that is not supported on 3.3.5a ({}), ignoring.", cond->SourceEntry, uint32(cond->ConditionType));
|
LOG_ERROR("sql.sql", "SourceEntry {} in `condition` table has a ConditionType that is not supported on 3.3.5a ({}), ignoring.", cond->SourceEntry, uint32(cond->ConditionType));
|
||||||
return false;
|
return false;
|
||||||
case CONDITION_STAND_STATE:
|
case CONDITION_STAND_STATE:
|
||||||
@@ -2274,6 +2281,13 @@ bool ConditionMgr::isConditionTypeValid(Condition* cond)
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
case CONDITION_DIFFICULTY_ID:
|
||||||
|
if (cond->ConditionValue1 >= MAX_DIFFICULTY)
|
||||||
|
{
|
||||||
|
LOG_ERROR("sql.sql", "CONDITION_DIFFICULTY_ID has non existing difficulty in value1 ({}), skipped.", cond->ConditionValue1);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
break;
|
||||||
case CONDITION_PET_TYPE:
|
case CONDITION_PET_TYPE:
|
||||||
if (cond->ConditionValue1 >= (1 << MAX_PET_TYPE))
|
if (cond->ConditionValue1 >= (1 << MAX_PET_TYPE))
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -81,13 +81,13 @@ enum ConditionTypes
|
|||||||
CONDITION_TAXI = 46, // 0 0 0 true if player is on taxi
|
CONDITION_TAXI = 46, // 0 0 0 true if player is on taxi
|
||||||
CONDITION_QUESTSTATE = 47, // quest_id state_mask 0 true if player is in any of the provided quest states for the quest (1 = not taken, 2 = completed, 8 = in progress, 32 = failed, 64 = rewarded)
|
CONDITION_QUESTSTATE = 47, // quest_id state_mask 0 true if player is in any of the provided quest states for the quest (1 = not taken, 2 = completed, 8 = in progress, 32 = failed, 64 = rewarded)
|
||||||
CONDITION_QUEST_OBJECTIVE_PROGRESS = 48, // quest_id objectiveIndex objectiveCount true if player has reached the specified objectiveCount quest progress for the objectiveIndex for the specified quest
|
CONDITION_QUEST_OBJECTIVE_PROGRESS = 48, // quest_id objectiveIndex objectiveCount true if player has reached the specified objectiveCount quest progress for the objectiveIndex for the specified quest
|
||||||
CONDITION_DIFFICULTY_ID = 49, // don't use on 3.3.5a
|
CONDITION_DIFFICULTY_ID = 49, // Difficulty 0 0 true is map has difficulty id
|
||||||
CONDITION_TC_END = 50, // placeholder
|
CONDITION_TC_END = 50, // placeholder
|
||||||
|
|
||||||
CONDITION_AC_START = 100,
|
CONDITION_AC_START = 100,
|
||||||
CONDITION_QUEST_SATISFY_EXCLUSIVE = 101, // quest_id 0 0 true if satisfied exclusive group
|
CONDITION_QUEST_SATISFY_EXCLUSIVE = 101, // quest_id 0 0 true if satisfied exclusive group
|
||||||
CONDITION_HAS_AURA_TYPE = 102, // aura_type 0 0 true if has aura type
|
CONDITION_HAS_AURA_TYPE = 102, // aura_type 0 0 true if has aura type
|
||||||
CONDITION_AC_END = 103 // placeholder
|
CONDITION_AC_END = 103 // placeholder
|
||||||
};
|
};
|
||||||
|
|
||||||
/*! Documentation on implementing a new ConditionSourceType:
|
/*! Documentation on implementing a new ConditionSourceType:
|
||||||
|
|||||||
Reference in New Issue
Block a user