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
|
CallAreaexploredoreventhappens = 15, // Questid
|
||||||
SetIngamePhaseGroup = 16, // phaseGroupId, apply
|
SetIngamePhaseGroup = 16, // phaseGroupId, apply
|
||||||
SetEmoteState = 17, // Emoteid
|
SetEmoteState = 17, // Emoteid
|
||||||
SetUnitFlag = 18, // Flags (May Be More Than One Field Or'D Together), Target
|
SetUnitFlag = 18, // Flags
|
||||||
RemoveUnitFlag = 19, // Flags (May Be More Than One Field Or'D Together), Target
|
RemoveUnitFlag = 19, // Flags
|
||||||
AutoAttack = 20, // Allowattackstate (0 = Stop Attack, Anything Else Means Continue Attacking)
|
AutoAttack = 20, // Allowattackstate (0 = Stop Attack, Anything Else Means Continue Attacking)
|
||||||
AllowCombatMovement = 21, // Allowcombatmovement (0 = Stop Combat Based Movement, Anything Else Continue Attacking)
|
AllowCombatMovement = 21, // Allowcombatmovement (0 = Stop Combat Based Movement, Anything Else Continue Attacking)
|
||||||
SetEventPhase = 22, // Phase
|
SetEventPhase = 22, // Phase
|
||||||
|
|||||||
@@ -3518,7 +3518,6 @@ namespace Game.AI
|
|||||||
public struct UnitFlag
|
public struct UnitFlag
|
||||||
{
|
{
|
||||||
public uint flag;
|
public uint flag;
|
||||||
public uint type;
|
|
||||||
}
|
}
|
||||||
public struct Flag
|
public struct Flag
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -632,18 +632,9 @@ namespace Game.AI
|
|||||||
{
|
{
|
||||||
if (IsUnit(target))
|
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.ToUnit().AddUnitFlag((UnitFlags)e.Action.unitFlag.flag);
|
target.GetGUID().ToString(), 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;
|
break;
|
||||||
@@ -654,18 +645,9 @@ namespace Game.AI
|
|||||||
{
|
{
|
||||||
if (IsUnit(target))
|
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.ToUnit().RemoveUnitFlag((UnitFlags)e.Action.unitFlag.flag);
|
target.GetGUID().ToString(), 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;
|
break;
|
||||||
|
|||||||
Reference in New Issue
Block a user