mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-18 03:15:41 +00:00
Merge pull request #755 from Nefertumm/PlayerBytes
Split playerBytes fields in characters table
This commit is contained in:
@@ -2004,12 +2004,14 @@ void Player::RemoveRestState()
|
||||
|
||||
bool Player::BuildEnumData(PreparedQueryResult result, WorldPacket* data)
|
||||
{
|
||||
// 0 1 2 3 4 5 6 7
|
||||
// "SELECT characters.guid, characters.name, characters.race, characters.class, characters.gender, characters.playerBytes, characters.playerBytes2, characters.level, "
|
||||
// 8 9 10 11 12 13 14
|
||||
// "characters.zone, characters.map, characters.position_x, characters.position_y, characters.position_z, guild_member.guildid, characters.playerFlags, "
|
||||
// 15 16 17 18 19 20 21 22
|
||||
// "characters.at_login, character_pet.entry, character_pet.modelid, character_pet.level, characters.data, character_banned.guid, characters.extra_flags, character_declinedname.genitive "
|
||||
// 0 1 2 3 4 5 6 7
|
||||
// "SELECT characters.guid, characters.name, characters.race, characters.class, characters.gender, characters.skin, characters.face, characters.hairStyle,
|
||||
// 8 9 10 11 12 13 14 15
|
||||
// characters.hairColor, characters.facialStyle, character.level, characters.zone, characters.map, characters.position_x, characters.position_y, characters.position_z,
|
||||
// 16 17 18 19 20 21 22 23
|
||||
// guild_member.guildid, characters.playerFlags, characters.at_login, character_pet.entry, character_pet.modelid, character_pet.level, characters.equipmentCache, character_banned.guid,
|
||||
// 24 25
|
||||
// characters.extra_flags, character_declinedname.genitive
|
||||
|
||||
Field* fields = result->Fetch();
|
||||
|
||||
@@ -2031,33 +2033,36 @@ bool Player::BuildEnumData(PreparedQueryResult result, WorldPacket* data)
|
||||
}
|
||||
|
||||
*data << uint64(MAKE_NEW_GUID(guid, 0, HIGHGUID_PLAYER));
|
||||
*data << fields[1].GetString(); // name
|
||||
*data << uint8(plrRace); // race
|
||||
*data << uint8(plrClass); // class
|
||||
*data << uint8(gender); // gender
|
||||
*data << fields[1].GetString(); // name
|
||||
*data << uint8(plrRace); // race
|
||||
*data << uint8(plrClass); // class
|
||||
*data << uint8(gender); // gender
|
||||
|
||||
uint32 playerBytes = fields[5].GetUInt32();
|
||||
*data << uint8(playerBytes); // skin
|
||||
*data << uint8(playerBytes >> 8); // face
|
||||
*data << uint8(playerBytes >> 16); // hair style
|
||||
*data << uint8(playerBytes >> 24); // hair color
|
||||
uint8 skin = fields[5].GetUInt8();
|
||||
uint8 face = fields[6].GetUInt8();
|
||||
uint8 hairStyle = fields[7].GetUInt8();
|
||||
uint8 hairColor = fields[8].GetUInt8();
|
||||
uint8 facialStyle = fields[9].GetUInt8();
|
||||
|
||||
*data << uint8(skin);
|
||||
*data << uint8(face);
|
||||
*data << uint8(hairStyle);
|
||||
*data << uint8(hairColor);
|
||||
*data << uint8(facialStyle);
|
||||
|
||||
uint32 playerBytes2 = fields[6].GetUInt32();
|
||||
*data << uint8(playerBytes2 & 0xFF); // facial hair
|
||||
*data << uint8(fields[10].GetUInt8()); // level
|
||||
*data << uint32(fields[11].GetUInt16()); // zone
|
||||
*data << uint32(fields[12].GetUInt16()); // map
|
||||
|
||||
*data << uint8(fields[7].GetUInt8()); // level
|
||||
*data << uint32(fields[8].GetUInt16()); // zone
|
||||
*data << uint32(fields[9].GetUInt16()); // map
|
||||
*data << fields[13].GetFloat(); // x
|
||||
*data << fields[14].GetFloat(); // y
|
||||
*data << fields[15].GetFloat(); // z
|
||||
|
||||
*data << fields[10].GetFloat(); // x
|
||||
*data << fields[11].GetFloat(); // y
|
||||
*data << fields[12].GetFloat(); // z
|
||||
|
||||
*data << uint32(fields[13].GetUInt32()); // guild id
|
||||
*data << uint32(fields[16].GetUInt32()); // guild id
|
||||
|
||||
uint32 charFlags = 0;
|
||||
uint32 playerFlags = fields[14].GetUInt32();
|
||||
uint16 atLoginFlags = fields[15].GetUInt16();
|
||||
uint32 playerFlags = fields[17].GetUInt32();
|
||||
uint16 atLoginFlags = fields[18].GetUInt16();
|
||||
if (playerFlags & PLAYER_FLAGS_HIDE_HELM)
|
||||
charFlags |= CHARACTER_FLAG_HIDE_HELM;
|
||||
if (playerFlags & PLAYER_FLAGS_HIDE_CLOAK)
|
||||
@@ -2066,17 +2071,17 @@ bool Player::BuildEnumData(PreparedQueryResult result, WorldPacket* data)
|
||||
charFlags |= CHARACTER_FLAG_GHOST;
|
||||
if (atLoginFlags & AT_LOGIN_RENAME)
|
||||
charFlags |= CHARACTER_FLAG_RENAME;
|
||||
if (fields[20].GetUInt32())
|
||||
if (fields[23].GetUInt32())
|
||||
charFlags |= CHARACTER_FLAG_LOCKED_BY_BILLING;
|
||||
if (sWorld->getBoolConfig(CONFIG_DECLINED_NAMES_USED))
|
||||
{
|
||||
if (!fields[22].GetString().empty())
|
||||
if (!fields[25].GetString().empty())
|
||||
charFlags |= CHARACTER_FLAG_DECLINED;
|
||||
}
|
||||
else
|
||||
charFlags |= CHARACTER_FLAG_DECLINED;
|
||||
|
||||
*data << uint32(charFlags); // character flags
|
||||
*data << uint32(charFlags); // character flags
|
||||
|
||||
// character customize flags
|
||||
if (atLoginFlags & AT_LOGIN_CUSTOMIZE)
|
||||
@@ -2099,12 +2104,12 @@ bool Player::BuildEnumData(PreparedQueryResult result, WorldPacket* data)
|
||||
// show pet at selection character in character list only for non-ghost character
|
||||
if (result && !(playerFlags & PLAYER_FLAGS_GHOST) && (plrClass == CLASS_WARLOCK || plrClass == CLASS_HUNTER || (plrClass == CLASS_DEATH_KNIGHT && (fields[21].GetUInt32()&PLAYER_EXTRA_SHOW_DK_PET))))
|
||||
{
|
||||
uint32 entry = fields[16].GetUInt32();
|
||||
uint32 entry = fields[19].GetUInt32();
|
||||
CreatureTemplate const* creatureInfo = sObjectMgr->GetCreatureTemplate(entry);
|
||||
if (creatureInfo)
|
||||
{
|
||||
petDisplayId = fields[17].GetUInt32();
|
||||
petLevel = fields[18].GetUInt16();
|
||||
petDisplayId = fields[20].GetUInt32();
|
||||
petLevel = fields[21].GetUInt16();
|
||||
petFamily = creatureInfo->family;
|
||||
}
|
||||
}
|
||||
@@ -2113,7 +2118,7 @@ bool Player::BuildEnumData(PreparedQueryResult result, WorldPacket* data)
|
||||
*data << uint32(petLevel);
|
||||
*data << uint32(petFamily);
|
||||
|
||||
Tokenizer equipment(fields[19].GetString(), ' ');
|
||||
Tokenizer equipment(fields[22].GetString(), ' ');
|
||||
for (uint8 slot = 0; slot < INVENTORY_SLOT_BAG_END; ++slot)
|
||||
{
|
||||
uint32 visualBase = slot * 2;
|
||||
@@ -2133,7 +2138,7 @@ bool Player::BuildEnumData(PreparedQueryResult result, WorldPacket* data)
|
||||
for (uint8 enchantSlot = PERM_ENCHANTMENT_SLOT; enchantSlot <= TEMP_ENCHANTMENT_SLOT; ++enchantSlot)
|
||||
{
|
||||
// values stored in 2 uint16
|
||||
uint32 enchantId = 0x0000FFFF & (enchants >> enchantSlot*16);
|
||||
uint32 enchantId = 0x0000FFFF & (enchants >> enchantSlot * 16);
|
||||
if (!enchantId)
|
||||
continue;
|
||||
|
||||
@@ -17607,15 +17612,15 @@ bool Player::isBeingLoaded() const
|
||||
|
||||
bool Player::LoadFromDB(uint32 guid, SQLQueryHolder *holder)
|
||||
{
|
||||
//// 0 1 2 3 4 5 6 7 8 9 10 11
|
||||
//QueryResult* result = CharacterDatabase.PQuery("SELECT guid, account, name, race, class, gender, level, xp, money, playerBytes, playerBytes2, playerFlags, "
|
||||
// 12 13 14 15 16 17 18 19 20 21 22 23 24
|
||||
//// 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
|
||||
//QueryResult* result = CharacterDatabase.PQuery("SELECT guid, account, name, race, class, gender, level, xp, money, skin, face, hairStyle, hairColor, facialStyle, bankSlots, restState, playerFlags, "
|
||||
// 17 18 19 20 21 22 23 24 25 26 27 28 29
|
||||
//"position_x, position_y, position_z, map, orientation, taximask, cinematic, totaltime, leveltime, rest_bonus, logout_time, is_logout_resting, resettalents_cost, "
|
||||
// 25 26 27 28 29 30 31 32 33 34 35 36 37 38
|
||||
// 30 31 32 33 34 35 36 37 38 39 40 41 42 43
|
||||
//"resettalents_time, trans_x, trans_y, trans_z, trans_o, transguid, extra_flags, stable_slots, at_login, zone, online, death_expire_time, taxi_path, instance_mode_mask, "
|
||||
// 39 40 41 42 43 44 45 46 47 48 49
|
||||
// 44 45 46 47 48 49 50 51 52 53 54
|
||||
//"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 65 66
|
||||
// 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71
|
||||
//"health, power1, power2, power3, power4, power5, power6, power7, instance_id, talentGroupsCount, activeTalentGroup, exploredZones, equipmentCache, ammoId, knownTitles, actionBars, grantableLevels FROM characters WHERE guid = '%u'", guid);
|
||||
PreparedQueryResult result = holder->GetPreparedResult(PLAYER_LOGIN_QUERY_LOAD_FROM);
|
||||
|
||||
@@ -17681,8 +17686,8 @@ bool Player::LoadFromDB(uint32 guid, SQLQueryHolder *holder)
|
||||
SetUInt32Value(UNIT_FIELD_LEVEL, fields[6].GetUInt8());
|
||||
SetUInt32Value(PLAYER_XP, fields[7].GetUInt32());
|
||||
|
||||
_LoadIntoDataField(fields[61].GetCString(), PLAYER_EXPLORED_ZONES_1, PLAYER_EXPLORED_ZONES_SIZE);
|
||||
_LoadIntoDataField(fields[64].GetCString(), PLAYER__FIELD_KNOWN_TITLES, KNOWN_TITLES_SIZE*2);
|
||||
_LoadIntoDataField(fields[66].GetCString(), PLAYER_EXPLORED_ZONES_1, PLAYER_EXPLORED_ZONES_SIZE);
|
||||
_LoadIntoDataField(fields[69].GetCString(), PLAYER__FIELD_KNOWN_TITLES, KNOWN_TITLES_SIZE*2);
|
||||
|
||||
SetObjectScale(1.0f);
|
||||
SetFloatValue(UNIT_FIELD_HOVERHEIGHT, 1.0f);
|
||||
@@ -17695,19 +17700,24 @@ bool Player::LoadFromDB(uint32 guid, SQLQueryHolder *holder)
|
||||
money = MAX_MONEY_AMOUNT;
|
||||
SetMoney(money);
|
||||
|
||||
SetUInt32Value(PLAYER_BYTES, fields[9].GetUInt32());
|
||||
SetUInt32Value(PLAYER_BYTES_2, fields[10].GetUInt32());
|
||||
SetByteValue(PLAYER_BYTES, 0, fields[9].GetUInt8());
|
||||
SetByteValue(PLAYER_BYTES, 1, fields[10].GetUInt8());
|
||||
SetByteValue(PLAYER_BYTES, 2, fields[11].GetUInt8());
|
||||
SetByteValue(PLAYER_BYTES, 3, fields[12].GetUInt8());
|
||||
SetByteValue(PLAYER_BYTES_2, 0, fields[13].GetUInt8());
|
||||
SetByteValue(PLAYER_BYTES_2, 2, fields[14].GetUInt8());
|
||||
SetByteValue(PLAYER_BYTES_2, 3, fields[15].GetUInt8());
|
||||
SetByteValue(PLAYER_BYTES_3, 0, fields[5].GetUInt8());
|
||||
SetByteValue(PLAYER_BYTES_3, 1, fields[49].GetUInt8());
|
||||
SetUInt32Value(PLAYER_FLAGS, fields[11].GetUInt32());
|
||||
SetInt32Value(PLAYER_FIELD_WATCHED_FACTION_INDEX, fields[48].GetUInt32());
|
||||
SetByteValue(PLAYER_BYTES_3, 1, fields[54].GetUInt8());
|
||||
SetUInt32Value(PLAYER_FLAGS, fields[16].GetUInt32());
|
||||
SetInt32Value(PLAYER_FIELD_WATCHED_FACTION_INDEX, fields[53].GetUInt32());
|
||||
|
||||
SetUInt64Value(PLAYER_FIELD_KNOWN_CURRENCIES, fields[47].GetUInt64());
|
||||
SetUInt64Value(PLAYER_FIELD_KNOWN_CURRENCIES, fields[52].GetUInt64());
|
||||
|
||||
SetUInt32Value(PLAYER_AMMO_ID, fields[63].GetUInt32());
|
||||
SetUInt32Value(PLAYER_AMMO_ID, fields[68].GetUInt32());
|
||||
|
||||
// set which actionbars the client has active - DO NOT REMOVE EVER AGAIN (can be changed though, if it does change fieldwise)
|
||||
SetByteValue(PLAYER_FIELD_BYTES, 2, fields[65].GetUInt8());
|
||||
SetByteValue(PLAYER_FIELD_BYTES, 2, fields[70].GetUInt8());
|
||||
|
||||
InitDisplayIds();
|
||||
|
||||
@@ -17740,21 +17750,21 @@ bool Player::LoadFromDB(uint32 guid, SQLQueryHolder *holder)
|
||||
InitPrimaryProfessions(); // to max set before any spell loaded
|
||||
|
||||
// init saved position, and fix it later if problematic
|
||||
uint32 transLowGUID = fields[30].GetUInt32();
|
||||
Relocate(fields[12].GetFloat(), fields[13].GetFloat(), fields[14].GetFloat(), fields[16].GetFloat());
|
||||
uint32 mapId = fields[15].GetUInt16();
|
||||
uint32 instanceId = fields[58].GetUInt32();
|
||||
uint32 transLowGUID = fields[35].GetUInt32();
|
||||
Relocate(fields[17].GetFloat(), fields[18].GetFloat(), fields[19].GetFloat(), fields[21].GetFloat());
|
||||
uint32 mapId = fields[20].GetUInt16();
|
||||
uint32 instanceId = fields[63].GetUInt32();
|
||||
|
||||
uint32 dungeonDiff = fields[38].GetUInt8() & 0x0F;
|
||||
uint32 dungeonDiff = fields[43].GetUInt8() & 0x0F;
|
||||
if (dungeonDiff >= MAX_DUNGEON_DIFFICULTY)
|
||||
dungeonDiff = DUNGEON_DIFFICULTY_NORMAL;
|
||||
uint32 raidDiff = (fields[38].GetUInt8() >> 4) & 0x0F;
|
||||
uint32 raidDiff = (fields[43].GetUInt8() >> 4) & 0x0F;
|
||||
if (raidDiff >= MAX_RAID_DIFFICULTY)
|
||||
raidDiff = RAID_DIFFICULTY_10MAN_NORMAL;
|
||||
SetDungeonDifficulty(Difficulty(dungeonDiff)); // may be changed in _LoadGroup
|
||||
SetRaidDifficulty(Difficulty(raidDiff)); // may be changed in _LoadGroup
|
||||
|
||||
std::string taxi_nodes = fields[37].GetString();
|
||||
std::string taxi_nodes = fields[42].GetString();
|
||||
|
||||
#define RelocateToHomebind(){ mapId = m_homebindMapId; instanceId = 0; Relocate(m_homebindX, m_homebindY, m_homebindZ); }
|
||||
|
||||
@@ -17762,14 +17772,14 @@ bool Player::LoadFromDB(uint32 guid, SQLQueryHolder *holder)
|
||||
|
||||
_LoadArenaTeamInfo();
|
||||
|
||||
SetArenaPoints(fields[39].GetUInt32());
|
||||
SetArenaPoints(fields[44].GetUInt32());
|
||||
|
||||
SetHonorPoints(fields[40].GetUInt32());
|
||||
SetUInt32Value(PLAYER_FIELD_TODAY_CONTRIBUTION, fields[41].GetUInt32());
|
||||
SetUInt32Value(PLAYER_FIELD_YESTERDAY_CONTRIBUTION, fields[42].GetUInt32());
|
||||
SetUInt32Value(PLAYER_FIELD_LIFETIME_HONORABLE_KILLS, fields[43].GetUInt32());
|
||||
SetUInt16Value(PLAYER_FIELD_KILLS, 0, fields[44].GetUInt16());
|
||||
SetUInt16Value(PLAYER_FIELD_KILLS, 1, fields[45].GetUInt16());
|
||||
SetHonorPoints(fields[45].GetUInt32());
|
||||
SetUInt32Value(PLAYER_FIELD_TODAY_CONTRIBUTION, fields[46].GetUInt32());
|
||||
SetUInt32Value(PLAYER_FIELD_YESTERDAY_CONTRIBUTION, fields[47].GetUInt32());
|
||||
SetUInt32Value(PLAYER_FIELD_LIFETIME_HONORABLE_KILLS, fields[48].GetUInt32());
|
||||
SetUInt16Value(PLAYER_FIELD_KILLS, 0, fields[49].GetUInt16());
|
||||
SetUInt16Value(PLAYER_FIELD_KILLS, 1, fields[50].GetUInt16());
|
||||
|
||||
_LoadInstanceTimeRestrictions(holder->GetPreparedResult(PLAYER_LOGIN_QUERY_LOAD_INSTANCE_LOCK_TIMES));
|
||||
_LoadEntryPointData(holder->GetPreparedResult(PLAYER_LOGIN_QUERY_LOAD_ENTRY_POINT));
|
||||
@@ -17852,7 +17862,7 @@ bool Player::LoadFromDB(uint32 guid, SQLQueryHolder *holder)
|
||||
|
||||
if (m_transport)
|
||||
{
|
||||
float x = fields[26].GetFloat(), y = fields[27].GetFloat(), z = fields[28].GetFloat(), o = fields[29].GetFloat();
|
||||
float x = fields[31].GetFloat(), y = fields[32].GetFloat(), z = fields[33].GetFloat(), o = fields[34].GetFloat();
|
||||
m_movementInfo.transport.guid = transGUID;
|
||||
m_movementInfo.transport.pos.Relocate(x, y, z, o);
|
||||
m_transport->CalculatePassengerPosition(x, y, z, &o);
|
||||
@@ -17971,7 +17981,7 @@ bool Player::LoadFromDB(uint32 guid, SQLQueryHolder *holder)
|
||||
SaveRecallPosition();
|
||||
|
||||
time_t now = time(NULL);
|
||||
time_t logoutTime = time_t(fields[22].GetUInt32());
|
||||
time_t logoutTime = time_t(fields[27].GetUInt32());
|
||||
|
||||
// since last logout (in seconds)
|
||||
uint32 time_diff = uint32(now - logoutTime); //uint64 is excessive for a time_diff in seconds.. uint32 allows for 136~ year difference.
|
||||
@@ -17984,25 +17994,25 @@ bool Player::LoadFromDB(uint32 guid, SQLQueryHolder *holder)
|
||||
|
||||
SetDrunkValue(newDrunkValue);
|
||||
|
||||
m_cinematic = fields[18].GetUInt8();
|
||||
m_Played_time[PLAYED_TIME_TOTAL]= fields[19].GetUInt32();
|
||||
m_Played_time[PLAYED_TIME_LEVEL]= fields[20].GetUInt32();
|
||||
m_cinematic = fields[23].GetUInt8();
|
||||
m_Played_time[PLAYED_TIME_TOTAL] = fields[24].GetUInt32();
|
||||
m_Played_time[PLAYED_TIME_LEVEL] = fields[25].GetUInt32();
|
||||
|
||||
m_resetTalentsCost = fields[24].GetUInt32();
|
||||
m_resetTalentsTime = time_t(fields[25].GetUInt32());
|
||||
m_resetTalentsCost = fields[29].GetUInt32();
|
||||
m_resetTalentsTime = time_t(fields[30].GetUInt32());
|
||||
|
||||
m_taxi.LoadTaxiMask(fields[17].GetCString()); // must be before InitTaxiNodesForLevel
|
||||
m_taxi.LoadTaxiMask(fields[22].GetCString()); // must be before InitTaxiNodesForLevel
|
||||
|
||||
uint32 extraflags = fields[31].GetUInt16();
|
||||
uint32 extraflags = fields[36].GetUInt16();
|
||||
|
||||
m_stableSlots = fields[32].GetUInt8();
|
||||
m_stableSlots = fields[37].GetUInt8();
|
||||
if (m_stableSlots > MAX_PET_STABLES)
|
||||
{
|
||||
sLog->outError("Player can have not more %u stable slots, but have in DB %u", MAX_PET_STABLES, uint32(m_stableSlots));
|
||||
m_stableSlots = MAX_PET_STABLES;
|
||||
}
|
||||
|
||||
m_atLoginFlags = fields[33].GetUInt16();
|
||||
m_atLoginFlags = fields[38].GetUInt16();
|
||||
|
||||
if (HasAtLoginFlag(AT_LOGIN_RENAME))
|
||||
{
|
||||
@@ -18015,7 +18025,7 @@ bool Player::LoadFromDB(uint32 guid, SQLQueryHolder *holder)
|
||||
m_lastHonorUpdateTime = logoutTime;
|
||||
UpdateHonorFields();
|
||||
|
||||
m_deathExpireTime = time_t(fields[36].GetUInt32());
|
||||
m_deathExpireTime = time_t(fields[41].GetUInt32());
|
||||
|
||||
if (m_deathExpireTime > now + MAX_DEATH_COUNT * DEATH_EXPIRE_STEP)
|
||||
m_deathExpireTime = now + MAX_DEATH_COUNT * DEATH_EXPIRE_STEP - 1;
|
||||
@@ -18054,7 +18064,7 @@ bool Player::LoadFromDB(uint32 guid, SQLQueryHolder *holder)
|
||||
ClearInCombat();
|
||||
|
||||
// rest bonus can only be calculated after InitStatsForLevel()
|
||||
_restBonus = fields[21].GetFloat();
|
||||
_restBonus = fields[26].GetFloat();
|
||||
|
||||
if (time_diff > 0)
|
||||
{
|
||||
@@ -18062,11 +18072,11 @@ bool Player::LoadFromDB(uint32 guid, SQLQueryHolder *holder)
|
||||
float bubble0 = 0.031f;
|
||||
//speed collect rest bonus in offline, in logout, in tavern, city (section/in hour)
|
||||
float bubble1 = 0.125f;
|
||||
float bubble = fields[23].GetUInt8() > 0
|
||||
float bubble = fields[28].GetUInt8() > 0
|
||||
? bubble1*sWorld->getRate(RATE_REST_OFFLINE_IN_TAVERN_OR_CITY)
|
||||
: bubble0*sWorld->getRate(RATE_REST_OFFLINE_IN_WILDERNESS);
|
||||
|
||||
SetRestBonus(GetRestBonus()+ time_diff*((float)GetUInt32Value(PLAYER_NEXT_LEVEL_XP)/72000)*bubble);
|
||||
SetRestBonus(GetRestBonus() + time_diff*((float)GetUInt32Value(PLAYER_NEXT_LEVEL_XP) / 72000)*bubble);
|
||||
}
|
||||
|
||||
// load skills after InitStatsForLevel because it triggering aura apply also
|
||||
@@ -18078,8 +18088,8 @@ bool Player::LoadFromDB(uint32 guid, SQLQueryHolder *holder)
|
||||
//mails are loaded only when needed ;-) - when player in game click on mailbox.
|
||||
//_LoadMail();
|
||||
|
||||
m_specsCount = fields[59].GetUInt8();
|
||||
m_activeSpec = fields[60].GetUInt8();
|
||||
m_specsCount = fields[64].GetUInt8();
|
||||
m_activeSpec = fields[65].GetUInt8();
|
||||
|
||||
learnDefaultSpells(); // pussywizard: move before loading spells and talents
|
||||
_LoadSpells(holder->GetPreparedResult(PLAYER_LOGIN_QUERY_LOAD_SPELLS));
|
||||
@@ -18154,11 +18164,11 @@ bool Player::LoadFromDB(uint32 guid, SQLQueryHolder *holder)
|
||||
UpdateAllStats();
|
||||
|
||||
// restore remembered power/health values (but not more max values)
|
||||
uint32 savedHealth = fields[50].GetUInt32();
|
||||
uint32 savedHealth = fields[55].GetUInt32();
|
||||
SetHealth(savedHealth > GetMaxHealth() ? GetMaxHealth() : savedHealth);
|
||||
for (uint8 i = 0; i < MAX_POWERS; ++i)
|
||||
{
|
||||
uint32 savedPower = fields[51+i].GetUInt32();
|
||||
uint32 savedPower = fields[56 + i].GetUInt32();
|
||||
SetPower(Powers(i), savedPower > GetMaxPower(Powers(i)) ? GetMaxPower(Powers(i)) : savedPower);
|
||||
}
|
||||
|
||||
@@ -18216,7 +18226,7 @@ bool Player::LoadFromDB(uint32 guid, SQLQueryHolder *holder)
|
||||
}
|
||||
|
||||
// RaF stuff.
|
||||
m_grantableLevels = fields[66].GetUInt8();
|
||||
m_grantableLevels = fields[71].GetUInt8();
|
||||
if (GetSession()->IsARecruiter() || (GetSession()->GetRecruiterId() != 0))
|
||||
SetFlag(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_REFER_A_FRIEND);
|
||||
|
||||
@@ -20338,25 +20348,15 @@ void Player::SetUInt32ValueInArray(Tokenizer& tokens, uint16 index, uint32 value
|
||||
void Player::Customize(uint64 guid, uint8 gender, uint8 skin, uint8 face, uint8 hairStyle, uint8 hairColor, uint8 facialHair)
|
||||
{
|
||||
// xinef: zomg! sync query
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_CHAR_PLAYERBYTES2);
|
||||
stmt->setUInt32(0, GUID_LOPART(guid));
|
||||
PreparedQueryResult result = CharacterDatabase.Query(stmt);
|
||||
|
||||
if (!result)
|
||||
return;
|
||||
|
||||
Field* fields = result->Fetch();
|
||||
|
||||
uint32 playerBytes2 = fields[0].GetUInt32();
|
||||
playerBytes2 &= ~0xFF;
|
||||
playerBytes2 |= facialHair;
|
||||
|
||||
stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_GENDER_PLAYERBYTES);
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_GENDER_AND_APPEARANCE);
|
||||
|
||||
stmt->setUInt8(0, gender);
|
||||
stmt->setUInt32(1, skin | (face << 8) | (hairStyle << 16) | (hairColor << 24));
|
||||
stmt->setUInt32(2, playerBytes2);
|
||||
stmt->setUInt32(3, GUID_LOPART(guid));
|
||||
stmt->setUInt8(1, skin);
|
||||
stmt->setUInt8(2, face);
|
||||
stmt->setUInt8(3, hairStyle);
|
||||
stmt->setUInt8(4, hairColor);
|
||||
stmt->setUInt8(5, facialHair);
|
||||
stmt->setUInt32(6, GUID_LOPART(guid));
|
||||
|
||||
CharacterDatabase.Execute(stmt);
|
||||
}
|
||||
@@ -26154,8 +26154,13 @@ void Player::_SaveCharacter(bool create, SQLTransaction& trans)
|
||||
stmt->setUInt8(index++, getLevel());
|
||||
stmt->setUInt32(index++, GetUInt32Value(PLAYER_XP));
|
||||
stmt->setUInt32(index++, GetMoney());
|
||||
stmt->setUInt32(index++, GetUInt32Value(PLAYER_BYTES));
|
||||
stmt->setUInt32(index++, GetUInt32Value(PLAYER_BYTES_2));
|
||||
stmt->setUInt8(index++, GetByteValue(PLAYER_BYTES, 0));
|
||||
stmt->setUInt8(index++, GetByteValue(PLAYER_BYTES, 1));
|
||||
stmt->setUInt8(index++, GetByteValue(PLAYER_BYTES, 2));
|
||||
stmt->setUInt8(index++, GetByteValue(PLAYER_BYTES, 3));
|
||||
stmt->setUInt8(index++, GetByteValue(PLAYER_BYTES_2, 0));
|
||||
stmt->setUInt8(index++, GetByteValue(PLAYER_BYTES_2, 2));
|
||||
stmt->setUInt8(index++, GetByteValue(PLAYER_BYTES_2, 3));
|
||||
stmt->setUInt32(index++, GetUInt32Value(PLAYER_FLAGS));
|
||||
stmt->setUInt16(index++, (uint16)GetMapId());
|
||||
stmt->setUInt32(index++, (uint32)GetInstanceId());
|
||||
@@ -26259,8 +26264,13 @@ void Player::_SaveCharacter(bool create, SQLTransaction& trans)
|
||||
stmt->setUInt8(index++, getLevel());
|
||||
stmt->setUInt32(index++, GetUInt32Value(PLAYER_XP));
|
||||
stmt->setUInt32(index++, GetMoney());
|
||||
stmt->setUInt32(index++, GetUInt32Value(PLAYER_BYTES));
|
||||
stmt->setUInt32(index++, GetUInt32Value(PLAYER_BYTES_2));
|
||||
stmt->setUInt8(index++, GetByteValue(PLAYER_BYTES, 0));
|
||||
stmt->setUInt8(index++, GetByteValue(PLAYER_BYTES, 1));
|
||||
stmt->setUInt8(index++, GetByteValue(PLAYER_BYTES, 2));
|
||||
stmt->setUInt8(index++, GetByteValue(PLAYER_BYTES, 3));
|
||||
stmt->setUInt8(index++, GetByteValue(PLAYER_BYTES_2, 0));
|
||||
stmt->setUInt8(index++, GetByteValue(PLAYER_BYTES_2, 2));
|
||||
stmt->setUInt8(index++, GetByteValue(PLAYER_BYTES_2, 3));
|
||||
stmt->setUInt32(index++, GetUInt32Value(PLAYER_FLAGS));
|
||||
|
||||
if (!IsBeingTeleported())
|
||||
|
||||
Reference in New Issue
Block a user