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:
@@ -337,7 +337,7 @@ namespace Game.Entities
|
|||||||
for (int j = 0; j < specSpells.Count; ++j)
|
for (int j = 0; j < specSpells.Count; ++j)
|
||||||
{
|
{
|
||||||
SpecializationSpellsRecord specSpell = specSpells[j];
|
SpecializationSpellsRecord specSpell = specSpells[j];
|
||||||
RemoveSpell(specSpell.SpellID, true);
|
RemoveSpell(specSpell.SpellID);
|
||||||
if (specSpell.OverridesSpellID != 0)
|
if (specSpell.OverridesSpellID != 0)
|
||||||
RemoveOverrideSpell(specSpell.OverridesSpellID, specSpell.SpellID);
|
RemoveOverrideSpell(specSpell.OverridesSpellID, specSpell.SpellID);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -96,12 +96,12 @@ namespace Game.Entities
|
|||||||
if (spellInfo == null)
|
if (spellInfo == null)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
RemoveSpell(talent.SpellID, true);
|
RemoveSpell(talent.SpellID);
|
||||||
|
|
||||||
// search for spells that the talent teaches and unlearn them
|
// search for spells that the talent teaches and unlearn them
|
||||||
foreach (var spellEffectInfo in spellInfo.GetEffects())
|
foreach (var spellEffectInfo in spellInfo.GetEffects())
|
||||||
if (spellEffectInfo.IsEffect(SpellEffectName.LearnSpell) && spellEffectInfo.TriggerSpell > 0)
|
if (spellEffectInfo.IsEffect(SpellEffectName.LearnSpell) && spellEffectInfo.TriggerSpell > 0)
|
||||||
RemoveSpell(spellEffectInfo.TriggerSpell, true);
|
RemoveSpell(spellEffectInfo.TriggerSpell);
|
||||||
|
|
||||||
if (talent.OverridesSpellID != 0)
|
if (talent.OverridesSpellID != 0)
|
||||||
RemoveOverrideSpell(talent.OverridesSpellID, talent.SpellID);
|
RemoveOverrideSpell(talent.OverridesSpellID, talent.SpellID);
|
||||||
@@ -320,12 +320,12 @@ namespace Game.Entities
|
|||||||
if (spellInfo == null)
|
if (spellInfo == null)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
RemoveSpell(talentInfo.SpellID, true);
|
RemoveSpell(talentInfo.SpellID);
|
||||||
|
|
||||||
// search for spells that the talent teaches and unlearn them
|
// search for spells that the talent teaches and unlearn them
|
||||||
foreach (var spellEffectInfo in spellInfo.GetEffects())
|
foreach (var spellEffectInfo in spellInfo.GetEffects())
|
||||||
if (spellEffectInfo.IsEffect(SpellEffectName.LearnSpell) && spellEffectInfo.TriggerSpell > 0)
|
if (spellEffectInfo.IsEffect(SpellEffectName.LearnSpell) && spellEffectInfo.TriggerSpell > 0)
|
||||||
RemoveSpell(spellEffectInfo.TriggerSpell, true);
|
RemoveSpell(spellEffectInfo.TriggerSpell);
|
||||||
|
|
||||||
if (talentInfo.OverridesSpellID != 0)
|
if (talentInfo.OverridesSpellID != 0)
|
||||||
RemoveOverrideSpell(talentInfo.OverridesSpellID, talentInfo.SpellID);
|
RemoveOverrideSpell(talentInfo.OverridesSpellID, talentInfo.SpellID);
|
||||||
@@ -337,12 +337,12 @@ namespace Game.Entities
|
|||||||
if (spellInfo == null)
|
if (spellInfo == null)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
RemoveSpell(talentInfo.SpellID, true);
|
RemoveSpell(talentInfo.SpellID);
|
||||||
|
|
||||||
// search for spells that the talent teaches and unlearn them
|
// search for spells that the talent teaches and unlearn them
|
||||||
foreach (var spellEffectInfo in spellInfo.GetEffects())
|
foreach (var spellEffectInfo in spellInfo.GetEffects())
|
||||||
if (spellEffectInfo.IsEffect(SpellEffectName.LearnSpell) && spellEffectInfo.TriggerSpell > 0)
|
if (spellEffectInfo.IsEffect(SpellEffectName.LearnSpell) && spellEffectInfo.TriggerSpell > 0)
|
||||||
RemoveSpell(spellEffectInfo.TriggerSpell, true);
|
RemoveSpell(spellEffectInfo.TriggerSpell);
|
||||||
|
|
||||||
if (talentInfo.OverridesSpellID != 0)
|
if (talentInfo.OverridesSpellID != 0)
|
||||||
RemoveOverrideSpell(talentInfo.OverridesSpellID, talentInfo.SpellID);
|
RemoveOverrideSpell(talentInfo.OverridesSpellID, talentInfo.SpellID);
|
||||||
@@ -802,7 +802,7 @@ namespace Game.Entities
|
|||||||
if (spellInfo == null)
|
if (spellInfo == null)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
RemoveSpell(talent.SpellID, true);
|
RemoveSpell(talent.SpellID);
|
||||||
|
|
||||||
// Move this to toggle ?
|
// Move this to toggle ?
|
||||||
if (talent.OverridesSpellID != 0)
|
if (talent.OverridesSpellID != 0)
|
||||||
@@ -827,7 +827,7 @@ namespace Game.Entities
|
|||||||
{
|
{
|
||||||
if (enable)
|
if (enable)
|
||||||
{
|
{
|
||||||
LearnSpell(pvpTalentInfo.SpellID, false);
|
LearnSpell(pvpTalentInfo.SpellID, true);
|
||||||
if (pvpTalentInfo.OverridesSpellID != 0)
|
if (pvpTalentInfo.OverridesSpellID != 0)
|
||||||
AddOverrideSpell(pvpTalentInfo.OverridesSpellID, pvpTalentInfo.SpellID);
|
AddOverrideSpell(pvpTalentInfo.OverridesSpellID, pvpTalentInfo.SpellID);
|
||||||
}
|
}
|
||||||
@@ -835,7 +835,7 @@ namespace Game.Entities
|
|||||||
{
|
{
|
||||||
if (pvpTalentInfo.OverridesSpellID != 0)
|
if (pvpTalentInfo.OverridesSpellID != 0)
|
||||||
RemoveOverrideSpell(pvpTalentInfo.OverridesSpellID, pvpTalentInfo.SpellID);
|
RemoveOverrideSpell(pvpTalentInfo.OverridesSpellID, pvpTalentInfo.SpellID);
|
||||||
RemoveSpell(pvpTalentInfo.SpellID, true);
|
RemoveSpell(pvpTalentInfo.SpellID);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user