mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-18 03:15:41 +00:00
fix(Core/Spells): Spells learned from skills should be visibile immediately in the spellbook and chat. (#5106)
This commit is contained in:
@@ -3908,9 +3908,9 @@ void Player::SendLearnPacket(uint32 spellId, bool learn)
|
||||
}
|
||||
}
|
||||
|
||||
bool Player::addSpell(uint32 spellId, uint8 addSpecMask, bool updateActive, bool temporary)
|
||||
bool Player::addSpell(uint32 spellId, uint8 addSpecMask, bool updateActive, bool temporary /*= false*/, bool learnFromSkill /*= false*/)
|
||||
{
|
||||
if (!_addSpell(spellId, addSpecMask, temporary))
|
||||
if (!_addSpell(spellId, addSpecMask, temporary, learnFromSkill))
|
||||
return false;
|
||||
|
||||
if (!updateActive)
|
||||
@@ -3955,7 +3955,7 @@ bool Player::addSpell(uint32 spellId, uint8 addSpecMask, bool updateActive, bool
|
||||
return true;
|
||||
}
|
||||
|
||||
bool Player::_addSpell(uint32 spellId, uint8 addSpecMask, bool temporary)
|
||||
bool Player::_addSpell(uint32 spellId, uint8 addSpecMask, bool temporary, bool learnFromSkill /*= false*/)
|
||||
{
|
||||
// pussywizard: this can be called to OVERWRITE currently existing spell params! usually to set active = false for lower ranks of a spell
|
||||
|
||||
@@ -3971,7 +3971,7 @@ bool Player::_addSpell(uint32 spellId, uint8 addSpecMask, bool temporary)
|
||||
// xinef: send packet so client can properly recognize this new spell
|
||||
// xinef: ignore passive spells and spells with learn effect
|
||||
// xinef: send spells with no aura effects (ie dual wield)
|
||||
if (IsInWorld() && !isBeingLoaded() && temporary && (!spellInfo->HasAttribute(SpellAttr0(SPELL_ATTR0_PASSIVE | SPELL_ATTR0_HIDDEN_CLIENTSIDE)) || !spellInfo->HasAnyAura()) && !spellInfo->HasEffect(SPELL_EFFECT_LEARN_SPELL))
|
||||
if (IsInWorld() && !isBeingLoaded() && temporary && (learnFromSkill || !spellInfo->HasAttribute(SpellAttr0(SPELL_ATTR0_PASSIVE | SPELL_ATTR0_HIDDEN_CLIENTSIDE)) || !spellInfo->HasAnyAura()) && !spellInfo->HasEffect(SPELL_EFFECT_LEARN_SPELL))
|
||||
SendLearnPacket(spellInfo->Id, true);
|
||||
|
||||
// xinef: DO NOT allow to learn spell with effect learn spell!
|
||||
@@ -24033,7 +24033,7 @@ void Player::learnSkillRewardedSpells(uint32 skill_id, uint32 skill_value)
|
||||
continue;
|
||||
}
|
||||
|
||||
addSpell(pAbility->spellId, SPEC_MASK_ALL, true, true);
|
||||
addSpell(pAbility->spellId, SPEC_MASK_ALL, true, true, true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user