oops, now it builds (and a bonus refactor that annoyed me)
Port From (https://github.com/TrinityCore/TrinityCore/commit/bd158f6c29581e08633c3971a130b0720f90b630)
This commit is contained in:
@@ -567,6 +567,8 @@ namespace Game.AI
|
||||
|
||||
public override void InitializeAI()
|
||||
{
|
||||
GetScript().OnInitialize(me);
|
||||
|
||||
_despawnTime = 0;
|
||||
_respawnTime = 0;
|
||||
_despawnState = 0;
|
||||
@@ -574,11 +576,11 @@ namespace Game.AI
|
||||
|
||||
me.SetVisible(true);
|
||||
|
||||
if (me.GetFaction() != me.GetCreatureTemplate().Faction)
|
||||
me.RestoreFaction();
|
||||
|
||||
GetScript().OnReset();
|
||||
GetScript().ProcessEventsFor(SmartEvents.Respawn);
|
||||
if (!me.IsDead())
|
||||
{
|
||||
GetScript().ProcessEventsFor(SmartEvents.Respawn);
|
||||
GetScript().OnReset();
|
||||
}
|
||||
|
||||
_followGuid.Clear();//do not reset follower on Reset(), we need it after combat evade
|
||||
_followDist = 0;
|
||||
@@ -883,7 +885,7 @@ namespace Game.AI
|
||||
GetScript().ProcessEventsFor(SmartEvents.FollowCompleted, player);
|
||||
}
|
||||
|
||||
public void SetScript9(SmartScriptHolder e, uint entry, Unit invoker)
|
||||
public void SetTimedActionList(SmartScriptHolder e, uint entry, Unit invoker)
|
||||
{
|
||||
GetScript().SetScript9(e, entry, invoker);
|
||||
}
|
||||
@@ -1127,7 +1129,7 @@ namespace Game.AI
|
||||
GetScript().ProcessEventsFor(SmartEvents.DataSet, null, id, value);
|
||||
}
|
||||
|
||||
public void SetScript9(SmartScriptHolder e, uint entry, Unit invoker)
|
||||
public void SetTimedActionList(SmartScriptHolder e, uint entry, Unit invoker)
|
||||
{
|
||||
GetScript().SetScript9(e, entry, invoker);
|
||||
}
|
||||
@@ -1178,7 +1180,7 @@ namespace Game.AI
|
||||
GetScript().ProcessEventsFor(SmartEvents.AreatriggerOntrigger, unit);
|
||||
}
|
||||
|
||||
public void SetScript9(SmartScriptHolder e, uint entry, Unit invoker)
|
||||
public void SetTimedActionList(SmartScriptHolder e, uint entry, Unit invoker)
|
||||
{
|
||||
GetScript().SetScript9(e, entry, invoker);
|
||||
}
|
||||
|
||||
@@ -1571,7 +1571,7 @@ namespace Game.AI
|
||||
if (creature != null)
|
||||
{
|
||||
if (IsSmart(creature))
|
||||
creature.GetAI<SmartAI>().SetScript9(e, e.Action.timedActionList.id, GetLastInvoker());
|
||||
creature.GetAI<SmartAI>().SetTimedActionList(e, e.Action.timedActionList.id, GetLastInvoker());
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -1579,7 +1579,7 @@ namespace Game.AI
|
||||
if (go != null)
|
||||
{
|
||||
if (IsSmartGO(go))
|
||||
go.GetAI<SmartGameObjectAI>().SetScript9(e, e.Action.timedActionList.id, GetLastInvoker());
|
||||
go.GetAI<SmartGameObjectAI>().SetTimedActionList(e, e.Action.timedActionList.id, GetLastInvoker());
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -1588,7 +1588,7 @@ namespace Game.AI
|
||||
{
|
||||
SmartAreaTriggerAI atSAI = areaTriggerTarget.GetAI<SmartAreaTriggerAI>();
|
||||
if (atSAI != null)
|
||||
atSAI.SetScript9(e, e.Action.timedActionList.id, GetLastInvoker());
|
||||
atSAI.SetTimedActionList(e, e.Action.timedActionList.id, GetLastInvoker());
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1672,7 +1672,7 @@ namespace Game.AI
|
||||
if (creature != null)
|
||||
{
|
||||
if (IsSmart(creature))
|
||||
creature.GetAI<SmartAI>().SetScript9(e, randomId, GetLastInvoker());
|
||||
creature.GetAI<SmartAI>().SetTimedActionList(e, randomId, GetLastInvoker());
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -1680,7 +1680,7 @@ namespace Game.AI
|
||||
if (go != null)
|
||||
{
|
||||
if (IsSmartGO(go))
|
||||
go.GetAI<SmartGameObjectAI>().SetScript9(e, randomId, GetLastInvoker());
|
||||
go.GetAI<SmartGameObjectAI>().SetTimedActionList(e, randomId, GetLastInvoker());
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -1689,7 +1689,7 @@ namespace Game.AI
|
||||
{
|
||||
SmartAreaTriggerAI atSAI = areaTriggerTarget.GetAI<SmartAreaTriggerAI>();
|
||||
if (atSAI != null)
|
||||
atSAI.SetScript9(e, randomId, GetLastInvoker());
|
||||
atSAI.SetTimedActionList(e, randomId, GetLastInvoker());
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1711,7 +1711,7 @@ namespace Game.AI
|
||||
if (creature != null)
|
||||
{
|
||||
if (IsSmart(creature))
|
||||
creature.GetAI<SmartAI>().SetScript9(e, id, GetLastInvoker());
|
||||
creature.GetAI<SmartAI>().SetTimedActionList(e, id, GetLastInvoker());
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -1719,7 +1719,7 @@ namespace Game.AI
|
||||
if (go != null)
|
||||
{
|
||||
if (IsSmartGO(go))
|
||||
go.GetAI<SmartGameObjectAI>().SetScript9(e, id, GetLastInvoker());
|
||||
go.GetAI<SmartGameObjectAI>().SetTimedActionList(e, id, GetLastInvoker());
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -1728,7 +1728,7 @@ namespace Game.AI
|
||||
{
|
||||
SmartAreaTriggerAI atSAI = areaTriggerTarget.GetAI<SmartAreaTriggerAI>();
|
||||
if (atSAI != null)
|
||||
atSAI.SetScript9(e, id, GetLastInvoker());
|
||||
atSAI.SetTimedActionList(e, id, GetLastInvoker());
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -3641,10 +3641,10 @@ namespace Game.AI
|
||||
{
|
||||
if (e.GetScriptType() == SmartScriptType.TimedActionlist)
|
||||
{
|
||||
Unit invoker9 = null;
|
||||
Unit invoker = null;
|
||||
if (_me != null && !mTimedActionListInvoker.IsEmpty())
|
||||
invoker9 = Global.ObjAccessor.GetUnit(_me, mTimedActionListInvoker);
|
||||
ProcessEvent(e, invoker9);
|
||||
invoker = Global.ObjAccessor.GetUnit(_me, mTimedActionListInvoker);
|
||||
ProcessEvent(e, invoker);
|
||||
e.EnableTimed = false;//disable event if it is in an ActionList and was processed once
|
||||
foreach (var holder in _timedActionList)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user