Messed up the commit history, so here is all the files rip, Credit to TrinityCore
This commit is contained in:
@@ -1430,23 +1430,8 @@ namespace Game.Entities
|
||||
}
|
||||
}
|
||||
|
||||
// unsummon pet
|
||||
Pet pet = player.GetPet();
|
||||
if (pet != null)
|
||||
{
|
||||
Battleground bg = ToPlayer().GetBattleground();
|
||||
// don't unsummon pet in arena but SetFlag UNIT_FLAG_STUNNED to disable pet's interface
|
||||
if (bg && bg.IsArena())
|
||||
pet.SetUnitFlag(UnitFlags.Stunned);
|
||||
else
|
||||
player.UnsummonPetTemporaryIfAny();
|
||||
}
|
||||
|
||||
// if we have charmed npc, stun him also (everywhere)
|
||||
Unit charm = player.GetCharmed();
|
||||
if (charm)
|
||||
if (charm.GetTypeId() == TypeId.Unit)
|
||||
charm.SetUnitFlag(UnitFlags.Stunned);
|
||||
// disable pet controls
|
||||
player.DisablePetControlsOnMount(ReactStates.Passive, CommandStates.Follow);
|
||||
|
||||
player.SendMovementSetCollisionHeight(player.GetCollisionHeight(), UpdateCollisionHeightReason.Mount);
|
||||
}
|
||||
@@ -1483,20 +1468,8 @@ namespace Game.Entities
|
||||
Player player = ToPlayer();
|
||||
if (player != null)
|
||||
{
|
||||
Pet pPet = player.GetPet();
|
||||
if (pPet != null)
|
||||
{
|
||||
if (pPet.HasUnitFlag(UnitFlags.Stunned) && !pPet.HasUnitState(UnitState.Stunned))
|
||||
pPet.RemoveUnitFlag(UnitFlags.Stunned);
|
||||
}
|
||||
else
|
||||
player.ResummonPetTemporaryUnSummonedIfAny();
|
||||
|
||||
// if we have charmed npc, remove stun also
|
||||
Unit charm = player.GetCharmed();
|
||||
if (charm)
|
||||
if (charm.GetTypeId() == TypeId.Unit && charm.HasUnitFlag(UnitFlags.Stunned) && !charm.HasUnitState(UnitState.Stunned))
|
||||
charm.RemoveUnitFlag(UnitFlags.Stunned);
|
||||
player.EnablePetControlsOnDismount();
|
||||
player.ResummonPetTemporaryUnSummonedIfAny();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -589,18 +589,39 @@ namespace Game.Entities
|
||||
return GetTransport();
|
||||
}
|
||||
|
||||
public void AtStartOfEncounter()
|
||||
public void AtStartOfEncounter(EncounterType type)
|
||||
{
|
||||
RemoveAurasWithInterruptFlags(SpellAuraInterruptFlags2.StartOfEncounter);
|
||||
|
||||
switch (type)
|
||||
{
|
||||
case EncounterType.DungeonEncounter:
|
||||
RemoveAurasWithInterruptFlags(SpellAuraInterruptFlags2.StartOfDungeonEncounter);
|
||||
break;
|
||||
case EncounterType.MythicPlusRun:
|
||||
RemoveAurasWithInterruptFlags(SpellAuraInterruptFlags2.StartOfMythicPlusRun);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
if (IsAlive())
|
||||
Unit.ProcSkillsAndAuras(this, null, new ProcFlagsInit(ProcFlags.EncounterStart), new ProcFlagsInit(), ProcFlagsSpellType.MaskAll, ProcFlagsSpellPhase.None, ProcFlagsHit.None, null, null, null);
|
||||
}
|
||||
|
||||
public void AtEndOfEncounter()
|
||||
public void AtEndOfEncounter(EncounterType type)
|
||||
{
|
||||
RemoveAurasWithInterruptFlags(SpellAuraInterruptFlags2.EndOfEncounter);
|
||||
|
||||
switch (type)
|
||||
{
|
||||
case EncounterType.DungeonEncounter:
|
||||
RemoveAurasWithInterruptFlags(SpellAuraInterruptFlags2.EndOfDungeonEncounter);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
GetSpellHistory().ResetCooldowns(pair =>
|
||||
{
|
||||
SpellInfo spellInfo = Global.SpellMgr.GetSpellInfo(pair.Key, Difficulty.None);
|
||||
|
||||
Reference in New Issue
Block a user