aboutsummaryrefslogtreecommitdiff
path: root/src/server/game/Handlers/CharacterHandler.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/server/game/Handlers/CharacterHandler.cpp')
-rw-r--r--src/server/game/Handlers/CharacterHandler.cpp58
1 files changed, 30 insertions, 28 deletions
diff --git a/src/server/game/Handlers/CharacterHandler.cpp b/src/server/game/Handlers/CharacterHandler.cpp
index d5d9f6e0b3a..f605e138ce3 100644
--- a/src/server/game/Handlers/CharacterHandler.cpp
+++ b/src/server/game/Handlers/CharacterHandler.cpp
@@ -359,17 +359,19 @@ void WorldSession::HandleCharCreateOpcode(WorldPackets::Character::CharacterCrea
}
// prevent character creating Expansion race without Expansion account
- if (raceEntry->expansion > Expansion())
+ uint8 raceExpansionRequirement = sObjectMgr->GetRaceExpansionRequirement(charCreate.CreateInfo->Race);
+ if (raceExpansionRequirement > Expansion())
{
- TC_LOG_ERROR("network", "Expansion %u account:[%d] tried to Create character with expansion %u race (%u)", Expansion(), GetAccountId(), raceEntry->expansion, charCreate.CreateInfo->Race);
+ TC_LOG_ERROR("network", "Expansion %u account:[%d] tried to Create character with expansion %u race (%u)", Expansion(), GetAccountId(), raceExpansionRequirement, charCreate.CreateInfo->Race);
SendCharCreate(CHAR_CREATE_EXPANSION);
return;
}
// prevent character creating Expansion class without Expansion account
- if (classEntry->expansion > Expansion())
+ uint8 classExpansionRequirement = sObjectMgr->GetClassExpansionRequirement(charCreate.CreateInfo->Class);
+ if (classExpansionRequirement > Expansion())
{
- TC_LOG_ERROR("network", "Expansion %u account:[%d] tried to Create character with expansion %u class (%u)", Expansion(), GetAccountId(), classEntry->expansion, charCreate.CreateInfo->Class);
+ TC_LOG_ERROR("network", "Expansion %u account:[%d] tried to Create character with expansion %u class (%u)", Expansion(), GetAccountId(), classExpansionRequirement, charCreate.CreateInfo->Class);
SendCharCreate(CHAR_CREATE_EXPANSION_CLASS);
return;
}
@@ -950,10 +952,10 @@ void WorldSession::HandlePlayerLogin(LoginQueryHolder* holder)
if (ChrClassesEntry const* cEntry = sChrClassesStore.LookupEntry(pCurrChar->getClass()))
{
- if (cEntry->CinematicSequence)
- pCurrChar->SendCinematicStart(cEntry->CinematicSequence);
+ if (cEntry->CinematicSequenceID)
+ pCurrChar->SendCinematicStart(cEntry->CinematicSequenceID);
else if (ChrRacesEntry const* rEntry = sChrRacesStore.LookupEntry(pCurrChar->getRace()))
- pCurrChar->SendCinematicStart(rEntry->CinematicSequence);
+ pCurrChar->SendCinematicStart(rEntry->CinematicSequenceID);
// send new char string if not empty
if (!sWorld->GetNewCharString().empty())
@@ -1335,17 +1337,17 @@ void WorldSession::HandleAlterAppearance(WorldPacket& recvData)
BarberShopStyleEntry const* bs_hair = sBarberShopStyleStore.LookupEntry(Hair);
- if (!bs_hair || bs_hair->type != 0 || bs_hair->race != _player->getRace() || bs_hair->gender != _player->getGender())
+ if (!bs_hair || bs_hair->Type != 0 || bs_hair->Race != _player->getRace() || bs_hair->Sex != _player->getGender())
return;
BarberShopStyleEntry const* bs_facialHair = sBarberShopStyleStore.LookupEntry(FacialHair);
- if (!bs_facialHair || bs_facialHair->type != 2 || bs_facialHair->race != _player->getRace() || bs_facialHair->gender != _player->getGender())
+ if (!bs_facialHair || bs_facialHair->Type != 2 || bs_facialHair->Race != _player->getRace() || bs_facialHair->Sex != _player->getGender())
return;
BarberShopStyleEntry const* bs_skinColor = sBarberShopStyleStore.LookupEntry(SkinColor);
- if (bs_skinColor && (bs_skinColor->type != 3 || bs_skinColor->race != _player->getRace() || bs_skinColor->gender != _player->getGender()))
+ if (bs_skinColor && (bs_skinColor->Type != 3 || bs_skinColor->Race != _player->getRace() || bs_skinColor->Sex != _player->getGender()))
return;
GameObject* go = _player->FindNearestGameObjectOfType(GAMEOBJECT_TYPE_BARBER_CHAIR, 5.0f);
@@ -1361,7 +1363,7 @@ void WorldSession::HandleAlterAppearance(WorldPacket& recvData)
return;
}
- uint32 cost = _player->GetBarberShopCost(bs_hair->hair_id, Color, bs_facialHair->hair_id, bs_skinColor);
+ uint32 cost = _player->GetBarberShopCost(bs_hair->Data, Color, bs_facialHair->Data, bs_skinColor);
// 0 - ok
// 1, 3 - not enough money
@@ -1377,11 +1379,11 @@ void WorldSession::HandleAlterAppearance(WorldPacket& recvData)
_player->ModifyMoney(-int64(cost)); // it isn't free
_player->UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_GOLD_SPENT_AT_BARBER, cost);
- _player->SetByteValue(PLAYER_BYTES, 2, uint8(bs_hair->hair_id));
+ _player->SetByteValue(PLAYER_BYTES, 2, uint8(bs_hair->Data));
_player->SetByteValue(PLAYER_BYTES, 3, uint8(Color));
- _player->SetByteValue(PLAYER_BYTES_2, 0, uint8(bs_facialHair->hair_id));
+ _player->SetByteValue(PLAYER_BYTES_2, 0, uint8(bs_facialHair->Data));
if (bs_skinColor)
- _player->SetByteValue(PLAYER_BYTES, 0, uint8(bs_skinColor->hair_id));
+ _player->SetByteValue(PLAYER_BYTES, 0, uint8(bs_skinColor->Data));
_player->UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_VISIT_BARBER_SHOP, 1);
@@ -1403,7 +1405,7 @@ void WorldSession::HandleRemoveGlyph(WorldPacket& recvData)
{
if (GlyphPropertiesEntry const* gp = sGlyphPropertiesStore.LookupEntry(glyph))
{
- _player->RemoveAurasDueToSpell(gp->SpellId);
+ _player->RemoveAurasDueToSpell(gp->SpellID);
_player->SetGlyph(slot, 0);
_player->SendTalentsInfoData(false);
}
@@ -2123,28 +2125,28 @@ void WorldSession::HandleCharFactionOrRaceChange(WorldPacket& recvData)
// new team
if (team == TEAM_ALLIANCE)
{
- uint32 bitIndex = htitleInfo->bit_index;
- uint32 index = bitIndex / 32;
- uint32 old_flag = 1 << (bitIndex % 32);
- uint32 new_flag = 1 << (atitleInfo->bit_index % 32);
+ uint32 maskID = htitleInfo->MaskID;
+ uint32 index = maskID / 32;
+ uint32 old_flag = 1 << (maskID % 32);
+ uint32 new_flag = 1 << (atitleInfo->MaskID % 32);
if (knownTitles[index] & old_flag)
{
knownTitles[index] &= ~old_flag;
// use index of the new title
- knownTitles[atitleInfo->bit_index / 32] |= new_flag;
+ knownTitles[atitleInfo->MaskID / 32] |= new_flag;
}
}
else
{
- uint32 bitIndex = atitleInfo->bit_index;
- uint32 index = bitIndex / 32;
- uint32 old_flag = 1 << (bitIndex % 32);
- uint32 new_flag = 1 << (htitleInfo->bit_index % 32);
+ uint32 maskID = atitleInfo->MaskID;
+ uint32 index = maskID / 32;
+ uint32 old_flag = 1 << (maskID % 32);
+ uint32 new_flag = 1 << (htitleInfo->MaskID % 32);
if (knownTitles[index] & old_flag)
{
knownTitles[index] &= ~old_flag;
// use index of the new title
- knownTitles[htitleInfo->bit_index / 32] |= new_flag;
+ knownTitles[htitleInfo->MaskID / 32] |= new_flag;
}
}
@@ -2218,10 +2220,10 @@ void WorldSession::HandleOpeningCinematic(WorldPacket& /*recvData*/)
if (ChrClassesEntry const* classEntry = sChrClassesStore.LookupEntry(_player->getClass()))
{
- if (classEntry->CinematicSequence)
- _player->SendCinematicStart(classEntry->CinematicSequence);
+ if (classEntry->CinematicSequenceID)
+ _player->SendCinematicStart(classEntry->CinematicSequenceID);
else if (ChrRacesEntry const* raceEntry = sChrRacesStore.LookupEntry(_player->getRace()))
- _player->SendCinematicStart(raceEntry->CinematicSequence);
+ _player->SendCinematicStart(raceEntry->CinematicSequenceID);
}
}