Core/Achievements: Award normal mode achievements when instance was done on heroic mode
This commit is contained in:
@@ -182,7 +182,7 @@ struct ScriptedAI : public CreatureAI
|
||||
Difficulty GetDifficulty() { return _difficulty; }
|
||||
|
||||
// return true for 25 man or 25 man heroic mode
|
||||
bool Is25ManRaid() { return _difficulty & 1; }
|
||||
bool Is25ManRaid() { return _difficulty & RAID_DIFFICULTY_MASK_25MAN; }
|
||||
|
||||
template<class T> inline
|
||||
const T& DUNGEON_MODE(const T& normal5, const T& heroic10)
|
||||
|
||||
@@ -334,7 +334,10 @@ bool AchievementCriteriaData::Meets(uint32 criteria_id, Player const* source, Un
|
||||
case ACHIEVEMENT_CRITERIA_DATA_TYPE_SCRIPT:
|
||||
return sScriptMgr->OnCriteriaCheck(this, const_cast<Player*>(source), const_cast<Unit*>(target));
|
||||
case ACHIEVEMENT_CRITERIA_DATA_TYPE_MAP_DIFFICULTY:
|
||||
return source->GetMap()->GetSpawnMode() == difficulty.difficulty;
|
||||
if (source->GetMap()->IsRaid())
|
||||
if (source->GetMap()->Is25ManRaid() != (difficulty.difficulty & RAID_DIFFICULTY_MASK_25MAN))
|
||||
return false;
|
||||
return source->GetMap()->GetSpawnMode() >= difficulty.difficulty;
|
||||
case ACHIEVEMENT_CRITERIA_DATA_TYPE_MAP_PLAYER_COUNT:
|
||||
return source->GetMap()->GetPlayersCountExceptGMs() <= map_players.maxcount;
|
||||
case ACHIEVEMENT_CRITERIA_DATA_TYPE_T_TEAM:
|
||||
|
||||
@@ -278,6 +278,8 @@ enum Difficulty
|
||||
RAID_DIFFICULTY_25MAN_HEROIC = 3,
|
||||
};
|
||||
|
||||
#define RAID_DIFFICULTY_MASK_25MAN 1 // since 25man difficulties are 1 and 3, we can check them like that
|
||||
|
||||
#define MAX_DUNGEON_DIFFICULTY 3
|
||||
#define MAX_RAID_DIFFICULTY 4
|
||||
#define MAX_DIFFICULTY 4
|
||||
|
||||
@@ -365,6 +365,7 @@ class Map : public GridRefManager<NGridType>
|
||||
bool IsRaid() const { return i_mapEntry && i_mapEntry->IsRaid(); }
|
||||
bool IsRaidOrHeroicDungeon() const { return IsRaid() || i_spawnMode > DUNGEON_DIFFICULTY_NORMAL; }
|
||||
bool IsHeroic() const { return IsRaid() ? i_spawnMode >= RAID_DIFFICULTY_10MAN_HEROIC : i_spawnMode >= DUNGEON_DIFFICULTY_HEROIC; }
|
||||
bool Is25ManRaid() const { return IsRaid() && i_spawnMode & RAID_DIFFICULTY_MASK_25MAN; } // since 25man difficulties are 1 and 3, we can check them like that
|
||||
bool IsBattleground() const { return i_mapEntry && i_mapEntry->IsBattleground(); }
|
||||
bool IsBattleArena() const { return i_mapEntry && i_mapEntry->IsBattleArena(); }
|
||||
bool IsBattlegroundOrArena() const { return i_mapEntry && i_mapEntry->IsBattlegroundOrArena(); }
|
||||
|
||||
@@ -5856,7 +5856,7 @@ void Spell::EffectReputation(SpellEffIndex effIndex)
|
||||
{
|
||||
rep_change = int32((float)rep_change * repData->spell_rate);
|
||||
}
|
||||
|
||||
|
||||
// Bonus from spells that increase reputation gain
|
||||
float bonus = rep_change * _player->GetTotalAuraModifier(SPELL_AURA_MOD_REPUTATION_GAIN) / 100.0f; // 10%
|
||||
rep_change += (int32)bonus;
|
||||
@@ -6952,7 +6952,7 @@ void Spell::EffectCastButtons(SpellEffIndex effIndex)
|
||||
if (!ab || ab->GetType() != ACTION_BUTTON_SPELL)
|
||||
continue;
|
||||
|
||||
//! Action button data is unverified when it's set so it can be "hacked"
|
||||
//! Action button data is unverified when it's set so it can be "hacked"
|
||||
//! to contain invalid spells, so filter here.
|
||||
uint32 spell_id = ab->GetAction();
|
||||
if (!spell_id)
|
||||
|
||||
Reference in New Issue
Block a user