mirror of
https://github.com/liyunfan1223/azerothcore-wotlk.git
synced 2026-08-09 00:08:01 +00:00
feat(Core/Conditions): CONDITION_CHARMED (#10298)
This commit is contained in:
committed by
GitHub
parent
6a08c9cbdb
commit
1ec6ea1cea
@@ -419,6 +419,12 @@ bool Condition::Meets(ConditionSourceInfo& sourceInfo)
|
|||||||
condMeets = unit->HasAuraType(AuraType(ConditionValue1));
|
condMeets = unit->HasAuraType(AuraType(ConditionValue1));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
case CONDITION_CHARMED:
|
||||||
|
{
|
||||||
|
if (Unit* unit = object->ToUnit())
|
||||||
|
condMeets = unit->IsCharmed();
|
||||||
|
break;
|
||||||
|
}
|
||||||
default:
|
default:
|
||||||
condMeets = false;
|
condMeets = false;
|
||||||
break;
|
break;
|
||||||
@@ -604,6 +610,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_CHARMED:
|
||||||
|
mask |= GRID_MAP_TYPE_MASK_CREATURE | GRID_MAP_TYPE_MASK_PLAYER;
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
ASSERT(false && "Condition::GetSearcherTypeMaskForCondition - missing condition handling!");
|
ASSERT(false && "Condition::GetSearcherTypeMaskForCondition - missing condition handling!");
|
||||||
break;
|
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));
|
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:
|
||||||
case CONDITION_CHARMED:
|
|
||||||
case CONDITION_PET_TYPE:
|
case CONDITION_PET_TYPE:
|
||||||
case CONDITION_TAXI:
|
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));
|
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;
|
break;
|
||||||
}
|
}
|
||||||
case CONDITION_IN_WATER:
|
|
||||||
{
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case CONDITION_QUEST_OBJECTIVE_PROGRESS:
|
case CONDITION_QUEST_OBJECTIVE_PROGRESS:
|
||||||
{
|
{
|
||||||
const Quest* quest = sObjectMgr->GetQuestTemplate(cond->ConditionValue1);
|
const Quest* quest = sObjectMgr->GetQuestTemplate(cond->ConditionValue1);
|
||||||
@@ -2252,6 +2256,8 @@ bool ConditionMgr::isConditionTypeValid(Condition* cond)
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
case CONDITION_IN_WATER:
|
||||||
|
case CONDITION_CHARMED:
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -76,7 +76,7 @@ enum ConditionTypes
|
|||||||
CONDITION_TERRAIN_SWAP = 41, // don't use on 3.3.5a
|
CONDITION_TERRAIN_SWAP = 41, // don't use on 3.3.5a
|
||||||
CONDITION_STAND_STATE = 42, // TODO: NOT SUPPORTED YET
|
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_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_PET_TYPE = 45, // TODO: NOT SUPPORTED YET
|
||||||
CONDITION_TAXI = 46, // 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)
|
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)
|
||||||
|
|||||||
Reference in New Issue
Block a user