Core/Spells: ported helper function from 3f28fd304d833eadefff8d343ab45caf8d0575c2

Core/Spells: Reimplemented automatic spell learning
This commit is contained in:
ariel- committed 2016-08-01 03:54:31 -03:00
1 parent 87f25be0aa
commit badef62df4
3 files changed
+20 -22

No files matched your search

+15
View File
@@ -17114,3 +17114,18 @@ void Unit::Whisper(uint32 textId, Player* target, bool isBossWhisper /*= false*/
ChatHandler::BuildChatPacket(data, isBossWhisper ? CHAT_MSG_RAID_BOSS_WHISPER : CHAT_MSG_MONSTER_WHISPER, LANG_UNIVERSAL, this, target, bct->GetText(locale, getGender()), 0, "", locale);
target->SendDirectMessage(&data);
}
SpellInfo const* Unit::GetCastSpellInfo(SpellInfo const* spellInfo) const
{
Unit::AuraEffectList swaps = GetAuraEffectsByType(SPELL_AURA_OVERRIDE_ACTIONBAR_SPELLS);
Unit::AuraEffectList const& swaps2 = GetAuraEffectsByType(SPELL_AURA_OVERRIDE_ACTIONBAR_SPELLS_2);
if (!swaps2.empty())
swaps.insert(swaps.end(), swaps2.begin(), swaps2.end());
for (AuraEffect const* aurEff : swaps)
if (aurEff->IsAffectingSpell(spellInfo))
if (SpellInfo const* newInfo = sSpellMgr->GetSpellInfo(aurEff->GetAmount()))
return newInfo;
return spellInfo;
}