[DiscordArchive] Hey, I am trying to figure out how spells know where they can be used... but I don't find anything.
[DiscordArchive] Hey, I am trying to figure out how spells know where they can be used... but I don't find anything.
Archived author: Saty • Posted: 2023-03-08T03:58:25.236000+00:00
Original source
Does it do a string lookup or smth?
Archived author: HelloKitty • Posted: 2023-03-08T03:59:37.902000+00:00
Original source
I never looked too deeply into it so I'm unsure how the client does it, as in if it predicts it like it does other spell cast results without sending a packet, but in TC Spell::CheckCast checks if a Spell "RequiresSpellFocus" and then does a search for the focus target in Spell::SearchSpellFocus.
Archived author: HelloKitty • Posted: 2023-03-08T03:59:53.507000+00:00
Original source
But these strings would be used in the cast result packets.
Archived author: HelloKitty • Posted: 2023-03-08T04:00:32.480000+00:00
Original source
You can see in Spell::WriteCastResultInfo for SPELL_FAILED_REQUIRES_SPELL_FOCUS it will send the focus id so the client can build the correct error message in red text.
Archived author: HelloKitty • Posted: 2023-03-08T04:03:34.119000+00:00
Original source
If you're looking for what those DBC ids point to you'll have to query the GO tables for GOs of type GAMEOBJECT_TYPE_SPELL_FOCUS (8) and the first data column should be the SpellFocusId DBC key.
Archived author: Saty • Posted: 2023-03-08T04:06:39.737000+00:00
Original source
Huh so its a serverside thing then... was hoping I can figure stuff out client side
Archived author: HelloKitty • Posted: 2023-03-08T04:07:49.779000+00:00
Original source
Well depending on what you want to create you can at least show the name of the focus object from just the DBCs. But that's about it, otherwise gotta query those tables
Archived author: Saty • Posted: 2023-03-08T04:09:54.928000+00:00
Original source
Seems like it haha. Dammit.
Archived author: Saty • Posted: 2023-03-08T04:21:10.249000+00:00
Original source
Thank you very much tho, would never have figured that out
Archived author: HelloKitty • Posted: 2023-03-08T04:28:55.334000+00:00
Original source
Happy to help <:owocat:486485371849277451>