mirror of
https://github.com/mangosfour/server.git
synced 2025-12-13 22:37:03 +00:00
[9359] Load/save current active spec and total spec count.
Still needed for complete dual spec: * support for second glyph set * implement gossip options * support for second talent set Signed-off-by: hunuza <hunuza@gmail.com>
This commit is contained in:
parent
2151704669
commit
230bc2b49e
7 changed files with 22 additions and 7 deletions
|
|
@ -21,7 +21,7 @@
|
|||
|
||||
DROP TABLE IF EXISTS `character_db_version`;
|
||||
CREATE TABLE `character_db_version` (
|
||||
`required_9354_01_characters_character_action` bit(1) default NULL
|
||||
`required_9359_01_characters_characters` bit(1) default NULL
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=FIXED COMMENT='Last applied sql update to DB';
|
||||
|
||||
--
|
||||
|
|
@ -250,6 +250,8 @@ CREATE TABLE `characters` (
|
|||
`power5` int(10) UNSIGNED NOT NULL default '0',
|
||||
`power6` int(10) UNSIGNED NOT NULL default '0',
|
||||
`power7` int(10) UNSIGNED NOT NULL default '0',
|
||||
`specCount` tinyint(3) UNSIGNED NOT NULL default '1',
|
||||
`activeSpec` tinyint(3) UNSIGNED NOT NULL default '0',
|
||||
PRIMARY KEY (`guid`),
|
||||
KEY `idx_account` (`account`),
|
||||
KEY `idx_online` (`online`),
|
||||
|
|
|
|||
4
sql/updates/9359_01_characters_characters.sql
Normal file
4
sql/updates/9359_01_characters_characters.sql
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
ALTER TABLE character_db_version CHANGE COLUMN required_9354_01_characters_character_action required_9359_01_characters_characters bit;
|
||||
|
||||
ALTER TABLE `characters` ADD `specCount` tinyint(3) unsigned NOT NULL default 1 AFTER `power7`;
|
||||
ALTER TABLE `characters` ADD `activeSpec` tinyint(3) unsigned NOT NULL default 0 AFTER `specCount`;
|
||||
|
|
@ -65,6 +65,7 @@ pkgdata_DATA = \
|
|||
9339_01_characters_group.sql \
|
||||
9349_01_characters_character_action.sql \
|
||||
9354_01_characters_character_action.sql \
|
||||
9359_01_characters_characters.sql \
|
||||
README
|
||||
|
||||
## Additional files to include when running 'make dist'
|
||||
|
|
@ -110,4 +111,5 @@ EXTRA_DIST = \
|
|||
9339_01_characters_group.sql \
|
||||
9349_01_characters_character_action.sql \
|
||||
9354_01_characters_character_action.sql \
|
||||
9359_01_characters_characters.sql \
|
||||
README
|
||||
|
|
|
|||
|
|
@ -72,7 +72,7 @@ bool LoginQueryHolder::Initialize()
|
|||
"position_x, position_y, position_z, map, orientation, taximask, cinematic, totaltime, leveltime, rest_bonus, logout_time, is_logout_resting, resettalents_cost,"
|
||||
"resettalents_time, trans_x, trans_y, trans_z, trans_o, transguid, extra_flags, stable_slots, at_login, zone, online, death_expire_time, taxi_path, dungeon_difficulty,"
|
||||
"arenaPoints, totalHonorPoints, todayHonorPoints, yesterdayHonorPoints, totalKills, todayKills, yesterdayKills, chosenTitle, knownCurrencies, watchedFaction, drunk,"
|
||||
"health, power1, power2, power3, power4, power5, power6, power7 FROM characters WHERE guid = '%u'", GUID_LOPART(m_guid));
|
||||
"health, power1, power2, power3, power4, power5, power6, power7, specCount, activeSpec FROM characters WHERE guid = '%u'", GUID_LOPART(m_guid));
|
||||
res &= SetPQuery(PLAYER_LOGIN_QUERY_LOADGROUP, "SELECT groupId FROM group_member WHERE memberGuid ='%u'", GUID_LOPART(m_guid));
|
||||
res &= SetPQuery(PLAYER_LOGIN_QUERY_LOADBOUNDINSTANCES, "SELECT id, permanent, map, difficulty, resettime FROM character_instance LEFT JOIN instance ON instance = id WHERE guid = '%u'", GUID_LOPART(m_guid));
|
||||
res &= SetPQuery(PLAYER_LOGIN_QUERY_LOADAURAS, "SELECT caster_guid,spell,effect_index,stackcount,amount,maxduration,remaintime,remaincharges FROM character_aura WHERE guid = '%u'", GUID_LOPART(m_guid));
|
||||
|
|
|
|||
|
|
@ -14598,8 +14598,8 @@ bool Player::LoadFromDB( uint32 guid, SqlQueryHolder *holder )
|
|||
//"resettalents_time, trans_x, trans_y, trans_z, trans_o, transguid, extra_flags, stable_slots, at_login, zone, online, death_expire_time, taxi_path, dungeon_difficulty,"
|
||||
// 40 41 42 43 44 45 46 47 48 49 50
|
||||
//"arenaPoints, totalHonorPoints, todayHonorPoints, yesterdayHonorPoints, totalKills, todayKills, yesterdayKills, chosenTitle, knownCurrencies, watchedFaction, drunk,"
|
||||
// 51 52 53 54 55 56 57 58
|
||||
//"health, power1, power2, power3, power4, power5, power6, power7 FROM characters WHERE guid = '%u'", GUID_LOPART(m_guid));
|
||||
// 51 52 53 54 55 56 57 58 59 60
|
||||
//"health, power1, power2, power3, power4, power5, power6, power7, specCount, activeSpec FROM characters WHERE guid = '%u'", GUID_LOPART(m_guid));
|
||||
QueryResult *result = holder->GetResult(PLAYER_LOGIN_QUERY_LOADFROM);
|
||||
|
||||
if(!result)
|
||||
|
|
@ -14996,6 +14996,9 @@ bool Player::LoadFromDB( uint32 guid, SqlQueryHolder *holder )
|
|||
// Mail
|
||||
_LoadMail();
|
||||
|
||||
m_specsCount = fields[59].GetUInt8();
|
||||
m_activeSpec = fields[60].GetUInt8();
|
||||
|
||||
_LoadAuras(holder->GetResult(PLAYER_LOGIN_QUERY_LOADAURAS), time_diff);
|
||||
_LoadGlyphAuras();
|
||||
|
||||
|
|
@ -16159,7 +16162,7 @@ void Player::SaveToDB()
|
|||
"trans_x, trans_y, trans_z, trans_o, transguid, extra_flags, stable_slots, at_login, zone, "
|
||||
"death_expire_time, taxi_path, arenaPoints, totalHonorPoints, todayHonorPoints, yesterdayHonorPoints, totalKills, "
|
||||
"todayKills, yesterdayKills, chosenTitle, knownCurrencies, watchedFaction, drunk, health, power1, power2, power3, "
|
||||
"power4, power5, power6, power7) VALUES ("
|
||||
"power4, power5, power6, power7, specCount, activeSpec) VALUES ("
|
||||
<< GetGUIDLow() << ", "
|
||||
<< GetSession()->GetAccountId() << ", '"
|
||||
<< sql_name << "', "
|
||||
|
|
@ -16267,6 +16270,10 @@ void Player::SaveToDB()
|
|||
for(uint32 i = 0; i < MAX_POWERS; ++i)
|
||||
ss << "," << GetPower(Powers(i));
|
||||
|
||||
ss << ", ";
|
||||
ss << uint32(m_specsCount) << ", ";
|
||||
ss << uint32(m_activeSpec);
|
||||
|
||||
ss << ")";
|
||||
|
||||
CharacterDatabase.Execute( ss.str().c_str() );
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
#ifndef __REVISION_NR_H__
|
||||
#define __REVISION_NR_H__
|
||||
#define REVISION_NR "9358"
|
||||
#define REVISION_NR "9359"
|
||||
#endif // __REVISION_NR_H__
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
#ifndef __REVISION_SQL_H__
|
||||
#define __REVISION_SQL_H__
|
||||
#define REVISION_DB_CHARACTERS "required_9354_01_characters_character_action"
|
||||
#define REVISION_DB_CHARACTERS "required_9359_01_characters_characters"
|
||||
#define REVISION_DB_MANGOS "required_9331_01_mangos_quest_template"
|
||||
#define REVISION_DB_REALMD "required_9010_01_realmd_realmlist"
|
||||
#endif // __REVISION_SQL_H__
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue