Core/Players: Don't flag unlearned talents and specialization spells as disabled since they are learned with "dependent" flag (and not saved in database)

Port From (https://github.com/TrinityCore/TrinityCore/commit/9bab2801c6f7fbad0ac32702c67a76f06718f2da)
This commit is contained in:
Hondacrx
2024-11-17 12:04:15 -05:00
parent a4af99c2bb
commit 7bb7819be3
2 changed files with 10 additions and 10 deletions
+1 -1
View File
@@ -337,7 +337,7 @@ namespace Game.Entities
for (int j = 0; j < specSpells.Count; ++j)
{
SpecializationSpellsRecord specSpell = specSpells[j];
RemoveSpell(specSpell.SpellID, true);
RemoveSpell(specSpell.SpellID);
if (specSpell.OverridesSpellID != 0)
RemoveOverrideSpell(specSpell.OverridesSpellID, specSpell.SpellID);
}
@@ -96,12 +96,12 @@ namespace Game.Entities
if (spellInfo == null)
return;
RemoveSpell(talent.SpellID, true);
RemoveSpell(talent.SpellID);
// search for spells that the talent teaches and unlearn them
foreach (var spellEffectInfo in spellInfo.GetEffects())
if (spellEffectInfo.IsEffect(SpellEffectName.LearnSpell) && spellEffectInfo.TriggerSpell > 0)
RemoveSpell(spellEffectInfo.TriggerSpell, true);
RemoveSpell(spellEffectInfo.TriggerSpell);
if (talent.OverridesSpellID != 0)
RemoveOverrideSpell(talent.OverridesSpellID, talent.SpellID);
@@ -320,12 +320,12 @@ namespace Game.Entities
if (spellInfo == null)
continue;
RemoveSpell(talentInfo.SpellID, true);
RemoveSpell(talentInfo.SpellID);
// search for spells that the talent teaches and unlearn them
foreach (var spellEffectInfo in spellInfo.GetEffects())
if (spellEffectInfo.IsEffect(SpellEffectName.LearnSpell) && spellEffectInfo.TriggerSpell > 0)
RemoveSpell(spellEffectInfo.TriggerSpell, true);
RemoveSpell(spellEffectInfo.TriggerSpell);
if (talentInfo.OverridesSpellID != 0)
RemoveOverrideSpell(talentInfo.OverridesSpellID, talentInfo.SpellID);
@@ -337,12 +337,12 @@ namespace Game.Entities
if (spellInfo == null)
continue;
RemoveSpell(talentInfo.SpellID, true);
RemoveSpell(talentInfo.SpellID);
// search for spells that the talent teaches and unlearn them
foreach (var spellEffectInfo in spellInfo.GetEffects())
if (spellEffectInfo.IsEffect(SpellEffectName.LearnSpell) && spellEffectInfo.TriggerSpell > 0)
RemoveSpell(spellEffectInfo.TriggerSpell, true);
RemoveSpell(spellEffectInfo.TriggerSpell);
if (talentInfo.OverridesSpellID != 0)
RemoveOverrideSpell(talentInfo.OverridesSpellID, talentInfo.SpellID);
@@ -802,7 +802,7 @@ namespace Game.Entities
if (spellInfo == null)
return;
RemoveSpell(talent.SpellID, true);
RemoveSpell(talent.SpellID);
// Move this to toggle ?
if (talent.OverridesSpellID != 0)
@@ -827,7 +827,7 @@ namespace Game.Entities
{
if (enable)
{
LearnSpell(pvpTalentInfo.SpellID, false);
LearnSpell(pvpTalentInfo.SpellID, true);
if (pvpTalentInfo.OverridesSpellID != 0)
AddOverrideSpell(pvpTalentInfo.OverridesSpellID, pvpTalentInfo.SpellID);
}
@@ -835,7 +835,7 @@ namespace Game.Entities
{
if (pvpTalentInfo.OverridesSpellID != 0)
RemoveOverrideSpell(pvpTalentInfo.OverridesSpellID, pvpTalentInfo.SpellID);
RemoveSpell(pvpTalentInfo.SpellID, true);
RemoveSpell(pvpTalentInfo.SpellID);
}
}
}