Core/SAI: Remove possibility to set/remove unit_flags2
Port From (https://github.com/TrinityCore/TrinityCore/commit/f55e86d90735aad1c0cfd8d1b6e79aa721e8267c)
This commit is contained in:
@@ -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
|
||||
{
|
||||
|
||||
@@ -631,20 +631,11 @@ namespace Game.AI
|
||||
foreach (var target in targets)
|
||||
{
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
@@ -653,20 +644,11 @@ namespace Game.AI
|
||||
foreach (var target in targets)
|
||||
{
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user