LegionCore-7.3.5
LegionCore-7.3.5 copied to clipboard
Hearthstone // Itemspell
If you use the hearthstone, other players will not see the spell. Does not only affect the hearthstone. It affects all items with spells.
I think the error is in the Player.cpp at CastItemUseSpell The triggerdatas are the problem
I think the error is in the Player.cpp at CastItemUseSpell The triggerdatas are the problem
Have you been able to fix it?
Well, unfortunately not quite yet. I have managed to get the spells to be displayed for all other players, but the items are no longer scored. This means that if you drink water, for example, and you have 20 of it, the counter doesn't go down any further. Instead of 19 items, the item remains at 20 items.
By the way. The fact that the spells are not displayed does not only apply to Hearthstone, but to all magic items. Items in quests... etc.
Does anyone have an idea to fix it correctly ?
Well, unfortunately not quite yet. I have managed to get the spells to be displayed for all other players, but the items are no longer scored. This means that if you drink water, for example, and you have 20 of it, the counter doesn't go down any further. Instead of 19 items, the item remains at 20 items.
By the way. The fact that the spells are not displayed does not only apply to Hearthstone, but to all magic items. Items in quests... etc.
Does anyone have an idea to fix it correctly ?
Ok, now I'll check to see what I can do and pass solution. You had said that the problem was in the TriggerData right?
Well, at least I think so. I looked it up on TrinityCore. From there I got the ServerCastId and ClientCastId. This can be found in the Player.cpp under
void Player::CastItemUseSpell
The CastId must also be added to the ScriptMgr.
Then it has at least shown the spell for all players, but unfortunately the items are no longer counted -.-
Well, at least I think so. I looked it up on TrinityCore. From there I got the ServerCastId and ClientCastId. This can be found in the Player.cpp under
void Player::CastItemUseSpell
The CastId must also be added to the ScriptMgr.
Then it has at least shown the spell for all players, but unfortunately the items are no longer counted -.-
Ok, well I'll check that out and see how I fix it, I already have an idea of how I can fix it. When I solve it, I'll send you the solution here.
That would of course be super nice of you :-)
Well, I've tried several times and I still haven't found the solution. I have compiled the TrinityCore server and deleted its ServerCastId and ClientCastId lines but still in Trinitycore, even if you delete those lines, the item's ability is still visible in the others. I don't know whether to give up or continue xd
I currently feel the same way :-) I'll have another look when I've finished with the garrisons. But maybe you or someone else has an idea for a solution :-) As I said, I suspect it's the TriggerDatas. It's just very annoying because you can never see what another player is currently doing :-)
@dufernst Do you have any idea where the problem could be?
HandleUseItemOpcode
And what do you think is the error there?
you need to look towards the handler
I've already tried that too. I have changed everything there to “TrinityCore-Like”. No success.
Update: It has something to do with the m_SpellVisual in the Spell.cpp.
The following code is stored there under Spell::prepare:
if (!m_SpellVisual)
m_SpellVisual = m_spellInfo->GetSpellXSpellVisualId(m_caster, m_targets.GetUnitTarget() ? m_targets.GetUnitTarget() : m_caster);
If you remove this code, no spell appears at all. If you type in .cast 8690 (Hearthstone) then it starts the spell, but does not display the visual. If you click on the hearthstone (item 6948) in your bag, it also casts the spell, but does not display anything. So the error must have something to do with the SpellVisual......
Hm seems like old bug tc
@ReyDonovan You don't happen to know how TC fixed it?
Unfortunately I can't find the commit of the fix -.-
I looked at the problem a little. If you set the combat log to full logging, then the second client (observer) will not even receive a message in the combat log that someone has started casting a spell. Therefore, the issue is not in the visual part, but in general in the fact that other clients do not receive information that someone has started casting a spell when using an item.
Yes, sir. I researched this topic. I have no idea why there are so many such small schools in this core, but they appear here and there. As I expected, the other client was receiving incorrect data. This is due to spellCastData and the SMSG_SPELL_START package. The GUID order is mixed up there. In fact, I have no idea why this even worked for all the other spells, but here we are. In this core we have this: https://github.com/dufernst/LegionCore-7.3.5/blob/bf7199a73c99b4e62f5444aa862ba864cd553dbb/src/server/game/Server/Packets/SpellPackets.cpp#L486 In TC it is: https://github.com/TrinityCore/TrinityCore/blob/31f6ba5a92b0f88f328e0e6adcf33bd4820599c2/src/server/game/Server/Packets/SpellPackets.cpp#L360 I think comments are unnecessary.
data << spellCastData.CasterUnit;
data << spellCastData.CasterGUID;
change to:
data << spellCastData.CasterGUID;
data << spellCastData.CasterUnit;
I was already assembling the core in Debug mode, but I was lucky that I thought of running the sniffer and climbed in to see how the package was being formed. If you're not too lazy, please make a pull request for this issue.
@Fragrus
I have exactly one more thing to say.... I love you :-)
Thank you 1000 times for this fix :-)
@Fragrus thanks again for the fix :+1: And @slash-design thanks for confirming. :+1: