![Smile Smile](images/smilies/smile.gif)
merci
Launcher WoW 5.1.0
|
void WorldSession::HandleSetDungeonDifficultyOpcode(WorldPacket& recvData) { sLog->outDebug(LOG_FILTER_NETWORKIO, "CMSG_SET_DUNGEON_DIFFICULTY"); uint32 mode; recvData >> mode; sLog->outDebug(LOG_FILTER_NETWORKIO, "NOBODIE dungeondifficulty 1 %u %u", mode, _player->GetDungeonDifficulty()); if (Difficulty(mode) == _player->GetDungeonDifficulty()) return; sLog->outDebug(LOG_FILTER_NETWORKIO, "NOBODIE dungeondifficulty 2"); // cannot reset while in an instance Map* map = _player->FindMap(); if (map && map->IsDungeon()) { sLog->outDebug(LOG_FILTER_NETWORKIO, "WorldSession::HandleSetDungeonDifficultyOpcode: player (Name: %s, GUID: %u) tried to reset the instance while player is inside!", _player->GetName().c_str(), _player->GetGUIDLow()); return; } Group* group = _player->GetGroup(); if (group) { sLog->outDebug(LOG_FILTER_NETWORKIO, "NOBODIE dungeondifficulty 3"); if (group->IsLeader(_player->GetGUID())) { sLog->outDebug(LOG_FILTER_NETWORKIO, "NOBODIE dungeondifficulty 4"); for (GroupReference* itr = group->GetFirstMember(); itr != NULL; itr = itr->next()) { sLog->outDebug(LOG_FILTER_NETWORKIO, "NOBODIE dungeondifficulty 5"); Player* groupGuy = itr->getSource(); if (!groupGuy) continue; if (!groupGuy->IsInMap(groupGuy)) return; if (groupGuy->GetMap()->IsNonRaidDungeon()) { sLog->outDebug(LOG_FILTER_NETWORKIO, "WorldSession::HandleSetDungeonDifficultyOpcode: player %d tried to reset the instance while group member (Name: %s, GUID: %u) is inside!", _player->GetGUIDLow(), groupGuy->GetName().c_str(), groupGuy->GetGUIDLow()); return; } } // the difficulty is set even if the instances can't be reset //_player->SendDungeonDifficulty(true); group->ResetInstances(INSTANCE_RESET_CHANGE_DIFFICULTY, false, _player); group->SetDungeonDifficulty(Difficulty(mode)); } } else { sLog->outDebug(LOG_FILTER_NETWORKIO, "NOBODIE dungeondifficulty 6"); _player->ResetInstances(INSTANCE_RESET_CHANGE_DIFFICULTY, false); _player->SetDungeonDifficulty(Difficulty(mode)); _player->SendDungeonDifficulty(false); } }