aboutsummaryrefslogtreecommitdiff
path: root/src/server/game/AI/ScriptedAI
diff options
context:
space:
mode:
authorTeleqraph <nyrdeveloper@gmail.com>2023-10-22 11:24:48 +0200
committerGitHub <noreply@github.com>2023-10-22 11:24:48 +0200
commit9eceff2bc243946998c006418229dbb639e898d6 (patch)
treef800e44d9d2d7bb7caf388cb690194ed3bfac3e2 /src/server/game/AI/ScriptedAI
parent3d3979f1cabf59321fbafcde1f0d1e600d29e974 (diff)
Core/Map: Implement several difficulty getters (#29370)
Co-authored-by: ModoX <moardox@gmail.com>
Diffstat (limited to 'src/server/game/AI/ScriptedAI')
-rw-r--r--src/server/game/AI/ScriptedAI/ScriptedCreature.cpp36
-rw-r--r--src/server/game/AI/ScriptedAI/ScriptedCreature.h14
2 files changed, 42 insertions, 8 deletions
diff --git a/src/server/game/AI/ScriptedAI/ScriptedCreature.cpp b/src/server/game/AI/ScriptedAI/ScriptedCreature.cpp
index ad12f677884..00c15509f5a 100644
--- a/src/server/game/AI/ScriptedAI/ScriptedCreature.cpp
+++ b/src/server/game/AI/ScriptedAI/ScriptedCreature.cpp
@@ -126,7 +126,6 @@ ScriptedAI::ScriptedAI(Creature* creature) : ScriptedAI(creature, creature->GetS
ScriptedAI::ScriptedAI(Creature* creature, uint32 scriptId) : CreatureAI(creature, scriptId), IsFleeing(false), _isCombatMovementAllowed(true)
{
- _isHeroic = me->GetMap()->IsHeroic();
_difficulty = me->GetMap()->GetDifficultyID();
}
@@ -304,6 +303,41 @@ bool ScriptedAI::HealthAbovePct(uint32 pct) const
return me->HealthAbovePct(pct);
}
+bool ScriptedAI::IsLFR() const
+{
+ return me->GetMap()->IsLFR();
+}
+
+bool ScriptedAI::IsNormal() const
+{
+ return me->GetMap()->IsNormal();
+}
+
+bool ScriptedAI::IsHeroic() const
+{
+ return me->GetMap()->IsHeroic();
+}
+
+bool ScriptedAI::IsMythic() const
+{
+ return me->GetMap()->IsMythic();
+}
+
+bool ScriptedAI::IsMythicPlus() const
+{
+ return me->GetMap()->IsMythicPlus();
+}
+
+bool ScriptedAI::IsHeroicOrHigher() const
+{
+ return me->GetMap()->IsHeroicOrHigher();
+}
+
+bool ScriptedAI::IsTimewalking() const
+{
+ return me->GetMap()->IsTimewalking();
+}
+
SpellInfo const* ScriptedAI::SelectSpell(Unit* target, uint32 school, uint32 mechanic, SelectTargetType targets, float rangeMin, float rangeMax, SelectEffect effect)
{
// No target so we can't cast
diff --git a/src/server/game/AI/ScriptedAI/ScriptedCreature.h b/src/server/game/AI/ScriptedAI/ScriptedCreature.h
index bcb0496ec36..a52b33b0dcc 100644
--- a/src/server/game/AI/ScriptedAI/ScriptedCreature.h
+++ b/src/server/game/AI/ScriptedAI/ScriptedCreature.h
@@ -237,12 +237,13 @@ struct TC_GAME_API ScriptedAI : public CreatureAI
void SetCombatMovement(bool allowMovement);
bool IsCombatMovementAllowed() const { return _isCombatMovementAllowed; }
- // return true for heroic mode. i.e.
- // - for dungeon in mode 10-heroic,
- // - for raid in mode 10-Heroic
- // - for raid in mode 25-heroic
- // DO NOT USE to check raid in mode 25-normal.
- bool IsHeroic() const { return _isHeroic; }
+ bool IsLFR() const;
+ bool IsNormal() const;
+ bool IsHeroic() const;
+ bool IsMythic() const;
+ bool IsMythicPlus() const;
+ bool IsHeroicOrHigher() const;
+ bool IsTimewalking() const;
// return the dungeon or raid difficulty
Difficulty GetDifficulty() const { return _difficulty; }
@@ -305,7 +306,6 @@ struct TC_GAME_API ScriptedAI : public CreatureAI
private:
Difficulty _difficulty;
bool _isCombatMovementAllowed;
- bool _isHeroic;
};
class TC_GAME_API BossAI : public ScriptedAI