diff --git a/src/game/Creature.cpp b/src/game/Creature.cpp index 94551dd9f..9f2838dda 100644 --- a/src/game/Creature.cpp +++ b/src/game/Creature.cpp @@ -248,13 +248,8 @@ bool Creature::InitEntry(uint32 Entry, CreatureData const* data /*=NULL*/, GameE return false; } - // difficulties for dungeons/battleground ordered in normal way - // and if more high version not exist must be used lesser version - // for raid order different: - // 10 man normal version must be used instead nonexistent 10 man heroic version - // 25 man normal version must be used instead nonexistent 25 man heroic version CreatureInfo const *cinfo = normalInfo; - for (uint8 diff = uint8(GetMap()->GetDifficulty()); diff > 0;) + for (Difficulty diff = GetMap()->GetDifficulty(); diff > REGULAR_DIFFICULTY; diff = GetPrevDifficulty(diff, GetMap()->IsRaid())) { // we already have valid Map pointer for current creature! if (normalInfo->DifficultyEntry[diff - 1]) @@ -266,13 +261,6 @@ bool Creature::InitEntry(uint32 Entry, CreatureData const* data /*=NULL*/, GameE // check and reported at startup, so just ignore (restore normalInfo) cinfo = normalInfo; } - - // for raid heroic to normal, for other to prev in normal order - if ((diff == int(RAID_DIFFICULTY_10MAN_HEROIC) || diff == int(RAID_DIFFICULTY_25MAN_HEROIC)) && - GetMap()->IsRaid()) - diff -= 2; // to normal raid difficulty cases - else - --diff; } SetEntry(Entry); // normal entry always diff --git a/src/game/DBCEnums.h b/src/game/DBCEnums.h index 1cd1ecad1..3afa1a331 100644 --- a/src/game/DBCEnums.h +++ b/src/game/DBCEnums.h @@ -266,7 +266,7 @@ enum Difficulty enum SpawnMask { - SPAWNMASK_REGULAR = (1 << REGULAR_DIFFICULTY),// any any maps without spawn modes (continents/subway) or in minimal spawnmode + SPAWNMASK_REGULAR = (1 << REGULAR_DIFFICULTY),// any maps without spawn modes (continents/subway) or in minimal spawnmode SPAWNMASK_DUNGEON_NORMAL = (1 << DUNGEON_DIFFICULTY_NORMAL), SPAWNMASK_DUNGEON_HEROIC = (1 << DUNGEON_DIFFICULTY_HEROIC), diff --git a/src/game/DBCStores.h b/src/game/DBCStores.h index 485ae875c..bd3b60664 100644 --- a/src/game/DBCStores.h +++ b/src/game/DBCStores.h @@ -64,6 +64,28 @@ bool Map2ZoneCoordinates(float& x,float& y,uint32 zone); typedef std::map MapDifficultyMap; MapDifficulty const* GetMapDifficultyData(uint32 mapId, Difficulty difficulty); +// natural order for difficulties up-down iteration +// difficulties for dungeons/battleground ordered in normal way +// and if more high version not exist must be used lesser version +// for raid order different: +// 10 man normal version must be used instead nonexistent 10 man heroic version +// 25 man normal version must be used instead nonexistent 25 man heroic version +inline Difficulty GetPrevDifficulty(Difficulty diff, bool isRaid) +{ + switch (diff) + { + default: + case RAID_DIFFICULTY_10MAN_NORMAL: // == DUNGEON_DIFFICULTY_NORMAL == REGULAR_DIFFICULTY + return REGULAR_DIFFICULTY; // return itself, caller code must properly check and not call for this case + case RAID_DIFFICULTY_25MAN_NORMAL: // == DUNGEON_DIFFICULTY_HEROIC + return RAID_DIFFICULTY_10MAN_NORMAL; + case RAID_DIFFICULTY_10MAN_HEROIC: + return isRaid ? RAID_DIFFICULTY_10MAN_NORMAL : DUNGEON_DIFFICULTY_HEROIC; + case RAID_DIFFICULTY_25MAN_HEROIC: + return isRaid ? RAID_DIFFICULTY_25MAN_NORMAL : RAID_DIFFICULTY_10MAN_HEROIC; + } +} + uint32 const* /*[3]*/ GetTalentTabPages(uint32 cls); bool IsPointInAreaTriggerZone(AreaTriggerEntry const* atEntry, uint32 mapid, float x, float y, float z, float delta = 0.0f); diff --git a/src/shared/revision_nr.h b/src/shared/revision_nr.h index f340c9746..837e8152d 100644 --- a/src/shared/revision_nr.h +++ b/src/shared/revision_nr.h @@ -1,4 +1,4 @@ #ifndef __REVISION_NR_H__ #define __REVISION_NR_H__ - #define REVISION_NR "11608" + #define REVISION_NR "11609" #endif // __REVISION_NR_H__