[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:
EnderGT 2010-02-11 20:48:27 +01:00 committed by hunuza
parent 2151704669
commit 230bc2b49e
7 changed files with 22 additions and 7 deletions

View file

@ -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() );