5020 {
5021 std::vector<uint32> availableElixirs =
5022 {
5023
5024 33720,
5025 54452,
5026 33726,
5027 28490,
5028 28491,
5029 28493,
5030 54494,
5031 28501,
5032 28503,
5033 38954,
5034
5035 39625,
5036 39626,
5037 39627,
5038 39628,
5039 28502,
5040 28514,
5041
5042 28489,
5043 28496
5044 };
5045
5047
5049 availableElixirs.push_back(28509);
5050
5052
5053 bool useElixir = true;
5054
5060
5062 {
5064 for (auto itr = auraMap.begin(); itr != auraMap.end(); ++itr)
5065 {
5066 uint32 spellId = itr->second->GetBase()->GetId();
5067 if (
sSpellMgr->IsSpellMemberOfSpellGroup(spellId, chosenSpellGroup) && spellId != chosenElixir)
5068 {
5069 useElixir = false;
5070 break;
5071 }
5072 }
5073 }
5074
5075 if (useElixir)
5077 }
std::uint32_t uint32
Definition Define.h:107
@ POWER_MANA
Definition SharedDefines.h:257
SpellGroup
Definition SpellMgr.h:331
@ SPELL_GROUP_NONE
Definition SpellMgr.h:332
@ SPELL_GROUP_ELIXIR_BATTLE
Definition SpellMgr.h:333
@ SPELL_GROUP_ELIXIR_GUARDIAN
Definition SpellMgr.h:334
#define sSpellMgr
Definition SpellMgr.h:847
Item * GetCastItem()
Definition SpellScript.cpp:625
Unit * GetCaster()
Definition SpellScript.cpp:401
boost::container::flat_multimap< uint32, AuraApplication * > AuraApplicationMap
Definition Unit.h:674
SpellCastResult CastSpell(SpellCastTargets const &targets, SpellInfo const *spellInfo, CustomSpellValues const *value, TriggerCastFlags triggerFlags=TRIGGERED_NONE, Item *castItem=nullptr, AuraEffect const *triggeredByAura=nullptr, ObjectGuid originalCaster=ObjectGuid::Empty)
Definition Unit.cpp:1372
Powers getPowerType() const
Definition Unit.h:1137
AuraApplicationMap & GetAppliedAuras()
Definition Unit.h:1388
auto SelectRandomContainerElement(C const &container) -> typename std::add_const< decltype(*std::begin(container))>::type &
Definition Containers.h:133