Core/SAI: Remove SMART_ACTION_ADD_AURA & actions to change object flags
Port From (https://github.com/TrinityCore/TrinityCore/commit/5ba93a95de911277908596d805e7fa7f38a18c3a)
This commit is contained in:
@@ -329,7 +329,7 @@ namespace Framework.Constants
|
||||
CloseGossip = 72, // None
|
||||
TriggerTimedEvent = 73, // Id(>1)
|
||||
RemoveTimedEvent = 74, // Id(>1)
|
||||
AddAura = 75, // Spellid, Targets
|
||||
AddAura = 75, // UNUSED, DO NOT REUSE
|
||||
OverrideScriptBaseObject = 76, // Warning: Can Crash Core, Do Not Use If You Dont Know What You Are Doing
|
||||
ResetScriptBaseObject = 77, // None
|
||||
CallScriptReset = 78, // None
|
||||
@@ -358,9 +358,9 @@ namespace Framework.Constants
|
||||
SetHomePos = 101, // None
|
||||
SetHealthRegen = 102, // 0/1
|
||||
SetRoot = 103, // Off/On
|
||||
SetGoFlag = 104, // Flags
|
||||
AddGoFlag = 105, // Flags
|
||||
RemoveGoFlag = 106, // Flags
|
||||
SetGoFlag = 104, // UNUSED, DO NOT REUSE
|
||||
AddGoFlag = 105, // UNUSED, DO NOT REUSE
|
||||
RemoveGoFlag = 106, // UNUSED, DO NOT REUSE
|
||||
SummonCreatureGroup = 107, // Group, Attackinvoker
|
||||
SetPower = 108, // PowerType, newPower
|
||||
AddPower = 109, // PowerType, newPower
|
||||
|
||||
@@ -1070,10 +1070,10 @@ namespace Game.AI
|
||||
Log.outError(LogFilter.Sql, $"SmartAIMgr: {e} has invoker cast action, but event does not provide any invoker!");
|
||||
return false;
|
||||
}
|
||||
// no break
|
||||
goto case SmartActions.AddAura;
|
||||
if (!IsSpellValid(e, e.Action.cast.spell))
|
||||
return false;
|
||||
break;
|
||||
case SmartActions.SelfCast:
|
||||
case SmartActions.AddAura:
|
||||
if (!IsSpellValid(e, e.Action.cast.spell))
|
||||
return false;
|
||||
break;
|
||||
@@ -2544,9 +2544,6 @@ namespace Game.AI
|
||||
[FieldOffset(4)]
|
||||
public SetRoot setRoot;
|
||||
|
||||
[FieldOffset(4)]
|
||||
public GoFlag goFlag;
|
||||
|
||||
[FieldOffset(4)]
|
||||
public GoState goState;
|
||||
|
||||
@@ -3035,10 +3032,6 @@ namespace Game.AI
|
||||
{
|
||||
public uint root;
|
||||
}
|
||||
public struct GoFlag
|
||||
{
|
||||
public uint flag;
|
||||
}
|
||||
public struct GoState
|
||||
{
|
||||
public uint state;
|
||||
|
||||
@@ -571,19 +571,6 @@ namespace Game.AI
|
||||
}
|
||||
break;
|
||||
}
|
||||
case SmartActions.AddAura:
|
||||
{
|
||||
foreach (var target in targets)
|
||||
{
|
||||
if (IsUnit(target))
|
||||
{
|
||||
target.ToUnit().AddAura(e.Action.cast.spell, target.ToUnit());
|
||||
Log.outDebug(LogFilter.ScriptsAi, "SmartScript.ProcessAction. SMART_ACTION_ADD_AURA: Adding aura {0} to unit {1}",
|
||||
e.Action.cast.spell, target.GetGUID().ToString());
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
case SmartActions.ActivateGobject:
|
||||
{
|
||||
foreach (var target in targets)
|
||||
@@ -2042,27 +2029,6 @@ namespace Game.AI
|
||||
target.ToCreature().SetControlled(e.Action.setRoot.root != 0, UnitState.Root);
|
||||
break;
|
||||
}
|
||||
case SmartActions.SetGoFlag:
|
||||
{
|
||||
foreach (var target in targets)
|
||||
if (IsGameObject(target))
|
||||
target.ToGameObject().SetFlags((GameObjectFlags)e.Action.goFlag.flag);
|
||||
break;
|
||||
}
|
||||
case SmartActions.AddGoFlag:
|
||||
{
|
||||
foreach (var target in targets)
|
||||
if (IsGameObject(target))
|
||||
target.ToGameObject().AddFlag((GameObjectFlags)e.Action.goFlag.flag);
|
||||
break;
|
||||
}
|
||||
case SmartActions.RemoveGoFlag:
|
||||
{
|
||||
foreach (var target in targets)
|
||||
if (IsGameObject(target))
|
||||
target.ToGameObject().RemoveFlag((GameObjectFlags)e.Action.goFlag.flag);
|
||||
break;
|
||||
}
|
||||
case SmartActions.SummonCreatureGroup:
|
||||
{
|
||||
GetBaseObject().SummonCreatureGroup((byte)e.Action.creatureGroup.group, out List<TempSummon> summonList);
|
||||
|
||||
Reference in New Issue
Block a user