Page 1 of 1
Editing spells column in chars table
Posted: Thu Sep 20, 2012 10:22 pm
by theloneus
Hi, I'm trying to decipher how individual spells are stored in the database because I would like to be able to add/remove specific spells on a character. If you understand how it works can you give me an overview?
Thanks!
Re: Editing spells column in chars table
Posted: Fri Sep 21, 2012 3:27 am
by bluekirby0
I would suggest making use of the LUA functions to do something like that. You could pretty easily make a GM command to add a spell to another player by looking at the existing GM command scripts. There is already a command for a GM to add a spell to their own character. If you have a specific reason to need to edit the database directly, it is doable but by no means a simple procedure.
Re: Editing spells column in chars table
Posted: Fri Sep 21, 2012 8:31 am
by theloneus
I'm actually interested in doing it directly (for a windows application I'm working on).
Re: Editing spells column in chars table
Posted: Fri Sep 21, 2012 2:39 pm
by Zedingo
I try and try not to ask too many questions. It takes all the fun out of it.
If I were you, I'd start my search either in a magic scroll script (to learn a spell) or the @addspell command.
Re: Editing spells column in chars table
Posted: Fri Sep 21, 2012 7:02 pm
by bluekirby0
Just about everything in the database stored as a blob is a bitmask. Do some research to help understand how bitmasks work and then you can use the values in the headers or
here to help determine the "position" of the bit you are looking for (you may or may not have to subtract one). Depending on your application language you may be able to cannibalize some of our functions to do what you need (but your license will have to be compatible with ours if you do that).
Re: Editing spells column in chars table
Posted: Fri Sep 21, 2012 10:21 pm
by theloneus
Thanks guys, that should be enough to get me rolling!