Core/Creatures: disabled "automatic" monster sparring

Port From (https://github.com/TrinityCore/TrinityCore/commit/27b5d1834850a1e7c64cb03200cdf7610d354730)
This commit is contained in:
hondacrx
2019-09-01 10:55:39 -04:00
parent 74a1025f41
commit 95a80cf51e
3 changed files with 2 additions and 13 deletions
@@ -440,7 +440,6 @@ namespace Framework.Constants
} }
public enum FactionTemplateFlags public enum FactionTemplateFlags
{ {
EnemySpar = 0x20, // guessed, sparring with enemies?
PVP = 0x800, // flagged for PvP PVP = 0x800, // flagged for PvP
ContestedGuard = 0x1000, // faction will attack players that were involved in PvP combats ContestedGuard = 0x1000, // faction will attack players that were involved in PvP combats
HostileByDefault = 0x2000 HostileByDefault = 0x2000
+2 -11
View File
@@ -72,25 +72,16 @@ namespace Game.AI
if (!me.IsWithinMeleeRange(victim)) if (!me.IsWithinMeleeRange(victim))
return; return;
bool sparAttack = me.GetFactionTemplateEntry().ShouldSparAttack() && victim.GetFactionTemplateEntry().ShouldSparAttack();
//Make sure our attack is ready and we aren't currently casting before checking distance //Make sure our attack is ready and we aren't currently casting before checking distance
if (me.isAttackReady()) if (me.isAttackReady())
{ {
if (sparAttack) me.AttackerStateUpdate(victim);
me.FakeAttackerStateUpdate(victim);
else
me.AttackerStateUpdate(victim);
me.resetAttackTimer(); me.resetAttackTimer();
} }
if (me.haveOffhandWeapon() && me.isAttackReady(WeaponAttackType.OffAttack)) if (me.haveOffhandWeapon() && me.isAttackReady(WeaponAttackType.OffAttack))
{ {
if (sparAttack) me.AttackerStateUpdate(victim, WeaponAttackType.OffAttack);
me.FakeAttackerStateUpdate(victim, WeaponAttackType.OffAttack);
else
me.AttackerStateUpdate(victim, WeaponAttackType.OffAttack);
me.resetAttackTimer(WeaponAttackType.OffAttack); me.resetAttackTimer(WeaponAttackType.OffAttack);
} }
} }
@@ -99,6 +99,5 @@ namespace Game.DataStorage
return EnemyGroup == 0 && FriendGroup == 0; return EnemyGroup == 0 && FriendGroup == 0;
} }
public bool IsContestedGuardFaction() { return (Flags & (ushort)FactionTemplateFlags.ContestedGuard) != 0; } public bool IsContestedGuardFaction() { return (Flags & (ushort)FactionTemplateFlags.ContestedGuard) != 0; }
public bool ShouldSparAttack() { return (Flags & (ushort)FactionTemplateFlags.EnemySpar) != 0; }
} }
} }