mirror of
https://github.com/liyunfan1223/azerothcore-wotlk.git
synced 2026-08-08 15:58:04 +00:00
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:
@@ -1473,20 +1473,35 @@ void SpellMgr::LoadSpellLearnSkills()
|
|||||||
|
|
||||||
for (uint8 i = 0; i < MAX_SPELL_EFFECTS; ++i)
|
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;
|
case SPELL_EFFECT_SKILL:
|
||||||
dbc_node.skill = entry->Effects[i].MiscValue;
|
dbc_node.skill = entry->Effects[i].MiscValue;
|
||||||
dbc_node.step = entry->Effects[i].CalcValue();
|
dbc_node.step = entry->Effects[i].CalcValue();
|
||||||
if (dbc_node.skill != SKILL_RIDING)
|
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;
|
dbc_node.value = 1;
|
||||||
else
|
dbc_node.maxvalue = 1;
|
||||||
dbc_node.value = dbc_node.step * 75;
|
break;
|
||||||
dbc_node.maxvalue = dbc_node.step * 75;
|
default:
|
||||||
mSpellLearnSkills[spell] = dbc_node;
|
continue;
|
||||||
++dbc_count;
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
mSpellLearnSkills[spell] = dbc_node;
|
||||||
|
++dbc_count;
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -562,7 +562,7 @@ struct SpellLearnSkillNode
|
|||||||
uint16 maxvalue; // 0 - max skill value for player level
|
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::multimap<uint32, SkillLineAbilityEntry const*> SkillLineAbilityMap;
|
||||||
typedef std::pair<SkillLineAbilityMap::const_iterator, SkillLineAbilityMap::const_iterator> SkillLineAbilityMapBounds;
|
typedef std::pair<SkillLineAbilityMap::const_iterator, SkillLineAbilityMap::const_iterator> SkillLineAbilityMapBounds;
|
||||||
|
|||||||
Reference in New Issue
Block a user