Skip to content

Commit eefd3ff

Browse files
author
Github Actions
committed
Merge 3.3.5 to 3.3.5-skip-dk
2 parents 448af61 + 273b004 commit eefd3ff

29 files changed

Lines changed: 242 additions & 123 deletions

‎src/server/game/Battlegrounds/Zones/BattlegroundAB.cpp‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -247,13 +247,13 @@ void BattlegroundAB::HandleAreaTrigger(Player* player, uint32 trigger)
247247
{
248248
case 3948: // Arathi Basin Alliance Exit.
249249
if (player->GetTeam() != ALLIANCE)
250-
player->GetSession()->SendAreaTriggerMessage("Only The Alliance can use that portal");
250+
player->GetSession()->SendNotification("Only The Alliance can use that portal");
251251
else
252252
player->LeaveBattleground();
253253
break;
254254
case 3949: // Arathi Basin Horde Exit.
255255
if (player->GetTeam() != HORDE)
256-
player->GetSession()->SendAreaTriggerMessage("Only The Horde can use that portal");
256+
player->GetSession()->SendNotification("Only The Horde can use that portal");
257257
else
258258
player->LeaveBattleground();
259259
break;

‎src/server/game/Battlegrounds/Zones/BattlegroundAV.cpp‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -510,13 +510,13 @@ void BattlegroundAV::HandleAreaTrigger(Player* player, uint32 trigger)
510510
case 95:
511511
case 2608:
512512
if (player->GetTeam() != ALLIANCE)
513-
player->GetSession()->SendAreaTriggerMessage("Only The Alliance can use that portal");
513+
player->GetSession()->SendNotification("Only The Alliance can use that portal");
514514
else
515515
player->LeaveBattleground();
516516
break;
517517
case 2606:
518518
if (player->GetTeam() != HORDE)
519-
player->GetSession()->SendAreaTriggerMessage("Only The Horde can use that portal");
519+
player->GetSession()->SendNotification("Only The Horde can use that portal");
520520
else
521521
player->LeaveBattleground();
522522
break;

‎src/server/game/Combat/ThreatManager.cpp‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -597,7 +597,7 @@ void ThreatManager::UpdateVictim()
597597
if (newHighest || _updateFlags.HasFlag(ThreatListClientUpdateFlags::UpdateNeeded))
598598
{
599599
SendThreatListToClients(newHighest);
600-
_updateFlags = ThreatListClientUpdateFlags::None;
600+
_updateFlags.RemoveFlag(ThreatListClientUpdateFlags::UpdateNeeded | ThreatListClientUpdateFlags::ForceHighestUpdate);
601601
}
602602

603603
ProcessAIUpdates();

‎src/server/game/Conditions/ConditionMgr.h‎

Lines changed: 23 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,23 @@ class WorldObject;
3333
class LootTemplate;
3434
struct Condition;
3535

36+
/*! Documentation on implementing a new ConditionType:
37+
Step 1: Check for the lowest free ID. Look for CONDITION_UNUSED_XX in the enum.
38+
Then define the new condition type.
39+
40+
Step 2: Determine and map the parameters for the new condition type.
41+
42+
Step 3: Add a case block to ConditionMgr::isConditionTypeValid with the new condition type
43+
and validate the parameters.
44+
45+
Step 4: Define the maximum available condition targets in ConditionMgr::GetMaxAvailableConditionTargets.
46+
47+
Step 5: Define the grid searcher mask in Condition::GetSearcherTypeMaskForCondition.
48+
49+
Step 6: Add a case block to ConditionMgr::Meets with the new condition type.
50+
51+
Step 7: Define condition name and expected condition values in ConditionMgr::StaticConditionTypeData.
52+
*/
3653
enum ConditionTypes
3754
{ // value1 value2 value3
3855
CONDITION_NONE = 0, // 0 0 0 always true
@@ -103,7 +120,7 @@ enum ConditionTypes
103120
Step 1: Check for the lowest free ID. Look for CONDITION_SOURCE_TYPE_UNUSED_XX in the enum.
104121
Then define the new source type.
105122
106-
Step 2: Determine and map the parameters for the new condition type.
123+
Step 2: Determine and map the parameters for the new condition source type.
107124
108125
Step 3: Add a case block to ConditionMgr::isSourceTypeValid with the new condition type
109126
and validate the parameters.
@@ -113,18 +130,20 @@ enum ConditionTypes
113130
114131
Step 5: Define the maximum available condition targets in ConditionMgr::GetMaxAvailableConditionTargets.
115132
133+
Step 6: Define ConditionSourceType Name in ConditionMgr::StaticSourceTypeData.
134+
116135
The following steps only apply if your condition can be grouped:
117136
118-
Step 6: Determine how you are going to store your conditions. You need to add a new storage container
137+
Step 7: Determine how you are going to store your conditions. You need to add a new storage container
119138
for it in ConditionMgr class, along with a function like:
120139
ConditionList GetConditionsForXXXYourNewSourceTypeXXX(parameters...)
121140
122141
The above function should be placed in upper level (practical) code that actually
123142
checks the conditions.
124143
125-
Step 7: Implement loading for your source type in ConditionMgr::LoadConditions.
144+
Step 8: Implement loading for your source type in ConditionMgr::LoadConditions.
126145
127-
Step 8: Implement memory cleaning for your source type in ConditionMgr::Clean.
146+
Step 9: Implement memory cleaning for your source type in ConditionMgr::Clean.
128147
*/
129148
enum ConditionSourceType
130149
{

‎src/server/game/Entities/Creature/GossipDef.cpp‎

Lines changed: 21 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -329,32 +329,28 @@ void QuestMenu::ClearMenu()
329329

330330
void PlayerMenu::SendQuestGiverQuestList(QEmote const& eEmote, const std::string& Title, ObjectGuid guid)
331331
{
332-
WorldPacket data(SMSG_QUESTGIVER_QUEST_LIST, 100); // guess size
333-
data << guid;
332+
LocaleConstant localeConstant = _session->GetSessionDbLocaleIndex();
333+
334+
WorldPackets::Quest::QuestGiverQuestListMessage questList;
335+
questList.QuestGiverGUID = guid;
334336

335337
if (QuestGreeting const* questGreeting = sObjectMgr->GetQuestGreeting(guid))
336338
{
337-
std::string strGreeting = questGreeting->greeting;
339+
questList.GreetEmoteDelay = questGreeting->greetEmoteDelay;
340+
questList.GreetEmoteType = questGreeting->greetEmoteType;
341+
questList.Greeting = questGreeting->greeting;
338342

339-
LocaleConstant localeConstant = _session->GetSessionDbLocaleIndex();
340343
if (localeConstant != LOCALE_enUS)
341344
if (QuestGreetingLocale const* questGreetingLocale = sObjectMgr->GetQuestGreetingLocale(MAKE_PAIR32(guid.GetEntry(), guid.GetTypeId())))
342-
ObjectMgr::GetLocaleString(questGreetingLocale->greeting, localeConstant, strGreeting);
343-
344-
data << strGreeting;
345-
data << uint32(questGreeting->greetEmoteDelay);
346-
data << uint32(questGreeting->greetEmoteType);
345+
ObjectMgr::GetLocaleString(questGreetingLocale->greeting, localeConstant, questList.Greeting);
347346
}
348347
else
349348
{
350-
data << Title;
351-
data << uint32(eEmote._Delay); // player emote
352-
data << uint32(eEmote._Emote); // NPC emote
349+
questList.GreetEmoteDelay = eEmote._Delay;
350+
questList.GreetEmoteType = eEmote._Emote;
351+
questList.Greeting = Title;
353352
}
354353

355-
size_t count_pos = data.wpos();
356-
data << uint8(0);
357-
uint32 count = 0;
358354
for (uint32 i = 0; i < _questMenu.GetMenuItemCount(); ++i)
359355
{
360356
QuestMenuItem const& questMenuItem = _questMenu.GetItem(i);
@@ -363,27 +359,22 @@ void PlayerMenu::SendQuestGiverQuestList(QEmote const& eEmote, const std::string
363359

364360
if (Quest const* quest = sObjectMgr->GetQuestTemplate(questID))
365361
{
366-
++count;
367-
std::string title = quest->GetLogTitle();
362+
WorldPackets::NPC::ClientGossipText& text = questList.QuestDataText.emplace_back();
363+
text.QuestID = questID;
364+
text.QuestType = questMenuItem.QuestIcon;
365+
text.QuestLevel = quest->GetQuestLevel();
366+
text.QuestFlags = quest->GetFlags();
367+
text.Repeatable = quest->IsAutoComplete() && quest->IsRepeatable() && !quest->IsDailyOrWeekly() && !quest->IsMonthly();
368368

369-
LocaleConstant localeConstant = _session->GetSessionDbLocaleIndex();
369+
text.QuestTitle = quest->GetLogTitle();
370370
if (localeConstant != LOCALE_enUS)
371371
if (QuestLocale const* questTemplateLocale = sObjectMgr->GetQuestLocale(questID))
372-
ObjectMgr::GetLocaleString(questTemplateLocale->LogTitle, localeConstant, title);
373-
374-
data << uint32(questID);
375-
data << uint32(questMenuItem.QuestIcon);
376-
data << int32(quest->GetQuestLevel());
377-
data << uint32(quest->GetFlags()); // 3.3.3 quest flags
378-
data << uint8(quest->IsAutoComplete() && quest->IsRepeatable() && !quest->IsDailyOrWeekly() && !quest->IsMonthly()); // 3.3.3 icon changes - 0: yellow exclapamtion mark, 1: blue question mark
379-
data << title;
372+
ObjectMgr::GetLocaleString(questTemplateLocale->LogTitle, localeConstant, text.QuestTitle);
380373
}
381374
}
382375

383-
data.put<uint8>(count_pos, count);
384-
_session->SendPacket(&data);
385-
386-
TC_LOG_DEBUG("network", "WORLD: Sent SMSG_QUESTGIVER_QUEST_LIST (QuestGiver: {})", guid.ToString());
376+
_session->SendPacket(questList.Write());
377+
TC_LOG_DEBUG("network", "WORLD: Sent SMSG_QUEST_GIVER_QUEST_LIST_MESSAGE NPC={}", guid.ToString());
387378
}
388379

389380
void PlayerMenu::SendQuestGiverStatus(QuestGiverStatus questStatus, ObjectGuid npcGUID) const

‎src/server/game/Entities/GameObject/GameObject.cpp‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232
#include "LootMgr.h"
3333
#include "Map.h"
3434
#include "MapManager.h"
35+
#include "MiscPackets.h"
3536
#include "ObjectAccessor.h"
3637
#include "ObjectMgr.h"
3738
#include "OutdoorPvPMgr.h"
@@ -2196,8 +2197,8 @@ void GameObject::Use(Unit* user)
21962197
// fallback, will always work
21972198
player->TeleportTo(GetMapId(), GetPositionX(), GetPositionY(), GetPositionZ(), GetOrientation(), TELE_TO_NOT_LEAVE_TRANSPORT | TELE_TO_NOT_LEAVE_COMBAT | TELE_TO_NOT_UNSUMMON_PET);
21982199

2199-
WorldPacket data(SMSG_ENABLE_BARBER_SHOP, 0);
2200-
player->SendDirectMessage(&data);
2200+
WorldPackets::Misc::EnableBarberShop packet;
2201+
player->SendDirectMessage(packet.Write());
22012202

22022203
player->SetStandState(UnitStandStateType(UNIT_STAND_STATE_SIT_LOW_CHAIR + info->barberChair.chairheight));
22032204
return;

‎src/server/game/Entities/Player/Player.cpp‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20604,7 +20604,7 @@ void Player::PetSpellInitialize()
2060420604

2060520605
CharmInfo* charmInfo = pet->GetCharmInfo();
2060620606

20607-
WorldPacket data(SMSG_PET_SPELLS, 8+2+4+4+4*MAX_UNIT_ACTION_BAR_INDEX+1+1);
20607+
WorldPacket data(SMSG_PET_SPELLS, 8 + 2 + 4 + 4 + 4 * MAX_UNIT_ACTION_BAR_INDEX + 1 + 1);
2060820608
data << pet->GetGUID();
2060920609
data << uint16(pet->GetCreatureTemplate()->family); // creature family (required for pet talents)
2061020610
data << uint32(pet->GetDuration());
@@ -20658,7 +20658,7 @@ void Player::PossessSpellInitialize()
2065820658
return;
2065920659
}
2066020660

20661-
WorldPacket data(SMSG_PET_SPELLS, 8+2+4+4+4*MAX_UNIT_ACTION_BAR_INDEX+1+1);
20661+
WorldPacket data(SMSG_PET_SPELLS, 8 + 2 + 4 + 4 + 4 * MAX_UNIT_ACTION_BAR_INDEX + 1 + 1);
2066220662
data << charm->GetGUID();
2066320663
data << uint16(0);
2066420664
data << uint32(0);
@@ -20749,7 +20749,7 @@ void Player::CharmSpellInitialize()
2074920749
}
2075020750
}
2075120751

20752-
WorldPacket data(SMSG_PET_SPELLS, 8+2+4+4+4*MAX_UNIT_ACTION_BAR_INDEX+1+4*addlist+1);
20752+
WorldPacket data(SMSG_PET_SPELLS, 8 + 2 + 4 + 4 + 4 * MAX_UNIT_ACTION_BAR_INDEX + 1 + 4 * addlist + 1);
2075320753
data << charm->GetGUID();
2075420754
data << uint16(0);
2075520755
data << uint32(0);
@@ -25901,7 +25901,7 @@ void Player::SendRefundInfo(Item* item)
2590125901
return;
2590225902
}
2590325903

