Messed up the commit history, so here is all the files rip, Credit to TrinityCore
This commit is contained in:
@@ -122,6 +122,7 @@ namespace Game.Entities
|
||||
PetStable m_petStable;
|
||||
public List<PetAura> m_petAuras = new();
|
||||
uint m_temporaryUnsummonedPetNumber;
|
||||
ReactStates? m_temporaryPetReactState;
|
||||
uint m_lastpetnumber;
|
||||
|
||||
// Player summoning
|
||||
|
||||
@@ -35,9 +35,9 @@ namespace Game.Entities
|
||||
return nearMembers[randTarget];
|
||||
}
|
||||
|
||||
public PartyResult CanUninviteFromGroup(ObjectGuid guidMember = default)
|
||||
public PartyResult CanUninviteFromGroup(ObjectGuid guidMember, byte? partyIndex)
|
||||
{
|
||||
Group grp = GetGroup();
|
||||
Group grp = GetGroup(partyIndex);
|
||||
if (!grp)
|
||||
return PartyResult.NotInGroup;
|
||||
|
||||
@@ -58,7 +58,7 @@ namespace Game.Entities
|
||||
return PartyResult.PartyLfgBootDungeonComplete;
|
||||
|
||||
Player player = Global.ObjAccessor.FindConnectedPlayer(guidMember);
|
||||
if (!player.m_lootRolls.Empty())
|
||||
if (player != null && !player.m_lootRolls.Empty())
|
||||
return PartyResult.PartyLfgBootLootRolls;
|
||||
|
||||
// @todo Should also be sent when anyone has recently left combat, with an aprox ~5 seconds timer.
|
||||
@@ -150,6 +150,23 @@ namespace Game.Entities
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public Group GetGroup(byte? partyIndex)
|
||||
{
|
||||
Group group = GetGroup();
|
||||
if (!partyIndex.HasValue)
|
||||
return group;
|
||||
|
||||
GroupCategory category = (GroupCategory)partyIndex;
|
||||
if (group != null && group.GetGroupCategory() == category)
|
||||
return group;
|
||||
|
||||
Group originalGroup = GetOriginalGroup();
|
||||
if (originalGroup && originalGroup.GetGroupCategory() == category)
|
||||
return originalGroup;
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
public void SetGroup(Group group, byte subgroup = 0)
|
||||
{
|
||||
@@ -167,10 +184,7 @@ namespace Game.Entities
|
||||
public void SetPartyType(GroupCategory category, GroupType type)
|
||||
{
|
||||
Cypher.Assert(category < GroupCategory.Max);
|
||||
byte value = m_playerData.PartyType;
|
||||
value &= (byte)~((byte)0xFF << ((byte)category * 4));
|
||||
value |= (byte)((byte)type << ((byte)category * 4));
|
||||
SetUpdateFieldValue(m_values.ModifyValue(m_playerData).ModifyValue(m_playerData.PartyType), value);
|
||||
SetUpdateFieldValue(ref m_values.ModifyValue(m_playerData).ModifyValue(m_playerData.PartyType, (int)category), (byte)type);
|
||||
}
|
||||
|
||||
public void ResetGroupUpdateSequenceIfNeeded(Group group)
|
||||
@@ -207,12 +221,19 @@ namespace Game.Entities
|
||||
}
|
||||
|
||||
public Group GetGroupInvite() { return m_groupInvite; }
|
||||
|
||||
public void SetGroupInvite(Group group) { m_groupInvite = group; }
|
||||
|
||||
public Group GetGroup() { return m_group.GetTarget(); }
|
||||
|
||||
public GroupReference GetGroupRef() { return m_group; }
|
||||
|
||||
public byte GetSubGroup() { return m_group.GetSubGroup(); }
|
||||
|
||||
public GroupUpdateFlags GetGroupUpdateFlag() { return m_groupUpdateMask; }
|
||||
|
||||
public void SetGroupUpdateFlag(GroupUpdateFlags flag) { m_groupUpdateMask |= flag; }
|
||||
|
||||
public void RemoveGroupUpdateFlag(GroupUpdateFlags flag) { m_groupUpdateMask &= ~flag; }
|
||||
|
||||
public Group GetOriginalGroup() { return m_originalGroup.GetTarget(); }
|
||||
|
||||
@@ -109,8 +109,8 @@ namespace Game.Entities
|
||||
m_questObjectiveCriteriaMgr = new QuestObjectiveCriteriaManager(this);
|
||||
m_sceneMgr = new SceneMgr(this);
|
||||
|
||||
m_bgBattlegroundQueueID[0] = new BgBattlegroundQueueID_Rec();
|
||||
m_bgBattlegroundQueueID[1] = new BgBattlegroundQueueID_Rec();
|
||||
for (var i = 0; i < SharedConst.MaxPlayerBGQueues; ++i)
|
||||
m_bgBattlegroundQueueID[i] = new BgBattlegroundQueueID_Rec();
|
||||
|
||||
m_bgData = new BGData();
|
||||
|
||||
@@ -1057,6 +1057,55 @@ namespace Game.Entities
|
||||
public void SetLastPetNumber(uint petnumber) { m_lastpetnumber = petnumber; }
|
||||
public uint GetTemporaryUnsummonedPetNumber() { return m_temporaryUnsummonedPetNumber; }
|
||||
public void SetTemporaryUnsummonedPetNumber(uint petnumber) { m_temporaryUnsummonedPetNumber = petnumber; }
|
||||
|
||||
public ReactStates? GetTemporaryPetReactState() { return m_temporaryPetReactState; }
|
||||
|
||||
public void DisablePetControlsOnMount(ReactStates reactState, CommandStates commandState)
|
||||
{
|
||||
Pet pet = GetPet();
|
||||
if (pet == null)
|
||||
return;
|
||||
|
||||
m_temporaryPetReactState = pet.GetReactState();
|
||||
pet.SetReactState(reactState);
|
||||
CharmInfo charmInfo = pet.GetCharmInfo();
|
||||
if (charmInfo != null)
|
||||
charmInfo.SetCommandState(commandState);
|
||||
|
||||
pet.GetMotionMaster().MoveFollow(this, SharedConst.PetFollowDist, pet.GetFollowAngle());
|
||||
|
||||
PetMode petMode = new();
|
||||
petMode.PetGUID = pet.GetGUID();
|
||||
petMode.ReactState = reactState;
|
||||
petMode.CommandState = commandState;
|
||||
petMode.Flag = 0;
|
||||
SendPacket(petMode);
|
||||
}
|
||||
|
||||
public void EnablePetControlsOnDismount()
|
||||
{
|
||||
Pet pet = GetPet();
|
||||
if (pet != null)
|
||||
{
|
||||
PetMode petMode = new();
|
||||
petMode.PetGUID = pet.GetGUID();
|
||||
if (m_temporaryPetReactState.HasValue)
|
||||
{
|
||||
petMode.ReactState = m_temporaryPetReactState.Value;
|
||||
pet.SetReactState(m_temporaryPetReactState.Value);
|
||||
}
|
||||
|
||||
CharmInfo charmInfo = pet.GetCharmInfo();
|
||||
if (charmInfo != null)
|
||||
petMode.CommandState = charmInfo.GetCommandState();
|
||||
|
||||
petMode.Flag = 0;
|
||||
SendPacket(petMode);
|
||||
}
|
||||
|
||||
m_temporaryPetReactState = null;
|
||||
}
|
||||
|
||||
public void UnsummonPetTemporaryIfAny()
|
||||
{
|
||||
Pet pet = GetPet();
|
||||
@@ -1091,7 +1140,7 @@ namespace Game.Entities
|
||||
|
||||
public bool IsPetNeedBeTemporaryUnsummoned()
|
||||
{
|
||||
return !IsInWorld || !IsAlive() || IsMounted();
|
||||
return !IsInWorld || !IsAlive() || HasUnitMovementFlag(MovementFlag.Flying) || HasExtraUnitMovementFlag2(MovementFlags3.AdvFlying);
|
||||
}
|
||||
|
||||
public void SendRemoveControlBar()
|
||||
@@ -6400,8 +6449,8 @@ namespace Game.Entities
|
||||
public void SendSellError(SellResult msg, Creature creature, ObjectGuid guid)
|
||||
{
|
||||
SellResponse sellResponse = new();
|
||||
sellResponse.VendorGUID = (creature ? creature.GetGUID() : ObjectGuid.Empty);
|
||||
sellResponse.ItemGUID = guid;
|
||||
sellResponse.VendorGUID = creature ? creature.GetGUID() : ObjectGuid.Empty;
|
||||
sellResponse.ItemGUIDs.Add(guid);
|
||||
sellResponse.Reason = msg;
|
||||
SendPacket(sellResponse);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user