Fix displaying the right ranks of spells in spellbook

- Fixes displaying the Seal of Righteousness (SoR) ranks
    - Fixes the "double spell listing" of non-stackable spells after the learning,
      both in chat and in spellbook (applies to all classes)
    - This fix is paired with 2 database updates, one for world and one for characters
    - After applying the fixes, all paladin characters must visit their trainer to relearn the "Judgement" spell
This commit is contained in:
H0zen 2016-02-15 13:16:38 +02:00
parent f70bb75ba0
commit e16313c5b2
4 changed files with 13 additions and 2 deletions

View File

@ -2983,8 +2983,10 @@ bool Player::addSpell(uint32 spell_id, bool active, bool learning, bool dependen
m_spells[spell_id] = newspell; m_spells[spell_id] = newspell;
// return false if spell disabled // return false if spell disabled or spell is non-stackable with lower-ranks
if (newspell.disabled) if (newspell.disabled ||
(sSpellMgr.IsRankedSpellNonStackableInSpellBook(spellInfo) &&
(sSpellMgr.GetFirstSpellInChain(spell_id) != spell_id)))
{ return false; } { return false; }
} }

View File

@ -1964,6 +1964,9 @@ bool SpellMgr::canStackSpellRanksInSpellBook(SpellEntry const* spellInfo) const
switch (spellInfo->SpellFamilyName) switch (spellInfo->SpellFamilyName)
{ {
case SPELLFAMILY_PALADIN: case SPELLFAMILY_PALADIN:
// Paladin SoR spell, Judgement version
if (spellInfo->Id == 21084 || spellInfo->Id == 20154)
{ return false; }
// Paladin aura Spell // Paladin aura Spell
if (spellInfo->Effect[i] == SPELL_EFFECT_APPLY_AREA_AURA_PARTY) if (spellInfo->Effect[i] == SPELL_EFFECT_APPLY_AREA_AURA_PARTY)
{ return false; } { return false; }

View File

@ -2276,6 +2276,11 @@ void Spell::EffectLearnSpell(SpellEffectIndex eff_idx)
Player* player = (Player*)unitTarget; Player* player = (Player*)unitTarget;
uint32 spellToLearn = m_spellInfo->EffectTriggerSpell[eff_idx]; uint32 spellToLearn = m_spellInfo->EffectTriggerSpell[eff_idx];
// special case for paladin SoR 20154 (non-judgement version)
if (m_spellInfo->Id == 10321)
{ player->removeSpell(20154, true, false); }
player->learnSpell(spellToLearn, false); player->learnSpell(spellToLearn, false);
if (WorldObject const* caster = GetCastingObject()) if (WorldObject const* caster = GetCastingObject())

View File

@ -706,6 +706,7 @@ SpellAuraProcResult Unit::HandleDummyAuraProc(Unit* pVictim, uint32 damage, Aura
uint32 spellId; uint32 spellId;
switch (triggeredByAura->GetId()) switch (triggeredByAura->GetId())
{ {
case 20154:
case 21084: spellId = 25742; break; // Rank 1 case 21084: spellId = 25742; break; // Rank 1
case 20287: spellId = 25740; break; // Rank 2 case 20287: spellId = 25740; break; // Rank 2
case 20288: spellId = 25739; break; // Rank 3 case 20288: spellId = 25739; break; // Rank 3