25904-
WorldPacket data(SMSG_ITEM_REFUND_INFO_RESPONSE, 8+4+4+4+4*4+4*4+4+4);
25904+
WorldPacket data(SMSG_ITEM_REFUND_INFO_RESPONSE, 8 + 4 + 4 + 4 + 4 * 4 + 4 * 4 + 4 + 4);
2590525905
data << item->GetGUID(); // item guid
2590625906
data << uint32(item->GetPaidMoney()); // money cost
2590725907
data << uint32(iece->HonorPoints); // honor point cost

‎src/server/game/Handlers/CharacterHandler.cpp‎

Lines changed: 11 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1253,64 +1253,61 @@ void WorldSession::HandleSetPlayerDeclinedNames(WorldPacket& recvData)
12531253
SendSetPlayerDeclinedNamesResult(DECLINED_NAMES_RESULT_SUCCESS, guid);
12541254
}
12551255

1256-
void WorldSession::HandleAlterAppearance(WorldPacket& recvData)
1256+
void WorldSession::HandleAlterAppearance(WorldPackets::Character::AlterApperance& packet)
12571257
{
12581258
TC_LOG_DEBUG("network", "CMSG_ALTER_APPEARANCE");
12591259

1260-
uint32 Hair, Color, FacialHair, SkinColor;
1261-
recvData >> Hair >> Color >> FacialHair >> SkinColor;
1262-
1263-
BarberShopStyleEntry const* bs_hair = sBarberShopStyleStore.LookupEntry(Hair);
1260+
BarberShopStyleEntry const* bs_hair = sBarberShopStyleStore.LookupEntry(packet.NewHairStyle);
12641261

12651262
if (!bs_hair || bs_hair->Type != 0 || bs_hair->Race != _player->GetRace() || Gender(bs_hair->Sex) != _player->GetNativeGender())
12661263
return;
12671264

1268-
BarberShopStyleEntry const* bs_facialHair = sBarberShopStyleStore.LookupEntry(FacialHair);
1265+
BarberShopStyleEntry const* bs_facialHair = sBarberShopStyleStore.LookupEntry(packet.NewFacialHair);
12691266

12701267
if (!bs_facialHair || bs_facialHair->Type != 2 || bs_facialHair->Race != _player->GetRace() || Gender(bs_facialHair->Sex) != _player->GetNativeGender())
12711268
return;
12721269

1273-
BarberShopStyleEntry const* bs_skinColor = sBarberShopStyleStore.LookupEntry(SkinColor);
1270+
BarberShopStyleEntry const* bs_skinColor = sBarberShopStyleStore.LookupEntry(packet.NewSkinColor);
12741271

12751272
if (bs_skinColor && (bs_skinColor->Type != 3 || bs_skinColor->Race != _player->GetRace() || Gender(bs_skinColor->Sex) != _player->GetNativeGender()))
12761273
return;
12771274

12781275
if (!Player::ValidateAppearance(_player->GetRace(), _player->GetClass(), _player->GetNativeGender(),
1279-
bs_hair->Data, Color, _player->GetFaceId(), bs_facialHair->Data,
1276+
bs_hair->Data, packet.NewHairColor, _player->GetFaceId(), bs_facialHair->Data,
12801277
bs_skinColor ? bs_skinColor->Data : _player->GetSkinId()))
12811278
return;
12821279

12831280
GameObject* go = _player->FindNearestGameObjectOfType(GAMEOBJECT_TYPE_BARBER_CHAIR, 5.0f);
12841281
if (!go)
12851282
{
1286-
SendBarberShopResult(BARBER_SHOP_RESULT_NOT_ON_CHAIR);
1283+
SendPacket(WorldPackets::Character::BarberShopResult(WorldPackets::Character::BarberShopResult::ResultEnum::NotOnChair).Write());
12871284
return;
12881285
}
12891286

12901287
if (_player->GetStandState() != UnitStandStateType(UNIT_STAND_STATE_SIT_LOW_CHAIR + go->GetGOInfo()->barberChair.chairheight))
12911288
{
1292-
SendBarberShopResult(BARBER_SHOP_RESULT_NOT_ON_CHAIR);
1289+
SendPacket(WorldPackets::Character::BarberShopResult(WorldPackets::Character::BarberShopResult::ResultEnum::NotOnChair).Write());
12931290
return;
12941291
}
12951292

1296-
uint32 cost = _player->GetBarberShopCost(bs_hair->Data, Color, bs_facialHair->Data, bs_skinColor);
1293+
uint32 cost = _player->GetBarberShopCost(bs_hair->Data, packet.NewHairColor, bs_facialHair->Data, bs_skinColor);
12971294

12981295
// 0 - ok
12991296
// 1, 3 - not enough money
13001297
// 2 - you have to sit on barber chair
13011298
if (!_player->HasEnoughMoney(cost))
13021299
{
1303-
SendBarberShopResult(BARBER_SHOP_RESULT_NO_MONEY);
1300+
SendPacket(WorldPackets::Character::BarberShopResult(WorldPackets::Character::BarberShopResult::ResultEnum::NoMoney).Write());
13041301
return;
13051302
}
13061303

1307-
SendBarberShopResult(BARBER_SHOP_RESULT_SUCCESS);
1304+
SendPacket(WorldPackets::Character::BarberShopResult(WorldPackets::Character::BarberShopResult::ResultEnum::Success).Write());
13081305

13091306
_player->ModifyMoney(-int32(cost)); // it isn't free
13101307
_player->UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_GOLD_SPENT_AT_BARBER, cost);
13111308

