Core/Creatures: Allow flagging creatures to not clear their tap list when evading
Port From (https://github.com/TrinityCore/TrinityCore/commit/6e309ed17ff448b971f206c7ea7174c736230299)
This commit is contained in:
@@ -294,7 +294,10 @@ namespace Game.AI
|
||||
|
||||
// sometimes bosses stuck in combat?
|
||||
me.CombatStop(true);
|
||||
|
||||
if (!me.IsTapListNotClearedOnEvade())
|
||||
me.SetTappedBy(null);
|
||||
|
||||
me.ResetPlayerDamageReq();
|
||||
me.SetLastDamagedTime(0);
|
||||
me.SetCannotReachTarget(false);
|
||||
|
||||
@@ -197,7 +197,10 @@ namespace Game.AI
|
||||
if (reset)
|
||||
{
|
||||
who.LoadCreaturesAddon();
|
||||
|
||||
if (!me.IsTapListNotClearedOnEvade())
|
||||
who.SetTappedBy(null);
|
||||
|
||||
who.ResetPlayerDamageReq();
|
||||
who.SetLastDamagedTime(0);
|
||||
who.SetCannotReachTarget(false);
|
||||
|
||||
@@ -121,6 +121,8 @@ namespace Game.AI
|
||||
{
|
||||
me.RemoveAllAuras();
|
||||
me.CombatStop(true);
|
||||
|
||||
if (!me.IsTapListNotClearedOnEvade())
|
||||
me.SetTappedBy(null);
|
||||
|
||||
EngagementOver();
|
||||
|
||||
@@ -87,6 +87,7 @@ namespace Game.Entities
|
||||
internal Dictionary<ObjectGuid, Loot> m_personalLoot = new();
|
||||
public Loot _loot;
|
||||
HashSet<ObjectGuid> m_tapList = new();
|
||||
bool m_dontClearTapListOnEvade;
|
||||
}
|
||||
|
||||
public enum ObjectCellMoveState
|
||||
|
||||
@@ -1206,6 +1206,15 @@ namespace Game.Entities
|
||||
_lootId = lootId;
|
||||
}
|
||||
|
||||
public void SetDontClearTapListOnEvade(bool dontClear)
|
||||
{
|
||||
// only temporary summons are allowed to not clear their tap list
|
||||
if (m_spawnId == 0)
|
||||
m_dontClearTapListOnEvade = dontClear;
|
||||
}
|
||||
|
||||
public bool IsTapListNotClearedOnEvade() { return m_dontClearTapListOnEvade; }
|
||||
|
||||
public void SetTappedBy(Unit unit, bool withGroup = true)
|
||||
{
|
||||
// set the player whose group should receive the right
|
||||
|
||||
Reference in New Issue
Block a user