Core/SAI: Remove possibility to set/remove unit_flags2

Port From (https://github.com/TrinityCore/TrinityCore/commit/f55e86d90735aad1c0cfd8d1b6e79aa721e8267c)
This commit is contained in:
hondacrx
2022-05-29 22:55:34 -04:00
parent 965aeb7425
commit 9f702c199b
3 changed files with 8 additions and 27 deletions
+2 -2
View File
@@ -261,8 +261,8 @@ namespace Framework.Constants
CallAreaexploredoreventhappens = 15, // Questid
SetIngamePhaseGroup = 16, // phaseGroupId, apply
SetEmoteState = 17, // Emoteid
SetUnitFlag = 18, // Flags (May Be More Than One Field Or'D Together), Target
RemoveUnitFlag = 19, // Flags (May Be More Than One Field Or'D Together), Target
SetUnitFlag = 18, // Flags
RemoveUnitFlag = 19, // Flags
AutoAttack = 20, // Allowattackstate (0 = Stop Attack, Anything Else Means Continue Attacking)
AllowCombatMovement = 21, // Allowcombatmovement (0 = Stop Combat Based Movement, Anything Else Continue Attacking)
SetEventPhase = 22, // Phase
@@ -3518,7 +3518,6 @@ namespace Game.AI
public struct UnitFlag
{
public uint flag;
public uint type;
}
public struct Flag
{
+6 -24
View File
@@ -632,18 +632,9 @@ namespace Game.AI
{
if (IsUnit(target))
{
if (e.Action.unitFlag.type == 0)
{
target.ToUnit().AddUnitFlag((UnitFlags)e.Action.unitFlag.flag);
Log.outDebug(LogFilter.ScriptsAi, "SmartScript.ProcessAction. SMART_ACTION_SET_UNIT_FLAG. Unit {0} added flag {1} to UNIT_FIELD_FLAGS",
target.GetGUID().ToString(), e.Action.unitFlag.flag);
}
else
{
target.ToUnit().AddUnitFlag2((UnitFlags2)e.Action.unitFlag.flag);
Log.outDebug(LogFilter.ScriptsAi, "SmartScript.ProcessAction. SMART_ACTION_SET_UNIT_FLAG. Unit {0} added flag {1} to UNIT_FIELD_FLAGS_2",
target.GetGUID().ToString(), e.Action.unitFlag.flag);
}
target.ToUnit().AddUnitFlag((UnitFlags)e.Action.unitFlag.flag);
Log.outDebug(LogFilter.ScriptsAi, "SmartScript.ProcessAction. SMART_ACTION_SET_UNIT_FLAG. Unit {0} added flag {1} to UNIT_FIELD_FLAGS",
target.GetGUID().ToString(), e.Action.unitFlag.flag);
}
}
break;
@@ -654,18 +645,9 @@ namespace Game.AI
{
if (IsUnit(target))
{
if (e.Action.unitFlag.type == 0)
{
target.ToUnit().RemoveUnitFlag((UnitFlags)e.Action.unitFlag.flag);
Log.outDebug(LogFilter.ScriptsAi, "SmartScript.ProcessAction. SMART_ACTION_REMOVE_UNIT_FLAG. Unit {0} removed flag {1} to UNIT_FIELD_FLAGS",
target.GetGUID().ToString(), e.Action.unitFlag.flag);
}
else
{
target.ToUnit().RemoveUnitFlag2((UnitFlags2)e.Action.unitFlag.flag);
Log.outDebug(LogFilter.ScriptsAi, "SmartScript.ProcessAction. SMART_ACTION_REMOVE_UNIT_FLAG. Unit {0} removed flag {1} to UNIT_FIELD_FLAGS_2",
target.GetGUID().ToString(), e.Action.unitFlag.flag);
}
target.ToUnit().RemoveUnitFlag((UnitFlags)e.Action.unitFlag.flag);
Log.outDebug(LogFilter.ScriptsAi, "SmartScript.ProcessAction. SMART_ACTION_REMOVE_UNIT_FLAG. Unit {0} removed flag {1} to UNIT_FIELD_FLAGS",
target.GetGUID().ToString(), e.Action.unitFlag.flag);
}
}
break;