Editing spells column in chars table

Post Reply
theloneus
Posts: 7
Joined: Sat Jul 28, 2012 9:57 pm

Editing spells column in chars table

Post by theloneus » Thu Sep 20, 2012 10:22 pm

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!

bluekirby0
Developer
Posts: 707
Joined: Sun Jul 22, 2012 12:11 am

Re: Editing spells column in chars table

Post by bluekirby0 » Fri Sep 21, 2012 3:27 am

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.

theloneus
Posts: 7
Joined: Sat Jul 28, 2012 9:57 pm

Re: Editing spells column in chars table

Post by theloneus » Fri Sep 21, 2012 8:31 am

I'm actually interested in doing it directly (for a windows application I'm working on).

Zedingo
Developer
Posts: 85
Joined: Tue Aug 14, 2012 12:24 pm

Re: Editing spells column in chars table

Post by Zedingo » Fri Sep 21, 2012 2:39 pm

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.

bluekirby0
Developer
Posts: 707
Joined: Sun Jul 22, 2012 12:11 am

Re: Editing spells column in chars table

Post by bluekirby0 » Fri Sep 21, 2012 7:02 pm

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).

theloneus
Posts: 7
Joined: Sat Jul 28, 2012 9:57 pm

Re: Editing spells column in chars table

Post by theloneus » Fri Sep 21, 2012 10:21 pm

Thanks guys, that should be enough to get me rolling!

Post Reply