Core/SAI: Remove deprecated events and actions
Port From (https://github.com/TrinityCore/TrinityCore/commit/e27724b3620ce245c8055d1cfa58b7caade7fb64)
This commit is contained in:
@@ -166,13 +166,13 @@ namespace Framework.Constants
|
||||
Range = 9, // Mindist, Maxdist, Repeatmin, Repeatmax
|
||||
OocLos = 10, // HostilityMode, Maxrnage, Cooldownmin, Cooldownmax
|
||||
Respawn = 11, // Type, Mapid, Zoneid
|
||||
TargetHealthPct = 12, // UNUSED, do not reuse
|
||||
TargetHealthPct = 12, // UNUSED, DO NOT REUSE
|
||||
VictimCasting = 13, // Repeatmin, Repeatmax
|
||||
FriendlyHealth = 14, // UNUSED, do not reuse
|
||||
FriendlyHealth = 14, // UNUSED, DO NOT REUSE
|
||||
FriendlyIsCc = 15, // Radius, Repeatmin, Repeatmax
|
||||
FriendlyMissingBuff = 16, // Spellid, Radius, Repeatmin, Repeatmax
|
||||
SummonedUnit = 17, // Creatureid(0 All), Cooldownmin, Cooldownmax
|
||||
TargetManaPct = 18, // UNUSED, do not reuse
|
||||
TargetManaPct = 18, // UNUSED, DO NOT REUSE
|
||||
AcceptedQuest = 19, // QuestID (0 = any), CooldownMin, CooldownMax
|
||||
RewardQuest = 20, // QuestID (0 = any), CooldownMin, CooldownMax
|
||||
ReachedHome = 21, // None
|
||||
@@ -184,7 +184,7 @@ namespace Framework.Constants
|
||||
PassengerBoarded = 27, // Cooldownmin, Cooldownmax
|
||||
PassengerRemoved = 28, // Cooldownmin, Cooldownmax
|
||||
Charmed = 29, // onRemove (0 - on apply, 1 - on remove)
|
||||
CharmedTarget = 30, // None
|
||||
CharmedTarget = 30, // UNUSED, DO NOT REUSE
|
||||
SpellHitTarget = 31, // Spellid, School, Cooldownmin, Cooldownmax
|
||||
Damaged = 32, // Mindmg, Maxdmg, Cooldownmin, Cooldownmax
|
||||
DamagedTarget = 33, // Mindmg, Maxdmg, Cooldownmin, Cooldownmax
|
||||
@@ -193,7 +193,7 @@ namespace Framework.Constants
|
||||
CorpseRemoved = 36, // None
|
||||
AiInit = 37, // None
|
||||
DataSet = 38, // Id, Value, Cooldownmin, Cooldownmax
|
||||
WaypointStart = 39, // Pointid(0any), Pathid(0any)
|
||||
WaypointStart = 39, // UNUSED, DO NOT REUSE
|
||||
WaypointReached = 40, // Pointid(0any), Pathid(0any)
|
||||
TransportAddplayer = 41, // None
|
||||
TransportAddcreature = 42, // Entry (0 Any)
|
||||
@@ -220,8 +220,8 @@ namespace Framework.Constants
|
||||
JustCreated = 63, // None
|
||||
GossipHello = 64, // noReportUse (for GOs)
|
||||
FollowCompleted = 65, // None
|
||||
PhaseChange = 66,
|
||||
IsBehindTarget = 67, // UNUSED, do not reuse
|
||||
PhaseChange = 66, //UNUSED, DO NOT REUSE
|
||||
IsBehindTarget = 67, // UNUSED, DO NOT REUSE
|
||||
GameEventStart = 68, // GameEvent.Entry
|
||||
GameEventEnd = 69, // GameEvent.Entry
|
||||
GoLootStateChanged = 70, // Go State
|
||||
@@ -261,8 +261,8 @@ namespace Framework.Constants
|
||||
CallAreaexploredoreventhappens = 15, // Questid
|
||||
SetIngamePhaseGroup = 16, // phaseGroupId, apply
|
||||
SetEmoteState = 17, // Emoteid
|
||||
SetUnitFlag = 18, // UNUSED, do not reuse
|
||||
RemoveUnitFlag = 19, // UNUSED, do not reuse
|
||||
SetUnitFlag = 18, // UNUSED, DO NOT REUSE
|
||||
RemoveUnitFlag = 19, // UNUSED, DO NOT REUSE
|
||||
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
|
||||
@@ -301,10 +301,10 @@ namespace Framework.Constants
|
||||
WpStop = 55, // Despawntime, Quest, Fail?
|
||||
AddItem = 56, // Itemid, Count
|
||||
RemoveItem = 57, // Itemid, Count
|
||||
InstallAITemplate = 58, // UNUSED, do not reuse
|
||||
InstallAITemplate = 58, // UNUSED, DO NOT REUSE
|
||||
SetRun = 59, // 0/1
|
||||
SetDisableGravity = 60, // 0/1
|
||||
SetSwim = 61, // 0/1
|
||||
SetSwim = 61, // UNUSED, DO NOT REUSE
|
||||
Teleport = 62, // Mapid,
|
||||
SetCounter = 63, // id, value, reset (0/1)
|
||||
StoreTargetList = 64, // Varid,
|
||||
@@ -319,8 +319,8 @@ namespace Framework.Constants
|
||||
TriggerTimedEvent = 73, // Id(>1)
|
||||
RemoveTimedEvent = 74, // Id(>1)
|
||||
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
|
||||
OverrideScriptBaseObject = 76, // UNUSED, DO NOT REUSE
|
||||
ResetScriptBaseObject = 77, // UNUSED, DO NOT REUSE
|
||||
CallScriptReset = 78, // None
|
||||
SetRangedMovement = 79, // Distance, Angle
|
||||
CallTimedActionlist = 80, // Id (Overwrites Already Running Actionlist), Stop After Combat?(0/1), Timer Update Type(0-Ooc, 1-Ic, 2-Always)
|
||||
@@ -337,9 +337,9 @@ namespace Framework.Constants
|
||||
RemoveUnitFieldBytes1 = 91, // Bytes, Target
|
||||
InterruptSpell = 92,
|
||||
SendGoCustomAnim = 93, // Anim Id
|
||||
SetDynamicFlag = 94, // UNUSED, do not reuse
|
||||
AddDynamicFlag = 95, // UNUSED, do not reuse
|
||||
RemoveDynamicFlag = 96, // UNUSED, do not reuse
|
||||
SetDynamicFlag = 94, // UNUSED, DO NOT REUSE
|
||||
AddDynamicFlag = 95, // UNUSED, DO NOT REUSE
|
||||
RemoveDynamicFlag = 96, // UNUSED, DO NOT REUSE
|
||||
JumpToPos = 97, // Speedxy, Speedz, Targetx, Targety, Targetz
|
||||
SendGossipMenu = 98, // Menuid, optionIndex
|
||||
GoSetLootState = 99, // State
|
||||
@@ -362,14 +362,14 @@ namespace Framework.Constants
|
||||
SetCorpseDelay = 116, // timer
|
||||
DisableEvade = 117, // 0/1 (1 = disabled, 0 = enabled)
|
||||
GoSetGoState = 118,
|
||||
SetCanFly = 119, // 0/1
|
||||
RemoveAurasByType = 120, // type
|
||||
SetSightDist = 121, // sightDistance
|
||||
Flee = 122, // fleeTime
|
||||
SetCanFly = 119, // UNUSED, DO NOT REUSE
|
||||
RemoveAurasByType = 120, // UNUSED, DO NOT REUSE
|
||||
SetSightDist = 121, // UNUSED, DO NOT REUSE
|
||||
Flee = 122, // UNUSED, DO NOT REUSE
|
||||
AddThreat = 123, // +threat, -threat
|
||||
LoadEquipment = 124, // id
|
||||
TriggerRandomTimedEvent = 125, // id min range, id max range
|
||||
RemoveAllGameobjects = 126,
|
||||
RemoveAllGameobjects = 126, // UNUSED, DO NOT REUSE
|
||||
PauseMovement = 127, // MovementSlot (default = 0, active = 1, controlled = 2), PauseTime (ms), Force
|
||||
PlayAnimkit = 128,
|
||||
ScenePlay = 129, // sceneId
|
||||
|
||||
@@ -401,11 +401,6 @@ namespace Game.AI
|
||||
return true;
|
||||
}
|
||||
|
||||
public override void WaypointStarted(uint nodeId, uint pathId)
|
||||
{
|
||||
GetScript().ProcessEventsFor(SmartEvents.WaypointStart, null, nodeId, pathId);
|
||||
}
|
||||
|
||||
public override void WaypointReached(uint nodeId, uint pathId)
|
||||
{
|
||||
if (!HasEscortState(SmartEscortState.Escorting))
|
||||
@@ -801,16 +796,6 @@ namespace Game.AI
|
||||
me.SetDisableGravity(disable);
|
||||
}
|
||||
|
||||
public void SetCanFly(bool fly = true)
|
||||
{
|
||||
me.SetCanFly(fly);
|
||||
}
|
||||
|
||||
public void SetSwim(bool swim)
|
||||
{
|
||||
me.SetSwim(swim);
|
||||
}
|
||||
|
||||
public void SetEvadeDisabled(bool disable)
|
||||
{
|
||||
_evadeDisabled = disable;
|
||||
|
||||
@@ -580,7 +580,6 @@ namespace Game.AI
|
||||
SmartEvents.PassengerBoarded => Marshal.SizeOf(typeof(SmartEvent.MinMax)),
|
||||
SmartEvents.PassengerRemoved => Marshal.SizeOf(typeof(SmartEvent.MinMax)),
|
||||
SmartEvents.Charmed => Marshal.SizeOf(typeof(SmartEvent.Charm)),
|
||||
SmartEvents.CharmedTarget => 0,
|
||||
SmartEvents.SpellHitTarget => Marshal.SizeOf(typeof(SmartEvent.SpellHit)),
|
||||
SmartEvents.Damaged => Marshal.SizeOf(typeof(SmartEvent.MinMaxRepeat)),
|
||||
SmartEvents.DamagedTarget => Marshal.SizeOf(typeof(SmartEvent.MinMaxRepeat)),
|
||||
@@ -589,7 +588,6 @@ namespace Game.AI
|
||||
SmartEvents.CorpseRemoved => 0,
|
||||
SmartEvents.AiInit => 0,
|
||||
SmartEvents.DataSet => Marshal.SizeOf(typeof(SmartEvent.DataSet)),
|
||||
SmartEvents.WaypointStart => Marshal.SizeOf(typeof(SmartEvent.Waypoint)),
|
||||
SmartEvents.WaypointReached => Marshal.SizeOf(typeof(SmartEvent.Waypoint)),
|
||||
SmartEvents.TransportAddplayer => 0,
|
||||
SmartEvents.TransportAddcreature => Marshal.SizeOf(typeof(SmartEvent.TransportAddCreature)),
|
||||
@@ -616,7 +614,6 @@ namespace Game.AI
|
||||
SmartEvents.JustCreated => 0,
|
||||
SmartEvents.GossipHello => Marshal.SizeOf(typeof(SmartEvent.GossipHello)),
|
||||
SmartEvents.FollowCompleted => 0,
|
||||
SmartEvents.PhaseChange => Marshal.SizeOf(typeof(SmartEvent.EventPhaseChange)),
|
||||
SmartEvents.GameEventStart => Marshal.SizeOf(typeof(SmartEvent.GameEvent)),
|
||||
SmartEvents.GameEventEnd => Marshal.SizeOf(typeof(SmartEvent.GameEvent)),
|
||||
SmartEvents.GoLootStateChanged => Marshal.SizeOf(typeof(SmartEvent.GoLootStateChanged)),
|
||||
@@ -729,7 +726,6 @@ namespace Game.AI
|
||||
SmartActions.RemoveItem => Marshal.SizeOf(typeof(SmartAction.Item)),
|
||||
SmartActions.SetRun => Marshal.SizeOf(typeof(SmartAction.SetRun)),
|
||||
SmartActions.SetDisableGravity => Marshal.SizeOf(typeof(SmartAction.SetDisableGravity)),
|
||||
SmartActions.SetSwim => Marshal.SizeOf(typeof(SmartAction.SetSwim)),
|
||||
SmartActions.Teleport => Marshal.SizeOf(typeof(SmartAction.Teleport)),
|
||||
SmartActions.SetCounter => Marshal.SizeOf(typeof(SmartAction.SetCounter)),
|
||||
SmartActions.StoreTargetList => Marshal.SizeOf(typeof(SmartAction.StoreTargets)),
|
||||
@@ -744,8 +740,6 @@ namespace Game.AI
|
||||
SmartActions.TriggerTimedEvent => Marshal.SizeOf(typeof(SmartAction.TimeEvent)),
|
||||
SmartActions.RemoveTimedEvent => Marshal.SizeOf(typeof(SmartAction.TimeEvent)),
|
||||
SmartActions.AddAura => Marshal.SizeOf(typeof(SmartAction.AddAura)),
|
||||
SmartActions.OverrideScriptBaseObject => 0,
|
||||
SmartActions.ResetScriptBaseObject => 0,
|
||||
SmartActions.CallScriptReset => 0,
|
||||
SmartActions.SetRangedMovement => Marshal.SizeOf(typeof(SmartAction.SetRangedMovement)),
|
||||
SmartActions.CallTimedActionlist => Marshal.SizeOf(typeof(SmartAction.TimedActionList)),
|
||||
@@ -786,14 +780,9 @@ namespace Game.AI
|
||||
SmartActions.SetCorpseDelay => Marshal.SizeOf(typeof(SmartAction.CorpseDelay)),
|
||||
SmartActions.DisableEvade => Marshal.SizeOf(typeof(SmartAction.DisableEvade)),
|
||||
SmartActions.GoSetGoState => Marshal.SizeOf(typeof(SmartAction.GoState)),
|
||||
SmartActions.SetCanFly => Marshal.SizeOf(typeof(SmartAction.SetFly)),
|
||||
SmartActions.RemoveAurasByType => Marshal.SizeOf(typeof(SmartAction.AuraType)),
|
||||
SmartActions.SetSightDist => Marshal.SizeOf(typeof(SmartAction.SightDistance)),
|
||||
SmartActions.Flee => Marshal.SizeOf(typeof(SmartAction.Flee)),
|
||||
SmartActions.AddThreat => Marshal.SizeOf(typeof(SmartAction.Threat)),
|
||||
SmartActions.LoadEquipment => Marshal.SizeOf(typeof(SmartAction.LoadEquipment)),
|
||||
SmartActions.TriggerRandomTimedEvent => Marshal.SizeOf(typeof(SmartAction.RandomTimedEvent)),
|
||||
SmartActions.RemoveAllGameobjects => 0,
|
||||
SmartActions.PauseMovement => Marshal.SizeOf(typeof(SmartAction.PauseMovement)),
|
||||
SmartActions.PlayAnimkit => Marshal.SizeOf(typeof(SmartAction.AnimKit)),
|
||||
SmartActions.ScenePlay => Marshal.SizeOf(typeof(SmartAction.Scene)),
|
||||
@@ -1141,27 +1130,6 @@ namespace Game.AI
|
||||
return false;
|
||||
break;
|
||||
}
|
||||
case SmartEvents.PhaseChange:
|
||||
{
|
||||
if (e.Event.eventPhaseChange.phasemask == 0)
|
||||
{
|
||||
Log.outError(LogFilter.Sql, $"SmartAIMgr: {e} has no param set, event won't be executed!.");
|
||||
return false;
|
||||
}
|
||||
|
||||
if (e.Event.eventPhaseChange.phasemask > (uint)SmartEventPhaseBits.All)
|
||||
{
|
||||
Log.outError(LogFilter.Sql, $"SmartAIMgr: {e} uses invalid phasemask {e.Event.eventPhaseChange.phasemask}, skipped.");
|
||||
return false;
|
||||
}
|
||||
|
||||
if (e.Event.event_phase_mask != 0 && (e.Event.event_phase_mask & e.Event.eventPhaseChange.phasemask) == 0)
|
||||
{
|
||||
Log.outError(LogFilter.Sql, $"SmartAIMgr: {e} uses event phasemask {e.Event.event_phase_mask} and incompatible event_param1 {e.Event.eventPhaseChange.phasemask}, skipped.");
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
}
|
||||
case SmartEvents.GameEventStart:
|
||||
case SmartEvents.GameEventEnd:
|
||||
{
|
||||
@@ -1304,7 +1272,6 @@ namespace Game.AI
|
||||
case SmartEvents.TimedEventTriggered:
|
||||
case SmartEvents.InstancePlayerEnter:
|
||||
case SmartEvents.TransportRelocate:
|
||||
case SmartEvents.CharmedTarget:
|
||||
case SmartEvents.CorpseRemoved:
|
||||
case SmartEvents.AiInit:
|
||||
case SmartEvents.TransportAddplayer:
|
||||
@@ -1314,7 +1281,6 @@ namespace Game.AI
|
||||
case SmartEvents.Evade:
|
||||
case SmartEvents.ReachedHome:
|
||||
case SmartEvents.JustSummoned:
|
||||
case SmartEvents.WaypointStart:
|
||||
case SmartEvents.WaypointReached:
|
||||
case SmartEvents.WaypointPaused:
|
||||
case SmartEvents.WaypointResumed:
|
||||
@@ -1335,6 +1301,9 @@ namespace Game.AI
|
||||
case SmartEvents.TargetHealthPct:
|
||||
case SmartEvents.FriendlyHealth:
|
||||
case SmartEvents.TargetManaPct:
|
||||
case SmartEvents.CharmedTarget:
|
||||
case SmartEvents.WaypointStart:
|
||||
case SmartEvents.PhaseChange:
|
||||
case SmartEvents.IsBehindTarget:
|
||||
Log.outError(LogFilter.Sql, $"SmartAIMgr: Unused event_type {e} skipped.");
|
||||
return false;
|
||||
@@ -1342,19 +1311,6 @@ namespace Game.AI
|
||||
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;
|
||||
}
|
||||
|
||||
// Additional check for deprecated
|
||||
switch (e.GetEventType())
|
||||
{
|
||||
// Deprecated
|
||||
case SmartEvents.PhaseChange:
|
||||
case SmartEvents.WaypointStart:
|
||||
case SmartEvents.CharmedTarget:
|
||||
Log.outWarn(LogFilter.Sql, "SmartAIMgr: Deprecated event_type: {e}, it might be removed in the future, loaded for now.");
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (!CheckUnusedEventParams(e))
|
||||
@@ -1826,15 +1782,6 @@ namespace Game.AI
|
||||
|
||||
break;
|
||||
}
|
||||
case SmartActions.RemoveAurasByType:
|
||||
{
|
||||
if (e.Action.auraType.type >= (uint)AuraType.Total)
|
||||
{
|
||||
Log.outError(LogFilter.Sql, $"Entry {e.EntryOrGuid} SourceType {e.GetScriptType()} Event {e.EventId} Action {e.GetActionType()} uses invalid data type {e.Action.auraType.type} (value range 0-TOTAL_AURAS), skipped.");
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
}
|
||||
case SmartActions.RespawnBySpawnId:
|
||||
{
|
||||
if (Global.ObjectMgr.GetSpawnData((SpawnObjectType)e.Action.respawnData.spawnType, e.Action.respawnData.spawnId) == null)
|
||||
@@ -1985,16 +1932,6 @@ namespace Game.AI
|
||||
TC_SAI_IS_BOOLEAN_VALID(e, e.Action.setDisableGravity.disable);
|
||||
break;
|
||||
}
|
||||
case SmartActions.SetCanFly:
|
||||
{
|
||||
TC_SAI_IS_BOOLEAN_VALID(e, e.Action.setFly.fly);
|
||||
break;
|
||||
}
|
||||
case SmartActions.SetSwim:
|
||||
{
|
||||
TC_SAI_IS_BOOLEAN_VALID(e, e.Action.setSwim.swim);
|
||||
break;
|
||||
}
|
||||
case SmartActions.SetCounter:
|
||||
{
|
||||
TC_SAI_IS_BOOLEAN_VALID(e, e.Action.setCounter.reset);
|
||||
@@ -2113,8 +2050,6 @@ namespace Game.AI
|
||||
case SmartActions.CloseGossip:
|
||||
case SmartActions.TriggerTimedEvent:
|
||||
case SmartActions.RemoveTimedEvent:
|
||||
case SmartActions.OverrideScriptBaseObject:
|
||||
case SmartActions.ResetScriptBaseObject:
|
||||
case SmartActions.ActivateGobject:
|
||||
case SmartActions.CallScriptReset:
|
||||
case SmartActions.SetRangedMovement:
|
||||
@@ -2138,11 +2073,8 @@ namespace Game.AI
|
||||
case SmartActions.SummonCreatureGroup:
|
||||
case SmartActions.MoveOffset:
|
||||
case SmartActions.SetCorpseDelay:
|
||||
case SmartActions.SetSightDist:
|
||||
case SmartActions.Flee:
|
||||
case SmartActions.AddThreat:
|
||||
case SmartActions.TriggerRandomTimedEvent:
|
||||
case SmartActions.RemoveAllGameobjects:
|
||||
case SmartActions.SpawnSpawngroup:
|
||||
case SmartActions.AddToStoredTargetList:
|
||||
break;
|
||||
@@ -2159,32 +2091,22 @@ namespace Game.AI
|
||||
case SmartActions.SetUnitFlag:
|
||||
case SmartActions.RemoveUnitFlag:
|
||||
case SmartActions.InstallAITemplate:
|
||||
case SmartActions.SetDynamicFlag:
|
||||
case SmartActions.AddDynamicFlag:
|
||||
case SmartActions.RemoveDynamicFlag:
|
||||
Log.outError(LogFilter.Sql, $"SmartAIMgr: Unused action_type: {e} Skipped.");
|
||||
return false;
|
||||
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);
|
||||
return false;
|
||||
}
|
||||
|
||||
// Additional check for deprecated
|
||||
switch (e.GetActionType())
|
||||
{
|
||||
// Deprecated
|
||||
case SmartActions.SetSwim:
|
||||
case SmartActions.OverrideScriptBaseObject:
|
||||
case SmartActions.ResetScriptBaseObject:
|
||||
case SmartActions.SetDynamicFlag:
|
||||
case SmartActions.AddDynamicFlag:
|
||||
case SmartActions.RemoveDynamicFlag:
|
||||
case SmartActions.SetCanFly:
|
||||
case SmartActions.RemoveAurasByType:
|
||||
case SmartActions.SetSightDist:
|
||||
case SmartActions.Flee:
|
||||
case SmartActions.RemoveAllGameobjects:
|
||||
Log.outWarn(LogFilter.Sql, $"SmartAIMgr: Deprecated action_type: {e}, it might be removed in the future, loaded for now.");
|
||||
break;
|
||||
Log.outError(LogFilter.Sql, $"SmartAIMgr: Unused action_type: {e} Skipped.");
|
||||
return false;
|
||||
default:
|
||||
break;
|
||||
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;
|
||||
}
|
||||
|
||||
if (!CheckUnusedActionParams(e))
|
||||
@@ -2654,9 +2576,6 @@ namespace Game.AI
|
||||
[FieldOffset(16)]
|
||||
public Gossip gossip;
|
||||
|
||||
[FieldOffset(16)]
|
||||
public EventPhaseChange eventPhaseChange;
|
||||
|
||||
[FieldOffset(16)]
|
||||
public GameEvent gameEvent;
|
||||
|
||||
@@ -2833,10 +2752,6 @@ namespace Game.AI
|
||||
public uint sender;
|
||||
public uint action;
|
||||
}
|
||||
public struct EventPhaseChange
|
||||
{
|
||||
public uint phasemask;
|
||||
}
|
||||
public struct GameEvent
|
||||
{
|
||||
public uint gameEventId;
|
||||
@@ -3040,12 +2955,6 @@ namespace Game.AI
|
||||
[FieldOffset(4)]
|
||||
public SetDisableGravity setDisableGravity;
|
||||
|
||||
[FieldOffset(4)]
|
||||
public SetFly setFly;
|
||||
|
||||
[FieldOffset(4)]
|
||||
public SetSwim setSwim;
|
||||
|
||||
[FieldOffset(4)]
|
||||
public Teleport teleport;
|
||||
|
||||
@@ -3094,9 +3003,6 @@ namespace Game.AI
|
||||
[FieldOffset(4)]
|
||||
public FleeAssist fleeAssist;
|
||||
|
||||
[FieldOffset(4)]
|
||||
public Flee flee;
|
||||
|
||||
[FieldOffset(4)]
|
||||
public EnableTempGO enableTempGO;
|
||||
|
||||
@@ -3154,9 +3060,6 @@ namespace Game.AI
|
||||
[FieldOffset(4)]
|
||||
public AuraType auraType;
|
||||
|
||||
[FieldOffset(4)]
|
||||
public SightDistance sightDistance;
|
||||
|
||||
[FieldOffset(4)]
|
||||
public LoadEquipment loadEquipment;
|
||||
|
||||
@@ -3479,14 +3382,6 @@ namespace Game.AI
|
||||
{
|
||||
public uint disable;
|
||||
}
|
||||
public struct SetFly
|
||||
{
|
||||
public uint fly;
|
||||
}
|
||||
public struct SetSwim
|
||||
{
|
||||
public uint swim;
|
||||
}
|
||||
public struct Teleport
|
||||
{
|
||||
public uint mapID;
|
||||
@@ -3575,10 +3470,6 @@ namespace Game.AI
|
||||
{
|
||||
public uint withEmote;
|
||||
}
|
||||
public struct Flee
|
||||
{
|
||||
public uint fleeTime;
|
||||
}
|
||||
public struct EnableTempGO
|
||||
{
|
||||
public uint duration;
|
||||
@@ -3672,14 +3563,6 @@ namespace Game.AI
|
||||
public uint maxDelay;
|
||||
public uint spawnflags;
|
||||
}
|
||||
public struct AuraType
|
||||
{
|
||||
public uint type;
|
||||
}
|
||||
public struct SightDistance
|
||||
{
|
||||
public uint dist;
|
||||
}
|
||||
public struct LoadEquipment
|
||||
{
|
||||
public uint id;
|
||||
|
||||
@@ -1261,14 +1261,6 @@ namespace Game.AI
|
||||
((SmartAI)_me.GetAI()).SetDisableGravity(e.Action.setDisableGravity.disable != 0);
|
||||
break;
|
||||
}
|
||||
case SmartActions.SetCanFly:
|
||||
{
|
||||
if (!IsSmart())
|
||||
break;
|
||||
|
||||
((SmartAI)_me.GetAI()).SetCanFly(e.Action.setFly.fly != 0);
|
||||
break;
|
||||
}
|
||||
case SmartActions.SetRun:
|
||||
{
|
||||
if (!IsSmart())
|
||||
@@ -1277,14 +1269,6 @@ namespace Game.AI
|
||||
((SmartAI)_me.GetAI()).SetRun(e.Action.setRun.run != 0);
|
||||
break;
|
||||
}
|
||||
case SmartActions.SetSwim:
|
||||
{
|
||||
if (!IsSmart())
|
||||
break;
|
||||
|
||||
((SmartAI)_me.GetAI()).SetSwim(e.Action.setSwim.swim != 0);
|
||||
break;
|
||||
}
|
||||
case SmartActions.SetCounter:
|
||||
{
|
||||
if (!targets.Empty())
|
||||
@@ -1534,36 +1518,6 @@ namespace Game.AI
|
||||
case SmartActions.RemoveTimedEvent:
|
||||
_remIDs.Add(e.Action.timeEvent.id);
|
||||
break;
|
||||
case SmartActions.OverrideScriptBaseObject:
|
||||
{
|
||||
foreach (var target in targets)
|
||||
{
|
||||
if (IsCreature(target))
|
||||
{
|
||||
if (_meOrigGUID.IsEmpty() && _me)
|
||||
_meOrigGUID = _me.GetGUID();
|
||||
if (_goOrigGUID.IsEmpty() && _go)
|
||||
_goOrigGUID = _go.GetGUID();
|
||||
_go = null;
|
||||
_me = target.ToCreature();
|
||||
break;
|
||||
}
|
||||
else if (IsGameObject(target))
|
||||
{
|
||||
if (_meOrigGUID.IsEmpty() && _me)
|
||||
_meOrigGUID = _me.GetGUID();
|
||||
if (_goOrigGUID.IsEmpty() && _go)
|
||||
_goOrigGUID = _go.GetGUID();
|
||||
_go = target.ToGameObject();
|
||||
_me = null;
|
||||
break;
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
case SmartActions.ResetScriptBaseObject:
|
||||
ResetBaseObject();
|
||||
break;
|
||||
case SmartActions.CallScriptReset:
|
||||
SetPhase(0);
|
||||
OnReset();
|
||||
@@ -2222,30 +2176,6 @@ namespace Game.AI
|
||||
((SmartAI)_me.GetAI()).SetEvadeDisabled(e.Action.disableEvade.disable != 0);
|
||||
break;
|
||||
}
|
||||
case SmartActions.RemoveAurasByType: // can be used to exit vehicle for example
|
||||
{
|
||||
foreach (var target in targets)
|
||||
if (IsUnit(target))
|
||||
target.ToUnit().RemoveAurasByType((AuraType)e.Action.auraType.type);
|
||||
|
||||
break;
|
||||
}
|
||||
case SmartActions.SetSightDist:
|
||||
{
|
||||
foreach (var target in targets)
|
||||
if (IsCreature(target))
|
||||
target.ToCreature().m_SightDistance = e.Action.sightDistance.dist;
|
||||
|
||||
break;
|
||||
}
|
||||
case SmartActions.Flee:
|
||||
{
|
||||
foreach (var target in targets)
|
||||
if (IsCreature(target))
|
||||
target.ToCreature().GetMotionMaster().MoveFleeing(_me, e.Action.flee.fleeTime);
|
||||
|
||||
break;
|
||||
}
|
||||
case SmartActions.AddThreat:
|
||||
{
|
||||
if (!_me.CanHaveThreatList())
|
||||
@@ -2271,15 +2201,6 @@ namespace Game.AI
|
||||
ProcessEventsFor(SmartEvents.TimedEventTriggered, null, eventId);
|
||||
break;
|
||||
}
|
||||
|
||||
case SmartActions.RemoveAllGameobjects:
|
||||
{
|
||||
foreach (var target in targets)
|
||||
if (IsUnit(target))
|
||||
target.ToUnit().RemoveAllGameObjects();
|
||||
|
||||
break;
|
||||
}
|
||||
case SmartActions.PauseMovement:
|
||||
{
|
||||
foreach (var target in targets)
|
||||
@@ -3244,7 +3165,6 @@ namespace Game.AI
|
||||
case SmartEvents.Death:
|
||||
case SmartEvents.Evade:
|
||||
case SmartEvents.ReachedHome:
|
||||
case SmartEvents.CharmedTarget:
|
||||
case SmartEvents.CorpseRemoved:
|
||||
case SmartEvents.AiInit:
|
||||
case SmartEvents.TransportAddplayer:
|
||||
@@ -3405,7 +3325,6 @@ namespace Game.AI
|
||||
ProcessAction(e, unit, var0);
|
||||
break;
|
||||
}
|
||||
case SmartEvents.WaypointStart:
|
||||
case SmartEvents.WaypointReached:
|
||||
case SmartEvents.WaypointResumed:
|
||||
case SmartEvents.WaypointPaused:
|
||||
@@ -3494,14 +3413,6 @@ namespace Game.AI
|
||||
ProcessAction(e, unit, var0, var1);
|
||||
break;
|
||||
}
|
||||
case SmartEvents.PhaseChange:
|
||||
{
|
||||
if (!IsInPhase(e.Event.eventPhaseChange.phasemask))
|
||||
return;
|
||||
|
||||
ProcessAction(e, GetLastInvoker());
|
||||
break;
|
||||
}
|
||||
case SmartEvents.GameEventStart:
|
||||
case SmartEvents.GameEventEnd:
|
||||
{
|
||||
@@ -4399,12 +4310,7 @@ namespace Game.AI
|
||||
}
|
||||
void SetPhase(uint p)
|
||||
{
|
||||
uint oldPhase = _eventPhase;
|
||||
|
||||
_eventPhase = p;
|
||||
|
||||
if (oldPhase != _eventPhase)
|
||||
ProcessEventsFor(SmartEvents.PhaseChange);
|
||||
}
|
||||
bool IsInPhase(uint p)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user