mirror of
https://github.com/mangosfour/server.git
synced 2025-12-17 07:37:03 +00:00
[11609] Add and use GetPrevDifficulty function.
Function return prev. difficulty in natural difficulty order for raid/dungeons/bg
This commit is contained in:
parent
44d168d4a3
commit
753b0cd969
4 changed files with 25 additions and 15 deletions
|
|
@ -248,13 +248,8 @@ bool Creature::InitEntry(uint32 Entry, CreatureData const* data /*=NULL*/, GameE
|
||||||
return false;
|
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;
|
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!
|
// we already have valid Map pointer for current creature!
|
||||||
if (normalInfo->DifficultyEntry[diff - 1])
|
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)
|
// check and reported at startup, so just ignore (restore normalInfo)
|
||||||
cinfo = 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
|
SetEntry(Entry); // normal entry always
|
||||||
|
|
|
||||||
|
|
@ -266,7 +266,7 @@ enum Difficulty
|
||||||
|
|
||||||
enum SpawnMask
|
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_NORMAL = (1 << DUNGEON_DIFFICULTY_NORMAL),
|
||||||
SPAWNMASK_DUNGEON_HEROIC = (1 << DUNGEON_DIFFICULTY_HEROIC),
|
SPAWNMASK_DUNGEON_HEROIC = (1 << DUNGEON_DIFFICULTY_HEROIC),
|
||||||
|
|
|
||||||
|
|
@ -64,6 +64,28 @@ bool Map2ZoneCoordinates(float& x,float& y,uint32 zone);
|
||||||
typedef std::map<uint32/*pair32(map,diff)*/,MapDifficulty> MapDifficultyMap;
|
typedef std::map<uint32/*pair32(map,diff)*/,MapDifficulty> MapDifficultyMap;
|
||||||
MapDifficulty const* GetMapDifficultyData(uint32 mapId, Difficulty difficulty);
|
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);
|
uint32 const* /*[3]*/ GetTalentTabPages(uint32 cls);
|
||||||
|
|
||||||
bool IsPointInAreaTriggerZone(AreaTriggerEntry const* atEntry, uint32 mapid, float x, float y, float z, float delta = 0.0f);
|
bool IsPointInAreaTriggerZone(AreaTriggerEntry const* atEntry, uint32 mapid, float x, float y, float z, float delta = 0.0f);
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
#ifndef __REVISION_NR_H__
|
#ifndef __REVISION_NR_H__
|
||||||
#define __REVISION_NR_H__
|
#define __REVISION_NR_H__
|
||||||
#define REVISION_NR "11608"
|
#define REVISION_NR "11609"
|
||||||
#endif // __REVISION_NR_H__
|
#endif // __REVISION_NR_H__
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue