Skip to content

Commit

Permalink
[9661] Implement dual talent specializations in talent switch part.
Browse files Browse the repository at this point in the history
* Implement talent specs switch functionality.
* Only gossip part still not implemented.
* At update server to this commit or later character talents will be reset
  with some spam in logs about wrong places talents in character_spell.
  It can be ignored as part of conversion to new table support.

Thanks to all getmangos.com community members who take part
in creating and updating original dual spec patch.

Signed-off-by: VladimirMangos <vladimir@getmangos.com>
  • Loading branch information
Laise authored and VladimirMangos committed Apr 2, 2010
1 parent dd1332b commit 6b825a1
Show file tree
Hide file tree
Showing 8 changed files with 322 additions and 71 deletions.
27 changes: 26 additions & 1 deletion sql/characters.sql
Expand Up @@ -21,7 +21,7 @@

DROP TABLE IF EXISTS `character_db_version`;
CREATE TABLE `character_db_version` (
`required_9646_01_characters_characters` bit(1) default NULL
`required_9661_01_characters_character_talent` bit(1) default NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=FIXED COMMENT='Last applied sql update to DB';

--
Expand Down Expand Up @@ -830,6 +830,31 @@ LOCK TABLES `character_spell_cooldown` WRITE;
/*!40000 ALTER TABLE `character_spell_cooldown` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `character_talent`
--

DROP TABLE IF EXISTS `character_talent`;
CREATE TABLE `character_talent` (
`guid` int(11) unsigned NOT NULL,
`talent_id` int(11) unsigned NOT NULL,
`current_rank` tinyint(3) unsigned NOT NULL DEFAULT '0',
`spec` tinyint(3) unsigned NOT NULL DEFAULT '0',
PRIMARY KEY (`guid`,`talent_id`,`spec`),
KEY guid_key (`guid`),
KEY talent_key (`talent_id`),
KEY spec_key (`spec`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

--
-- Dumping data for table `character_talent`
--

LOCK TABLES `character_talent` WRITE;
/*!40000 ALTER TABLE `character_talent` DISABLE KEYS */;
/*!40000 ALTER TABLE `character_talent` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `character_ticket`
--
Expand Down
13 changes: 13 additions & 0 deletions sql/updates/9661_01_characters_character_talent.sql
@@ -0,0 +1,13 @@
ALTER TABLE character_db_version CHANGE COLUMN required_9646_01_characters_characters required_9661_01_characters_character_talent bit;

DROP TABLE IF EXISTS `character_talent`;
CREATE TABLE `character_talent` (
`guid` int(11) unsigned NOT NULL,
`talent_id` int(11) unsigned NOT NULL,
`current_rank` tinyint(3) unsigned NOT NULL DEFAULT '0',
`spec` tinyint(3) unsigned NOT NULL DEFAULT '0',
PRIMARY KEY (`guid`,`talent_id`,`spec`),
KEY guid_key (`guid`),
KEY talent_key (`talent_id`),
KEY spec_key (`spec`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
2 changes: 2 additions & 0 deletions sql/updates/Makefile.am
Expand Up @@ -100,6 +100,7 @@ pkgdata_DATA = \
9651_01_mangos_quest_poi.sql \
9656_01_mangos_command.sql \
9656_02_mangos_mangos_string.sql \
9661_01_characters_character_talent.sql \
README

## Additional files to include when running 'make dist'
Expand Down Expand Up @@ -180,4 +181,5 @@ EXTRA_DIST = \
9651_01_mangos_quest_poi.sql \
9656_01_mangos_command.sql \
9656_02_mangos_mangos_string.sql \
9661_01_characters_character_talent.sql \
README
1 change: 1 addition & 0 deletions src/game/CharacterHandler.cpp
Expand Up @@ -95,6 +95,7 @@ bool LoginQueryHolder::Initialize()
res &= SetPQuery(PLAYER_LOGIN_QUERY_LOADEQUIPMENTSETS, "SELECT setguid, setindex, name, iconname, item0, item1, item2, item3, item4, item5, item6, item7, item8, item9, item10, item11, item12, item13, item14, item15, item16, item17, item18 FROM character_equipmentsets WHERE guid = '%u' ORDER BY setindex", GUID_LOPART(m_guid));
res &= SetPQuery(PLAYER_LOGIN_QUERY_LOADBGDATA, "SELECT instance_id, team, join_x, join_y, join_z, join_o, join_map, taxi_start, taxi_end, mount_spell FROM character_battleground_data WHERE guid = '%u'", GUID_LOPART(m_guid));
res &= SetPQuery(PLAYER_LOGIN_QUERY_LOADACCOUNTDATA, "SELECT type, time, data FROM character_account_data WHERE guid='%u'", GUID_LOPART(m_guid));
res &= SetPQuery(PLAYER_LOGIN_QUERY_LOADTALENTS, "SELECT talent_id, current_rank, spec FROM character_talent WHERE guid = '%u'", GUID_LOPART(m_guid));
res &= SetPQuery(PLAYER_LOGIN_QUERY_LOADSKILLS, "SELECT skill, value, max FROM character_skills WHERE guid = '%u'", GUID_LOPART(m_guid));
res &= SetPQuery(PLAYER_LOGIN_QUERY_LOADGLYPHS, "SELECT spec, slot, glyph FROM character_glyphs WHERE guid='%u'", GUID_LOPART(m_guid));
res &= SetPQuery(PLAYER_LOGIN_QUERY_LOADMAILS, "SELECT id,messageType,sender,receiver,subject,itemTextId,has_items,expire_time,deliver_time,money,cod,checked,stationery,mailTemplateId FROM mail WHERE receiver = '%u' ORDER BY id DESC", GUID_LOPART(m_guid));
Expand Down

14 comments on commit 6b825a1

@luisalvarado
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pff i gotta be dreaming. Somebody bitch slap me silly.

@VladimirMangos
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/me slap cyrex :D

@nanouniko
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!! very nice work!

@DarkTerror
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Really good Job!! Thanks!!

@Andrewzz
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A bi thanks for this :) we all are really happy that now this is fully supported by Core.
Now is missing Vehicles support and MaNGOS will rulez =D
Congrats for all your work

@kanz
Copy link

@kanz kanz commented on 6b825a1 Apr 3, 2010

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thx, good work!

@nowonshere
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for this, devs!
/cheer
/thanks
/bow
;)

@rsa
Copy link
Contributor

@rsa rsa commented on 6b825a1 Apr 3, 2010

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Excellent work. More often to such commits instead of cutting away never stopped anyone from fields in the database ...

@VladimirMangos
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Only ppl not understanding code development think that some feature adding commits can exist without many preparation commits and without const code cleanup and improving code without any visible for users changes.. if devs has been think as you then mangos project long time ago die in hacks.

@rsa
Copy link
Contributor

@rsa rsa commented on 6b825a1 Apr 3, 2010

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Doing something new and good, never to abandon backwards compatibility. What relation to the hacks are unused core code field of the database? It prevented further develop the core? However, removal of this field is buried a lot of well-done work for web portals, addons and other useful things.

@apoc
Copy link
Contributor

@apoc apoc commented on 6b825a1 Apr 3, 2010

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you think removing of DATA BLOB, it was pain in the ass for a long time. Storing data in such way is not well designed, inefficient and also makes harder to get certain data for web portals what you mentioned, you have to also update code of web portal with every client update. I think removing of DATA BLOB was the very very good step forward.

About backward compatibility, this is needed for comercial products where people pays a lot of money to keep the backward compatibility. For open source it only means to create not flexible skeleton ...

@hunuza
Copy link
Contributor

@hunuza hunuza commented on 6b825a1 Apr 3, 2010

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should start thinking about things like backward compatibility when we reach 1.0, but not before...

@VladimirMangos
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In fact removing 'data' make more future compatibility for tools, becaus will not need update all strange indexes at client switch.

@unloading
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you give any estimate for the "gossip part" of the dual specialization?
There are few patches out there that do the trick, like Insider's p129 and in Tasssadar's repo,
but closing this chapter in official repo would be deeply appreciated as well xD

Please sign in to comment.