Core/AI: CreatureAI.EnterCombat is now called CreatureAI.JustEngagedWith. There's also two new methods on UnitAI, though they're never invoked right now.
Port From (https://github.com/TrinityCore/TrinityCore/commit/bce43de7f3fba618c370f2aba327d23dd30d1cdd)
This commit is contained in:
@@ -51,7 +51,7 @@ namespace Game.AI
|
||||
}
|
||||
}
|
||||
|
||||
public override void EnterCombat(Unit victim)
|
||||
public override void JustEngagedWith(Unit victim)
|
||||
{
|
||||
foreach (var id in Spells)
|
||||
{
|
||||
@@ -134,7 +134,7 @@ namespace Game.AI
|
||||
AttackStartCaster(victim, _attackDist);
|
||||
}
|
||||
|
||||
public override void EnterCombat(Unit victim)
|
||||
public override void JustEngagedWith(Unit victim)
|
||||
{
|
||||
if (Spells.Empty())
|
||||
return;
|
||||
|
||||
@@ -408,11 +408,8 @@ namespace Game.AI
|
||||
me.DoImmediateBoundaryCheck();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Called for reaction when initially engaged
|
||||
/// </summary>
|
||||
/// <param name="victim"></param>
|
||||
public virtual void EnterCombat(Unit victim) { }
|
||||
// Called for reaction when initially engaged - this will always happen _after_ JustEnteredCombat
|
||||
public virtual void JustEngagedWith(Unit who) { }
|
||||
|
||||
// Called when the creature is killed
|
||||
public virtual void JustDied(Unit killer) { }
|
||||
|
||||
@@ -478,6 +478,13 @@ namespace Game.AI
|
||||
public virtual void SetGUID(ObjectGuid guid, int id = 0) { }
|
||||
public virtual ObjectGuid GetGUID(int id = 0) { return ObjectGuid.Empty; }
|
||||
|
||||
// Called when the unit enters combat
|
||||
// (NOTE: Creature engage logic should NOT be here, but in JustEngagedWith, which happens once threat is established!)
|
||||
public virtual void JustEnteredCombat(Unit who) { }
|
||||
|
||||
// Called when the unit leaves combat
|
||||
public virtual void JustExitedCombat() { }
|
||||
|
||||
public virtual void DamageDealt(Unit victim, ref uint damage, DamageEffectType damageType) { }
|
||||
public virtual void DamageTaken(Unit attacker, ref uint damage) { }
|
||||
public virtual void HealReceived(Unit by, uint addhealth) { }
|
||||
|
||||
Reference in New Issue
Block a user