18#ifndef TRINITYCORE_GROUP_H
19#define TRINITYCORE_GROUP_H
50#define MAX_GROUP_SIZE 5
51#define MAX_RAID_SIZE 40
52#define MAX_RAID_SUBGROUPS MAX_RAID_SIZE / MAX_GROUP_SIZE
54#define TARGET_ICONS_COUNT 8
55#define RAID_MARKERS_COUNT 8
57#define READYCHECK_DURATION 35000
230 return Seconds(_endTime - _startTime);
234 bool IsRunning()
const;
253 void LoadGroupFromDB(
Field* field);
255 bool AddInvite(
Player* player);
256 void RemoveInvite(
Player* player);
257 void RemoveAllInvites();
258 bool AddLeaderInvite(
Player* player);
259 bool AddMember(
Player* player);
265 void UpdateLooterGuid(
WorldObject* pLootedObject,
bool ifneed =
false);
267 void Disband(
bool hideDestroy =
false);
270 void SetEveryoneIsAssistant(
bool apply);
275 void UpdateReadyCheck(
uint32 diff);
279 void EndReadyCheck();
282 bool IsReadyCheckCompleted(
void)
const;
284 void SetOfflineMembersReadyChecked(
void);
285 void SetMemberReadyCheck(
ObjectGuid guid,
bool ready);
286 void SetMemberReadyCheck(MemberSlot* slot,
bool ready);
288 void SetMemberReadyChecked(MemberSlot* slot);
289 void ResetMemberReadyChecked(
void);
293 void DeleteRaidMarker(
uint8 markerId);
294 void SendRaidMarkersChanged(
WorldSession* session =
nullptr)
const;
298 bool isLFGGroup()
const;
299 bool isRaidGroup()
const;
300 bool isBGGroup()
const;
301 bool isBFGroup()
const;
302 bool IsCreated()
const;
306 const char * GetLeaderName()
const;
317 ObjectGuid GetMemberGUID(std::string
const& name)
const;
325 Player* GetInvited(
const std::string& name)
const;
328 bool SameSubGroup(
ObjectGuid guid1, MemberSlot
const* slot2)
const;
329 bool SameSubGroup(
Player const* member1,
Player const* member2)
const;
330 bool HasFreeSlotSubGroup(
uint8 subgroup)
const;
342 void ConvertToRaid();
343 void ConvertToGroup();
355 void SetDungeonDifficultyID(
Difficulty difficulty);
356 void SetRaidDifficultyID(
Difficulty difficulty);
357 void SetLegacyRaidDifficultyID(
Difficulty difficulty);
366 void SendUpdate()
const;
367 void SendUpdateToPlayer(
ObjectGuid playerGUID, MemberSlot
const* slot =
nullptr)
const;
368 void SendUpdateDestroyGroupToPlayer(
Player* player)
const;
369 void UpdatePlayerOutOfRange(
Player const* player)
const;
371 template<
class Worker>
375 worker(itr->GetSource());
386 auto itr = m_recentInstances.find(mapId);
387 return itr != m_recentInstances.end() ? itr->second.first : m_leaderGuid;
392 auto itr = m_recentInstances.find(mapId);
393 return itr != m_recentInstances.end() ? itr->second.second : 0;
398 m_recentInstances[mapId] = { instanceOwner, instanceId };
403 void StartLeaderOfflineTimer();
404 void StopLeaderOfflineTimer();
405 void SelectNewPartyOrRaidLeader();
408 void BroadcastGroupUpdate(
void);
417 void _homebindIfInstance(
Player* player);
419 void _initRaidSubGroupsCounter();
420 member_citerator _getMemberCSlot(
ObjectGuid Guid)
const;
421 member_witerator _getMemberWSlot(
ObjectGuid Guid);
422 void SubGroupCounterIncrease(
uint8 subgroup);
423 void SubGroupCounterDecrease(
uint8 subgroup);
424 void ToggleGroupMemberFlag(member_witerator slot,
uint8 flag,
bool apply);
std::chrono::milliseconds Milliseconds
Milliseconds shorthand typedef.
std::chrono::seconds Seconds
Seconds shorthand typedef.
#define READYCHECK_DURATION
@ GROUP_ASSIGN_MAINASSIST
#define RAID_MARKERS_COUNT
@ GROUP_FLAG_LFG_RESTRICTED
@ GROUP_FLAG_RESTRICT_PINGS
@ GROUP_FLAG_CROSS_FACTION
@ GROUP_FLAG_ONE_PERSON_PARTY
@ GROUP_FLAG_EVERYONE_ASSISTANT
@ GROUP_UPDATE_FLAG_PHASE
@ GROUP_UPDATE_FLAG_CUR_HP
@ GROUP_UPDATE_FLAG_UNK322
@ GROUP_UPDATE_FLAG_UNK4000000
@ GROUP_UPDATE_FLAG_POWER_TYPE
@ GROUP_UPDATE_FLAG_MAX_HP
@ GROUP_UPDATE_FLAG_UNK2000000
@ GROUP_UPDATE_FLAG_VEHICLE_SEAT
@ GROUP_UPDATE_FLAG_STATUS
@ GROUP_UPDATE_FLAG_MAX_POWER
@ GROUP_UPDATE_FLAG_UNK200000
@ GROUP_UPDATE_FLAG_POSITION
@ GROUP_UPDATE_FLAG_AURAS
@ GROUP_UPDATE_FLAG_LEVEL
@ GROUP_UPDATE_FLAG_UNK704
@ GROUP_UPDATE_FLAG_CUR_POWER
#define TARGET_ICONS_COUNT
@ GROUP_UPDATE_FLAG_PET_CUR_HP
@ GROUP_UPDATE_FLAG_PET_MODEL_ID
@ GROUP_UPDATE_FLAG_PET_NAME
@ GROUP_UPDATE_FLAG_PET_AURAS
@ GROUP_UPDATE_FLAG_PET_GUID
@ GROUP_UPDATE_FLAG_PET_NONE
@ GROUP_UPDATE_FLAG_PET_MAX_HP
@ GROUP_CATEGORY_INSTANCE
std::optional< T > Optional
Optional helper class to wrap optional values within.
GroupJoinBattlegroundResult
@ GROUP_REMOVEMETHOD_DEFAULT
Class used to access individual fields of database query result.
Seconds GetTotalTime() const
MemberSlotList const & GetMemberSlots() const
uint8 m_leaderFactionGroup
GroupCategory GetGroupCategory() const
RestrictPingsTo m_pingRestriction
Difficulty m_legacyRaidDifficulty
GroupCategory m_groupCategory
bool IsAssistant(ObjectGuid guid) const
std::array< std::unique_ptr< RaidMarker >, RAID_MARKERS_COUNT > m_markers
std::list< MemberSlot > MemberSlotList
Difficulty m_raidDifficulty
GroupRefManager m_memberMgr
std::set< Player * > InvitesList
Trinity::unique_trackable_ptr< Group > m_scriptRef
std::unordered_map< uint32, std::pair< ObjectGuid, uint32 > > m_recentInstances
MemberSlotList m_memberSlots
uint32 GetMembersCount() const
Trinity::unique_weak_ptr< Group > GetWeakPtr() const
void BroadcastWorker(Worker const &worker) const
GroupReference const * GetFirstMember() const
Difficulty GetRaidDifficultyID() const
TimeTracker m_leaderOfflineTimer
Milliseconds m_readyCheckTimer
ObjectGuid m_masterLooterGuid
MemberSlotList::iterator member_witerator
bool IsReadyCheckStarted(void) const
uint32 GetRecentInstanceId(uint32 mapId) const
void SetRecentInstance(uint32 mapId, ObjectGuid instanceOwner, uint32 instanceId)
uint32 GetInviteeCount() const
GroupReference * GetFirstMember()
Difficulty GetDungeonDifficultyID() const
ObjectGuid GetRecentInstanceOwner(uint32 mapId) const
uint8 * m_subGroupsCounts
MemberSlotList::const_iterator member_citerator
std::array< std::unique_ptr< CountdownInfo >, 3 > m_countdowns
Difficulty m_dungeonDifficulty
uint32 GetDbStoreId() const
Difficulty GetLegacyRaidDifficultyID() const
ItemQualities m_lootThreshold
GroupFlags GetGroupFlags() const
GroupInstanceRefManager m_ownedInstancesMgr
static ObjectGuid const Empty
Trinity::unique_trackable_ptr companion class, replicating what std::weak_ptr is to std::shared_ptr.
constexpr void WorldRelocate(WorldLocation const &loc)
Player session in the World.
std::unique_ptr< VignetteData > Create(VignetteEntry const *vignetteData, WorldObject const *owner)
void Update(VignetteData &vignette, WorldObject const *owner)
void operator()(Group *) const
RaidMarker(uint32 mapId, float positionX, float positionY, float positionZ, ObjectGuid transportGuid=ObjectGuid::Empty)