Add player byte offsets enum.
This commit is contained in:
@@ -2209,11 +2209,11 @@ bool ChatHandler::HandleCharacterCopySkinCommand(char* args)
|
||||
uint8 hairColor = fields[3].GetUInt32();
|
||||
uint8 facialHair = fields[4].GetUInt32();
|
||||
uint8 gender = fields[5].GetUInt8();
|
||||
target->SetByteValue(PLAYER_BYTES, 0, skin);
|
||||
target->SetByteValue(PLAYER_BYTES, 1, face);
|
||||
target->SetByteValue(PLAYER_BYTES, 2, hairStyle);
|
||||
target->SetByteValue(PLAYER_BYTES, 3, hairColor);
|
||||
target->SetByteValue(PLAYER_BYTES_2, 0, facialHair);
|
||||
target->SetByteValue(PLAYER_BYTES, PLAYER_BYTES_OFFSET_SKIN_ID, skin);
|
||||
target->SetByteValue(PLAYER_BYTES, PLAYER_BYTES_OFFSET_FACE_ID, face);
|
||||
target->SetByteValue(PLAYER_BYTES, PLAYER_BYTES_OFFSET_HAIR_STYLE_ID, hairStyle);
|
||||
target->SetByteValue(PLAYER_BYTES, PLAYER_BYTES_OFFSET_HAIR_COLOR_ID, hairColor);
|
||||
target->SetByteValue(PLAYER_BYTES_2, PLAYER_BYTES_2_OFFSET_FACIAL_STYLE, facialHair);
|
||||
target->SetByteValue(UNIT_FIELD_BYTES_0, UNIT_BYTES_0_OFFSET_GENDER, gender);
|
||||
SendSysMessage("Modification du skin/genre OK.");
|
||||
return true;
|
||||
@@ -2427,13 +2427,13 @@ bool ChatHandler::HandleModifyHonorCommand(char* args)
|
||||
if (amount < 0 || amount > 255)
|
||||
return false;
|
||||
// rank points is sent to client with same size of uint8(255) for each rank
|
||||
target->SetByteValue(PLAYER_FIELD_BYTES2, 0, amount);
|
||||
target->SetByteValue(PLAYER_FIELD_BYTES2, PLAYER_FIELD_BYTES_2_OFFSET_HONOR_RANK_BAR, amount);
|
||||
}
|
||||
else if (hasStringAbbr(field, "rank"))
|
||||
{
|
||||
if (amount < 0 || amount >= HONOR_RANK_COUNT)
|
||||
return false;
|
||||
target->SetByteValue(PLAYER_BYTES_3, 3, amount);
|
||||
target->SetByteValue(PLAYER_BYTES_3, PLAYER_BYTES_3_OFFSET_HONOR_RANK, amount);
|
||||
}
|
||||
else if (hasStringAbbr(field, "todaykills"))
|
||||
target->SetUInt16Value(PLAYER_FIELD_SESSION_KILLS, 0, (uint32)amount);
|
||||
@@ -4062,7 +4062,7 @@ bool ChatHandler::HandleModifyGenderCommand(char *args)
|
||||
|
||||
// Set gender
|
||||
player->SetByteValue(UNIT_FIELD_BYTES_0, UNIT_BYTES_0_OFFSET_GENDER, gender);
|
||||
player->SetUInt16Value(PLAYER_BYTES_3, 0, uint16(gender) | (player->GetDrunkValue() & 0xFFFE));
|
||||
player->SetUInt16Value(PLAYER_BYTES_3, PLAYER_BYTES_3_OFFSET_GENDER_AND_INEBRIATION, uint16(gender) | (player->GetDrunkValue() & 0xFFFE));
|
||||
|
||||
// Change display ID
|
||||
player->InitPlayerDisplayIds();
|
||||
@@ -4657,7 +4657,7 @@ bool ChatHandler::HandleModifyHairStyleCommand(char* args)
|
||||
if (!target)
|
||||
target = m_session->GetPlayer();
|
||||
|
||||
target->SetByteValue(PLAYER_BYTES, 2, hairstyle);
|
||||
target->SetByteValue(PLAYER_BYTES, PLAYER_BYTES_OFFSET_HAIR_STYLE_ID, hairstyle);
|
||||
target->SetDisplayId(DISPLAY_ID_BOX);
|
||||
target->DirectSendPublicValueUpdate(UNIT_FIELD_DISPLAYID);
|
||||
target->DeMorph();
|
||||
@@ -4677,7 +4677,7 @@ bool ChatHandler::HandleModifyHairColorCommand(char* args)
|
||||
if (!target)
|
||||
target = m_session->GetPlayer();
|
||||
|
||||
target->SetByteValue(PLAYER_BYTES, 3, haircolor);
|
||||
target->SetByteValue(PLAYER_BYTES, PLAYER_BYTES_OFFSET_HAIR_COLOR_ID, haircolor);
|
||||
target->SetDisplayId(DISPLAY_ID_BOX);
|
||||
target->DirectSendPublicValueUpdate(UNIT_FIELD_DISPLAYID);
|
||||
target->DeMorph();
|
||||
@@ -4697,7 +4697,7 @@ bool ChatHandler::HandleModifySkinColorCommand(char* args)
|
||||
if (!target)
|
||||
target = m_session->GetPlayer();
|
||||
|
||||
target->SetByteValue(PLAYER_BYTES, 0, skincolor);
|
||||
target->SetByteValue(PLAYER_BYTES, PLAYER_BYTES_OFFSET_SKIN_ID, skincolor);
|
||||
target->SetDisplayId(DISPLAY_ID_BOX);
|
||||
target->DirectSendPublicValueUpdate(UNIT_FIELD_DISPLAYID);
|
||||
target->DeMorph();
|
||||
@@ -4717,7 +4717,7 @@ bool ChatHandler::HandleModifyAccessoriesCommand(char* args)
|
||||
if (!target)
|
||||
target = m_session->GetPlayer();
|
||||
|
||||
target->SetByteValue(PLAYER_BYTES_2, 0, accessories);
|
||||
target->SetByteValue(PLAYER_BYTES_2, PLAYER_BYTES_2_OFFSET_FACIAL_STYLE, accessories);
|
||||
target->SetDisplayId(DISPLAY_ID_BOX);
|
||||
target->DirectSendPublicValueUpdate(UNIT_FIELD_DISPLAYID);
|
||||
target->DeMorph();
|
||||
|
||||
@@ -979,7 +979,7 @@ void WorldSession::HandleSetActionBarTogglesOpcode(WorldPacket& recv_data)
|
||||
return;
|
||||
}
|
||||
|
||||
GetPlayer()->SetByteValue(PLAYER_FIELD_BYTES, 2, actionBar);
|
||||
GetPlayer()->SetByteValue(PLAYER_FIELD_BYTES, PLAYER_FIELD_BYTES_OFFSET_ACTION_BARS, actionBar);
|
||||
}
|
||||
|
||||
void WorldSession::HandlePlayedTime(WorldPacket& /*recv_data*/)
|
||||
@@ -1076,7 +1076,7 @@ void WorldSession::HandleInspectHonorStatsOpcode(WorldPacket& recv_data)
|
||||
data << pTarget->GetUInt32Value(PLAYER_FIELD_LAST_WEEK_RANK);
|
||||
|
||||
// Rank progress bar
|
||||
data << (uint8)pTarget->GetByteValue(PLAYER_FIELD_BYTES2, 0);
|
||||
data << (uint8)pTarget->GetByteValue(PLAYER_FIELD_BYTES2, PLAYER_FIELD_BYTES_2_OFFSET_HONOR_RANK_BAR);
|
||||
|
||||
SendPacket(&data);
|
||||
}
|
||||
|
||||
@@ -858,15 +858,15 @@ void HonorMgr::Update()
|
||||
SetHighestRank(m_rank);
|
||||
|
||||
// HIGHEST RANK
|
||||
m_owner->SetByteValue(PLAYER_FIELD_BYTES, 3, m_highestRank.rank);
|
||||
m_owner->SetByteValue(PLAYER_FIELD_BYTES, PLAYER_FIELD_BYTES_OFFSET_HIGHEST_HONOR_RANK, m_highestRank.rank);
|
||||
// RANK (Patent)
|
||||
m_owner->SetByteValue(PLAYER_BYTES_3, 3, m_rank.rank);
|
||||
m_owner->SetByteValue(PLAYER_BYTES_3, PLAYER_BYTES_3_OFFSET_HONOR_RANK, m_rank.rank);
|
||||
|
||||
uint32 honorBar = uint32(m_rankPoints >= 0.0f ? m_rankPoints : -1 * m_rankPoints);
|
||||
honorBar = uint8(((honorBar - m_rank.minRP) / (m_rank.maxRP - m_rank.minRP)) * (m_rank.positive ? 255 : -255));
|
||||
|
||||
// PLAYER_FIELD_HONOR_BAR
|
||||
m_owner->SetByteValue(PLAYER_FIELD_BYTES2, 0, honorBar);
|
||||
m_owner->SetByteValue(PLAYER_FIELD_BYTES2, PLAYER_FIELD_BYTES_2_OFFSET_HONOR_RANK_BAR, honorBar);
|
||||
|
||||
// TODAY
|
||||
m_owner->SetUInt16Value(PLAYER_FIELD_SESSION_KILLS, 0, todayHK);
|
||||
|
||||
+39
-35
@@ -871,16 +871,18 @@ bool Player::Create(uint32 guidlow, std::string const& name, uint8 race, uint8 c
|
||||
SetInt32Value(PLAYER_FIELD_WATCHED_FACTION_INDEX, -1); // -1 is default value
|
||||
#endif
|
||||
|
||||
SetByteValue(PLAYER_BYTES, 0, skin);
|
||||
SetByteValue(PLAYER_BYTES, 1, face);
|
||||
SetByteValue(PLAYER_BYTES, 2, hairStyle);
|
||||
SetByteValue(PLAYER_BYTES, 3, hairColor);
|
||||
SetByteValue(PLAYER_BYTES, PLAYER_BYTES_OFFSET_SKIN_ID, skin);
|
||||
SetByteValue(PLAYER_BYTES, PLAYER_BYTES_OFFSET_FACE_ID, face);
|
||||
SetByteValue(PLAYER_BYTES, PLAYER_BYTES_OFFSET_HAIR_STYLE_ID, hairStyle);
|
||||
SetByteValue(PLAYER_BYTES, PLAYER_BYTES_OFFSET_HAIR_COLOR_ID, hairColor);
|
||||
|
||||
SetByteValue(PLAYER_BYTES_2, 0, facialHair);
|
||||
SetByteValue(PLAYER_BYTES_2, 3, REST_STATE_NORMAL);
|
||||
SetByteValue(PLAYER_BYTES_2, PLAYER_BYTES_2_OFFSET_FACIAL_STYLE, facialHair);
|
||||
SetByteValue(PLAYER_BYTES_2, PLAYER_BYTES_2_OFFSET_UNK1, 0xEE);
|
||||
SetByteValue(PLAYER_BYTES_2, PLAYER_BYTES_2_OFFSET_REST_STATE, REST_STATE_NORMAL);
|
||||
|
||||
SetUInt16Value(PLAYER_BYTES_3, 0, gender); // only GENDER_MALE/GENDER_FEMALE (1 bit) allowed, drunk state = 0
|
||||
SetByteValue(PLAYER_BYTES_3, 3, 0); // BattlefieldArenaFaction (0 or 1)
|
||||
// only GENDER_MALE/GENDER_FEMALE (1 bit) allowed, drunk state = 0
|
||||
SetUInt16Value(PLAYER_BYTES_3, PLAYER_BYTES_3_OFFSET_GENDER_AND_INEBRIATION, gender);
|
||||
SetByteValue(PLAYER_BYTES_3, PLAYER_BYTES_3_OFFSET_HONOR_RANK, 0);
|
||||
|
||||
SetUInt32Value(PLAYER_GUILDID, 0);
|
||||
SetUInt32Value(PLAYER_GUILDRANK, 0);
|
||||
@@ -1166,7 +1168,7 @@ DrunkenState Player::GetDrunkenstateByValue(uint16 value)
|
||||
void Player::SetDrunkValue(uint16 newDrunkenValue, uint32 itemId)
|
||||
{
|
||||
m_drunk = newDrunkenValue;
|
||||
SetUInt16Value(PLAYER_BYTES_3, 0, uint16(GetGender()) | (m_drunk & 0xFFFE));
|
||||
SetUInt16Value(PLAYER_BYTES_3, PLAYER_BYTES_3_OFFSET_GENDER_AND_INEBRIATION, uint16(GetGender()) | (m_drunk & 0xFFFE));
|
||||
|
||||
uint32 newDrunkenState = Player::GetDrunkenstateByValue(m_drunk);
|
||||
|
||||
@@ -1462,13 +1464,13 @@ bool Player::IsCityProtector() { return m_ExtraFlags & PLAYER_EXTRA_CITY_PROTECT
|
||||
|
||||
void Player::SetCityTitle()
|
||||
{
|
||||
SetByteValue(PLAYER_BYTES_3, 2, GetRace());
|
||||
SetByteValue(PLAYER_BYTES_3, PLAYER_BYTES_3_OFFSET_CITY_PROTECTOR_TITLE, GetRace());
|
||||
m_ExtraFlags |= PLAYER_EXTRA_CITY_PROTECTOR;
|
||||
}
|
||||
|
||||
void Player::RemoveCityTitle()
|
||||
{
|
||||
SetByteValue(PLAYER_BYTES_3, 2, 0);
|
||||
SetByteValue(PLAYER_BYTES_3, PLAYER_BYTES_3_OFFSET_CITY_PROTECTOR_TITLE, 0);
|
||||
m_ExtraFlags &= ~PLAYER_EXTRA_CITY_PROTECTOR;
|
||||
}
|
||||
|
||||
@@ -4931,7 +4933,7 @@ void Player::KillPlayer()
|
||||
//SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_IN_PVP);
|
||||
|
||||
SetUInt32Value(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_NONE);
|
||||
ApplyModByteFlag(PLAYER_FIELD_BYTES, 0, PLAYER_FIELD_BYTE_RELEASE_TIMER, !sMapStorage.LookupEntry<MapEntry>(GetMapId())->Instanceable());
|
||||
ApplyModByteFlag(PLAYER_FIELD_BYTES, PLAYER_FIELD_BYTES_OFFSET_FLAGS, PLAYER_FIELD_BYTE_RELEASE_TIMER, !sMapStorage.LookupEntry<MapEntry>(GetMapId())->Instanceable());
|
||||
|
||||
// 6 minutes until repop at graveyard
|
||||
m_deathTimer = CORPSE_REPOP_TIME;
|
||||
@@ -4958,11 +4960,11 @@ Corpse* Player::CreateCorpse()
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
uint8 skin = GetByteValue(PLAYER_BYTES, 0);
|
||||
uint8 face = GetByteValue(PLAYER_BYTES, 1);
|
||||
uint8 hairstyle = GetByteValue(PLAYER_BYTES, 2);
|
||||
uint8 haircolor = GetByteValue(PLAYER_BYTES, 3);
|
||||
uint8 facialhair = GetByteValue(PLAYER_BYTES_2, 0);
|
||||
uint8 skin = GetByteValue(PLAYER_BYTES, PLAYER_BYTES_OFFSET_SKIN_ID);
|
||||
uint8 face = GetByteValue(PLAYER_BYTES, PLAYER_BYTES_OFFSET_FACE_ID);
|
||||
uint8 hairstyle = GetByteValue(PLAYER_BYTES, PLAYER_BYTES_OFFSET_HAIR_STYLE_ID);
|
||||
uint8 haircolor = GetByteValue(PLAYER_BYTES, PLAYER_BYTES_OFFSET_HAIR_COLOR_ID);
|
||||
uint8 facialhair = GetByteValue(PLAYER_BYTES_2, PLAYER_BYTES_2_OFFSET_FACIAL_STYLE);
|
||||
|
||||
corpse->SetByteValue(CORPSE_FIELD_BYTES_1, 1, GetRace());
|
||||
corpse->SetByteValue(CORPSE_FIELD_BYTES_1, 2, GetGender());
|
||||
@@ -14748,16 +14750,18 @@ bool Player::LoadFromDB(ObjectGuid guid, SqlQueryHolder* holder)
|
||||
money = MAX_MONEY_AMOUNT;
|
||||
SetMoney(money);
|
||||
|
||||
SetByteValue(PLAYER_BYTES, 0, fields[9].GetUInt8()); // skin
|
||||
SetByteValue(PLAYER_BYTES, 1, fields[10].GetUInt8()); // face
|
||||
SetByteValue(PLAYER_BYTES, 2, fields[11].GetUInt8()); // hair style
|
||||
SetByteValue(PLAYER_BYTES, 3, fields[12].GetUInt8()); // hair color
|
||||
SetByteValue(PLAYER_BYTES_2, 0, fields[13].GetUInt8()); // facial hair
|
||||
SetByteValue(PLAYER_BYTES, PLAYER_BYTES_OFFSET_SKIN_ID, fields[9].GetUInt8());
|
||||
SetByteValue(PLAYER_BYTES, PLAYER_BYTES_OFFSET_FACE_ID, fields[10].GetUInt8());
|
||||
SetByteValue(PLAYER_BYTES, PLAYER_BYTES_OFFSET_HAIR_STYLE_ID, fields[11].GetUInt8());
|
||||
SetByteValue(PLAYER_BYTES, PLAYER_BYTES_OFFSET_HAIR_COLOR_ID, fields[12].GetUInt8());
|
||||
SetByteValue(PLAYER_BYTES_2, PLAYER_BYTES_2_OFFSET_FACIAL_STYLE, fields[13].GetUInt8());
|
||||
SetByteValue(PLAYER_BYTES_2, PLAYER_BYTES_2_OFFSET_UNK1, 0xEE);
|
||||
SetBankBagSlotCount(fields[14].GetUInt8());
|
||||
SetByteValue(PLAYER_BYTES_2, PLAYER_BYTES_2_OFFSET_REST_STATE, REST_STATE_NORMAL);
|
||||
|
||||
m_drunk = fields[49].GetUInt16();
|
||||
|
||||
SetUInt16Value(PLAYER_BYTES_3, 0, (m_drunk & 0xFFFE) | gender);
|
||||
SetUInt16Value(PLAYER_BYTES_3, PLAYER_BYTES_3_OFFSET_GENDER_AND_INEBRIATION, (m_drunk & 0xFFFE) | gender);
|
||||
|
||||
SetUInt32Value(PLAYER_FLAGS, fields[15].GetUInt32());
|
||||
|
||||
@@ -14774,7 +14778,7 @@ bool Player::LoadFromDB(ObjectGuid guid, SqlQueryHolder* holder)
|
||||
SetUInt32Value(PLAYER_AMMO_ID, fields[58].GetUInt32());
|
||||
|
||||
// Action bars state
|
||||
SetByteValue(PLAYER_FIELD_BYTES, 2, fields[59].GetUInt8());
|
||||
SetByteValue(PLAYER_FIELD_BYTES, PLAYER_FIELD_BYTES_OFFSET_ACTION_BARS, fields[59].GetUInt8());
|
||||
|
||||
// cleanup inventory related item value fields (its will be filled correctly in _LoadInventory)
|
||||
for (uint8 slot = EQUIPMENT_SLOT_START; slot < EQUIPMENT_SLOT_END; ++slot)
|
||||
@@ -15506,7 +15510,7 @@ void Player::LoadCorpse()
|
||||
else
|
||||
{
|
||||
if (Corpse* corpse = GetCorpse())
|
||||
ApplyModByteFlag(PLAYER_FIELD_BYTES, 0, PLAYER_FIELD_BYTE_RELEASE_TIMER, corpse && !sMapStorage.LookupEntry<MapEntry>(corpse->GetMapId())->Instanceable());
|
||||
ApplyModByteFlag(PLAYER_FIELD_BYTES, PLAYER_FIELD_BYTES_OFFSET_FLAGS, PLAYER_FIELD_BYTE_RELEASE_TIMER, corpse && !sMapStorage.LookupEntry<MapEntry>(corpse->GetMapId())->Instanceable());
|
||||
else
|
||||
{
|
||||
//Prevent Dead Player login without corpse
|
||||
@@ -16467,12 +16471,12 @@ void Player::SaveToDB(bool online, bool force)
|
||||
uberInsert.addUInt32(GetLevel());
|
||||
uberInsert.addUInt32(GetUInt32Value(PLAYER_XP));
|
||||
uberInsert.addUInt32(GetMoney());
|
||||
uberInsert.addUInt8(GetByteValue(PLAYER_BYTES, 0)); // skin
|
||||
uberInsert.addUInt8(GetByteValue(PLAYER_BYTES, 1)); // face
|
||||
uberInsert.addUInt8(GetByteValue(PLAYER_BYTES, 2)); // hair style
|
||||
uberInsert.addUInt8(GetByteValue(PLAYER_BYTES, 3)); // hair color
|
||||
uberInsert.addUInt32(GetByteValue(PLAYER_BYTES_2, 0)); // facial hair
|
||||
uberInsert.addUInt32(GetByteValue(PLAYER_BYTES_2, 2)); // bank bag slots
|
||||
uberInsert.addUInt8(GetByteValue(PLAYER_BYTES, PLAYER_BYTES_OFFSET_SKIN_ID));
|
||||
uberInsert.addUInt8(GetByteValue(PLAYER_BYTES, PLAYER_BYTES_OFFSET_FACE_ID));
|
||||
uberInsert.addUInt8(GetByteValue(PLAYER_BYTES, PLAYER_BYTES_OFFSET_HAIR_STYLE_ID));
|
||||
uberInsert.addUInt8(GetByteValue(PLAYER_BYTES, PLAYER_BYTES_OFFSET_HAIR_COLOR_ID));
|
||||
uberInsert.addUInt32(GetByteValue(PLAYER_BYTES_2, PLAYER_BYTES_2_OFFSET_FACIAL_STYLE));
|
||||
uberInsert.addUInt32(GetByteValue(PLAYER_BYTES_2, PLAYER_BYTES_2_OFFSET_BANK_BAG_SLOTS));
|
||||
|
||||
// Nostalrius: Fix toggled PvP flag after relog.
|
||||
uint32 playerFlags = GetUInt32Value(PLAYER_FLAGS) & ~(PLAYER_FLAGS_PVP_DESIRED);
|
||||
@@ -16581,7 +16585,7 @@ void Player::SaveToDB(bool online, bool force)
|
||||
|
||||
uberInsert.addUInt32(GetUInt32Value(PLAYER_AMMO_ID));
|
||||
|
||||
uberInsert.addUInt32(uint32(GetByteValue(PLAYER_FIELD_BYTES, 2)));
|
||||
uberInsert.addUInt32(uint32(GetByteValue(PLAYER_FIELD_BYTES, PLAYER_FIELD_BYTES_OFFSET_ACTION_BARS)));
|
||||
uberInsert.addUInt32(GetWorldMask());
|
||||
uberInsert.addUInt64(uint64(m_createTime));
|
||||
uberInsert.Execute();
|
||||
@@ -17774,9 +17778,9 @@ void Player::SetRestBonus(float rest_bonus_new)
|
||||
|
||||
// update data for client
|
||||
if (m_restBonus > 10)
|
||||
SetByteValue(PLAYER_BYTES_2, 3, REST_STATE_RESTED);
|
||||
SetByteValue(PLAYER_BYTES_2, PLAYER_BYTES_2_OFFSET_REST_STATE, REST_STATE_RESTED);
|
||||
else if (m_restBonus <= 1)
|
||||
SetByteValue(PLAYER_BYTES_2, 3, REST_STATE_NORMAL);
|
||||
SetByteValue(PLAYER_BYTES_2, PLAYER_BYTES_2_OFFSET_REST_STATE, REST_STATE_NORMAL);
|
||||
|
||||
// RestTickUpdate
|
||||
SetUInt32Value(PLAYER_REST_STATE_EXPERIENCE, uint32(m_restBonus));
|
||||
@@ -18861,7 +18865,7 @@ void Player::SetComboPoints()
|
||||
if (combotarget)
|
||||
{
|
||||
SetGuidValue(PLAYER_FIELD_COMBO_TARGET, combotarget->GetObjectGuid());
|
||||
SetByteValue(PLAYER_FIELD_BYTES, 1, m_comboPoints);
|
||||
SetByteValue(PLAYER_FIELD_BYTES, PLAYER_FIELD_BYTES_OFFSET_COMBO_POINTS, m_comboPoints);
|
||||
}
|
||||
/*else
|
||||
{
|
||||
|
||||
@@ -330,6 +330,45 @@ enum PlayerFlags
|
||||
PLAYER_FLAGS_PVP_TIMER = 0x00040000, // 3.0.2, pvp timer active (after you disable pvp manually)
|
||||
};
|
||||
|
||||
enum PlayerBytesOffsets
|
||||
{
|
||||
PLAYER_BYTES_OFFSET_SKIN_ID = 0,
|
||||
PLAYER_BYTES_OFFSET_FACE_ID = 1,
|
||||
PLAYER_BYTES_OFFSET_HAIR_STYLE_ID = 2,
|
||||
PLAYER_BYTES_OFFSET_HAIR_COLOR_ID = 3
|
||||
};
|
||||
|
||||
enum PlayerBytes2Offsets
|
||||
{
|
||||
PLAYER_BYTES_2_OFFSET_FACIAL_STYLE = 0,
|
||||
PLAYER_BYTES_2_OFFSET_UNK1 = 1,
|
||||
PLAYER_BYTES_2_OFFSET_BANK_BAG_SLOTS = 2,
|
||||
PLAYER_BYTES_2_OFFSET_REST_STATE = 3
|
||||
};
|
||||
|
||||
enum PlayerBytes3Offsets
|
||||
{
|
||||
PLAYER_BYTES_3_OFFSET_GENDER_AND_INEBRIATION = 0, // uint16, 1 bit for gender, rest for drunk state
|
||||
PLAYER_BYTES_3_OFFSET_CITY_PROTECTOR_TITLE = 2, // race id
|
||||
PLAYER_BYTES_3_OFFSET_HONOR_RANK = 3
|
||||
};
|
||||
|
||||
enum PlayerFieldBytesOffsets
|
||||
{
|
||||
PLAYER_FIELD_BYTES_OFFSET_FLAGS = 0,
|
||||
PLAYER_FIELD_BYTES_OFFSET_COMBO_POINTS = 1,
|
||||
PLAYER_FIELD_BYTES_OFFSET_ACTION_BARS = 2,
|
||||
PLAYER_FIELD_BYTES_OFFSET_HIGHEST_HONOR_RANK = 3
|
||||
};
|
||||
|
||||
enum PlayerFieldBytes2Offsets
|
||||
{
|
||||
PLAYER_FIELD_BYTES_2_OFFSET_HONOR_RANK_BAR = 0,
|
||||
PLAYER_FIELD_BYTES_2_OFFSET_FLAGS = 1,
|
||||
PLAYER_FIELD_BYTES_2_OFFSET_UNK2 = 2,
|
||||
PLAYER_FIELD_BYTES_2_OFFSET_UNK3 = 3
|
||||
};
|
||||
|
||||
// used in (PLAYER_FIELD_BYTES, 0) byte values
|
||||
enum PlayerFieldByteFlags
|
||||
{
|
||||
@@ -1063,8 +1102,8 @@ class Player final: public Unit
|
||||
static bool IsBankPos(uint8 bag, uint8 slot);
|
||||
bool IsValidPos(uint16 pos, bool explicit_pos) const { return IsValidPos(pos >> 8, pos & 255, explicit_pos); }
|
||||
bool IsValidPos(uint8 bag, uint8 slot, bool explicit_pos) const;
|
||||
uint8 GetBankBagSlotCount() const { return GetByteValue(PLAYER_BYTES_2, 2); }
|
||||
void SetBankBagSlotCount(uint8 count) { SetByteValue(PLAYER_BYTES_2, 2, count); }
|
||||
uint8 GetBankBagSlotCount() const { return GetByteValue(PLAYER_BYTES_2, PLAYER_BYTES_2_OFFSET_BANK_BAG_SLOTS); }
|
||||
void SetBankBagSlotCount(uint8 count) { SetByteValue(PLAYER_BYTES_2, PLAYER_BYTES_2_OFFSET_BANK_BAG_SLOTS, count); }
|
||||
bool HasItemCount(uint32 item, uint32 count = 1, bool inBankAlso = false) const;
|
||||
bool HasItemFitToSpellReqirements(SpellEntry const* spellInfo, Item const* ignoreItem = nullptr);
|
||||
bool HasItemWithIdEquipped(uint32 item, uint32 count = 1, uint8 except_slot = NULL_SLOT) const;
|
||||
|
||||
@@ -75,11 +75,11 @@ bool PlayerBotAI::SpawnNewPlayer(WorldSession* sess, uint8 class_, uint32 race_,
|
||||
std::string name = sObjectMgr.GeneratePetName(1863); // Succubus name
|
||||
normalizePlayerName(name);
|
||||
uint8 gender = pClone ? pClone->GetByteValue(UNIT_FIELD_BYTES_0, UNIT_BYTES_0_OFFSET_GENDER) : urand(0, 1);
|
||||
uint8 skin = pClone ? pClone->GetByteValue(PLAYER_BYTES, 0) : urand(0, 5);
|
||||
uint8 face = pClone ? pClone->GetByteValue(PLAYER_BYTES, 1) : urand(0, 5);
|
||||
uint8 hairStyle = pClone ? pClone->GetByteValue(PLAYER_BYTES, 2) : urand(0, 5);
|
||||
uint8 hairColor = pClone ? pClone->GetByteValue(PLAYER_BYTES, 3) : urand(0, 5);
|
||||
uint8 facialHair = pClone ? pClone->GetByteValue(PLAYER_BYTES_2, 0) : urand(0, 5);
|
||||
uint8 skin = pClone ? pClone->GetByteValue(PLAYER_BYTES, PLAYER_BYTES_OFFSET_SKIN_ID) : urand(0, 5);
|
||||
uint8 face = pClone ? pClone->GetByteValue(PLAYER_BYTES, PLAYER_BYTES_OFFSET_FACE_ID) : urand(0, 5);
|
||||
uint8 hairStyle = pClone ? pClone->GetByteValue(PLAYER_BYTES, PLAYER_BYTES_OFFSET_HAIR_STYLE_ID) : urand(0, 5);
|
||||
uint8 hairColor = pClone ? pClone->GetByteValue(PLAYER_BYTES, PLAYER_BYTES_OFFSET_HAIR_COLOR_ID) : urand(0, 5);
|
||||
uint8 facialHair = pClone ? pClone->GetByteValue(PLAYER_BYTES_2, PLAYER_BYTES_2_OFFSET_FACIAL_STYLE) : urand(0, 5);
|
||||
Player* newChar = new Player(sess);
|
||||
uint32 guid = botEntry->playerGUID;
|
||||
if (!newChar->Create(guid, name, race_, class_, gender, skin, face, hairStyle, hairColor, facialHair))
|
||||
|
||||
@@ -2967,7 +2967,7 @@ void Aura::HandleAuraTrackStealthed(bool apply, bool /*Real*/)
|
||||
if (apply)
|
||||
GetTarget()->RemoveNoStackAurasDueToAuraHolder(GetHolder());
|
||||
|
||||
GetTarget()->ApplyModByteFlag(PLAYER_FIELD_BYTES, 0, PLAYER_FIELD_BYTE_TRACK_STEALTHED, apply);
|
||||
GetTarget()->ApplyModByteFlag(PLAYER_FIELD_BYTES, PLAYER_FIELD_BYTES_OFFSET_FLAGS, PLAYER_FIELD_BYTE_TRACK_STEALTHED, apply);
|
||||
}
|
||||
|
||||
void Aura::HandleAuraModScale(bool apply, bool /*Real*/)
|
||||
@@ -3702,7 +3702,7 @@ void Aura::HandleModStealth(bool apply, bool Real)
|
||||
{
|
||||
target->SetByteFlag(UNIT_FIELD_BYTES_1, UNIT_BYTES_1_OFFSET_VIS_FLAG, UNIT_VIS_FLAGS_CREEP);
|
||||
if (target->GetTypeId() == TYPEID_PLAYER)
|
||||
target->SetByteFlag(PLAYER_FIELD_BYTES2, 1, PLAYER_FIELD_BYTE2_STEALTH);
|
||||
target->SetByteFlag(PLAYER_FIELD_BYTES2, PLAYER_FIELD_BYTES_2_OFFSET_FLAGS, PLAYER_FIELD_BYTE2_STEALTH);
|
||||
// apply only if not in GM invisibility (and overwrite invisibility state)
|
||||
if (target->GetVisibility() != VISIBILITY_OFF)
|
||||
{
|
||||
@@ -3741,7 +3741,7 @@ void Aura::HandleModStealth(bool apply, bool Real)
|
||||
{
|
||||
target->RemoveByteFlag(UNIT_FIELD_BYTES_1, UNIT_BYTES_1_OFFSET_VIS_FLAG, UNIT_VIS_FLAGS_CREEP);
|
||||
if (target->GetTypeId() == TYPEID_PLAYER)
|
||||
target->RemoveByteFlag(PLAYER_FIELD_BYTES2, 1, PLAYER_FIELD_BYTE2_STEALTH);
|
||||
target->RemoveByteFlag(PLAYER_FIELD_BYTES2, PLAYER_FIELD_BYTES_2_OFFSET_FLAGS, PLAYER_FIELD_BYTE2_STEALTH);
|
||||
// restore invisibility if any
|
||||
if (target->HasAuraType(SPELL_AURA_MOD_INVISIBILITY))
|
||||
{
|
||||
@@ -3767,7 +3767,7 @@ void Aura::HandleInvisibility(bool apply, bool Real)
|
||||
if (Real && target->GetTypeId() == TYPEID_PLAYER)
|
||||
{
|
||||
// apply glow vision
|
||||
target->SetByteFlag(PLAYER_FIELD_BYTES2, 1, PLAYER_FIELD_BYTE2_INVISIBILITY_GLOW);
|
||||
target->SetByteFlag(PLAYER_FIELD_BYTES2, PLAYER_FIELD_BYTES_2_OFFSET_FLAGS, PLAYER_FIELD_BYTE2_INVISIBILITY_GLOW);
|
||||
}
|
||||
|
||||
// apply only if not in GM invisibility and not stealth
|
||||
@@ -3791,7 +3791,7 @@ void Aura::HandleInvisibility(bool apply, bool Real)
|
||||
{
|
||||
// remove glow vision
|
||||
if (target->GetTypeId() == TYPEID_PLAYER)
|
||||
target->RemoveByteFlag(PLAYER_FIELD_BYTES2, 1, PLAYER_FIELD_BYTE2_INVISIBILITY_GLOW);
|
||||
target->RemoveByteFlag(PLAYER_FIELD_BYTES2, PLAYER_FIELD_BYTES_2_OFFSET_FLAGS, PLAYER_FIELD_BYTE2_INVISIBILITY_GLOW);
|
||||
// apply only if not in GM invisibility & not stealthed while invisible
|
||||
if (target->GetVisibility() != VISIBILITY_OFF)
|
||||
{
|
||||
@@ -3826,7 +3826,7 @@ void Aura::HandleDetectAmore(bool apply, bool /*real*/)
|
||||
if (!GetTarget()->IsPlayer())
|
||||
return;
|
||||
|
||||
GetTarget()->ApplyModByteFlag(PLAYER_FIELD_BYTES2, 1, PLAYER_FIELD_BYTE2_DETECT_AMORE, apply);
|
||||
GetTarget()->ApplyModByteFlag(PLAYER_FIELD_BYTES2, PLAYER_FIELD_BYTES_2_OFFSET_FLAGS, PLAYER_FIELD_BYTE2_DETECT_AMORE, apply);
|
||||
}
|
||||
|
||||
void Aura::HandleAuraModRoot(bool apply, bool Real)
|
||||
|
||||
Reference in New Issue
Block a user