mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-21 09:44:45 +01:00
Fix merge
This commit is contained in:
@@ -422,6 +422,13 @@ bool Condition::Meets(ConditionSourceInfo& sourceInfo)
|
||||
condMeets = object->IsInTerrainSwap(ConditionValue1);
|
||||
break;
|
||||
}
|
||||
case CONDITION_REALM_ACHIEVEMENT:
|
||||
{
|
||||
AchievementEntry const* achievement = sAchievementMgr->GetAchievement(ConditionValue1);
|
||||
if (achievement && sAchievementMgr->IsRealmCompleted(achievement, std::numeric_limits<uint32>::max()))
|
||||
condMeets = true;
|
||||
break;
|
||||
}
|
||||
default:
|
||||
condMeets = false;
|
||||
break;
|
||||
@@ -594,6 +601,9 @@ uint32 Condition::GetSearcherTypeMaskForCondition()
|
||||
case CONDITION_TERRAIN_SWAP:
|
||||
mask |= GRID_MAP_TYPE_MASK_ALL;
|
||||
break;
|
||||
case CONDITION_REALM_ACHIEVEMENT:
|
||||
mask |= GRID_MAP_TYPE_MASK_ALL;
|
||||
break;
|
||||
default:
|
||||
ASSERT(false && "Condition::GetSearcherTypeMaskForCondition - missing condition handling!");
|
||||
break;
|
||||
@@ -2089,6 +2099,16 @@ bool ConditionMgr::isConditionTypeValid(Condition* cond)
|
||||
case CONDITION_AREAID:
|
||||
case CONDITION_ALIVE:
|
||||
break;
|
||||
case CONDITION_REALM_ACHIEVEMENT:
|
||||
{
|
||||
AchievementEntry const* achievement = sAchievementMgr->GetAchievement(cond->ConditionValue1);
|
||||
if (!achievement)
|
||||
{
|
||||
TC_LOG_ERROR("sql.sql", "%s has non existing realm first achivement id (%u), skipped.", cond->ToString(true).c_str(), cond->ConditionValue1);
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
}
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -73,7 +73,8 @@ enum ConditionTypes
|
||||
CONDITION_HP_VAL = 37, // hpVal ComparisonType 0 true if unit's hp matches given value
|
||||
CONDITION_HP_PCT = 38, // hpPct ComparisonType 0 true if unit's hp matches given pct
|
||||
CONDITION_TERRAIN_SWAP = 39, // terrainSwap 0 0 true if object is in terrainswap
|
||||
CONDITION_MAX = 40 // MAX
|
||||
CONDITION_REALM_ACHIEVEMENT = 40, // achievement_id 0 0 true if realm achievement is complete
|
||||
CONDITION_MAX = 41 // MAX
|
||||
};
|
||||
|
||||
/*! Documentation on implementing a new ConditionSourceType:
|
||||
|
||||
Reference in New Issue
Block a user