Hello everyone!

actually i'm using this:

https://www.servuo.com/archive/acc-public-gates-and-spell-system.17/

and i've created my own spells using the spell system of this great resource.

Right now i've created more than 130 new custom spells (in 1 single spellschool) but i'm having some issues with Cspellbook and CspellbookGump.

Even if i configured

C#:
public override int BookCount { get { return 150; } }

every time I add a new scroll to the spell book, the book's spellcount seems to be stuck at 64. Furthermore, once added, when I open the CSpellBookGump I discover that in the gump, besides that spell, another one always appears that I never dragged into the book (as if two were added at a time). I didn't make any particular changes to the system's spellbook.

Can anyone help me out?

Many thanks in advance
 
I think this is an integer issue where you may be stuck at that number. Of course someone may correct my thinking.

If this is "true", you can make a book that holds the spells...meaning not a traditional spellbook. If you have the package you mentioned in the subject, look over the code for one of the books and you will see how you can make a really big book like you want. If you get it done, it will behave very similar to a standard RunUO/ServUO spellbook, you just won't have those drag and drop icons you can place for easier casting.
 
yea if I am not wrong, the spellbooks by default work as a 64bit Integer and each bit is used as a flag, with overflow and all that it would explain the behaviour.
I mean you could just make a spellbook band 2 or look into making it work as a bitarray or something to get 150 in one or find another solution ;)
 
I found a way to solve the problem.

I created an alternative method to store the spells inserted in the book.
Now the CSpellbook has a list of known spells that is serialized and deserialized. Every time you drag the scroll onto the book, it checks to see if it is present in the list and adds it.
CSpellbookgump can now show spells in the book in two different ways.
If the book is Full = true then it does everything in the old way otherwise it checks the list to see if the magic is transcribed and, if it is, shows the appropriate labels and buttons

Thank you all for the support! :D
 
Back