fix(Core/Spell): Add Dual Wield skill dependency to Dual Wield effect, sho… (#9162)

* Core/Spell: Add Dual Wield skill dependency to Dual Wield effect, should remove the skill properly when unlearning spell. Source: TrinityCore.

Fixes #8882
This commit is contained in:
UltraNix
2021-11-21 03:44:44 +01:00
committed by GitHub
parent 2d83c8ca6c
commit 02aaa3d17f
2 changed files with 27 additions and 12 deletions

View File

@@ -1473,20 +1473,35 @@ void SpellMgr::LoadSpellLearnSkills()
for (uint8 i = 0; i < MAX_SPELL_EFFECTS; ++i)
{
if (entry->Effects[i].Effect == SPELL_EFFECT_SKILL)
SpellLearnSkillNode dbc_node;
switch (entry->Effects[i].Effect)
{
SpellLearnSkillNode dbc_node;
dbc_node.skill = entry->Effects[i].MiscValue;
dbc_node.step = entry->Effects[i].CalcValue();
if (dbc_node.skill != SKILL_RIDING)
case SPELL_EFFECT_SKILL:
dbc_node.skill = entry->Effects[i].MiscValue;
dbc_node.step = entry->Effects[i].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[spell] = dbc_node;
++dbc_count;
break;
}
}

View File

@@ -562,7 +562,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;
typedef std::multimap<uint32, SkillLineAbilityEntry const*> SkillLineAbilityMap;
typedef std::pair<SkillLineAbilityMap::const_iterator, SkillLineAbilityMap::const_iterator> SkillLineAbilityMapBounds;