feat(Core/Conditions): CONDITION_CHARMED (#10298)

This commit is contained in:
IntelligentQuantum
2022-01-29 05:21:23 +03:30
committed by GitHub
parent 6a08c9cbdb
commit 1ec6ea1cea
2 changed files with 12 additions and 6 deletions

View File

@@ -419,6 +419,12 @@ bool Condition::Meets(ConditionSourceInfo& sourceInfo)
condMeets = unit->HasAuraType(AuraType(ConditionValue1));
break;
}
case CONDITION_CHARMED:
{
if (Unit* unit = object->ToUnit())
condMeets = unit->IsCharmed();
break;
}
default:
condMeets = false;
break;
@@ -604,6 +610,9 @@ uint32 Condition::GetSearcherTypeMaskForCondition()
case CONDITION_HAS_AURA_TYPE:
mask |= GRID_MAP_TYPE_MASK_CREATURE | GRID_MAP_TYPE_MASK_PLAYER;
break;
case CONDITION_CHARMED:
mask |= GRID_MAP_TYPE_MASK_CREATURE | GRID_MAP_TYPE_MASK_PLAYER;
break;
default:
ASSERT(false && "Condition::GetSearcherTypeMaskForCondition - missing condition handling!");
break;
@@ -1662,7 +1671,6 @@ bool ConditionMgr::isConditionTypeValid(Condition* cond)
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;
case CONDITION_STAND_STATE:
case CONDITION_CHARMED:
case CONDITION_PET_TYPE:
case CONDITION_TAXI:
LOG_ERROR("sql.sql", "SourceEntry {} in `condition` table has a ConditionType that is not yet supported on AzerothCore ({}), ignoring.", cond->SourceEntry, uint32(cond->ConditionType));
@@ -2211,10 +2219,6 @@ bool ConditionMgr::isConditionTypeValid(Condition* cond)
}
break;
}
case CONDITION_IN_WATER:
{
break;
}
case CONDITION_QUEST_OBJECTIVE_PROGRESS:
{
const Quest* quest = sObjectMgr->GetQuestTemplate(cond->ConditionValue1);
@@ -2252,6 +2256,8 @@ bool ConditionMgr::isConditionTypeValid(Condition* cond)
}
break;
}
case CONDITION_IN_WATER:
case CONDITION_CHARMED:
default:
break;
}

View File

@@ -76,7 +76,7 @@ enum ConditionTypes
CONDITION_TERRAIN_SWAP = 41, // don't use on 3.3.5a
CONDITION_STAND_STATE = 42, // TODO: NOT SUPPORTED YET
CONDITION_DAILY_QUEST_DONE = 43, // quest id 0 0 true if daily quest has been completed for the day
CONDITION_CHARMED = 44, // TODO: NOT SUPPORTED YET
CONDITION_CHARMED = 44, // 0 0 0 true if unit is currently charmed
CONDITION_PET_TYPE = 45, // TODO: NOT SUPPORTED YET
CONDITION_TAXI = 46, // TODO: NOT SUPPORTED YET
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)