diff options
| author | Rat <gmstreetrat@gmail.com> | 2014-12-04 19:23:35 +0100 | 
|---|---|---|
| committer | Rat <gmstreetrat@gmail.com> | 2014-12-04 19:23:35 +0100 | 
| commit | 08f486bfcf77d007aeb324b5c941433545234b0e (patch) | |
| tree | d5f4ae067e15e8800c097d0da40f31339e147e8d /src/server/game/Handlers/SpellHandler.cpp | |
| parent | df2514f0444a1b39f07ed63208f5db3ea4eb5c6d (diff) | |
Core/Spells: some updates to player spell and talent learning
Diffstat (limited to 'src/server/game/Handlers/SpellHandler.cpp')
| -rw-r--r-- | src/server/game/Handlers/SpellHandler.cpp | 23 | 
1 files changed, 23 insertions, 0 deletions
diff --git a/src/server/game/Handlers/SpellHandler.cpp b/src/server/game/Handlers/SpellHandler.cpp index 3ca660dccd1..a6bd43f72c6 100644 --- a/src/server/game/Handlers/SpellHandler.cpp +++ b/src/server/game/Handlers/SpellHandler.cpp @@ -371,6 +371,29 @@ void WorldSession::HandleCastSpellOpcode(WorldPackets::Spells::SpellCastRequest&          // not have spell in spellbook          return;      } +     +    if (Player* plr = caster->ToPlayer()) +    { +        uint32 specId = plr->GetActiveTalentSpec(); +        if (specId) +        { +            if (sSpecializationOverrideSpellMap.find(specId) != sSpecializationOverrideSpellMap.end()) +            { +                if (sSpecializationOverrideSpellMap[specId].find(castRequest.SpellID) != sSpecializationOverrideSpellMap[specId].end()) +                { +                    SpellInfo const* newSpellInfo = sSpellMgr->GetSpellInfo(sSpecializationOverrideSpellMap[specId][castRequest.SpellID]); +                    if (newSpellInfo) +                    { +                        if (newSpellInfo->SpellLevel <= caster->getLevel()) +                        { +                            spellInfo = newSpellInfo; +                            castRequest.SpellID = newSpellInfo->Id; +                        } +                    } +                } +            } +        } +    }      Unit::AuraEffectList swaps = mover->GetAuraEffectsByType(SPELL_AURA_OVERRIDE_ACTIONBAR_SPELLS);      Unit::AuraEffectList const& swaps2 = mover->GetAuraEffectsByType(SPELL_AURA_OVERRIDE_ACTIONBAR_SPELLS_2);  | 
