Core/SAI: Remove deprecated events and actions
Port From (https://github.com/TrinityCore/TrinityCore/commit/29190e56428afa8d5acd2cf6ca3d712c2558899d)
This commit is contained in:
@@ -166,13 +166,13 @@ namespace Framework.Constants
|
|||||||
Range = 9, // Mindist, Maxdist, Repeatmin, Repeatmax
|
Range = 9, // Mindist, Maxdist, Repeatmin, Repeatmax
|
||||||
OocLos = 10, // HostilityMode, Maxrnage, Cooldownmin, Cooldownmax
|
OocLos = 10, // HostilityMode, Maxrnage, Cooldownmin, Cooldownmax
|
||||||
Respawn = 11, // Type, Mapid, Zoneid
|
Respawn = 11, // Type, Mapid, Zoneid
|
||||||
TargetHealthPct = 12, // Hpmin%, Hpmax%, Repeatmin, Repeatmax
|
TargetHealthPct = 12, // UNUSED, do not reuse
|
||||||
VictimCasting = 13, // Repeatmin, Repeatmax
|
VictimCasting = 13, // Repeatmin, Repeatmax
|
||||||
FriendlyHealth = 14, // Hpdeficit, Radius, Repeatmin, Repeatmax
|
FriendlyHealth = 14, // UNUSED, do not reuse
|
||||||
FriendlyIsCc = 15, // Radius, Repeatmin, Repeatmax
|
FriendlyIsCc = 15, // Radius, Repeatmin, Repeatmax
|
||||||
FriendlyMissingBuff = 16, // Spellid, Radius, Repeatmin, Repeatmax
|
FriendlyMissingBuff = 16, // Spellid, Radius, Repeatmin, Repeatmax
|
||||||
SummonedUnit = 17, // Creatureid(0 All), Cooldownmin, Cooldownmax
|
SummonedUnit = 17, // Creatureid(0 All), Cooldownmin, Cooldownmax
|
||||||
TargetManaPct = 18, // Manamin%, Manamax%, Repeatmin, Repeatmax
|
TargetManaPct = 18, // UNUSED, do not reuse
|
||||||
AcceptedQuest = 19, // QuestID (0 = any), CooldownMin, CooldownMax
|
AcceptedQuest = 19, // QuestID (0 = any), CooldownMin, CooldownMax
|
||||||
RewardQuest = 20, // QuestID (0 = any), CooldownMin, CooldownMax
|
RewardQuest = 20, // QuestID (0 = any), CooldownMin, CooldownMax
|
||||||
ReachedHome = 21, // None
|
ReachedHome = 21, // None
|
||||||
@@ -221,7 +221,7 @@ namespace Framework.Constants
|
|||||||
GossipHello = 64, // noReportUse (for GOs)
|
GossipHello = 64, // noReportUse (for GOs)
|
||||||
FollowCompleted = 65, // None
|
FollowCompleted = 65, // None
|
||||||
PhaseChange = 66,
|
PhaseChange = 66,
|
||||||
IsBehindTarget = 67, // Cooldownmin, Cooldownmax
|
IsBehindTarget = 67, // UNUSED, do not reuse
|
||||||
GameEventStart = 68, // GameEvent.Entry
|
GameEventStart = 68, // GameEvent.Entry
|
||||||
GameEventEnd = 69, // GameEvent.Entry
|
GameEventEnd = 69, // GameEvent.Entry
|
||||||
GoLootStateChanged = 70, // Go State
|
GoLootStateChanged = 70, // Go State
|
||||||
@@ -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
|
SetUnitFlag = 18, // UNUSED, do not reuse
|
||||||
RemoveUnitFlag = 19, // Flags
|
RemoveUnitFlag = 19, // UNUSED, do not reuse
|
||||||
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
|
||||||
@@ -301,7 +301,7 @@ namespace Framework.Constants
|
|||||||
WpStop = 55, // Despawntime, Quest, Fail?
|
WpStop = 55, // Despawntime, Quest, Fail?
|
||||||
AddItem = 56, // Itemid, Count
|
AddItem = 56, // Itemid, Count
|
||||||
RemoveItem = 57, // Itemid, Count
|
RemoveItem = 57, // Itemid, Count
|
||||||
InstallAITemplate = 58, // do not use
|
InstallAITemplate = 58, // UNUSED, do not reuse
|
||||||
SetRun = 59, // 0/1
|
SetRun = 59, // 0/1
|
||||||
SetDisableGravity = 60, // 0/1
|
SetDisableGravity = 60, // 0/1
|
||||||
SetSwim = 61, // 0/1
|
SetSwim = 61, // 0/1
|
||||||
@@ -337,9 +337,9 @@ namespace Framework.Constants
|
|||||||
RemoveUnitFieldBytes1 = 91, // Bytes, Target
|
RemoveUnitFieldBytes1 = 91, // Bytes, Target
|
||||||
InterruptSpell = 92,
|
InterruptSpell = 92,
|
||||||
SendGoCustomAnim = 93, // Anim Id
|
SendGoCustomAnim = 93, // Anim Id
|
||||||
SetDynamicFlag = 94, // do not use
|
SetDynamicFlag = 94, // UNUSED, do not reuse
|
||||||
AddDynamicFlag = 95, // Flags
|
AddDynamicFlag = 95, // UNUSED, do not reuse
|
||||||
RemoveDynamicFlag = 96, // Flags
|
RemoveDynamicFlag = 96, // UNUSED, do not reuse
|
||||||
JumpToPos = 97, // Speedxy, Speedz, Targetx, Targety, Targetz
|
JumpToPos = 97, // Speedxy, Speedz, Targetx, Targety, Targetz
|
||||||
SendGossipMenu = 98, // Menuid, optionIndex
|
SendGossipMenu = 98, // Menuid, optionIndex
|
||||||
GoSetLootState = 99, // State
|
GoSetLootState = 99, // State
|
||||||
|
|||||||
@@ -249,11 +249,8 @@ namespace Game.AI
|
|||||||
case SmartEvents.UpdateOoc:
|
case SmartEvents.UpdateOoc:
|
||||||
case SmartEvents.UpdateIc:
|
case SmartEvents.UpdateIc:
|
||||||
case SmartEvents.HealthPct:
|
case SmartEvents.HealthPct:
|
||||||
case SmartEvents.TargetHealthPct:
|
|
||||||
case SmartEvents.ManaPct:
|
case SmartEvents.ManaPct:
|
||||||
case SmartEvents.TargetManaPct:
|
|
||||||
case SmartEvents.Range:
|
case SmartEvents.Range:
|
||||||
case SmartEvents.FriendlyHealth:
|
|
||||||
case SmartEvents.FriendlyHealthPCT:
|
case SmartEvents.FriendlyHealthPCT:
|
||||||
case SmartEvents.FriendlyMissingBuff:
|
case SmartEvents.FriendlyMissingBuff:
|
||||||
case SmartEvents.HasAura:
|
case SmartEvents.HasAura:
|
||||||
@@ -414,17 +411,13 @@ namespace Game.AI
|
|||||||
case SmartEvents.IcLos:
|
case SmartEvents.IcLos:
|
||||||
case SmartEvents.OocLos:
|
case SmartEvents.OocLos:
|
||||||
case SmartEvents.DistanceCreature:
|
case SmartEvents.DistanceCreature:
|
||||||
case SmartEvents.FriendlyHealth:
|
|
||||||
case SmartEvents.FriendlyHealthPCT:
|
case SmartEvents.FriendlyHealthPCT:
|
||||||
case SmartEvents.FriendlyIsCc:
|
case SmartEvents.FriendlyIsCc:
|
||||||
case SmartEvents.FriendlyMissingBuff:
|
case SmartEvents.FriendlyMissingBuff:
|
||||||
case SmartEvents.ActionDone:
|
case SmartEvents.ActionDone:
|
||||||
case SmartEvents.TargetHealthPct:
|
|
||||||
case SmartEvents.TargetManaPct:
|
|
||||||
case SmartEvents.Range:
|
case SmartEvents.Range:
|
||||||
case SmartEvents.VictimCasting:
|
case SmartEvents.VictimCasting:
|
||||||
case SmartEvents.TargetBuffed:
|
case SmartEvents.TargetBuffed:
|
||||||
case SmartEvents.IsBehindTarget:
|
|
||||||
case SmartEvents.InstancePlayerEnter:
|
case SmartEvents.InstancePlayerEnter:
|
||||||
case SmartEvents.TransportAddcreature:
|
case SmartEvents.TransportAddcreature:
|
||||||
case SmartEvents.DataSet:
|
case SmartEvents.DataSet:
|
||||||
@@ -572,13 +565,10 @@ namespace Game.AI
|
|||||||
SmartEvents.Range => Marshal.SizeOf(typeof(SmartEvent.MinMaxRepeat)),
|
SmartEvents.Range => Marshal.SizeOf(typeof(SmartEvent.MinMaxRepeat)),
|
||||||
SmartEvents.OocLos => Marshal.SizeOf(typeof(SmartEvent.Los)),
|
SmartEvents.OocLos => Marshal.SizeOf(typeof(SmartEvent.Los)),
|
||||||
SmartEvents.Respawn => Marshal.SizeOf(typeof(SmartEvent.Respawn)),
|
SmartEvents.Respawn => Marshal.SizeOf(typeof(SmartEvent.Respawn)),
|
||||||
SmartEvents.TargetHealthPct => Marshal.SizeOf(typeof(SmartEvent.MinMaxRepeat)),
|
|
||||||
SmartEvents.VictimCasting => Marshal.SizeOf(typeof(SmartEvent.TargetCasting)),
|
SmartEvents.VictimCasting => Marshal.SizeOf(typeof(SmartEvent.TargetCasting)),
|
||||||
SmartEvents.FriendlyHealth => Marshal.SizeOf(typeof(SmartEvent.FriendlyHealth)),
|
|
||||||
SmartEvents.FriendlyIsCc => Marshal.SizeOf(typeof(SmartEvent.FriendlyCC)),
|
SmartEvents.FriendlyIsCc => Marshal.SizeOf(typeof(SmartEvent.FriendlyCC)),
|
||||||
SmartEvents.FriendlyMissingBuff => Marshal.SizeOf(typeof(SmartEvent.MissingBuff)),
|
SmartEvents.FriendlyMissingBuff => Marshal.SizeOf(typeof(SmartEvent.MissingBuff)),
|
||||||
SmartEvents.SummonedUnit => Marshal.SizeOf(typeof(SmartEvent.Summoned)),
|
SmartEvents.SummonedUnit => Marshal.SizeOf(typeof(SmartEvent.Summoned)),
|
||||||
SmartEvents.TargetManaPct => Marshal.SizeOf(typeof(SmartEvent.MinMaxRepeat)),
|
|
||||||
SmartEvents.AcceptedQuest => Marshal.SizeOf(typeof(SmartEvent.Quest)),
|
SmartEvents.AcceptedQuest => Marshal.SizeOf(typeof(SmartEvent.Quest)),
|
||||||
SmartEvents.RewardQuest => Marshal.SizeOf(typeof(SmartEvent.Quest)),
|
SmartEvents.RewardQuest => Marshal.SizeOf(typeof(SmartEvent.Quest)),
|
||||||
SmartEvents.ReachedHome => 0,
|
SmartEvents.ReachedHome => 0,
|
||||||
@@ -627,7 +617,6 @@ namespace Game.AI
|
|||||||
SmartEvents.GossipHello => Marshal.SizeOf(typeof(SmartEvent.GossipHello)),
|
SmartEvents.GossipHello => Marshal.SizeOf(typeof(SmartEvent.GossipHello)),
|
||||||
SmartEvents.FollowCompleted => 0,
|
SmartEvents.FollowCompleted => 0,
|
||||||
SmartEvents.PhaseChange => Marshal.SizeOf(typeof(SmartEvent.EventPhaseChange)),
|
SmartEvents.PhaseChange => Marshal.SizeOf(typeof(SmartEvent.EventPhaseChange)),
|
||||||
SmartEvents.IsBehindTarget => Marshal.SizeOf(typeof(SmartEvent.BehindTarget)),
|
|
||||||
SmartEvents.GameEventStart => Marshal.SizeOf(typeof(SmartEvent.GameEvent)),
|
SmartEvents.GameEventStart => Marshal.SizeOf(typeof(SmartEvent.GameEvent)),
|
||||||
SmartEvents.GameEventEnd => Marshal.SizeOf(typeof(SmartEvent.GameEvent)),
|
SmartEvents.GameEventEnd => Marshal.SizeOf(typeof(SmartEvent.GameEvent)),
|
||||||
SmartEvents.GoLootStateChanged => Marshal.SizeOf(typeof(SmartEvent.GoLootStateChanged)),
|
SmartEvents.GoLootStateChanged => Marshal.SizeOf(typeof(SmartEvent.GoLootStateChanged)),
|
||||||
@@ -700,8 +689,6 @@ namespace Game.AI
|
|||||||
SmartActions.CallAreaexploredoreventhappens => Marshal.SizeOf(typeof(SmartAction.Quest)),
|
SmartActions.CallAreaexploredoreventhappens => Marshal.SizeOf(typeof(SmartAction.Quest)),
|
||||||
SmartActions.SetIngamePhaseGroup => Marshal.SizeOf(typeof(SmartAction.IngamePhaseGroup)),
|
SmartActions.SetIngamePhaseGroup => Marshal.SizeOf(typeof(SmartAction.IngamePhaseGroup)),
|
||||||
SmartActions.SetEmoteState => Marshal.SizeOf(typeof(SmartAction.Emote)),
|
SmartActions.SetEmoteState => Marshal.SizeOf(typeof(SmartAction.Emote)),
|
||||||
SmartActions.SetUnitFlag => Marshal.SizeOf(typeof(SmartAction.UnitFlag)),
|
|
||||||
SmartActions.RemoveUnitFlag => Marshal.SizeOf(typeof(SmartAction.UnitFlag)),
|
|
||||||
SmartActions.AutoAttack => Marshal.SizeOf(typeof(SmartAction.AutoAttack)),
|
SmartActions.AutoAttack => Marshal.SizeOf(typeof(SmartAction.AutoAttack)),
|
||||||
SmartActions.AllowCombatMovement => Marshal.SizeOf(typeof(SmartAction.CombatMove)),
|
SmartActions.AllowCombatMovement => Marshal.SizeOf(typeof(SmartAction.CombatMove)),
|
||||||
SmartActions.SetEventPhase => Marshal.SizeOf(typeof(SmartAction.SetEventPhase)),
|
SmartActions.SetEventPhase => Marshal.SizeOf(typeof(SmartAction.SetEventPhase)),
|
||||||
@@ -987,8 +974,6 @@ namespace Game.AI
|
|||||||
case SmartEvents.UpdateOoc:
|
case SmartEvents.UpdateOoc:
|
||||||
case SmartEvents.HealthPct:
|
case SmartEvents.HealthPct:
|
||||||
case SmartEvents.ManaPct:
|
case SmartEvents.ManaPct:
|
||||||
case SmartEvents.TargetHealthPct:
|
|
||||||
case SmartEvents.TargetManaPct:
|
|
||||||
case SmartEvents.Range:
|
case SmartEvents.Range:
|
||||||
case SmartEvents.Damaged:
|
case SmartEvents.Damaged:
|
||||||
case SmartEvents.DamagedTarget:
|
case SmartEvents.DamagedTarget:
|
||||||
@@ -1041,13 +1026,6 @@ namespace Game.AI
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case SmartEvents.FriendlyHealth:
|
|
||||||
if (!NotNULL(e, e.Event.friendlyHealth.radius))
|
|
||||||
return false;
|
|
||||||
|
|
||||||
if (!IsMinMaxValid(e, e.Event.friendlyHealth.repeatMin, e.Event.friendlyHealth.repeatMax))
|
|
||||||
return false;
|
|
||||||
break;
|
|
||||||
case SmartEvents.FriendlyIsCc:
|
case SmartEvents.FriendlyIsCc:
|
||||||
if (!IsMinMaxValid(e, e.Event.friendlyCC.repeatMin, e.Event.friendlyCC.repeatMax))
|
if (!IsMinMaxValid(e, e.Event.friendlyCC.repeatMin, e.Event.friendlyCC.repeatMax))
|
||||||
return false;
|
return false;
|
||||||
@@ -1184,12 +1162,6 @@ namespace Game.AI
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case SmartEvents.IsBehindTarget:
|
|
||||||
{
|
|
||||||
if (!IsMinMaxValid(e, e.Event.behindTarget.cooldownMin, e.Event.behindTarget.cooldownMax))
|
|
||||||
return false;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case SmartEvents.GameEventStart:
|
case SmartEvents.GameEventStart:
|
||||||
case SmartEvents.GameEventEnd:
|
case SmartEvents.GameEventEnd:
|
||||||
{
|
{
|
||||||
@@ -1358,24 +1330,18 @@ namespace Game.AI
|
|||||||
case SmartEvents.SceneComplete:
|
case SmartEvents.SceneComplete:
|
||||||
case SmartEvents.SceneTrigger:
|
case SmartEvents.SceneTrigger:
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
//Unused
|
||||||
|
case SmartEvents.TargetHealthPct:
|
||||||
|
case SmartEvents.FriendlyHealth:
|
||||||
|
case SmartEvents.TargetManaPct:
|
||||||
|
case SmartEvents.IsBehindTarget:
|
||||||
|
Log.outError(LogFilter.Sql, $"SmartAIMgr: Unused event_type {e} skipped.");
|
||||||
|
return false;
|
||||||
default:
|
default:
|
||||||
Log.outError(LogFilter.ScriptsAi, "SmartAIMgr: Not handled event_type({0}), Entry {1} SourceType {2} Event {3} Action {4}, skipped.", e.GetEventType(), e.EntryOrGuid, e.GetScriptType(), e.EventId, e.GetActionType());
|
Log.outError(LogFilter.ScriptsAi, "SmartAIMgr: Not handled event_type({0}), Entry {1} SourceType {2} Event {3} Action {4}, skipped.", e.GetEventType(), e.EntryOrGuid, e.GetScriptType(), e.EventId, e.GetActionType());
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Additional check for deprecated
|
|
||||||
switch (e.GetEventType())
|
|
||||||
{
|
|
||||||
// Deprecated
|
|
||||||
case SmartEvents.FriendlyHealth:
|
|
||||||
case SmartEvents.TargetHealthPct:
|
|
||||||
case SmartEvents.IsBehindTarget:
|
|
||||||
case SmartEvents.TargetManaPct:
|
|
||||||
Log.outWarn(LogFilter.Sql, $"SmartAIMgr: Deprecated event_type({e.GetEventType()}), {e}, it might be removed in the future, loaded for now.");
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!CheckUnusedEventParams(e))
|
if (!CheckUnusedEventParams(e))
|
||||||
@@ -2127,8 +2093,6 @@ namespace Game.AI
|
|||||||
case SmartActions.AttackStop:
|
case SmartActions.AttackStop:
|
||||||
case SmartActions.WpPause:
|
case SmartActions.WpPause:
|
||||||
case SmartActions.ForceDespawn:
|
case SmartActions.ForceDespawn:
|
||||||
case SmartActions.SetUnitFlag:
|
|
||||||
case SmartActions.RemoveUnitFlag:
|
|
||||||
case SmartActions.Playmovie:
|
case SmartActions.Playmovie:
|
||||||
case SmartActions.CloseGossip:
|
case SmartActions.CloseGossip:
|
||||||
case SmartActions.TriggerTimedEvent:
|
case SmartActions.TriggerTimedEvent:
|
||||||
@@ -2146,8 +2110,6 @@ namespace Game.AI
|
|||||||
case SmartActions.SetUnitFieldBytes1:
|
case SmartActions.SetUnitFieldBytes1:
|
||||||
case SmartActions.RemoveUnitFieldBytes1:
|
case SmartActions.RemoveUnitFieldBytes1:
|
||||||
case SmartActions.SendGoCustomAnim:
|
case SmartActions.SendGoCustomAnim:
|
||||||
case SmartActions.AddDynamicFlag:
|
|
||||||
case SmartActions.RemoveDynamicFlag:
|
|
||||||
case SmartActions.JumpToPos:
|
case SmartActions.JumpToPos:
|
||||||
case SmartActions.SendGossipMenu:
|
case SmartActions.SendGossipMenu:
|
||||||
case SmartActions.GoSetLootState:
|
case SmartActions.GoSetLootState:
|
||||||
@@ -2178,30 +2140,19 @@ namespace Game.AI
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
// No longer supported
|
// No longer supported
|
||||||
|
case SmartActions.SetUnitFlag:
|
||||||
|
case SmartActions.RemoveUnitFlag:
|
||||||
case SmartActions.InstallAITemplate:
|
case SmartActions.InstallAITemplate:
|
||||||
case SmartActions.SetDynamicFlag:
|
case SmartActions.SetDynamicFlag:
|
||||||
Log.outError(LogFilter.Sql, $"SmartAIMgr: No longer supported action_type: {e} Skipped.");
|
case SmartActions.AddDynamicFlag:
|
||||||
|
case SmartActions.RemoveDynamicFlag:
|
||||||
|
Log.outError(LogFilter.Sql, $"SmartAIMgr: Unused action_type: {e} Skipped.");
|
||||||
return false;
|
return false;
|
||||||
default:
|
default:
|
||||||
Log.outError(LogFilter.ScriptsAi, "SmartAIMgr: Not handled action_type({0}), event_type({1}), Entry {2} SourceType {3} Event {4}, skipped.", e.GetActionType(), e.GetEventType(), e.EntryOrGuid, e.GetScriptType(), e.EventId);
|
Log.outError(LogFilter.ScriptsAi, "SmartAIMgr: Not handled action_type({0}), event_type({1}), Entry {2} SourceType {3} Event {4}, skipped.", e.GetActionType(), e.GetEventType(), e.EntryOrGuid, e.GetScriptType(), e.EventId);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Additional check for deprecated
|
|
||||||
switch (e.GetActionType())
|
|
||||||
{
|
|
||||||
// Deprecated
|
|
||||||
case SmartActions.SetUnitFlag:
|
|
||||||
case SmartActions.RemoveUnitFlag:
|
|
||||||
case SmartActions.AddItem:
|
|
||||||
case SmartActions.AddDynamicFlag:
|
|
||||||
case SmartActions.RemoveDynamicFlag:
|
|
||||||
Log.outWarn(LogFilter.Sql, $"SmartAIMgr: Deprecated action_type: {e}, it might be removed in the future, loaded for now.");
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!CheckUnusedActionParams(e))
|
if (!CheckUnusedActionParams(e))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
@@ -2612,9 +2563,6 @@ namespace Game.AI
|
|||||||
[FieldOffset(16)]
|
[FieldOffset(16)]
|
||||||
public TargetCasting targetCasting;
|
public TargetCasting targetCasting;
|
||||||
|
|
||||||
[FieldOffset(16)]
|
|
||||||
public FriendlyHealth friendlyHealth;
|
|
||||||
|
|
||||||
[FieldOffset(16)]
|
[FieldOffset(16)]
|
||||||
public FriendlyCC friendlyCC;
|
public FriendlyCC friendlyCC;
|
||||||
|
|
||||||
@@ -2675,9 +2623,6 @@ namespace Game.AI
|
|||||||
[FieldOffset(16)]
|
[FieldOffset(16)]
|
||||||
public EventPhaseChange eventPhaseChange;
|
public EventPhaseChange eventPhaseChange;
|
||||||
|
|
||||||
[FieldOffset(16)]
|
|
||||||
public BehindTarget behindTarget;
|
|
||||||
|
|
||||||
[FieldOffset(16)]
|
[FieldOffset(16)]
|
||||||
public GameEvent gameEvent;
|
public GameEvent gameEvent;
|
||||||
|
|
||||||
@@ -2755,13 +2700,6 @@ namespace Game.AI
|
|||||||
public uint repeatMax;
|
public uint repeatMax;
|
||||||
public uint spellId;
|
public uint spellId;
|
||||||
}
|
}
|
||||||
public struct FriendlyHealth
|
|
||||||
{
|
|
||||||
public uint hpDeficit;
|
|
||||||
public uint radius;
|
|
||||||
public uint repeatMin;
|
|
||||||
public uint repeatMax;
|
|
||||||
}
|
|
||||||
public struct FriendlyCC
|
public struct FriendlyCC
|
||||||
{
|
{
|
||||||
public uint radius;
|
public uint radius;
|
||||||
@@ -2865,11 +2803,6 @@ namespace Game.AI
|
|||||||
{
|
{
|
||||||
public uint phasemask;
|
public uint phasemask;
|
||||||
}
|
}
|
||||||
public struct BehindTarget
|
|
||||||
{
|
|
||||||
public uint cooldownMin;
|
|
||||||
public uint cooldownMax;
|
|
||||||
}
|
|
||||||
public struct GameEvent
|
public struct GameEvent
|
||||||
{
|
{
|
||||||
public uint gameEventId;
|
public uint gameEventId;
|
||||||
@@ -3097,9 +3030,6 @@ namespace Game.AI
|
|||||||
[FieldOffset(4)]
|
[FieldOffset(4)]
|
||||||
public Equip equip;
|
public Equip equip;
|
||||||
|
|
||||||
[FieldOffset(4)]
|
|
||||||
public UnitFlag unitFlag;
|
|
||||||
|
|
||||||
[FieldOffset(4)]
|
[FieldOffset(4)]
|
||||||
public Flag flag;
|
public Flag flag;
|
||||||
|
|
||||||
@@ -3555,10 +3485,6 @@ namespace Game.AI
|
|||||||
public uint slot2;
|
public uint slot2;
|
||||||
public uint slot3;
|
public uint slot3;
|
||||||
}
|
}
|
||||||
public struct UnitFlag
|
|
||||||
{
|
|
||||||
public uint flag;
|
|
||||||
}
|
|
||||||
public struct Flag
|
public struct Flag
|
||||||
{
|
{
|
||||||
public uint flag;
|
public uint flag;
|
||||||
|
|||||||
@@ -626,32 +626,6 @@ namespace Game.AI
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case SmartActions.SetUnitFlag:
|
|
||||||
{
|
|
||||||
foreach (var target in targets)
|
|
||||||
{
|
|
||||||
if (IsUnit(target))
|
|
||||||
{
|
|
||||||
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;
|
|
||||||
}
|
|
||||||
case SmartActions.RemoveUnitFlag:
|
|
||||||
{
|
|
||||||
foreach (var target in targets)
|
|
||||||
{
|
|
||||||
if (IsUnit(target))
|
|
||||||
{
|
|
||||||
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;
|
|
||||||
}
|
|
||||||
case SmartActions.AutoAttack:
|
case SmartActions.AutoAttack:
|
||||||
{
|
{
|
||||||
if (!IsSmart())
|
if (!IsSmart())
|
||||||
@@ -3149,16 +3123,6 @@ namespace Game.AI
|
|||||||
ProcessTimedAction(e, e.Event.minMaxRepeat.repeatMin, e.Event.minMaxRepeat.repeatMax);
|
ProcessTimedAction(e, e.Event.minMaxRepeat.repeatMin, e.Event.minMaxRepeat.repeatMax);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case SmartEvents.TargetHealthPct:
|
|
||||||
{
|
|
||||||
if (_me == null || !_me.IsEngaged() || _me.GetVictim() == null || _me.GetVictim().GetMaxHealth() == 0)
|
|
||||||
return;
|
|
||||||
uint perc = (uint)_me.GetVictim().GetHealthPct();
|
|
||||||
if (perc > e.Event.minMaxRepeat.max || perc < e.Event.minMaxRepeat.min)
|
|
||||||
return;
|
|
||||||
ProcessTimedAction(e, e.Event.minMaxRepeat.repeatMin, e.Event.minMaxRepeat.repeatMax, _me.GetVictim());
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case SmartEvents.ManaPct:
|
case SmartEvents.ManaPct:
|
||||||
{
|
{
|
||||||
if (_me == null || !_me.IsEngaged() || _me.GetMaxPower(PowerType.Mana) == 0)
|
if (_me == null || !_me.IsEngaged() || _me.GetMaxPower(PowerType.Mana) == 0)
|
||||||
@@ -3169,16 +3133,6 @@ namespace Game.AI
|
|||||||
ProcessTimedAction(e, e.Event.minMaxRepeat.repeatMin, e.Event.minMaxRepeat.repeatMax);
|
ProcessTimedAction(e, e.Event.minMaxRepeat.repeatMin, e.Event.minMaxRepeat.repeatMax);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case SmartEvents.TargetManaPct:
|
|
||||||
{
|
|
||||||
if (_me == null || !_me.IsEngaged() || _me.GetVictim() == null || _me.GetVictim().GetMaxPower(PowerType.Mana) == 0)
|
|
||||||
return;
|
|
||||||
uint perc = (uint)_me.GetVictim().GetPowerPct(PowerType.Mana);
|
|
||||||
if (perc > e.Event.minMaxRepeat.max || perc < e.Event.minMaxRepeat.min)
|
|
||||||
return;
|
|
||||||
ProcessTimedAction(e, e.Event.minMaxRepeat.repeatMin, e.Event.minMaxRepeat.repeatMax, _me.GetVictim());
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case SmartEvents.Range:
|
case SmartEvents.Range:
|
||||||
{
|
{
|
||||||
if (_me == null || !_me.IsEngaged() || _me.GetVictim() == null)
|
if (_me == null || !_me.IsEngaged() || _me.GetVictim() == null)
|
||||||
@@ -3211,22 +3165,6 @@ namespace Game.AI
|
|||||||
ProcessTimedAction(e, e.Event.targetCasting.repeatMin, e.Event.targetCasting.repeatMax, _me.GetVictim());
|
ProcessTimedAction(e, e.Event.targetCasting.repeatMin, e.Event.targetCasting.repeatMax, _me.GetVictim());
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case SmartEvents.FriendlyHealth:
|
|
||||||
{
|
|
||||||
if (_me == null || !_me.IsEngaged())
|
|
||||||
return;
|
|
||||||
|
|
||||||
Unit target = DoSelectLowestHpFriendly(e.Event.friendlyHealth.radius, e.Event.friendlyHealth.hpDeficit);
|
|
||||||
if (target == null || !target.IsInCombat())
|
|
||||||
{
|
|
||||||
// if there are at least two same npcs, they will perform the same action immediately even if this is useless...
|
|
||||||
RecalcTimer(e, 1000, 3000);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
ProcessTimedAction(e, e.Event.friendlyHealth.repeatMin, e.Event.friendlyHealth.repeatMax, target);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case SmartEvents.FriendlyIsCc:
|
case SmartEvents.FriendlyIsCc:
|
||||||
{
|
{
|
||||||
if (_me == null || !_me.IsEngaged())
|
if (_me == null || !_me.IsEngaged())
|
||||||
@@ -3336,19 +3274,6 @@ namespace Game.AI
|
|||||||
ProcessAction(e, unit, var0, var1, bvar, spell, gob);
|
ProcessAction(e, unit, var0, var1, bvar, spell, gob);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case SmartEvents.IsBehindTarget:
|
|
||||||
{
|
|
||||||
if (_me == null)
|
|
||||||
return;
|
|
||||||
|
|
||||||
Unit victim = _me.GetVictim();
|
|
||||||
if (victim != null)
|
|
||||||
{
|
|
||||||
if (!victim.HasInArc(MathFunctions.PI, _me))
|
|
||||||
ProcessTimedAction(e, e.Event.behindTarget.cooldownMin, e.Event.behindTarget.cooldownMax, victim);
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case SmartEvents.ReceiveEmote:
|
case SmartEvents.ReceiveEmote:
|
||||||
if (e.Event.emote.emoteId == var0)
|
if (e.Event.emote.emoteId == var0)
|
||||||
{
|
{
|
||||||
@@ -3810,17 +3735,13 @@ namespace Game.AI
|
|||||||
case SmartEvents.UpdateIc:
|
case SmartEvents.UpdateIc:
|
||||||
case SmartEvents.UpdateOoc:
|
case SmartEvents.UpdateOoc:
|
||||||
case SmartEvents.HealthPct:
|
case SmartEvents.HealthPct:
|
||||||
case SmartEvents.TargetHealthPct:
|
|
||||||
case SmartEvents.ManaPct:
|
case SmartEvents.ManaPct:
|
||||||
case SmartEvents.TargetManaPct:
|
|
||||||
case SmartEvents.Range:
|
case SmartEvents.Range:
|
||||||
case SmartEvents.VictimCasting:
|
case SmartEvents.VictimCasting:
|
||||||
case SmartEvents.FriendlyHealth:
|
|
||||||
case SmartEvents.FriendlyIsCc:
|
case SmartEvents.FriendlyIsCc:
|
||||||
case SmartEvents.FriendlyMissingBuff:
|
case SmartEvents.FriendlyMissingBuff:
|
||||||
case SmartEvents.HasAura:
|
case SmartEvents.HasAura:
|
||||||
case SmartEvents.TargetBuffed:
|
case SmartEvents.TargetBuffed:
|
||||||
case SmartEvents.IsBehindTarget:
|
|
||||||
case SmartEvents.FriendlyHealthPCT:
|
case SmartEvents.FriendlyHealthPCT:
|
||||||
case SmartEvents.DistanceCreature:
|
case SmartEvents.DistanceCreature:
|
||||||
case SmartEvents.DistanceGameobject:
|
case SmartEvents.DistanceGameobject:
|
||||||
|
|||||||
Reference in New Issue
Block a user