mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-29 13:22:48 +01:00
Core/Spell: Add Dual Wield skill dependency to Dual Wield effect, should remove the skill properly when unlearning spell.
Closes #17196
(cherry picked from commit 405167dafd)
This commit is contained in:
@@ -1401,29 +1401,41 @@ void SpellMgr::LoadSpellLearnSkills()
|
||||
|
||||
// search auto-learned skills and add its to map also for use in unlearn spells/talents
|
||||
uint32 dbc_count = 0;
|
||||
for (uint32 spell = 0; spell < GetSpellInfoStoreSize(); ++spell)
|
||||
for (SpellInfo const* entry : mSpellInfoMap)
|
||||
{
|
||||
SpellInfo const* entry = GetSpellInfo(spell);
|
||||
|
||||
if (!entry)
|
||||
continue;
|
||||
|
||||
for (SpellEffectInfo const* effect : entry->GetEffectsForDifficulty(DIFFICULTY_NONE))
|
||||
{
|
||||
if (effect && effect->Effect == SPELL_EFFECT_SKILL)
|
||||
if (!effect)
|
||||
continue;
|
||||
|
||||
SpellLearnSkillNode dbc_node;
|
||||
switch (effect->Effect)
|
||||
{
|
||||
SpellLearnSkillNode dbc_node;
|
||||
dbc_node.skill = uint16(effect->MiscValue);
|
||||
dbc_node.step = uint16(effect->CalcValue());
|
||||
if (dbc_node.skill != SKILL_RIDING)
|
||||
case SPELL_EFFECT_SKILL:
|
||||
dbc_node.skill = uint16(effect->MiscValue);
|
||||
dbc_node.step = uint16(effect->CalcValue());
|
||||
if (dbc_node.skill != SKILL_RIDING)
|
||||
dbc_node.value = 1;
|
||||
else
|
||||
dbc_node.value = dbc_node.step * 75;
|
||||
dbc_node.maxvalue = dbc_node.step * 75;
|
||||
break;
|
||||
case SPELL_EFFECT_DUAL_WIELD:
|
||||
dbc_node.skill = SKILL_DUAL_WIELD;
|
||||
dbc_node.step = 1;
|
||||
dbc_node.value = 1;
|
||||
else
|
||||
dbc_node.value = dbc_node.step * 75;
|
||||
dbc_node.maxvalue = dbc_node.step * 75;
|
||||
mSpellLearnSkills[spell] = dbc_node;
|
||||
++dbc_count;
|
||||
break;
|
||||
dbc_node.maxvalue = 1;
|
||||
break;
|
||||
default:
|
||||
continue;
|
||||
}
|
||||
|
||||
mSpellLearnSkills[entry->Id] = dbc_node;
|
||||
++dbc_count;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -552,7 +552,7 @@ struct SpellLearnSkillNode
|
||||
uint16 maxvalue; // 0 - max skill value for player level
|
||||
};
|
||||
|
||||
typedef std::map<uint32, SpellLearnSkillNode> SpellLearnSkillMap;
|
||||
typedef std::unordered_map<uint32, SpellLearnSkillNode> SpellLearnSkillMap;
|
||||
|
||||
struct SpellLearnSpellNode
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user