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;
|
return false;
|
||||||
|
|
||||||
if (!updateActive)
|
if (!updateActive)
|
||||||
@@ -3955,7 +3955,7 @@ bool Player::addSpell(uint32 spellId, uint8 addSpecMask, bool updateActive, bool
|
|||||||
return true;
|
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
|
// 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: send packet so client can properly recognize this new spell
|
||||||
// xinef: ignore passive spells and spells with learn effect
|
// xinef: ignore passive spells and spells with learn effect
|
||||||
// xinef: send spells with no aura effects (ie dual wield)
|
// 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);
|
SendLearnPacket(spellInfo->Id, true);
|
||||||
|
|
||||||
// xinef: DO NOT allow to learn spell with effect learn spell!
|
// 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;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
addSpell(pAbility->spellId, SPEC_MASK_ALL, true, true);
|
addSpell(pAbility->spellId, SPEC_MASK_ALL, true, true, true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1695,8 +1695,8 @@ public:
|
|||||||
void SendProficiency(ItemClass itemClass, uint32 itemSubclassMask);
|
void SendProficiency(ItemClass itemClass, uint32 itemSubclassMask);
|
||||||
void SendInitialSpells();
|
void SendInitialSpells();
|
||||||
void SendLearnPacket(uint32 spellId, bool learn);
|
void SendLearnPacket(uint32 spellId, bool learn);
|
||||||
bool addSpell(uint32 spellId, uint8 addSpecMask, bool updateActive, bool temporary = false);
|
bool addSpell(uint32 spellId, uint8 addSpecMask, bool updateActive, bool temporary = false, bool learnFromSkill = false);
|
||||||
bool _addSpell(uint32 spellId, uint8 addSpecMask, bool temporary);
|
bool _addSpell(uint32 spellId, uint8 addSpecMask, bool temporary, bool learnFromSkill = false);
|
||||||
void learnSpell(uint32 spellId);
|
void learnSpell(uint32 spellId);
|
||||||
void removeSpell(uint32 spellId, uint8 removeSpecMask, bool onlyTemporary);
|
void removeSpell(uint32 spellId, uint8 removeSpecMask, bool onlyTemporary);
|
||||||
void resetSpells();
|
void resetSpells();
|
||||||
|
|||||||
Reference in New Issue
Block a user