From 7bb7819be31c3bcb985425f7736014ba7c062827 Mon Sep 17 00:00:00 2001 From: Hondacrx Date: Sun, 17 Nov 2024 12:04:15 -0500 Subject: [PATCH] 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) --- Source/Game/Entities/Player/Player.Spells.cs | 2 +- Source/Game/Entities/Player/Player.Talents.cs | 18 +++++++++--------- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/Source/Game/Entities/Player/Player.Spells.cs b/Source/Game/Entities/Player/Player.Spells.cs index 0bef138fe..f25cc09a6 100644 --- a/Source/Game/Entities/Player/Player.Spells.cs +++ b/Source/Game/Entities/Player/Player.Spells.cs @@ -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); } diff --git a/Source/Game/Entities/Player/Player.Talents.cs b/Source/Game/Entities/Player/Player.Talents.cs index 8108e9486..70f5da950 100644 --- a/Source/Game/Entities/Player/Player.Talents.cs +++ b/Source/Game/Entities/Player/Player.Talents.cs @@ -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); } } }