Implementing: AA/Character Traits
Posted: Fri Oct 21, 2011 12:54 pm
I figured out the packet to populate the character traits list.
(yes I know that is a necro spell in the swash grand master spell choices....)
I used packets from live and lucky for me 6118 client uses the same structure. I figured it out without looking at the WS_TraitsList struct then went to compare it after to see if I got close. The struct is almost the same except some things have misleading names for example
Is the byte that tells you wich trait has been selected.
Now that I have figured this out I want to start working on the actual system to make this usable, but I will be the first to admit I suck at designing systems (mainy DB tables) I usually just start coding until I get the result I was looking for, so before I start I wanted to get feedback.
I figure the player should have a list of traits they have selected, and there should be a table for all the trait choices. Every thing on this page (racial abilities, racial traditions, character traits, and grand master spells) is sent in the same packet so should all of them be stored in the same table? As for the actual traits I would assume they would just go into the spell table?
So 2 new tables Character_traits (stores what choices the player made)
and character_trait_choices (used to populate the page)
Like I said, I suck at designing tables so let me know if this is acceptable or if there is a better way to do this.
(yes I know that is a necro spell in the swash grand master spell choices....)
I used packets from live and lucky for me 6118 client uses the same structure. I figured it out without looking at the WS_TraitsList struct then went to compare it after to see if I got close. The struct is almost the same except some things have misleading names for example
Code: Select all
<Data ElementName="trait_line" Type="int8" Size="1" />Now that I have figured this out I want to start working on the actual system to make this usable, but I will be the first to admit I suck at designing systems (mainy DB tables) I usually just start coding until I get the result I was looking for, so before I start I wanted to get feedback.
I figure the player should have a list of traits they have selected, and there should be a table for all the trait choices. Every thing on this page (racial abilities, racial traditions, character traits, and grand master spells) is sent in the same packet so should all of them be stored in the same table? As for the actual traits I would assume they would just go into the spell table?
So 2 new tables Character_traits (stores what choices the player made)
Code: Select all
CREATE TABLE `character_traits` (
`id` INT(10) UNSIGNED NOT NULL AUTO_INCREMENT,
`char_id` INT(10) UNSIGNED NOT NULL DEFAULT '0',
`trait_id` INT(10) UNSIGNED NOT NULL DEFAULT '0',
PRIMARY KEY (`id`),
INDEX `FK_char_traits` (`char_id`),
CONSTRAINT `FK_char_traits` FOREIGN KEY (`char_id`) REFERENCES `characters` (`id`) ON UPDATE CASCADE ON DELETE CASCADE
)Code: Select all
CREATE TABLE `character_traits_choices` (
`id` INT(10) UNSIGNED NOT NULL AUTO_INCREMENT,
`trait_id` INT(10) UNSIGNED NOT NULL DEFAULT '0',
`level` INT(10) UNSIGNED NOT NULL DEFAULT '0',
`race_req` INT(10) UNSIGNED NOT NULL DEFAULT '0',
`class_req` INT(10) UNSIGNED NOT NULL DEFAULT '0',
PRIMARY KEY (`id`)
)