mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-19 08:55:32 +01:00
Core/SmartAI: Add ability to modify UNIT_FIELD_FLAGS_2 to SAI actions.
This commit is contained in:
@@ -657,9 +657,18 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u
|
||||
{
|
||||
if (IsUnit(*itr))
|
||||
{
|
||||
(*itr)->ToUnit()->SetFlag(UNIT_FIELD_FLAGS, e.action.unitFlag.flag);
|
||||
TC_LOG_DEBUG(LOG_FILTER_DATABASE_AI, "SmartScript::ProcessAction:: SMART_ACTION_SET_UNIT_FLAG. Unit %u added flag %u to UNIT_FIELD_FLAGS",
|
||||
if (!e.action.unitFlag.type)
|
||||
{
|
||||
(*itr)->ToUnit()->SetFlag(UNIT_FIELD_FLAGS, e.action.unitFlag.flag);
|
||||
TC_LOG_DEBUG(LOG_FILTER_DATABASE_AI, "SmartScript::ProcessAction:: SMART_ACTION_SET_UNIT_FLAG. Unit %u added flag %u to UNIT_FIELD_FLAGS",
|
||||
(*itr)->GetGUIDLow(), e.action.unitFlag.flag);
|
||||
}
|
||||
else
|
||||
{
|
||||
(*itr)->ToUnit()->SetFlag(UNIT_FIELD_FLAGS_2, e.action.unitFlag.flag);
|
||||
TC_LOG_DEBUG(LOG_FILTER_DATABASE_AI, "SmartScript::ProcessAction:: SMART_ACTION_SET_UNIT_FLAG. Unit %u added flag %u to UNIT_FIELD_FLAGS_2",
|
||||
(*itr)->GetGUIDLow(), e.action.unitFlag.flag);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -676,9 +685,18 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u
|
||||
{
|
||||
if (IsUnit(*itr))
|
||||
{
|
||||
(*itr)->ToUnit()->RemoveFlag(UNIT_FIELD_FLAGS, e.action.unitFlag.flag);
|
||||
TC_LOG_DEBUG(LOG_FILTER_DATABASE_AI, "SmartScript::ProcessAction:: SMART_ACTION_REMOVE_UNIT_FLAG. Unit %u removed flag %u to UNIT_FIELD_FLAGS",
|
||||
if (!e.action.unitFlag.type)
|
||||
{
|
||||
(*itr)->ToUnit()->RemoveFlag(UNIT_FIELD_FLAGS, e.action.unitFlag.flag);
|
||||
TC_LOG_DEBUG(LOG_FILTER_DATABASE_AI, "SmartScript::ProcessAction:: SMART_ACTION_REMOVE_UNIT_FLAG. Unit %u removed flag %u to UNIT_FIELD_FLAGS",
|
||||
(*itr)->GetGUIDLow(), e.action.unitFlag.flag);
|
||||
}
|
||||
else
|
||||
{
|
||||
(*itr)->ToUnit()->RemoveFlag(UNIT_FIELD_FLAGS_2, e.action.unitFlag.flag);
|
||||
TC_LOG_DEBUG(LOG_FILTER_DATABASE_AI, "SmartScript::ProcessAction:: SMART_ACTION_REMOVE_UNIT_FLAG. Unit %u removed flag %u to UNIT_FIELD_FLAGS_2",
|
||||
(*itr)->GetGUIDLow(), e.action.unitFlag.flag);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -827,6 +827,7 @@ struct SmartAction
|
||||
struct
|
||||
{
|
||||
uint32 flag;
|
||||
uint32 type;
|
||||
} unitFlag;
|
||||
|
||||
struct
|
||||
|
||||
Reference in New Issue
Block a user