Skip to content

Commit

Permalink
400
Browse files Browse the repository at this point in the history
  • Loading branch information
tomrus88 committed May 8, 2010
1 parent 245f508 commit 0bbe3a7
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 13 deletions.
7 changes: 7 additions & 0 deletions sql/400/01_characters.sql
@@ -0,0 +1,7 @@
alter table `characters`.`characters`
add column `power8` int(10) UNSIGNED DEFAULT '0' NOT NULL after `power7`,
add column `power9` int(10) UNSIGNED DEFAULT '0' NOT NULL after `power8`;

alter table `characters`.`character_stats`
add column `maxpower8` int(10) UNSIGNED DEFAULT '0' NOT NULL after `maxpower7`,
add column `maxpower9` int(10) UNSIGNED DEFAULT '0' NOT NULL after `maxpower8`;
2 changes: 1 addition & 1 deletion src/game/CharacterHandler.cpp
Expand Up @@ -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, specCount, activeSpec, exploredZones, equipmentCache, ammoId, knownTitles, actionBars FROM characters WHERE guid = '%u'", GUID_LOPART(m_guid));
"health, power1, power2, power3, power4, power5, power6, power7, power8, power9, specCount, activeSpec, exploredZones, equipmentCache, ammoId, knownTitles, actionBars 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));
Expand Down
24 changes: 12 additions & 12 deletions src/game/Player.cpp
Expand Up @@ -14850,8 +14850,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,"
// 39 40 41 42 43 44 45 46 47 48 49
//"arenaPoints, totalHonorPoints, todayHonorPoints, yesterdayHonorPoints, totalKills, todayKills, yesterdayKills, chosenTitle, knownCurrencies, watchedFaction, drunk,"
// 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64
//"health, power1, power2, power3, power4, power5, power6, power7, specCount, activeSpec, exploredZones, equipmentCache, ammoId, knownTitles, actionBars FROM characters WHERE guid = '%u'", GUID_LOPART(m_guid));
// 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66
//"health, power1, power2, power3, power4, power5, power6, power7, power8, power9, specCount, activeSpec, exploredZones, equipmentCache, ammoId, knownTitles, actionBars FROM characters WHERE guid = '%u'", GUID_LOPART(m_guid));
QueryResult *result = holder->GetResult(PLAYER_LOGIN_QUERY_LOADFROM);

if(!result)
Expand Down Expand Up @@ -14899,8 +14899,8 @@ bool Player::LoadFromDB( uint32 guid, SqlQueryHolder *holder )
SetUInt32Value(UNIT_FIELD_LEVEL, fields[6].GetUInt8());
SetUInt32Value(PLAYER_XP, fields[7].GetUInt32());

_LoadIntoDataField(fields[60].GetString(), PLAYER_EXPLORED_ZONES_1, PLAYER_EXPLORED_ZONES_SIZE);
_LoadIntoDataField(fields[63].GetString(), PLAYER__FIELD_KNOWN_TITLES, KNOWN_TITLES_SIZE*2);
_LoadIntoDataField(fields[62].GetString(), PLAYER_EXPLORED_ZONES_1, PLAYER_EXPLORED_ZONES_SIZE);
_LoadIntoDataField(fields[65].GetString(), PLAYER__FIELD_KNOWN_TITLES, KNOWN_TITLES_SIZE*2);

SetFloatValue(UNIT_FIELD_BOUNDINGRADIUS, DEFAULT_WORLD_OBJECT_SIZE);
SetFloatValue(UNIT_FIELD_COMBATREACH, 1.5f);
Expand All @@ -14919,8 +14919,8 @@ bool Player::LoadFromDB( uint32 guid, SqlQueryHolder *holder )

//SetUInt64Value(PLAYER_FIELD_KNOWN_CURRENCIES, fields[47].GetUInt64());

//SetUInt32Value(PLAYER_AMMO_ID, fields[62].GetUInt32());
SetByteValue(PLAYER_FIELD_BYTES, 2, fields[64].GetUInt8());
//SetUInt32Value(PLAYER_AMMO_ID, fields[64].GetUInt32());
SetByteValue(PLAYER_FIELD_BYTES, 2, fields[66].GetUInt8());

InitDisplayIds();

Expand Down Expand Up @@ -15215,7 +15215,7 @@ bool Player::LoadFromDB( uint32 guid, SqlQueryHolder *holder )
SetUInt32Value(PLAYER_TRACK_CREATURES, 0 );
SetUInt32Value(PLAYER_TRACK_RESOURCES, 0 );

// cleanup aura list explicitly before skill load wher some spells can be applied
// cleanup aura list explicitly before skill load where some spells can be applied
RemoveAllAuras();

// make sure the unit is considered out of combat for proper loading
Expand Down Expand Up @@ -15257,8 +15257,8 @@ bool Player::LoadFromDB( uint32 guid, SqlQueryHolder *holder )
_LoadMailedItems(holder->GetResult(PLAYER_LOGIN_QUERY_LOADMAILEDITEMS));
UpdateNextMailTimeAndUnreads();

m_specsCount = fields[58].GetUInt8();
m_activeSpec = fields[59].GetUInt8();
m_specsCount = fields[60].GetUInt8();
m_activeSpec = fields[61].GetUInt8();

_LoadGlyphs(holder->GetResult(PLAYER_LOGIN_QUERY_LOADGLYPHS));

Expand Down Expand Up @@ -16538,7 +16538,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, specCount, activeSpec, exploredZones, equipmentCache, ammoId, knownTitles, actionBars) VALUES ("
"power4, power5, power6, power7, power8, power9, specCount, activeSpec, exploredZones, equipmentCache, ammoId, knownTitles, actionBars) VALUES ("
<< GetGUIDLow() << ", "
<< GetSession()->GetAccountId() << ", '"
<< sql_name << "', "
Expand Down Expand Up @@ -16626,7 +16626,7 @@ void Player::SaveToDB()

ss << GetUInt32Value(PLAYER_CHOSEN_TITLE) << ", ";

ss << uint32(0)/*GetUInt64Value(PLAYER_FIELD_KNOWN_CURRENCIES)*/ << ", ";
ss << uint64(0)/*GetUInt64Value(PLAYER_FIELD_KNOWN_CURRENCIES)*/ << ", ";

// FIXME: at this moment send to DB as unsigned, including unit32(-1)
ss << GetUInt32Value(PLAYER_FIELD_WATCHED_FACTION_INDEX) << ", ";
Expand Down Expand Up @@ -17105,7 +17105,7 @@ void Player::_SaveStats()

CharacterDatabase.PExecute("DELETE FROM character_stats WHERE guid = '%u'", GetGUIDLow());
std::ostringstream ss;
ss << "INSERT INTO character_stats (guid, maxhealth, maxpower1, maxpower2, maxpower3, maxpower4, maxpower5, maxpower6, maxpower7, "
ss << "INSERT INTO character_stats (guid, maxhealth, maxpower1, maxpower2, maxpower3, maxpower4, maxpower5, maxpower6, maxpower7, maxpower8, maxpower9, "
"strength, agility, stamina, intellect, spirit, armor, resHoly, resFire, resNature, resFrost, resShadow, resArcane, "
"blockPct, dodgePct, parryPct, critPct, rangedCritPct, spellCritPct, attackPower, rangedAttackPower, spellPower) VALUES ("
<< GetGUIDLow() << ", "
Expand Down

0 comments on commit 0bbe3a7

Please sign in to comment.