From 5da217877be7f22db3bfc8ee06ca1ffad172d281 Mon Sep 17 00:00:00 2001 From: Shauren Date: Wed, 15 Jun 2016 16:20:43 +0200 Subject: Core/Spells: Automatically generate spell rank info from SkillLineAbility * This fixes weird spellbook/talent/glyph/profession ui behavior when knowing multiple spells to remove talent or glyph, or multiple spells to open profession ui --- src/server/game/Spells/SpellInfo.cpp | 39 ------------------------------------ 1 file changed, 39 deletions(-) (limited to 'src/server/game/Spells/SpellInfo.cpp') diff --git a/src/server/game/Spells/SpellInfo.cpp b/src/server/game/Spells/SpellInfo.cpp index e7ac181e69f..25a5c874a58 100644 --- a/src/server/game/Spells/SpellInfo.cpp +++ b/src/server/game/Spells/SpellInfo.cpp @@ -1257,22 +1257,6 @@ bool SpellInfo::IsQuestTame() const return effect0 && effect1 && effect0->Effect == SPELL_EFFECT_THREAT && effect1->Effect == SPELL_EFFECT_APPLY_AURA && effect1->ApplyAuraName == SPELL_AURA_DUMMY; } -bool SpellInfo::IsProfessionOrRiding(uint32 difficulty) const -{ - SpellEffectInfoVector effects = GetEffectsForDifficulty(difficulty); - for (SpellEffectInfo const* effect : effects) - { - if ((effect && effect->Effect == SPELL_EFFECT_SKILL)) - { - uint32 skill = effect->MiscValue; - - if (IsProfessionOrRidingSkill(skill)) - return true; - } - } - return false; -} - bool SpellInfo::IsProfession(uint32 difficulty) const { SpellEffectInfoVector effects = GetEffectsForDifficulty(difficulty); @@ -1310,23 +1294,6 @@ bool SpellInfo::IsPrimaryProfessionFirstRank(uint32 difficulty) const return IsPrimaryProfession(difficulty) && GetRank() == 1; } -bool SpellInfo::IsAbilityLearnedWithProfession() const -{ - SkillLineAbilityMapBounds bounds = sSpellMgr->GetSkillLineAbilityMapBounds(Id); - - for (SkillLineAbilityMap::const_iterator _spell_idx = bounds.first; _spell_idx != bounds.second; ++_spell_idx) - { - SkillLineAbilityEntry const* pAbility = _spell_idx->second; - if (!pAbility || pAbility->AquireMethod != SKILL_LINE_ABILITY_LEARNED_ON_SKILL_VALUE) - continue; - - if (pAbility->MinSkillLineRank > 0) - return true; - } - - return false; -} - bool SpellInfo::IsAbilityOfSkillType(uint32 skillType) const { SkillLineAbilityMapBounds bounds = sSpellMgr->GetSkillLineAbilityMapBounds(Id); @@ -1425,12 +1392,6 @@ bool SpellInfo::IsStackableWithRanks() const if (IsPassive()) return false; - if (IsProfessionOrRiding()) - return false; - - if (IsAbilityLearnedWithProfession()) - return false; - // All stance spells. if any better way, change it. SpellEffectInfoVector effects = GetEffectsForDifficulty(DIFFICULTY_NONE); for (SpellEffectInfo const* effect : effects) -- cgit v1.2.3