fix(Core/Spells): Glyphs should send SMSG_LEARNED_SPELL/SMSG_REMOVED_… (#7161)
* fix(Core/Spells): Glyphs should send SMSG_LEARNED_SPELL/SMSG_REMOVED_SPELL packet in case of updating spell tooltips. Fixed #6323 * chore(Core/CharacterHandler): improve comment * chore(Core/SpellEffects): improve comment Co-authored-by: Stefano Borzì <stefanoborzi32@gmail.com>
This commit is contained in:
@@ -2670,6 +2670,21 @@ void Player::SendInitialSpells()
|
|||||||
++spellCount;
|
++spellCount;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Added spells from glyphs too (needed by spell tooltips)
|
||||||
|
for (uint8 i = 0; i < MAX_GLYPH_SLOT_INDEX; ++i)
|
||||||
|
{
|
||||||
|
if (uint32 glyph = GetGlyph(i))
|
||||||
|
{
|
||||||
|
if (GlyphPropertiesEntry const* glyphEntry = sGlyphPropertiesStore.LookupEntry(glyph))
|
||||||
|
{
|
||||||
|
data << uint32(glyphEntry->SpellId);
|
||||||
|
data << uint16(0); // it's not slot id
|
||||||
|
|
||||||
|
++spellCount;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// xinef: we have to send talents, but not those on m_spells list
|
// xinef: we have to send talents, but not those on m_spells list
|
||||||
for (PlayerTalentMap::iterator itr = m_talents.begin(); itr != m_talents.end(); ++itr)
|
for (PlayerTalentMap::iterator itr = m_talents.begin(); itr != m_talents.end(); ++itr)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1548,6 +1548,7 @@ void WorldSession::HandleRemoveGlyph(WorldPacket& recvData)
|
|||||||
if (GlyphPropertiesEntry const* glyphEntry = sGlyphPropertiesStore.LookupEntry(glyph))
|
if (GlyphPropertiesEntry const* glyphEntry = sGlyphPropertiesStore.LookupEntry(glyph))
|
||||||
{
|
{
|
||||||
_player->RemoveAurasDueToSpell(glyphEntry->SpellId);
|
_player->RemoveAurasDueToSpell(glyphEntry->SpellId);
|
||||||
|
_player->SendLearnPacket(glyphEntry->SpellId, false); // Send packet to properly handle client-side spell tooltips
|
||||||
_player->SetGlyph(slot, 0, true);
|
_player->SetGlyph(slot, 0, true);
|
||||||
_player->SendTalentsInfoData(false);
|
_player->SendTalentsInfoData(false);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -102,7 +102,7 @@ pEffect SpellEffects[TOTAL_SPELL_EFFECTS] =
|
|||||||
&Spell::EffectTeleUnitsFaceCaster, // 43 SPELL_EFFECT_TELEPORT_UNITS_FACE_CASTER
|
&Spell::EffectTeleUnitsFaceCaster, // 43 SPELL_EFFECT_TELEPORT_UNITS_FACE_CASTER
|
||||||
&Spell::EffectLearnSkill, // 44 SPELL_EFFECT_SKILL_STEP
|
&Spell::EffectLearnSkill, // 44 SPELL_EFFECT_SKILL_STEP
|
||||||
&Spell::EffectAddHonor, // 45 SPELL_EFFECT_ADD_HONOR honor/pvp related
|
&Spell::EffectAddHonor, // 45 SPELL_EFFECT_ADD_HONOR honor/pvp related
|
||||||
&Spell::EffectUnused, // 46 SPELL_EFFECT_SPAWN clientside, unit appears as if it was just spawned
|
&Spell::EffectUnused, // 46 SPELL_EFFECT_SPAWN client-side, unit appears as if it was just spawned
|
||||||
&Spell::EffectTradeSkill, // 47 SPELL_EFFECT_TRADE_SKILL
|
&Spell::EffectTradeSkill, // 47 SPELL_EFFECT_TRADE_SKILL
|
||||||
&Spell::EffectUnused, // 48 SPELL_EFFECT_STEALTH one spell: Base Stealth
|
&Spell::EffectUnused, // 48 SPELL_EFFECT_STEALTH one spell: Base Stealth
|
||||||
&Spell::EffectUnused, // 49 SPELL_EFFECT_DETECT one spell: Detect
|
&Spell::EffectUnused, // 49 SPELL_EFFECT_DETECT one spell: Detect
|
||||||
@@ -4540,8 +4540,12 @@ void Spell::EffectApplyGlyph(SpellEffIndex effIndex)
|
|||||||
// remove old glyph aura
|
// remove old glyph aura
|
||||||
if (uint32 oldGlyph = player->GetGlyph(m_glyphIndex))
|
if (uint32 oldGlyph = player->GetGlyph(m_glyphIndex))
|
||||||
if (GlyphPropertiesEntry const* oldGlyphEntry = sGlyphPropertiesStore.LookupEntry(oldGlyph))
|
if (GlyphPropertiesEntry const* oldGlyphEntry = sGlyphPropertiesStore.LookupEntry(oldGlyph))
|
||||||
|
{
|
||||||
player->RemoveAurasDueToSpell(oldGlyphEntry->SpellId);
|
player->RemoveAurasDueToSpell(oldGlyphEntry->SpellId);
|
||||||
|
player->SendLearnPacket(oldGlyphEntry->SpellId, false); // Send packet to properly handle client-side spell tooltips
|
||||||
|
}
|
||||||
|
|
||||||
|
player->SendLearnPacket(glyphEntry->SpellId, true); // Send packet to properly handle client-side spell tooltips
|
||||||
player->CastSpell(m_caster, glyphEntry->SpellId, TriggerCastFlags(TRIGGERED_FULL_MASK & ~(TRIGGERED_IGNORE_SHAPESHIFT | TRIGGERED_IGNORE_CASTER_AURASTATE)));
|
player->CastSpell(m_caster, glyphEntry->SpellId, TriggerCastFlags(TRIGGERED_FULL_MASK & ~(TRIGGERED_IGNORE_SHAPESHIFT | TRIGGERED_IGNORE_CASTER_AURASTATE)));
|
||||||
player->SetGlyph(m_glyphIndex, glyph, !player->GetSession()->PlayerLoading());
|
player->SetGlyph(m_glyphIndex, glyph, !player->GetSession()->PlayerLoading());
|
||||||
player->SendTalentsInfoData(false);
|
player->SendTalentsInfoData(false);
|
||||||
|
|||||||
Reference in New Issue
Block a user