diff options
author | Shauren <shauren.trinity@gmail.com> | 2020-06-12 01:29:18 +0200 |
---|---|---|
committer | Shauren <shauren.trinity@gmail.com> | 2020-06-12 01:29:18 +0200 |
commit | c7306439e7004288fb85890d6a5f730cf1761d71 (patch) | |
tree | a1b6fd4af385923f321ff24ef4d66d09374397b9 /src/server/game/AI/CreatureAI.cpp | |
parent | 1cdd1d0249ad49c860e117e1e39d451e1a3fbe43 (diff) |
Core/Spells: Implement using different difficulty data from all spell related db2s, not just SpellEffect and SpellPower
Diffstat (limited to 'src/server/game/AI/CreatureAI.cpp')
-rw-r--r-- | src/server/game/AI/CreatureAI.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/server/game/AI/CreatureAI.cpp b/src/server/game/AI/CreatureAI.cpp index 3c65160aaf6..80d59e4e7cc 100644 --- a/src/server/game/AI/CreatureAI.cpp +++ b/src/server/game/AI/CreatureAI.cpp @@ -17,6 +17,7 @@ #include "CreatureAI.h" #include "AreaBoundary.h" +#include "Containers.h" #include "Creature.h" #include "CreatureAIImpl.h" #include "CreatureTextMgr.h" @@ -41,8 +42,11 @@ void CreatureAI::OnCharmed(bool apply) } } -AISpellInfoType* UnitAI::AISpellInfo; -AISpellInfoType* GetAISpellInfo(uint32 i) { return &UnitAI::AISpellInfo[i]; } +std::unordered_map<std::pair<uint32, Difficulty>, AISpellInfoType> UnitAI::AISpellInfo; +AISpellInfoType* GetAISpellInfo(uint32 spellId, Difficulty difficulty) +{ + return Trinity::Containers::MapGetValuePtr(UnitAI::AISpellInfo, { spellId, difficulty }); +} CreatureAI::CreatureAI(Creature* creature) : UnitAI(creature), me(creature), _boundary(nullptr), _negateBoundary(false), m_MoveInLineOfSight_locked(false) { |