aboutsummaryrefslogtreecommitdiff
path: root/src/server/game/Entities/Player
diff options
context:
space:
mode:
Diffstat (limited to 'src/server/game/Entities/Player')
-rw-r--r--src/server/game/Entities/Player/Player.cpp184
-rw-r--r--src/server/game/Entities/Player/Player.h26
2 files changed, 137 insertions, 73 deletions
diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp
index 9da2865277e..3ef12a96f8c 100644
--- a/src/server/game/Entities/Player/Player.cpp
+++ b/src/server/game/Entities/Player/Player.cpp
@@ -790,8 +790,9 @@ Player::Player(WorldSession* session): Unit(true)
m_HomebindTimer = 0;
m_InstanceValid = true;
m_dungeonDifficulty = DIFFICULTY_NORMAL;
- m_raidDifficulty = DIFFICULTY_10_N;
- m_raidMapDifficulty = DIFFICULTY_10_N;
+ m_raidDifficulty = DIFFICULTY_NORMAL_RAID;
+ m_legacyRaidDifficulty = DIFFICULTY_10_N;
+ m_raidMapDifficulty = DIFFICULTY_NORMAL_RAID;
m_lastPotionId = 0;
_talentMgr = new PlayerTalentInfo();
@@ -6696,7 +6697,7 @@ void Player::RewardReputation(Unit* victim, float rate)
// support for: Championing - http://www.wowwiki.com/Championing
Map const* map = GetMap();
if (map && map->IsNonRaidDungeon())
- if (LFGDungeonEntry const* dungeon = GetLFGDungeon(map->GetId(), map->GetDifficulty()))
+ if (LFGDungeonEntry const* dungeon = GetLFGDungeon(map->GetId(), map->GetDifficultyID()))
if (dungeon->TargetLevel == 80)
ChampioningFaction = GetChampioningFaction();
}
@@ -11558,7 +11559,7 @@ InventoryResult Player::CanRollForItemInLFG(ItemTemplate const* proto, WorldObje
// check if looted object is inside the lfg dungeon
Map const* map = lootedObject->GetMap();
- if (!sLFGMgr->inLfgDungeonMap(GetGroup()->GetGUID(), map->GetId(), map->GetDifficulty()))
+ if (!sLFGMgr->inLfgDungeonMap(GetGroup()->GetGUID(), map->GetId(), map->GetDifficultyID()))
return EQUIP_ERR_OK;
if (!proto)
@@ -15927,7 +15928,7 @@ void Player::KilledMonsterCredit(uint32 entry, ObjectGuid guid /*= ObjectGuid::E
// just if !ingroup || !noraidgroup || raidgroup
QuestStatusData& q_status = m_QuestStatus[questid];
- if (q_status.Status == QUEST_STATUS_INCOMPLETE && (!GetGroup() || !GetGroup()->isRaidGroup() || qInfo->IsAllowedInRaid(GetMap()->GetDifficulty())))
+ if (q_status.Status == QUEST_STATUS_INCOMPLETE && (!GetGroup() || !GetGroup()->isRaidGroup() || qInfo->IsAllowedInRaid(GetMap()->GetDifficultyID())))
{
if (qInfo->HasSpecialFlag(QUEST_SPECIAL_FLAGS_KILL) /*&& !qInfo->HasSpecialFlag(QUEST_SPECIAL_FLAGS_CAST)*/)
{
@@ -15980,7 +15981,7 @@ void Player::KilledPlayerCredit()
// just if !ingroup || !noraidgroup || raidgroup
QuestStatusData& q_status = m_QuestStatus[questid];
- if (q_status.Status == QUEST_STATUS_INCOMPLETE && (!GetGroup() || !GetGroup()->isRaidGroup() || qInfo->IsAllowedInRaid(GetMap()->GetDifficulty())))
+ if (q_status.Status == QUEST_STATUS_INCOMPLETE && (!GetGroup() || !GetGroup()->isRaidGroup() || qInfo->IsAllowedInRaid(GetMap()->GetDifficultyID())))
{
for (QuestObjective const& obj : qInfo->GetObjectives())
{
@@ -16207,7 +16208,7 @@ bool Player::HasQuestForItem(uint32 itemid) const
continue;
// hide quest if player is in raid-group and quest is no raid quest
- if (GetGroup() && GetGroup()->isRaidGroup() && !qInfo->IsAllowedInRaid(GetMap()->GetDifficulty()))
+ if (GetGroup() && GetGroup()->isRaidGroup() && !qInfo->IsAllowedInRaid(GetMap()->GetDifficultyID()))
if (!InBattleground()) //there are two ways.. we can make every bg-quest a raidquest, or add this code here.. i don't know if this can be exploited by other quests, but i think all other quests depend on a specific area.. but keep this in mind, if something strange happens later
continue;
@@ -16645,13 +16646,13 @@ bool Player::LoadFromDB(ObjectGuid guid, SQLQueryHolder *holder)
// 12 13 14 15 16 17 18 19 20 21 22 23 24
//"position_x, position_y, position_z, map, orientation, taximask, cinematic, totaltime, leveltime, rest_bonus, logout_time, is_logout_resting, resettalents_cost, "
// 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39
- //"resettalents_time, talentTree, trans_x, trans_y, trans_z, trans_o, transguid, extra_flags, stable_slots, at_login, zone, online, death_expire_time, taxi_path, instance_mode_mask, "
+ //"resettalents_time, talentTree, trans_x, trans_y, trans_z, trans_o, transguid, extra_flags, stable_slots, at_login, zone, online, death_expire_time, taxi_path, dungeonDifficulty, "
// 40 41 42 43 44 45
//"totalKills, todayKills, yesterdayKills, chosenTitle, watchedFaction, drunk, "
// 46 47 48 49 50 51 52 53 54 55 56
//"health, power1, power2, power3, power4, power5, instance_id, speccount, activespec, exploredZones, equipmentCache, "
- // 57 58 59
- //"knownTitles, actionBars, grantableLevels FROM characters WHERE guid = '%u'", guid);
+ // 57 58 59 60 61
+ //"knownTitles, actionBars, grantableLevels, raidDifficulty, legacyRaidDifficulty FROM characters WHERE guid = '%u'", guid);
PreparedQueryResult result = holder->GetPreparedResult(PLAYER_LOGIN_QUERY_LOAD_FROM);
if (!result)
{
@@ -16777,14 +16778,9 @@ bool Player::LoadFromDB(ObjectGuid guid, SQLQueryHolder *holder)
uint32 mapId = fields[15].GetUInt16();
uint32 instanceId = fields[52].GetUInt32();
- uint32 dungeonDiff = fields[39].GetUInt8() & 0x0F;
- if (dungeonDiff >= MAX_DUNGEON_DIFFICULTY)
- dungeonDiff = DIFFICULTY_NORMAL;
- uint32 raidDiff = (fields[39].GetUInt8() >> 4) & 0x0F;
- if (raidDiff >= MAX_RAID_DIFFICULTY)
- raidDiff = DIFFICULTY_10_N;
- SetDungeonDifficulty(Difficulty(dungeonDiff)); // may be changed in _LoadGroup
- SetRaidDifficulty(Difficulty(raidDiff)); // may be changed in _LoadGroup
+ SetDungeonDifficultyID(CheckLoadedDungeonDifficultyID(Difficulty(fields[39].GetUInt8())));
+ SetRaidDifficultyID(CheckLoadedRaidDifficultyID(Difficulty(fields[60].GetUInt8())));
+ SetLegacyRaidDifficultyID(CheckLoadedLegacyRaidDifficultyID(Difficulty(fields[61].GetUInt8())));
std::string taxi_nodes = fields[38].GetString();
@@ -16979,7 +16975,7 @@ bool Player::LoadFromDB(ObjectGuid guid, SQLQueryHolder *holder)
// fix crash (because of if (Map* map = _FindMap(instanceId)) in MapInstanced::CreateInstance)
if (instanceId)
- if (InstanceSave* save = GetInstanceSave(mapId, mapEntry->IsRaid()))
+ if (InstanceSave* save = GetInstanceSave(mapId))
if (save->GetInstanceId() != instanceId)
instanceId = 0;
}
@@ -17042,7 +17038,6 @@ bool Player::LoadFromDB(ObjectGuid guid, SQLQueryHolder *holder)
}
SetMap(map);
- StoreRaidMapDifficulty();
// randomize first save time in range [CONFIG_INTERVAL_SAVE] around [CONFIG_INTERVAL_SAVE]
// this must help in case next save after mass player load after server startup
@@ -18300,8 +18295,9 @@ void Player::_LoadGroup(PreparedQueryResult result)
if (getLevel() >= LEVELREQUIREMENT_HEROIC)
{
// the group leader may change the instance difficulty while the player is offline
- SetDungeonDifficulty(group->GetDungeonDifficulty());
- SetRaidDifficulty(group->GetRaidDifficulty());
+ SetDungeonDifficultyID(group->GetDungeonDifficultyID());
+ SetRaidDifficultyID(group->GetRaidDifficultyID());
+ SetLegacyRaidDifficultyID(group->GetLegacyRaidDifficultyID());
}
}
}
@@ -18398,9 +18394,10 @@ InstancePlayerBind* Player::GetBoundInstance(uint32 mapid, Difficulty difficulty
return NULL;
}
-InstanceSave* Player::GetInstanceSave(uint32 mapid, bool raid)
+InstanceSave* Player::GetInstanceSave(uint32 mapid)
{
- InstancePlayerBind* pBind = GetBoundInstance(mapid, GetDifficulty(raid));
+ MapEntry const* mapEntry = sMapStore.LookupEntry(mapid);
+ InstancePlayerBind* pBind = GetBoundInstance(mapid, GetDifficultyID(mapEntry));
InstanceSave* pSave = pBind ? pBind->save : NULL;
if (!pBind || !pBind->perm)
if (Group* group = GetGroup())
@@ -18442,7 +18439,7 @@ InstancePlayerBind* Player::BindToInstance(InstanceSave* save, bool permanent, b
{
if (save)
{
- InstancePlayerBind& bind = m_boundInstances[save->GetDifficulty()][save->GetMapId()];
+ InstancePlayerBind& bind = m_boundInstances[save->GetDifficultyID()][save->GetMapId()];
if (!load)
{
if (bind.save)
@@ -18485,8 +18482,8 @@ InstancePlayerBind* Player::BindToInstance(InstanceSave* save, bool permanent, b
bind.save = save;
bind.perm = permanent;
if (!load)
- TC_LOG_DEBUG("maps", "Player::BindToInstance: %s(%s) is now bound to map %d, instance %d, difficulty %d", GetName().c_str(), GetGUID().ToString().c_str(), save->GetMapId(), save->GetInstanceId(), save->GetDifficulty());
- sScriptMgr->OnPlayerBindToInstance(this, save->GetDifficulty(), save->GetMapId(), permanent);
+ TC_LOG_DEBUG("maps", "Player::BindToInstance: %s(%s) is now bound to map %d, instance %d, difficulty %d", GetName().c_str(), GetGUID().ToString().c_str(), save->GetMapId(), save->GetInstanceId(), save->GetDifficultyID());
+ sScriptMgr->OnPlayerBindToInstance(this, save->GetDifficultyID(), save->GetMapId(), permanent);
return &bind;
}
@@ -18531,14 +18528,14 @@ void Player::SendRaidInfo()
if (itr->second.perm)
{
InstanceSave* save = itr->second.save;
- bool isHeroic = save->GetDifficulty() == DIFFICULTY_10_HC || save->GetDifficulty() == DIFFICULTY_25_HC;
+ bool isHeroic = save->GetDifficultyID() == DIFFICULTY_10_HC || save->GetDifficultyID() == DIFFICULTY_25_HC;
uint32 completedEncounters = 0;
if (Map* map = sMapMgr->FindMap(save->GetMapId(), save->GetInstanceId()))
if (InstanceScript* instanceScript = ((InstanceMap*)map)->GetInstanceScript())
completedEncounters = instanceScript->GetCompletedEncounterMask();
data << uint32(save->GetMapId()); // map id
- data << uint32(save->GetDifficulty()); // difficulty
+ data << uint32(save->GetDifficultyID()); // difficulty
data << uint32(isHeroic); // heroic
data << uint64(save->GetInstanceId()); // instance id
data << uint8(1); // expired = 0
@@ -18606,7 +18603,7 @@ void Player::ConvertInstancesToGroup(Player* player, Group* group, bool switchLe
{
for (BoundInstancesMap::iterator itr = player->m_boundInstances[i].begin(); itr != player->m_boundInstances[i].end();)
{
- if (!switchLeader || !group->GetBoundInstance(itr->second.save->GetDifficulty(), itr->first))
+ if (!switchLeader || !group->GetBoundInstance(itr->second.save->GetDifficultyID(), itr->first))
group->BindToInstance(itr->second.save, itr->second.perm, false);
// permanent binds are not removed
@@ -18672,7 +18669,7 @@ bool Player::Satisfy(AccessRequirement const* ar, uint32 target_map, bool report
if (!leader || !leader->HasAchieved(ar->achievement))
missingAchievement = ar->achievement;
- Difficulty target_difficulty = GetDifficulty(mapEntry->IsRaid());
+ Difficulty target_difficulty = GetDifficultyID(mapEntry);
MapDifficulty const* mapDiff = GetDownscaledMapDifficultyData(target_map, target_difficulty);
if (LevelMin || LevelMax || missingItem || missingQuest || missingAchievement)
{
@@ -18838,7 +18835,7 @@ void Player::SaveToDB(bool create /*=false*/)
stmt->setUInt32(index++, GetUInt32Value(PLAYER_FLAGS));
stmt->setUInt16(index++, (uint16)GetMapId());
stmt->setUInt32(index++, (uint32)GetInstanceId());
- stmt->setUInt8(index++, (uint8(GetDungeonDifficulty()) | uint8(GetRaidDifficulty()) << 4));
+ stmt->setUInt8(index++, (uint8(GetDungeonDifficultyID()) | uint8(GetRaidDifficultyID()) << 4));
stmt->setFloat(index++, finiteAlways(GetPositionX()));
stmt->setFloat(index++, finiteAlways(GetPositionY()));
stmt->setFloat(index++, finiteAlways(GetPositionZ()));
@@ -18959,7 +18956,9 @@ void Player::SaveToDB(bool create /*=false*/)
{
stmt->setUInt16(index++, (uint16)GetMapId());
stmt->setUInt32(index++, (uint32)GetInstanceId());
- stmt->setUInt8(index++, (uint8(GetDungeonDifficulty()) | uint8(GetRaidDifficulty()) << 4));
+ stmt->setUInt8(index++, uint8(GetDungeonDifficultyID()));
+ stmt->setUInt8(index++, uint8(GetRaidDifficultyID()));
+ stmt->setUInt8(index++, uint8(GetLegacyRaidDifficultyID()));
stmt->setFloat(index++, finiteAlways(GetPositionX()));
stmt->setFloat(index++, finiteAlways(GetPositionY()));
stmt->setFloat(index++, finiteAlways(GetPositionZ()));
@@ -18969,7 +18968,9 @@ void Player::SaveToDB(bool create /*=false*/)
{
stmt->setUInt16(index++, (uint16)GetTeleportDest().GetMapId());
stmt->setUInt32(index++, (uint32)0);
- stmt->setUInt8(index++, (uint8(GetDungeonDifficulty()) | uint8(GetRaidDifficulty()) << 4));
+ stmt->setUInt8(index++, uint8(GetDungeonDifficultyID()));
+ stmt->setUInt8(index++, uint8(GetRaidDifficultyID()));
+ stmt->setUInt8(index++, uint8(GetLegacyRaidDifficultyID()));
stmt->setFloat(index++, finiteAlways(GetTeleportDest().GetPositionX()));
stmt->setFloat(index++, finiteAlways(GetTeleportDest().GetPositionY()));
stmt->setFloat(index++, finiteAlways(GetTeleportDest().GetPositionZ()));
@@ -19963,24 +19964,19 @@ void Player::SendExplorationExperience(uint32 Area, uint32 Experience)
GetSession()->SendPacket(&data);
}
-void Player::SendDungeonDifficulty(bool IsInGroup)
+void Player::SendDungeonDifficulty()
{
- uint8 val = 0x00000001;
- WorldPacket data(MSG_SET_DUNGEON_DIFFICULTY, 12);
- data << (uint32)GetDungeonDifficulty();
- data << uint32(val);
- data << uint32(IsInGroup);
- GetSession()->SendPacket(&data);
+ WorldPackets::Misc::DungeonDifficultySet dungeonDifficultySet;
+ dungeonDifficultySet.DifficultyID = GetDungeonDifficultyID();
+ GetSession()->SendPacket(dungeonDifficultySet.Write());
}
-void Player::SendRaidDifficulty(bool IsInGroup, int32 forcedDifficulty)
+void Player::SendRaidDifficulty(bool legacy, int32 forcedDifficulty /*= -1*/)
{
- uint8 val = 0x00000001;
- WorldPacket data(MSG_SET_RAID_DIFFICULTY, 12);
- data << uint32(forcedDifficulty == -1 ? GetRaidDifficulty() : forcedDifficulty);
- data << uint32(val);
- data << uint32(IsInGroup);
- GetSession()->SendPacket(&data);
+ WorldPackets::Misc::RaidDifficultySet raidDifficultySet;
+ raidDifficultySet.DifficultyID = forcedDifficulty == -1 ? (legacy ? GetLegacyRaidDifficultyID() : GetRaidDifficultyID()) : forcedDifficulty;
+ raidDifficultySet.Legacy = legacy;
+ GetSession()->SendPacket(raidDifficultySet.Write());
}
void Player::SendResetFailedNotify(uint32 /*mapid*/)
@@ -19990,12 +19986,19 @@ void Player::SendResetFailedNotify(uint32 /*mapid*/)
}
/// Reset all solo instances and optionally send a message on success for each
-void Player::ResetInstances(uint8 method, bool isRaid)
+void Player::ResetInstances(uint8 method, bool isRaid, bool isLegacy)
{
// method can be INSTANCE_RESET_ALL, INSTANCE_RESET_CHANGE_DIFFICULTY, INSTANCE_RESET_GROUP_JOIN
// we assume that when the difficulty changes, all instances that can be reset will be
- Difficulty diff = GetDifficulty(isRaid);
+ Difficulty diff = GetDungeonDifficultyID();
+ if (isRaid)
+ {
+ if (!isLegacy)
+ diff = GetRaidDifficultyID();
+ else
+ diff = GetLegacyRaidDifficultyID();
+ }
for (BoundInstancesMap::iterator itr = m_boundInstances[diff].begin(); itr != m_boundInstances[diff].end();)
{
@@ -22867,11 +22870,11 @@ void Player::SendInitialPacketsBeforeAddToMap()
WorldPackets::Misc::WorldServerInfo worldServerInfo;
worldServerInfo.IneligibleForLootMask.Clear(); /// @todo
worldServerInfo.WeeklyReset = sWorld->GetNextWeeklyQuestsResetTime() - WEEK;
- worldServerInfo.InstanceGroupSize.Clear(); /// @todo
+ worldServerInfo.InstanceGroupSize.Set(GetMap()->GetMapDifficulty()->maxPlayers);
worldServerInfo.IsTournamentRealm = 0; /// @todo
worldServerInfo.RestrictedAccountMaxLevel.Clear(); /// @todo
worldServerInfo.RestrictedAccountMaxMoney.Clear(); /// @todo
- worldServerInfo.DifficultyID = GetMap()->GetDifficulty();
+ worldServerInfo.DifficultyID = GetMap()->GetDifficultyID();
SendDirectMessage(worldServerInfo.Write());
// SMSG_TALENTS_INFO x 2 for pet (unspent points and talents in separate packets...)
@@ -22925,17 +22928,13 @@ void Player::SendInitialPacketsAfterAddToMap()
SendEnchantmentDurations(); // must be after add to map
SendItemDurations(); // must be after add to map
- // raid downscaling - send difficulty to player
if (GetMap()->IsRaid())
{
- if (GetMap()->GetDifficulty() != GetRaidDifficulty())
- {
- StoreRaidMapDifficulty();
- SendRaidDifficulty(GetGroup() != NULL, GetStoredRaidDifficulty());
- }
+ DifficultyEntry const* difficulty = sDifficultyStore.LookupEntry(GetMap()->GetDifficultyID());
+ SendRaidDifficulty((difficulty->Flags & DIFFICULTY_FLAG_LEGACY) != 0, GetMap()->GetDifficultyID());
}
- else if (GetRaidDifficulty() != GetStoredRaidDifficulty())
- SendRaidDifficulty(GetGroup() != NULL);
+ else if (GetMap()->IsNonRaidDungeon())
+ SendDungeonDifficulty();
}
void Player::SendUpdateToOutOfRangeGroupMembers()
@@ -23603,7 +23602,7 @@ bool Player::HasQuestForGO(int32 GOId) const
if (!qInfo)
continue;
- if (GetGroup() && GetGroup()->isRaidGroup() && !qInfo->IsAllowedInRaid(GetMap()->GetDifficulty()))
+ if (GetGroup() && GetGroup()->isRaidGroup() && !qInfo->IsAllowedInRaid(GetMap()->GetDifficultyID()))
continue;
for (QuestObjective const& obj : qInfo->GetObjectives())
@@ -24323,7 +24322,7 @@ bool Player::inRandomLfgDungeon()
if (sLFGMgr->selectedRandomLfgDungeon(GetGUID()))
{
Map const* map = GetMap();
- return sLFGMgr->inLfgDungeonMap(GetGUID(), map->GetId(), map->GetDifficulty());
+ return sLFGMgr->inLfgDungeonMap(GetGUID(), map->GetId(), map->GetDifficultyID());
}
return false;
@@ -27070,3 +27069,64 @@ uint32 Player::CalculateTalentsPoints() const
// 1 talent point for every 15 levels
return getLevel() >= 100 ? 7 : uint32(floor(getLevel() / 15.f));
}
+
+Difficulty Player::GetDifficultyID(MapEntry const* mapEntry) const
+{
+ if (!mapEntry->IsRaid())
+ return m_dungeonDifficulty;
+
+ MapDifficulty const* defaultDifficulty = GetDefaultMapDifficulty(mapEntry->ID);
+ if (!defaultDifficulty)
+ return m_legacyRaidDifficulty;
+
+ DifficultyEntry const* difficulty = sDifficultyStore.LookupEntry(defaultDifficulty->DifficultyID);
+ if (!difficulty || difficulty->Flags & DIFFICULTY_FLAG_LEGACY)
+ return m_legacyRaidDifficulty;
+
+ return m_raidDifficulty;
+}
+
+Difficulty Player::CheckLoadedDungeonDifficultyID(Difficulty difficulty)
+{
+ DifficultyEntry const* difficultyEntry = sDifficultyStore.LookupEntry(difficulty);
+ if (!difficultyEntry)
+ return DIFFICULTY_NORMAL;
+
+ if (difficultyEntry->InstanceType != MAP_INSTANCE)
+ return DIFFICULTY_NORMAL;
+
+ if (!(difficultyEntry->Flags & DIFFICULTY_FLAG_CAN_SELECT))
+ return DIFFICULTY_NORMAL;
+
+ return difficulty;
+}
+
+Difficulty Player::CheckLoadedRaidDifficultyID(Difficulty difficulty)
+{
+ DifficultyEntry const* difficultyEntry = sDifficultyStore.LookupEntry(difficulty);
+ if (!difficultyEntry)
+ return DIFFICULTY_NORMAL_RAID;
+
+ if (difficultyEntry->InstanceType != MAP_INSTANCE)
+ return DIFFICULTY_NORMAL_RAID;
+
+ if (!(difficultyEntry->Flags & DIFFICULTY_FLAG_CAN_SELECT) || (difficultyEntry->Flags & DIFFICULTY_FLAG_LEGACY))
+ return DIFFICULTY_NORMAL_RAID;
+
+ return difficulty;
+}
+
+Difficulty Player::CheckLoadedLegacyRaidDifficultyID(Difficulty difficulty)
+{
+ DifficultyEntry const* difficultyEntry = sDifficultyStore.LookupEntry(difficulty);
+ if (!difficultyEntry)
+ return DIFFICULTY_10_N;
+
+ if (difficultyEntry->InstanceType != MAP_INSTANCE)
+ return DIFFICULTY_10_N;
+
+ if (!(difficultyEntry->Flags & DIFFICULTY_FLAG_CAN_SELECT) || !(difficultyEntry->Flags & DIFFICULTY_FLAG_LEGACY))
+ return DIFFICULTY_10_N;
+
+ return difficulty;
+}
diff --git a/src/server/game/Entities/Player/Player.h b/src/server/game/Entities/Player/Player.h
index 1c76e594236..5b768ceee8d 100644
--- a/src/server/game/Entities/Player/Player.h
+++ b/src/server/game/Entities/Player/Player.h
@@ -2006,13 +2006,16 @@ class Player : public Unit, public GridObject<Player>
uint32 GetArenaTeamIdInvited() { return m_ArenaTeamIdInvited; }
uint32 GetRBGPersonalRating() const { return 0; }
- Difficulty GetDifficulty(bool isRaid) const { return isRaid ? m_raidDifficulty : m_dungeonDifficulty; }
- Difficulty GetDungeonDifficulty() const { return m_dungeonDifficulty; }
- Difficulty GetRaidDifficulty() const { return m_raidDifficulty; }
- Difficulty GetStoredRaidDifficulty() const { return m_raidMapDifficulty; } // only for use in difficulty packet after exiting to raid map
- void SetDungeonDifficulty(Difficulty dungeon_difficulty) { m_dungeonDifficulty = dungeon_difficulty; }
- void SetRaidDifficulty(Difficulty raid_difficulty) { m_raidDifficulty = raid_difficulty; }
- void StoreRaidMapDifficulty() { m_raidMapDifficulty = GetMap()->GetDifficulty(); }
+ Difficulty GetDifficultyID(MapEntry const* mapEntry) const;
+ Difficulty GetDungeonDifficultyID() const { return m_dungeonDifficulty; }
+ Difficulty GetRaidDifficultyID() const { return m_raidDifficulty; }
+ Difficulty GetLegacyRaidDifficultyID() const { return m_legacyRaidDifficulty; }
+ void SetDungeonDifficultyID(Difficulty dungeon_difficulty) { m_dungeonDifficulty = dungeon_difficulty; }
+ void SetRaidDifficultyID(Difficulty raid_difficulty) { m_raidDifficulty = raid_difficulty; }
+ void SetLegacyRaidDifficultyID(Difficulty raid_difficulty) { m_legacyRaidDifficulty = raid_difficulty; }
+ static Difficulty CheckLoadedDungeonDifficultyID(Difficulty difficulty);
+ static Difficulty CheckLoadedRaidDifficultyID(Difficulty difficulty);
+ static Difficulty CheckLoadedLegacyRaidDifficultyID(Difficulty difficulty);
bool UpdateSkill(uint32 skill_id, uint32 step);
bool UpdateSkillPro(uint16 skillId, int32 chance, uint32 step);
@@ -2100,9 +2103,9 @@ class Player : public Unit, public GridObject<Player>
void SendAutoRepeatCancel(Unit* target);
void SendExplorationExperience(uint32 Area, uint32 Experience);
- void SendDungeonDifficulty(bool IsInGroup);
- void SendRaidDifficulty(bool IsInGroup, int32 forcedDifficulty = -1);
- void ResetInstances(uint8 method, bool isRaid);
+ void SendDungeonDifficulty();
+ void SendRaidDifficulty(bool legacy, int32 forcedDifficulty = -1);
+ void ResetInstances(uint8 method, bool isRaid, bool isLegacy);
void SendResetInstanceSuccess(uint32 MapId);
void SendResetInstanceFailed(uint32 reason, uint32 MapId);
void SendResetFailedNotify(uint32 mapid);
@@ -2468,7 +2471,7 @@ class Player : public Unit, public GridObject<Player>
BoundInstancesMap m_boundInstances[MAX_DIFFICULTY];
InstancePlayerBind* GetBoundInstance(uint32 mapid, Difficulty difficulty);
BoundInstancesMap& GetBoundInstances(Difficulty difficulty) { return m_boundInstances[difficulty]; }
- InstanceSave* GetInstanceSave(uint32 mapid, bool raid);
+ InstanceSave* GetInstanceSave(uint32 mapid);
void UnbindInstance(uint32 mapid, Difficulty difficulty, bool unload = false);
void UnbindInstance(BoundInstancesMap::iterator &itr, Difficulty difficulty, bool unload = false);
InstancePlayerBind* BindToInstance(InstanceSave* save, bool permanent, bool load = false);
@@ -2732,6 +2735,7 @@ class Player : public Unit, public GridObject<Player>
uint32 m_speakCount;
Difficulty m_dungeonDifficulty;
Difficulty m_raidDifficulty;
+ Difficulty m_legacyRaidDifficulty;
Difficulty m_raidMapDifficulty;
uint32 m_atLoginFlags;