Question: Keeping Spells Specific to a Wand
mercurialmusic opened this issue ยท 4 comments
I promise I searched first, so I apologize if this is a stupid question.
We've created a wand (BrewingGuide) that serves as a recipe book for our brewing plugin. On use the wand only casts one spell, recipeselector, which branches into categories and eventually spells that bring up the recipe in a book GUI (facilitated by another plugin). Most of the recipes are locked and can be purchased with game currency within the selector, from NPCs, or won in quests. All of that: the custom wand itself, the unlocking, the casting, works exactly like we want it to.
The problem we can't figure out is that every time a new recipe spell is unlocked for the custom wand, it is also added to the default wand inventory. They can't cast the spell from their default wand because the spell requires them to be holding the BrewingGuide, but it's there taking up inventory space.
We did create a separate path for it. I don't really understand the classes thing, though, so I'm guessing it's something I'm missing there? I tried experimenting with that but all it did was automatically add all of the recipe spells to the default wand! All help is much appreciated!
Ah yes sorry you would probably need to make separate classes for the two wands. Classes are basically the things that "remember" what spells you've unlocked, and how much mana you have.
So if two wands are using the same class, they will share the same spells.
However it may be hard to change that at this point since players already have a mix of both types of spells on their base class (probably the builtin mage class?)
So another approach, since you had the foresight to create separate paths, is to add this tag to your base wand:
wand:
limit_spells_to_path: true
That will hide any spells the player knows that aren't part of the basic wand path.
Let me know if that helps!
(Also really sorry for how long it took me to respond to this one, I somehow missed it completely...)
So limit_spells_to_path: true
did work, but then we ran into the problem of not being able to add other random spells, e.g. those earned in events, so for any future searchers, as a workaround we moved all of the "extra_spells" in the paths to the main spells within the path, added our event spells to the extra_spells, then set show_extra_spells: false
in the spellshop. This successfully hid any event spells we'd want to use while still allowing them on the wand.
Seems like classes would have been the simplest way to go, but this seems to have worked out. Thanks again!