From AlterEgo, 1 Year ago, written in Diff-output.
This paste will hop the perch in 1 Second.
Embed
  1.  src/server/game/AI/ScriptedAI/ScriptedCreature.h | 28 ++++------
  2.  src/server/game/Conditions/DisableMgr.cpp        | 26 +++------
  3.  src/server/game/DataStores/DBCEnums.h            | 70 +++++++++++-------------
  4.  src/server/game/DataStores/DBCStores.cpp         | 10 +++-
  5.  src/server/game/DungeonFinding/LFGMgr.cpp        |  4 +-
  6.  src/server/game/DungeonFinding/LFGScripts.cpp    |  2 +-
  7.  src/server/game/Entities/Creature/Creature.cpp   | 37 ++++++++-----
  8.  src/server/game/Globals/ObjectMgr.cpp            | 48 ++++++++--------
  9.  src/server/game/Instances/InstanceSaveMgr.h      |  2 +-
  10.  src/server/game/Maps/Map.h                       |  6 +-
  11.  10 files changed, 113 insertions(+), 120 deletions(-)
  12.  
  13. diff --git a/src/server/game/AI/ScriptedAI/ScriptedCreature.h b/src/server/game/AI/ScriptedAI/ScriptedCreature.h
  14. index 47c3c0b..54a6152 100644
  15. --- a/src/server/game/AI/ScriptedAI/ScriptedCreature.h
  16. +++ b/src/server/game/AI/ScriptedAI/ScriptedCreature.h
  17. @@ -320,9 +320,9 @@ struct ScriptedAI : public CreatureAI
  18.      {
  19.          switch (_difficulty)
  20.          {
  21. -            case DUNGEON_DIFFICULTY_NORMAL:
  22. +            case REGULAR_DIFFICULTY:
  23.                  return normal5;
  24. -            case DUNGEON_DIFFICULTY_HEROIC:
  25. +            case HEROIC_DIFFICULTY:
  26.                  return heroic10;
  27.              default:
  28.                  break;
  29. @@ -336,9 +336,9 @@ struct ScriptedAI : public CreatureAI
  30.      {
  31.          switch (_difficulty)
  32.          {
  33. -            case RAID_DIFFICULTY_10MAN_NORMAL:
  34. +            case MAN10_DIFFICULTY:
  35.                  return normal10;
  36. -            case RAID_DIFFICULTY_25MAN_NORMAL:
  37. +            case MAN25_DIFFICULTY:
  38.                  return normal25;
  39.              default:
  40.                  break;
  41. @@ -352,14 +352,10 @@ struct ScriptedAI : public CreatureAI
  42.      {
  43.          switch (_difficulty)
  44.          {
  45. -            case RAID_DIFFICULTY_10MAN_NORMAL:
  46. +            case MAN10_DIFFICULTY:
  47.                  return normal10;
  48. -            case RAID_DIFFICULTY_25MAN_NORMAL:
  49. +            case MAN25_DIFFICULTY:
  50.                  return normal25;
  51. -            case RAID_DIFFICULTY_10MAN_FLEX:
  52. -                return flex;
  53. -            case RAID_DIFFICULTY_25MAN_LFR:
  54. -                return lfr;
  55.              default:
  56.                  break;
  57.          }
  58. @@ -372,18 +368,14 @@ struct ScriptedAI : public CreatureAI
  59.      {
  60.          switch (_difficulty)
  61.          {
  62. -            case RAID_DIFFICULTY_10MAN_NORMAL:
  63. +            case MAN10_DIFFICULTY:
  64.                  return normal10;
  65. -            case RAID_DIFFICULTY_25MAN_NORMAL:
  66. +            case MAN25_DIFFICULTY:
  67.                  return normal25;
  68. -            case RAID_DIFFICULTY_10MAN_HEROIC:
  69. +            case MAN10_HEROIC_DIFFICULTY:
  70.                  return heroic10;
  71. -            case RAID_DIFFICULTY_25MAN_HEROIC:
  72. +            case MAN25_HEROIC_DIFFICULTY:
  73.                  return heroic25;
  74. -            case RAID_DIFFICULTY_10MAN_FLEX:
  75. -                return flex;
  76. -            case RAID_DIFFICULTY_25MAN_LFR:
  77. -                return lfr;
  78.              default:
  79.                  break;
  80.          }
  81. diff --git a/src/server/game/Conditions/DisableMgr.cpp b/src/server/game/Conditions/DisableMgr.cpp
  82. index e7e3f73..d30583e 100644
  83. --- a/src/server/game/Conditions/DisableMgr.cpp
  84. +++ b/src/server/game/Conditions/DisableMgr.cpp
  85. @@ -134,21 +134,12 @@ void LoadDisables()
  86.                              isFlagInvalid = true;
  87.                          break;
  88.                      case MAP_INSTANCE:
  89. -                        if (flags & DUNGEON_STATUSFLAG_HEROIC && !GetMapDifficultyData(entry, DUNGEON_DIFFICULTY_HEROIC))
  90. -                            flags -= DUNGEON_STATUSFLAG_HEROIC;
  91. -                        if (!flags)
  92. -                            isFlagInvalid = true;
  93. -                        break;
  94.                      case MAP_RAID:
  95. -                        if (flags & RAID_STATUSFLAG_10MAN_HEROIC && !GetMapDifficultyData(entry, RAID_DIFFICULTY_10MAN_HEROIC))
  96. -                            flags -= RAID_STATUSFLAG_10MAN_HEROIC;
  97. -                        if (flags & RAID_STATUSFLAG_25MAN_HEROIC && !GetMapDifficultyData(entry, RAID_DIFFICULTY_25MAN_HEROIC))
  98. -                            flags -= RAID_STATUSFLAG_25MAN_HEROIC;
  99. -                        if (flags & RAID_STATUSFLAG_10MAN_FLEX && !GetMapDifficultyData(entry, RAID_DIFFICULTY_10MAN_FLEX))
  100. -                            flags -= RAID_STATUSFLAG_10MAN_FLEX;
  101. -                        if (flags & RAID_STATUSFLAG_25MAN_LFR && !GetMapDifficultyData(entry, RAID_DIFFICULTY_25MAN_LFR))
  102. -                            flags -= RAID_STATUSFLAG_25MAN_LFR;
  103. -                        if (!flags)
  104. +                        if (flags & DUNGEON_STATUSFLAG_HEROIC && !GetMapDifficultyData(entry, HEROIC_DIFFICULTY))
  105. +                            isFlagInvalid = true;
  106. +                        else if (flags & RAID_STATUSFLAG_10MAN_HEROIC && !GetMapDifficultyData(entry, MAN10_HEROIC_DIFFICULTY))
  107. +                            isFlagInvalid = true;
  108. +                        else if (flags & RAID_STATUSFLAG_25MAN_HEROIC && !GetMapDifficultyData(entry, MAN25_HEROIC_DIFFICULTY))
  109.                              isFlagInvalid = true;
  110.                          break;
  111.                      case MAP_BATTLEGROUND:
  112. @@ -356,7 +347,8 @@ bool IsDisabledFor(DisableType type, uint32 entry, Unit const* unit, uint8 flags
  113.  
  114.              break;
  115.          }
  116. -        case DISABLE_TYPE_MAP:
  117. +       // Need to update
  118. +       /* case DISABLE_TYPE_MAP:
  119.              if (Player const* player = unit->ToPlayer())
  120.              {
  121.                  MapEntry const* mapEntry = sMapStore.LookupEntry(entry);
  122. @@ -367,7 +359,7 @@ bool IsDisabledFor(DisableType type, uint32 entry, Unit const* unit, uint8 flags
  123.                      GetDownscaledMapDifficultyData(entry, targetDifficulty);
  124.                      switch (targetDifficulty)
  125.                      {
  126. -                        case DUNGEON_DIFFICULTY_NORMAL:
  127. +                        case NORMAL_DIFFICULTY:
  128.                              return disabledModes & DUNGEON_STATUSFLAG_NORMAL;
  129.                          case DUNGEON_DIFFICULTY_HEROIC:
  130.                              return disabledModes & DUNGEON_STATUSFLAG_HEROIC;
  131. @@ -384,7 +376,7 @@ bool IsDisabledFor(DisableType type, uint32 entry, Unit const* unit, uint8 flags
  132.                  else if (mapEntry->map_type == MAP_COMMON)
  133.                      return true;
  134.              }
  135. -            return false;
  136. +            return false; */
  137.          case DISABLE_TYPE_QUEST:
  138.              if (!unit)
  139.                  return true;
  140. diff --git a/src/server/game/DataStores/DBCEnums.h b/src/server/game/DataStores/DBCEnums.h
  141. index c65aeca..3b1b279 100644
  142. --- a/src/server/game/DataStores/DBCEnums.h
  143. +++ b/src/server/game/DataStores/DBCEnums.h
  144. @@ -325,54 +325,50 @@ enum AreaFlags
  145.  
  146.  enum Difficulty
  147.  {
  148. -    REGULAR_DIFFICULTY           = 0,
  149. -
  150. -    DUNGEON_DIFFICULTY_NORMAL    = 0,
  151. -    DUNGEON_DIFFICULTY_HEROIC    = 1,
  152. -    DUNGEON_DIFFICULTY_CHALLENGE = 2,
  153. -
  154. -    RAID_DIFFICULTY_10MAN_NORMAL = 0,
  155. -    RAID_DIFFICULTY_25MAN_NORMAL = 1,
  156. -    RAID_DIFFICULTY_10MAN_HEROIC = 2,
  157. -    RAID_DIFFICULTY_25MAN_HEROIC = 3,
  158. -    RAID_DIFFICULTY_10MAN_FLEX   = 4,
  159. -    RAID_DIFFICULTY_25MAN_LFR    = 5,
  160. -
  161. -    SCENARIO_DIFFICULTY_NORMAL   = 0,
  162. -    SCENARIO_DIFFICULTY_HEROIC   = 1
  163. +    NONE_DIFFICULTY              = 0,                       // entry
  164. +    REGULAR_DIFFICULTY           = 1,                       // difficulty_entry_1
  165. +    HEROIC_DIFFICULTY            = 2,                       // difficulty_entry_2
  166. +    MAN10_DIFFICULTY             = 3,                       // difficulty_entry_3
  167. +    MAN25_DIFFICULTY             = 4,                       // difficulty_entry_4
  168. +    MAN10_HEROIC_DIFFICULTY      = 5,                       // difficulty_entry_5
  169. +    MAN25_HEROIC_DIFFICULTY      = 6,                       // difficulty_entry_6
  170. +    RAID_TOOL_DIFFICULTY         = 7,                       // difficulty_entry_7
  171. +    CHALLENGE_MODE_DIFFICULTY    = 8,                       // difficulty_entry_8
  172. +    MAN40_DIFFICULTY             = 9,                       // difficulty_entry_9
  173. +                                                            // difficulty_entry_10
  174. +    SCENARIO_HEROIC_DIFFICULTY   = 11,                      // difficulty_entry_11
  175. +    SCENARIO_DIFFICULTY          = 12,                      // difficulty_entry_12
  176. +                                                            // difficulty_entry_13
  177. +    DYNAMIC_DIFFICULTY           = 14                       // difficulty_entry_14
  178.  };
  179.  
  180. -#define RAID_DIFFICULTY_MASK_25MAN 1    // since 25man difficulties are 1 and 3, we can check them like that
  181. +#define RAID_DIFFICULTY_MASK_25MAN 1                        // since 25man difficulties are 1 and 3, we can check them like that
  182.  
  183. -#define MAX_DUNGEON_DIFFICULTY     3
  184. -#define MAX_RAID_DIFFICULTY        6
  185. -#define MAX_SCENARIO_DIFFICULTY    2
  186. -#define MAX_DIFFICULTY             4 // temp hack Should be 6 but need to finish the DB side.
  187. +#define MAX_DUNGEON_DIFFICULTY     HEROIC_DIFFICULTY+1
  188. +#define MAX_RAID_DIFFICULTY        MAN40_DIFFICULTY+1
  189. +#define MAX_DIFFICULTY             DYNAMIC_DIFFICULTY+1     // difficulty_entry_15
  190.  
  191.  enum SpawnMask
  192.  {
  193. -    SPAWNMASK_CONTINENT             = (1 << REGULAR_DIFFICULTY), // any maps without spawn modes
  194. +    SPAWNMASK_CONTINENT         = (1 << NONE_DIFFICULTY),   // any maps without spawn modes
  195.  
  196. -    SPAWNMASK_DUNGEON_NORMAL        = (1 << DUNGEON_DIFFICULTY_NORMAL),
  197. -    SPAWNMASK_DUNGEON_HEROIC        = (1 << DUNGEON_DIFFICULTY_HEROIC),
  198. -    SPAWNMASK_DUNGEON_CHALLENGE     = (1 << DUNGEON_DIFFICULTY_CHALLENGE),
  199. -    SPAWNMASK_DUNGEON_ALL           = (SPAWNMASK_DUNGEON_NORMAL | SPAWNMASK_DUNGEON_HEROIC | SPAWNMASK_DUNGEON_CHALLENGE),
  200. +    SPAWNMASK_DUNGEON_NORMAL    = (1 << REGULAR_DIFFICULTY),
  201. +    SPAWNMASK_DUNGEON_HEROIC    = (1 << HEROIC_DIFFICULTY),
  202. +    SPAWNMASK_DUNGEON_CHALLENGE = (1 << CHALLENGE_MODE_DIFFICULTY),
  203. +    SPAWNMASK_DUNGEON_ALL       = (SPAWNMASK_DUNGEON_NORMAL | SPAWNMASK_DUNGEON_HEROIC | SPAWNMASK_DUNGEON_CHALLENGE),
  204.  
  205. -    SPAWNMASK_RAID_10MAN_NORMAL     = (1 << RAID_DIFFICULTY_10MAN_NORMAL),
  206. -    SPAWNMASK_RAID_25MAN_NORMAL     = (1 << RAID_DIFFICULTY_25MAN_NORMAL),
  207. -    SPAWNMASK_RAID_10MAN_FLEX       = (1 << RAID_DIFFICULTY_10MAN_FLEX),
  208. -    SPAWNMASK_RAID_25MAN_LFR        = (1 << RAID_DIFFICULTY_25MAN_LFR),
  209. -    SPAWNMASK_RAID_NORMAL_ALL       = (SPAWNMASK_RAID_10MAN_NORMAL | SPAWNMASK_RAID_25MAN_NORMAL | SPAWNMASK_RAID_10MAN_FLEX | SPAWNMASK_RAID_25MAN_LFR),
  210. +    SPAWNMASK_RAID_10MAN_NORMAL = (1 << MAN10_DIFFICULTY ),
  211. +    SPAWNMASK_RAID_25MAN_NORMAL = (1 << MAN25_DIFFICULTY),
  212. +    SPAWNMASK_RAID_40MAN_NORMAL = (1 << MAN40_DIFFICULTY),
  213. +    SPAWNMASK_RAID_NORMAL_ALL   = (SPAWNMASK_RAID_10MAN_NORMAL | SPAWNMASK_RAID_25MAN_NORMAL | SPAWNMASK_RAID_40MAN_NORMAL),
  214.  
  215. -    SPAWNMASK_RAID_10MAN_HEROIC     = (1 << RAID_DIFFICULTY_10MAN_HEROIC),
  216. -    SPAWNMASK_RAID_25MAN_HEROIC     = (1 << RAID_DIFFICULTY_25MAN_HEROIC),
  217. -    SPAWNMASK_RAID_HEROIC_ALL       = (SPAWNMASK_RAID_10MAN_HEROIC | SPAWNMASK_RAID_25MAN_HEROIC),
  218. +    SPAWNMASK_RAID_10MAN_HEROIC = (1 << MAN10_HEROIC_DIFFICULTY),
  219. +    SPAWNMASK_RAID_25MAN_HEROIC = (1 << MAN25_HEROIC_DIFFICULTY),
  220. +    SPAWNMASK_RAID_HEROIC_ALL   = (SPAWNMASK_RAID_10MAN_HEROIC | SPAWNMASK_RAID_25MAN_HEROIC),
  221.  
  222. -    SPAWNMASK_RAID_ALL              = (SPAWNMASK_RAID_NORMAL_ALL | SPAWNMASK_RAID_HEROIC_ALL),
  223. +    SPAWNMASK_RAID_RAID_TOOL    = (1 << RAID_TOOL_DIFFICULTY),
  224.  
  225. -    SPAWNMASK_SCENARIO_NORMAL       = (1 << SCENARIO_DIFFICULTY_NORMAL),
  226. -    SPAWNMASK_SCENARIO_HEROIC       = (1 << SCENARIO_DIFFICULTY_HEROIC),
  227. -    SPAWNMASK_SCENARIO_ALL          = (SCENARIO_DIFFICULTY_NORMAL | SCENARIO_DIFFICULTY_HEROIC)
  228. +    SPAWNMASK_RAID_ALL          = (SPAWNMASK_RAID_NORMAL_ALL | SPAWNMASK_RAID_HEROIC_ALL | SPAWNMASK_RAID_RAID_TOOL)
  229.  };
  230.  
  231.  enum FactionTemplateFlags
  232. diff --git a/src/server/game/DataStores/DBCStores.cpp b/src/server/game/DataStores/DBCStores.cpp
  233. index b561331..2618069 100644
  234. --- a/src/server/game/DataStores/DBCStores.cpp
  235. +++ b/src/server/game/DataStores/DBCStores.cpp
  236. @@ -1191,10 +1191,14 @@ MapDifficulty const* GetDownscaledMapDifficultyData(uint32 mapId, Difficulty &di
  237.      MapDifficulty const* mapDiff = GetMapDifficultyData(mapId, Difficulty(tmpDiff));
  238.      if (!mapDiff)
  239.      {
  240. -        if (tmpDiff > RAID_DIFFICULTY_25MAN_NORMAL) // heroic, downscale to normal
  241. -            tmpDiff -= 2;
  242. +        if (tmpDiff == MAN25_HEROIC_DIFFICULTY)
  243. +            tmpDiff = MAN25_DIFFICULTY;
  244. +        else if (tmpDiff == MAN10_HEROIC_DIFFICULTY)
  245. +            tmpDiff = MAN10_DIFFICULTY;
  246.          else
  247. -            tmpDiff -= 1;   // any non-normal mode for raids like tbc (only one mode)
  248. +        {
  249. +            tmpDiff = REGULAR_DIFFICULTY;
  250. +        }
  251.  
  252.          // pull new data
  253.          mapDiff = GetMapDifficultyData(mapId, Difficulty(tmpDiff)); // we are 10 normal or 25 normal
  254. diff --git a/src/server/game/DungeonFinding/LFGMgr.cpp b/src/server/game/DungeonFinding/LFGMgr.cpp
  255. index 51a5b29..ab8d2d8 100644
  256. --- a/src/server/game/DungeonFinding/LFGMgr.cpp
  257. +++ b/src/server/game/DungeonFinding/LFGMgr.cpp
  258. @@ -396,7 +396,7 @@ void LFGMgr::InitializeLockedDungeons(Player* player, uint8 level /* = 0 */)
  259.              lockData = LFG_LOCKSTATUS_INSUFFICIENT_EXPANSION;
  260.          else if (DisableMgr::IsDisabledFor(DISABLE_TYPE_MAP, dungeon->map, player))
  261.              lockData = LFG_LOCKSTATUS_RAID_LOCKED;
  262. -        else if (dungeon->difficulty > DUNGEON_DIFFICULTY_NORMAL && player->GetBoundInstance(dungeon->map, Difficulty(dungeon->difficulty)))
  263. +        else if (dungeon->difficulty > REGULAR_DIFFICULTY && player->GetBoundInstance(dungeon->map, Difficulty(dungeon->difficulty)))
  264.              lockData = LFG_LOCKSTATUS_RAID_LOCKED;
  265.          else if (dungeon->minlevel > level)
  266.              lockData = LFG_LOCKSTATUS_TOO_LOW_LEVEL;
  267. @@ -1457,7 +1457,7 @@ void LFGMgr::FinishDungeon(uint64 gguid, const uint32 dungeonId)
  268.          }
  269.  
  270.          // Update achievements
  271. -        if (dungeon->difficulty == DUNGEON_DIFFICULTY_HEROIC)
  272. +        if (dungeon->difficulty == HEROIC_DIFFICULTY)
  273.              player->UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_USE_LFD_TO_GROUP_WITH_PLAYERS, 1);
  274.  
  275.          LfgReward const* reward = GetRandomDungeonReward(rDungeonId, player->getLevel());
  276. diff --git a/src/server/game/DungeonFinding/LFGScripts.cpp b/src/server/game/DungeonFinding/LFGScripts.cpp
  277. index d5a67b1..833b002 100644
  278. --- a/src/server/game/DungeonFinding/LFGScripts.cpp
  279. +++ b/src/server/game/DungeonFinding/LFGScripts.cpp
  280. @@ -84,7 +84,7 @@ void LFGPlayerScript::OnLogin(Player* player)
  281.  void LFGPlayerScript::OnBindToInstance(Player* player, Difficulty difficulty, uint32 mapId, bool /*permanent*/)
  282.  {
  283.      MapEntry const* mapEntry = sMapStore.LookupEntry(mapId);
  284. -    if (mapEntry->IsDungeon() && difficulty > DUNGEON_DIFFICULTY_NORMAL)
  285. +    if (mapEntry->IsDungeon() && difficulty > REGULAR_DIFFICULTY)
  286.          sLFGMgr->InitializeLockedDungeons(player);
  287.  }
  288.  
  289. diff --git a/src/server/game/Entities/Creature/Creature.cpp b/src/server/game/Entities/Creature/Creature.cpp
  290. index d2b38fd..c8dec78 100644
  291. --- a/src/server/game/Entities/Creature/Creature.cpp
  292. +++ b/src/server/game/Entities/Creature/Creature.cpp
  293. @@ -269,31 +269,38 @@ bool Creature::InitEntry(uint32 entry, uint32 /*team*/, const CreatureData* data
  294.  
  295.      // get difficulty 1 mode entry
  296.      CreatureTemplate const* cinfo = normalInfo;
  297. -    for (uint8 diff = uint8(GetMap()->GetSpawnMode()); diff > 0;)
  298. +    uint8 diff = uint8(GetMap()->GetSpawnMode());
  299. +    if (diff)
  300.      {
  301. -        // we already have valid Map pointer for current creature!
  302.          if (normalInfo->DifficultyEntry[diff - 1])
  303.          {
  304.              cinfo = sObjectMgr->GetCreatureTemplate(normalInfo->DifficultyEntry[diff - 1]);
  305. -            if (cinfo)
  306. -                break;                                      // template found
  307.  
  308.              // check and reported at startup, so just ignore (restore normalInfo)
  309. -            cinfo = normalInfo;
  310. +            if (!cinfo)
  311. +                cinfo = normalInfo;
  312.          }
  313.  
  314. -        // for instances heroic to normal, other cases attempt to retrieve previous difficulty
  315. -        if (diff >= RAID_DIFFICULTY_10MAN_HEROIC && GetMap()->IsRaid())
  316. -            diff -= 2;                                      // to normal raid difficulty cases
  317. -        else
  318. -            --diff;
  319. -    }
  320. +        if (cinfo == normalInfo && (diff == MAN25_HEROIC_DIFFICULTY || diff == RAID_TOOL_DIFFICULTY) && normalInfo->DifficultyEntry[MAN25_DIFFICULTY - 1])
  321. +        {
  322. +            cinfo = sObjectMgr->GetCreatureTemplate(normalInfo->DifficultyEntry[MAN25_DIFFICULTY - 1]);
  323. +
  324. +            // check and reported at startup, so just ignore (restore normalInfo)
  325. +            if (!cinfo)
  326. +                cinfo = normalInfo;
  327. +        }
  328.  
  329. -    // Initialize loot duplicate count depending on raid difficulty
  330. -    if (GetMap()->Is25ManRaid())
  331. -        loot.maxDuplicates = 3;
  332. +        if (cinfo == normalInfo &&  diff == MAN10_HEROIC_DIFFICULTY && normalInfo->DifficultyEntry[MAN10_DIFFICULTY - 1])
  333. +        {
  334. +            cinfo = sObjectMgr->GetCreatureTemplate(normalInfo->DifficultyEntry[MAN10_DIFFICULTY - 1]);
  335. +
  336. +            // check and reported at startup, so just ignore (restore normalInfo)
  337. +            if (!cinfo)
  338. +                cinfo = normalInfo;
  339. +        }
  340. +    }
  341.  
  342. -    SetEntry(entry);                                        // normal entry always
  343. +    SetEntry(Entry);                                        // normal entry always
  344.      m_creatureInfo = cinfo;                                 // map mode related always
  345.  
  346.      // equal to player Race field, but creature does not have race
  347. diff --git a/src/server/game/Globals/ObjectMgr.cpp b/src/server/game/Globals/ObjectMgr.cpp
  348. index fd356dd..5188b03 100644
  349. --- a/src/server/game/Globals/ObjectMgr.cpp
  350. +++ b/src/server/game/Globals/ObjectMgr.cpp
  351. @@ -1613,8 +1613,10 @@ void ObjectMgr::LoadCreatures()
  352.      {
  353.          Field* fields = result->Fetch();
  354.  
  355. -        uint32 guid         = fields[0].GetUInt32();
  356. -        uint32 entry        = fields[1].GetUInt32();
  357. +        uint8 index = 0;
  358. +
  359. +        uint32 guid         = fields[index++].GetUInt32();
  360. +        uint32 entry        = fields[index++].GetUInt32();
  361.  
  362.          CreatureTemplate const* cInfo = GetCreatureTemplate(entry);
  363.          if (!cInfo)
  364. @@ -1625,26 +1627,26 @@ void ObjectMgr::LoadCreatures()
  365.  
  366.          CreatureData& data = _creatureDataStore[guid];
  367.          data.id             = entry;
  368. -        data.mapid          = fields[2].GetUInt16();
  369. -        data.displayid      = fields[3].GetUInt32();
  370. -        data.equipmentId    = fields[4].GetInt8();
  371. -        data.posX           = fields[5].GetFloat();
  372. -        data.posY           = fields[6].GetFloat();
  373. -        data.posZ           = fields[7].GetFloat();
  374. -        data.orientation    = fields[8].GetFloat();
  375. -        data.spawntimesecs  = fields[9].GetUInt32();
  376. -        data.spawndist      = fields[10].GetFloat();
  377. -        data.currentwaypoint= fields[11].GetUInt32();
  378. -        data.curhealth      = fields[12].GetUInt32();
  379. -        data.curmana        = fields[13].GetUInt32();
  380. -        data.movementType   = fields[14].GetUInt8();
  381. -        data.spawnMask      = fields[15].GetUInt8();
  382. -        data.phaseMask      = fields[16].GetUInt32();
  383. -        int16 gameEvent     = fields[17].GetInt8();
  384. -        uint32 PoolId       = fields[18].GetUInt32();
  385. -        data.npcflag        = fields[19].GetUInt32();
  386. -        data.unit_flags     = fields[20].GetUInt32();
  387. -        data.dynamicflags   = fields[21].GetUInt32();
  388. +        data.mapid          = fields[index++].GetUInt16();
  389. +        data.displayid      = fields[index++].GetUInt32();
  390. +        data.equipmentId    = fields[index++].GetInt8();
  391. +        data.posX           = fields[index++].GetFloat();
  392. +        data.posY           = fields[index++].GetFloat();
  393. +        data.posZ           = fields[index++].GetFloat();
  394. +        data.orientation    = fields[index++].GetFloat();
  395. +        data.spawntimesecs  = fields[index++].GetUInt32();
  396. +        data.spawndist      = fields[index++].GetFloat();
  397. +        data.currentwaypoint= fields[index++].GetUInt32();
  398. +        data.curhealth      = fields[index++].GetUInt32();
  399. +        data.curmana        = fields[index++].GetUInt32();
  400. +        data.movementType   = fields[index++].GetUInt8();
  401. +        data.spawnMask      = fields[index++].GetUInt8();
  402. +        data.phaseMask      = fields[index++].GetUInt32();
  403. +        int16 gameEvent     = fields[index++].GetInt8();
  404. +        uint32 PoolId       = fields[index++].GetUInt32();
  405. +        data.npcflag        = fields[index++].GetUInt32();
  406. +        data.unit_flags     = fields[index++].GetUInt32();
  407. +        data.dynamicflags   = fields[index++].GetUInt32();
  408.  
  409.          MapEntry const* mapEntry = sMapStore.LookupEntry(data.mapid);
  410.          if (!mapEntry)
  411. @@ -1657,7 +1659,7 @@ void ObjectMgr::LoadCreatures()
  412.              TC_LOG_ERROR("sql.sql", "Table `creature` have creature (GUID: %u) that have wrong spawn mask %u including not supported difficulty modes for map (Id: %u) spawnMasks[data.mapid]: %u.", guid, data.spawnMask, data.mapid, spawnMasks[data.mapid]);
  413.  
  414.          bool ok = true;
  415. -        for (uint32 diff = 0; diff < MAX_DIFFICULTY - 1 && ok; ++diff)
  416. +        for (uint32 diff = 0; diff < 6 MAX_DIFFICULTY - 1 && ok; ++diff)
  417.          {
  418.              if (_difficultyEntries[diff].find(data.id) != _difficultyEntries[diff].end())
  419.              {
  420. diff --git a/src/server/game/Instances/InstanceSaveMgr.h b/src/server/game/Instances/InstanceSaveMgr.h
  421. index 7ef1bf5..85ddc58 100644
  422. --- a/src/server/game/Instances/InstanceSaveMgr.h
  423. +++ b/src/server/game/Instances/InstanceSaveMgr.h
  424. @@ -164,7 +164,7 @@ class InstanceSaveManager
  425.              uint16 mapid;
  426.              uint16 instanceId;
  427.  
  428. -            InstResetEvent() : type(0), difficulty(DUNGEON_DIFFICULTY_NORMAL), mapid(0), instanceId(0) { }
  429. +            InstResetEvent() : type(0), difficulty(REGULAR_DIFFICULTY), mapid(0), instanceId(0) { }
  430.              InstResetEvent(uint8 t, uint32 _mapid, Difficulty d, uint16 _instanceid)
  431.                  : type(t), difficulty(d), mapid(_mapid), instanceId(_instanceid) { }
  432.              bool operator == (const InstResetEvent& e) const { return e.instanceId == instanceId; }
  433. diff --git a/src/server/game/Maps/Map.h b/src/server/game/Maps/Map.h
  434. index 3d97c9c..ddff956 100644
  435. --- a/src/server/game/Maps/Map.h
  436. +++ b/src/server/game/Maps/Map.h
  437. @@ -378,9 +378,9 @@ class Map : public GridRefManager<NGridType>
  438.          bool IsDungeon() const { return i_mapEntry && i_mapEntry->IsDungeon(); }
  439.          bool IsNonRaidDungeon() const { return i_mapEntry && i_mapEntry->IsNonRaidDungeon(); }
  440.          bool IsRaid() const { return i_mapEntry && i_mapEntry->IsRaid(); }
  441. -        bool IsRaidOrHeroicDungeon() const { return IsRaid() || i_spawnMode > DUNGEON_DIFFICULTY_NORMAL; }
  442. -        bool IsHeroic() const { return IsRaid() ? i_spawnMode >= RAID_DIFFICULTY_10MAN_HEROIC : i_spawnMode >= DUNGEON_DIFFICULTY_HEROIC; }
  443. -        bool Is25ManRaid() const { return IsRaid() && i_spawnMode & RAID_DIFFICULTY_MASK_25MAN; }   // since 25man difficulties are 1 and 3, we can check them like that
  444. +        bool IsRaidOrHeroicDungeon() const { return IsRaid() || (i_spawnMode == MAN25_DIFFICULTY || i_spawnMode == MAN25_HEROIC_DIFFICULTY || i_spawnMode == MAN10_DIFFICULTY || i_spawnMode == MAN10_HEROIC_DIFFICULTY || i_spawnMode == MAN40_DIFFICULTY || i_spawnMode == HEROIC_DIFFICULTY); }
  445. +        bool IsHeroic() const { return (i_spawnMode == MAN25_HEROIC_DIFFICULTY || i_spawnMode == MAN10_HEROIC_DIFFICULTY || i_spawnMode == HEROIC_DIFFICULTY); }
  446. +        bool Is25ManRaid() const { return IsRaid() && (i_spawnMode == MAN25_DIFFICULTY || i_spawnMode == MAN25_HEROIC_DIFFICULTY); }   // since 25man difficulties are 1 and 3, we can check them like that
  447.          bool IsBattleground() const { return i_mapEntry && i_mapEntry->IsBattleground(); }
  448.          bool IsBattleArena() const { return i_mapEntry && i_mapEntry->IsBattleArena(); }
  449.          bool IsBattlegroundOrArena() const { return i_mapEntry && i_mapEntry->IsBattlegroundOrArena(); }
  450.