13121309
_player->SetHairStyleId(uint8(bs_hair->Data));
1313-
_player->SetHairColorId(uint8(Color));
1310+
_player->SetHairColorId(uint8(packet.NewHairColor));
13141311
_player->SetFacialStyle(uint8(bs_facialHair->Data));
13151312
if (bs_skinColor)
13161313
_player->SetSkinId(uint8(bs_skinColor->Data));
@@ -2179,13 +2176,6 @@ void WorldSession::SendSetPlayerDeclinedNamesResult(DeclinedNameResult result, O
21792176
SendPacket(&data);
21802177
}
21812178

2182-
void WorldSession::SendBarberShopResult(BarberShopResult result)
2183-
{
2184-
WorldPacket data(SMSG_BARBER_SHOP_RESULT, 4);
2185-
data << uint32(result);
2186-
SendPacket(&data);
2187-
}
2188-
21892179
void WorldSession::HandleOpeningCinematic(WorldPackets::Misc::OpeningCinematic& /*packet*/)
21902180
{
21912181
// Only players that has not yet gained any experience can use this

‎src/server/game/Handlers/GroupHandler.cpp‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -907,7 +907,7 @@ void WorldSession::HandleRequestPartyMemberStatsOpcode(WorldPacket &recvData)
907907
Player* player = ObjectAccessor::FindConnectedPlayer(guid);
908908
if (!player || !GetPlayer()->IsInSameRaidWith(player))
909909
{
910-
WorldPacket data(SMSG_PARTY_MEMBER_STATS_FULL, 3+4+2);
910+
WorldPacket data(SMSG_PARTY_MEMBER_STATS_FULL, 3 + 4 + 2);
911911
data << uint8(0); // only for SMSG_PARTY_MEMBER_STATS_FULL, probably arena/bg related
912912
data << guid.WriteAsPacked();
913913
data << uint32(GROUP_UPDATE_FLAG_STATUS);
@@ -919,7 +919,7 @@ void WorldSession::HandleRequestPartyMemberStatsOpcode(WorldPacket &recvData)
919919
Pet* pet = player->GetPet();
920920
Powers powerType = player->GetPowerType();
921921

922-
WorldPacket data(SMSG_PARTY_MEMBER_STATS_FULL, 4+2+2+2+1+2*6+8+1+8);
922+
WorldPacket data(SMSG_PARTY_MEMBER_STATS_FULL, 4 + 2 + 2 + 2 + 1 + 2 * 6 + 8 + 1 + 8);
923923
data << uint8(0); // only for SMSG_PARTY_MEMBER_STATS_FULL, probably arena/bg related
924924
data << player->GetPackGUID();
925925

‎src/server/game/Handlers/LFGHandler.cpp‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -286,9 +286,9 @@ void WorldSession::HandleLfrLeaveOpcode(WorldPacket& recvData)
286286
//sLFGMgr->LeaveLfr(GetPlayer(), dungeonId);
287287
}
288288

289-
void WorldSession::HandleLfgGetStatus(WorldPacket& /*recvData*/)
289+
void WorldSession::HandleDFGetJoinStatus(WorldPacket& /*recvData*/)
290290
{
291-
TC_LOG_DEBUG("lfg", "CMSG_LFG_GET_STATUS {}", GetPlayerInfo());
291+
TC_LOG_DEBUG("lfg", "CMSG_DF_GET_JOIN_STATUS {}", GetPlayerInfo());
292292

293293
ObjectGuid guid = GetPlayer()->GetGUID();
294294
lfg::LfgUpdateData updateData = sLFGMgr->GetLfgStatus(guid);

0 commit comments

Comments
 (0)