diff options
| author | Shauren <shauren.trinity@gmail.com> | 2015-01-24 20:28:42 +0100 |
|---|---|---|
| committer | Shauren <shauren.trinity@gmail.com> | 2015-01-24 20:28:42 +0100 |
| commit | 5fed109cbfbdd9350a2928b66b5d89fe1f5e0ed3 (patch) | |
| tree | 487471a9d9631e6ab7ae17da905908ac99a8bb42 /src/server/game/Maps | |
| parent | 284b807af47fac32278dc1d1b3dce3da792d6d74 (diff) | |
Core/Loot: Implemented automatic assignment of Heroic/Mythic item bonuses when dropped in appropriate instance difficulty
Diffstat (limited to 'src/server/game/Maps')
| -rw-r--r-- | src/server/game/Maps/Map.cpp | 24 | ||||
| -rw-r--r-- | src/server/game/Maps/Map.h | 3 | ||||
| -rw-r--r-- | src/server/game/Maps/MapManager.cpp | 2 |
3 files changed, 21 insertions, 8 deletions
diff --git a/src/server/game/Maps/Map.cpp b/src/server/game/Maps/Map.cpp index 29041b5bccb..41594ad7d94 100644 --- a/src/server/game/Maps/Map.cpp +++ b/src/server/game/Maps/Map.cpp @@ -3201,11 +3201,23 @@ void InstanceMap::SetResetSchedule(bool on) } } -MapDifficulty const* Map::GetMapDifficulty() const +MapDifficultyEntry const* Map::GetMapDifficulty() const { return GetMapDifficultyData(GetId(), GetDifficultyID()); } +uint32 Map::GetDifficultyLootBonusTreeMod() const +{ + if (MapDifficultyEntry const* mapDifficulty = GetMapDifficulty()) + if (mapDifficulty->ItemBonusTreeModID) + return mapDifficulty->ItemBonusTreeModID; + + if (DifficultyEntry const* difficulty = sDifficultyStore.LookupEntry(GetDifficultyID())) + return difficulty->ItemBonusTreeModID; + + return 0; +} + bool Map::IsHeroic() const { if (DifficultyEntry const* difficulty = sDifficultyStore.LookupEntry(i_spawnMode)) @@ -3215,17 +3227,17 @@ bool Map::IsHeroic() const uint32 InstanceMap::GetMaxPlayers() const { - MapDifficulty const* mapDiff = GetMapDifficulty(); - if (mapDiff && mapDiff->maxPlayers) - return mapDiff->maxPlayers; + MapDifficultyEntry const* mapDiff = GetMapDifficulty(); + if (mapDiff && mapDiff->MaxPlayers) + return mapDiff->MaxPlayers; return GetEntry()->MaxPlayers; } uint32 InstanceMap::GetMaxResetDelay() const { - MapDifficulty const* mapDiff = GetMapDifficulty(); - return mapDiff ? mapDiff->resetTime : 0; + MapDifficultyEntry const* mapDiff = GetMapDifficulty(); + return mapDiff ? mapDiff->RaidDuration : 0; } /* ******* Battleground Instance Maps ******* */ diff --git a/src/server/game/Maps/Map.h b/src/server/game/Maps/Map.h index 94b89484e15..d38852e50c9 100644 --- a/src/server/game/Maps/Map.h +++ b/src/server/game/Maps/Map.h @@ -386,7 +386,8 @@ class Map : public GridRefManager<NGridType> // have meaning only for instanced map (that have set real difficulty) Difficulty GetDifficultyID() const { return Difficulty(GetSpawnMode()); } - MapDifficulty const* GetMapDifficulty() const; + MapDifficultyEntry const* GetMapDifficulty() const; + uint32 GetDifficultyLootBonusTreeMod() const; bool Instanceable() const { return i_mapEntry && i_mapEntry->Instanceable(); } bool IsDungeon() const { return i_mapEntry && i_mapEntry->IsDungeon(); } diff --git a/src/server/game/Maps/MapManager.cpp b/src/server/game/Maps/MapManager.cpp index 8c4dd2e0c65..89ca656675b 100644 --- a/src/server/game/Maps/MapManager.cpp +++ b/src/server/game/Maps/MapManager.cpp @@ -136,7 +136,7 @@ bool MapManager::CanPlayerEnter(uint32 mapid, Player* player, bool loginCheck) Difficulty targetDifficulty, requestedDifficulty; targetDifficulty = requestedDifficulty = player->GetDifficultyID(entry); // Get the highest available difficulty if current setting is higher than the instance allows - MapDifficulty const* mapDiff = GetDownscaledMapDifficultyData(entry->ID, targetDifficulty); + MapDifficultyEntry const* mapDiff = GetDownscaledMapDifficultyData(entry->ID, targetDifficulty); if (!mapDiff) { player->SendTransferAborted(mapid, TRANSFER_ABORT_DIFFICULTY, requestedDifficulty); |
