Skip to content

Commit 84aa463

Browse files
author
Github Actions
committed
Merge 3.3.5-base_patch to 3.3.5-passive_anticheat
2 parents 937df1c + 0b55c6b commit 84aa463

File tree

25 files changed

+355
-292
lines changed

25 files changed

+355
-292
lines changed
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
ALTER TABLE `creature_classlevelstats` CHANGE `basehp0` `basehp0` int unsigned NOT NULL DEFAULT '1';
2+
ALTER TABLE `creature_classlevelstats` CHANGE `basehp1` `basehp1` int unsigned NOT NULL DEFAULT '1';
3+
ALTER TABLE `creature_classlevelstats` CHANGE `basehp2` `basehp2` int unsigned NOT NULL DEFAULT '1';
4+
ALTER TABLE `creature_classlevelstats` CHANGE `basemana` `basemana` int unsigned NOT NULL DEFAULT '1';
5+
ALTER TABLE `creature_classlevelstats` CHANGE `basearmor` `basearmor` int unsigned NOT NULL DEFAULT '1';

sql/updates/world/3.3.5/2025_02_02_00_world.sql

Lines changed: 215 additions & 0 deletions
Large diffs are not rendered by default.

src/server/database/Database/Implementation/CharacterDatabase.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ void CharacterDatabaseConnection::DoPrepareStatements()
176176
// 0: uint32, 1: uint8, 3: string, 4: uint32, 5: uint32
177177
PrepareStatement(CHAR_INS_GUILD_RANK, "INSERT INTO guild_rank (guildid, rid, rname, rights, BankMoneyPerDay) VALUES (?, ?, ?, ?, ?)", CONNECTION_ASYNC);
178178
PrepareStatement(CHAR_DEL_GUILD_RANKS, "DELETE FROM guild_rank WHERE guildid = ?", CONNECTION_ASYNC); // 0: uint32
179-
PrepareStatement(CHAR_DEL_GUILD_LOWEST_RANK, "DELETE FROM guild_rank WHERE guildid = ? AND rid >= ?", CONNECTION_ASYNC); // 0: uint32, 1: uint8
179+
PrepareStatement(CHAR_DEL_GUILD_RANK, "DELETE FROM guild_rank WHERE guildid = ? AND rid = ?", CONNECTION_ASYNC); // 0: uint32, 1: uint8
180180
PrepareStatement(CHAR_INS_GUILD_BANK_TAB, "INSERT INTO guild_bank_tab (guildid, TabId) VALUES (?, ?)", CONNECTION_ASYNC); // 0: uint32, 1: uint8
181181
PrepareStatement(CHAR_DEL_GUILD_BANK_TAB, "DELETE FROM guild_bank_tab WHERE guildid = ? AND TabId = ?", CONNECTION_ASYNC); // 0: uint32, 1: uint8
182182
PrepareStatement(CHAR_DEL_GUILD_BANK_TABS, "DELETE FROM guild_bank_tab WHERE guildid = ?", CONNECTION_ASYNC); // 0: uint32

src/server/database/Database/Implementation/CharacterDatabase.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ enum CharacterDatabaseStatements : uint32
155155
CHAR_DEL_GUILD_MEMBERS,
156156
CHAR_INS_GUILD_RANK,
157157
CHAR_DEL_GUILD_RANKS,
158-
CHAR_DEL_GUILD_LOWEST_RANK,
158+
CHAR_DEL_GUILD_RANK,
159159
CHAR_INS_GUILD_BANK_TAB,
160160
CHAR_DEL_GUILD_BANK_TAB,
161161
CHAR_DEL_GUILD_BANK_TABS,

src/server/game/Battlegrounds/Battleground.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -769,6 +769,10 @@ void Battleground::EndBattleground(uint32 winner)
769769
CharacterDatabase.Execute(stmt);
770770
}
771771

772+
// remove temporary currency bonus auras before rewarding player
773+
player->RemoveAura(SPELL_HONORABLE_DEFENDER_25Y);
774+
player->RemoveAura(SPELL_HONORABLE_DEFENDER_60Y);
775+
772776
// Reward winner team
773777
if (team == winner)
774778
{

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

Lines changed: 50 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -265,7 +265,7 @@ Player::Player(WorldSession* session): Unit(true)
265265
SetLastRuneGraceTimer(i, 0);
266266
}
267267

268-
for (uint8 i=0; i < MAX_TIMERS; i++)
268+
for (uint8 i = 0; i < MAX_TIMERS; i++)
269269
m_MirrorTimer[i] = DISABLED_MIRROR_TIMER;
270270

271271
m_MirrorTimerFlags = UNDERWATER_NONE;
@@ -526,7 +526,7 @@ bool Player::Create(ObjectGuid::LowType guidlow, CharacterCreateInfo* createInfo
526526
SetArenaFaction(0);
527527

528528
SetUInt32Value(PLAYER_GUILDID, 0);
529-
SetRank(0);
529+
SetGuildRank(0);
530530
SetUInt32Value(PLAYER_GUILD_TIMESTAMP, 0);
531531

532532
for (int i = 0; i < KNOWN_TITLES_SIZE; ++i)
@@ -16694,14 +16694,17 @@ void Player::SendQuestReward(Quest const* quest, uint32 XP) const
1669416694
{
1669516695
uint32 questId = quest->GetQuestId();
1669616696
sGameEventMgr->HandleQuestComplete(questId);
16697-
WorldPacket data(SMSG_QUESTGIVER_QUEST_COMPLETE, (4+4+4+4+4));
16698-
data << uint32(questId);
16697+
16698+
uint32 xp;
1669916699

1670016700
if (!IsMaxLevel())
16701-
data << uint32(XP);
16701+
xp = XP;
1670216702
else
16703-
data << uint32(0);
16703+
xp = 0;
1670416704

16705+
WorldPacket data(SMSG_QUESTGIVER_QUEST_COMPLETE, (4+4+4+4+4));
16706+
data << uint32(questId);
16707+
data << uint32(xp);
1670516708
data << uint32(quest->GetRewOrReqMoney(this));
1670616709
data << uint32(10 * quest->CalculateHonorGain(GetQuestLevel(quest)));
1670716710
data << uint32(quest->GetBonusTalents()); // bonus talents
@@ -18938,8 +18941,8 @@ void Player::SendSavedInstances()
1893818941
}
1893918942
}
1894018943

18941-
//Send opcode 811. true or false means, whether you have current raid/heroic instances
18942-
data.Initialize(SMSG_UPDATE_INSTANCE_OWNERSHIP);
18944+
//Send opcode SMSG_UPDATE_INSTANCE_OWNERSHIP. true or false means, whether you have current raid/heroic instances
18945+
data.Initialize(SMSG_UPDATE_INSTANCE_OWNERSHIP, 4);
1894318946
data << uint32(hasBeenSaved);
1894418947
SendDirectMessage(&data);
1894518948

@@ -18952,7 +18955,7 @@ void Player::SendSavedInstances()
1895218955
{
1895318956
if (itr->second.perm)
1895418957
{
18955-
data.Initialize(SMSG_UPDATE_LAST_INSTANCE);
18958+
data.Initialize(SMSG_UPDATE_LAST_INSTANCE, 4);
1895618959
data << uint32(itr->second.save->GetMapId());
1895718960
SendDirectMessage(&data);
1895818961
}
@@ -19725,7 +19728,7 @@ void Player::_SaveInventory(CharacterDatabaseTransaction trans)
1972519728
// save all changes to the item...
1972619729
if (item->GetState() != ITEM_NEW) // only for existing items, no duplicates
1972719730
item->SaveToDB(trans);
19728-
// ...but do not save position in invntory
19731+
// ...but do not save position in inventory
1972919732
continue;
1973019733
}
1973119734
}
@@ -20391,7 +20394,7 @@ void Player::SendResetInstanceFailed(uint32 reason, uint32 MapId) const
2039120394
// 1: There are players offline in your party.
2039220395
// 2>: There are players in your party attempting to zone into an instance.
2039320396
*/
20394-
WorldPacket data(SMSG_INSTANCE_RESET_FAILED, 4);
20397+
WorldPacket data(SMSG_INSTANCE_RESET_FAILED, 8);
2039520398
data << uint32(reason);
2039620399
data << uint32(MapId);
2039720400
SendDirectMessage(&data);
@@ -20701,6 +20704,16 @@ void Player::TextEmote(std::string_view text, WorldObject const* /*= nullptr*/,
2070120704
SendMessageToSetInRange(&data, sWorld->getFloatConfig(CONFIG_LISTEN_RANGE_TEXTEMOTE), true, !GetSession()->HasPermission(rbac::RBAC_PERM_TWO_SIDE_INTERACTION_CHAT), true);
2070220705
}
2070320706

20707+
void Player::WhisperAddon(std::string const& text, Player* receiver)
20708+
{
20709+
std::string _text(text);
20710+
sScriptMgr->OnPlayerChat(this, CHAT_MSG_WHISPER, uint32(LANG_ADDON), _text, receiver);
20711+
20712+
WorldPacket data;
20713+
ChatHandler::BuildChatPacket(data, CHAT_MSG_WHISPER, LANG_ADDON, this, this, _text);
20714+
receiver->SendDirectMessage(&data);
20715+
}
20716+
2070420717
void Player::TextEmote(uint32 textId, WorldObject const* target /*= nullptr*/, bool /*isBossEmote = false*/)
2070520718
{
2070620719
Talk(textId, CHAT_MSG_EMOTE, sWorld->getFloatConfig(CONFIG_LISTEN_RANGE_TEXTEMOTE), target);
@@ -26130,14 +26143,15 @@ void Player::SetReputation(uint32 factionentry, uint32 value)
2613026143
{
2613126144
GetReputationMgr().SetReputation(sFactionStore.LookupEntry(factionentry), value);
2613226145
}
26146+
2613326147
uint32 Player::GetReputation(uint32 factionentry) const
2613426148
{
2613526149
return GetReputationMgr().GetReputation(sFactionStore.LookupEntry(factionentry));
2613626150
}
2613726151

26138-
std::string const& Player::GetGuildName() const
26152+
std::string Player::GetGuildName() const
2613926153
{
26140-
return sGuildMgr->GetGuildById(GetGuildId())->GetName();
26154+
return GetGuildId() ? sGuildMgr->GetGuildById(GetGuildId())->GetName() : "";
2614126155
}
2614226156

2614326157
void Player::SendDuelCountdown(uint32 counter)
@@ -26230,6 +26244,26 @@ PetStable& Player::GetOrInitPetStable()
2623026244
return *m_petStable;
2623126245
}
2623226246

26247+
void Player::SendItemRefundResult(Item* item, ItemExtendedCostEntry const* iece, uint8 error) const
26248+
{
26249+
WorldPacket data(SMSG_ITEM_REFUND_RESULT, 8 + 4 + 4 + 4 + 4 + 4 * 4 + 4 * 4);
26250+
data << uint64(item->GetGUID()); // item guid
26251+
data << uint32(error); // 0, or error code
26252+
if (!error)
26253+
{
26254+
data << uint32(item->GetPaidMoney()); // money cost
26255+
data << uint32(iece->HonorPoints); // honor point cost
26256+
data << uint32(iece->ArenaPoints); // arena point cost
26257+
for (uint8 i = 0; i < MAX_ITEM_EXTENDED_COST_REQUIREMENTS; ++i) // item cost data
26258+
{
26259+
data << uint32(iece->ItemID[i]);
26260+
data << uint32(iece->ItemCount[i]);
26261+
}
26262+
}
26263+
26264+
SendDirectMessage(&data);
26265+
}
26266+
2623326267
void Player::RefundItem(Item* item)
2623426268
{
2623526269
if (!item->IsRefundable())
@@ -26241,10 +26275,7 @@ void Player::RefundItem(Item* item)
2624126275
if (item->IsRefundExpired()) // item refund has expired
2624226276
{
2624326277
item->SetNotRefundable(this);
26244-
WorldPacket data(SMSG_ITEM_REFUND_RESULT, 8+4);
26245-
data << uint64(item->GetGUID()); // Guid
26246-
data << uint32(10); // Error!
26247-
SendDirectMessage(&data);
26278+
SendItemRefundResult(item, nullptr, 10);
2624826279
return;
2624926280
}
2625026281

@@ -26282,25 +26313,11 @@ void Player::RefundItem(Item* item)
2628226313

2628326314
if (store_error)
2628426315
{
26285-
WorldPacket data(SMSG_ITEM_REFUND_RESULT, 8+4);
26286-
data << uint64(item->GetGUID()); // Guid
26287-
data << uint32(10); // Error!
26288-
SendDirectMessage(&data);
26316+
SendItemRefundResult(item, iece, 10);
2628926317
return;
2629026318
}
2629126319

26292-
WorldPacket data(SMSG_ITEM_REFUND_RESULT, 8+4+4+4+4+4*4+4*4);
26293-
data << uint64(item->GetGUID()); // item guid
26294-
data << uint32(0); // 0, or error code
26295-
data << uint32(item->GetPaidMoney()); // money cost
26296-
data << uint32(iece->HonorPoints); // honor point cost
26297-
data << uint32(iece->ArenaPoints); // arena point cost
26298-
for (uint8 i = 0; i < MAX_ITEM_EXTENDED_COST_REQUIREMENTS; ++i) // item cost data
26299-
{
26300-
data << uint32(iece->ItemID[i]);
26301-
data << uint32(iece->ItemCount[i]);
26302-
}
26303-
SendDirectMessage(&data);
26320+
SendItemRefundResult(item, iece, 0);
2630426321

2630526322
uint32 moneyRefund = item->GetPaidMoney(); // item-> will be invalidated in DestroyItem
2630626323

src/server/game/Entities/Player/Player.h

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ struct CharTitlesEntry;
4444
struct ChatChannelsEntry;
4545
struct CreatureTemplate;
4646
struct FactionEntry;
47+
struct ItemExtendedCostEntry;
4748
struct ItemSetEffect;
4849
struct ItemTemplate;
4950
struct Loot;
@@ -1079,6 +1080,7 @@ class TC_GAME_API Player : public Unit, public GridObject<Player>
10791080
/// Handles whispers from Addons and players based on sender, receiver's guid and language.
10801081
void Whisper(std::string_view text, Language language, Player* receiver, bool = false) override;
10811082
void Whisper(uint32 textId, Player* target, bool isBossWhisper = false) override;
1083+
void WhisperAddon(std::string const& text, Player* receiver);
10821084

10831085
/*********************************************************/
10841086
/*** STORAGE SYSTEM ***/
@@ -1471,7 +1473,7 @@ class TC_GAME_API Player : public Unit, public GridObject<Player>
14711473
void RemoveTemporarySpell(uint32 spellId);
14721474
void SetReputation(uint32 factionentry, uint32 value);
14731475
uint32 GetReputation(uint32 factionentry) const;
1474-
std::string const& GetGuildName() const;
1476+
std::string GetGuildName() const;
14751477

14761478
// Talents
14771479
uint32 GetFreeTalentPoints() const { return GetUInt32Value(PLAYER_CHARACTER_POINTS1); }
@@ -1605,8 +1607,8 @@ class TC_GAME_API Player : public Unit, public GridObject<Player>
16051607
void SendUpdateToOutOfRangeGroupMembers();
16061608

16071609
void SetInGuild(uint32 guildId);
1608-
void SetRank(uint8 rankId) { SetUInt32Value(PLAYER_GUILDRANK, rankId); }
1609-
uint8 GetRank() const { return uint8(GetUInt32Value(PLAYER_GUILDRANK)); }
1610+
void SetGuildRank(uint8 rankId) { SetUInt32Value(PLAYER_GUILDRANK, rankId); }
1611+
uint8 GetGuildRank() const { return uint8(GetUInt32Value(PLAYER_GUILDRANK)); }
16101612
void SetGuildIdInvited(uint32 GuildId) { m_GuildIdInvited = GuildId; }
16111613
uint32 GetGuildId() const { return GetUInt32Value(PLAYER_GUILDID); }
16121614
Guild* GetGuild();
@@ -2497,6 +2499,7 @@ class TC_GAME_API Player : public Unit, public GridObject<Player>
24972499
GuidSet m_refundableItems;
24982500
void SendRefundInfo(Item* item);
24992501
void RefundItem(Item* item);
2502+
void SendItemRefundResult(Item* item, ItemExtendedCostEntry const* iece, uint8 error) const;
25002503

25012504
// know currencies are not removed at any point (0 displayed)
25022505
void AddKnownCurrency(uint32 itemId);

src/server/game/Entities/Unit/Unit.cpp

Lines changed: 16 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -11102,8 +11102,9 @@ bool Unit::InitTamedPet(Pet* pet, uint8 level, uint32 spell_id)
1110211102
// only if not player and not controlled by player pet. And not at BG
1110311103
if ((durabilityLoss && !player && !victim->ToPlayer()->InBattleground()) || (player && sWorld->getBoolConfig(CONFIG_DURABILITY_LOSS_IN_PVP)))
1110411104
{
11105-
TC_LOG_DEBUG("entities.unit", "We are dead, losing {} percent durability", sWorld->getRate(RATE_DURABILITY_LOSS_ON_DEATH));
11106-
plrVictim->DurabilityLossAll(sWorld->getRate(RATE_DURABILITY_LOSS_ON_DEATH), false);
11105+
double baseLoss = sWorld->getRate(RATE_DURABILITY_LOSS_ON_DEATH);
11106+
TC_LOG_DEBUG("entities.unit", "We are dead, losing {} percent durability", baseLoss);
11107+
plrVictim->DurabilityLossAll(baseLoss, false);
1110711108
// durability lost message
1110811109
plrVictim->SendDurabilityLoss();
1110911110
}
@@ -12212,6 +12213,17 @@ void Unit::UpdateObjectVisibility(bool forced)
1221212213
}
1221312214
}
1221412215

12216+
void Unit::SendMoveKnockBack(Player* player, float speedXY, float speedZ, float vcos, float vsin)
12217+
{
12218+
WorldPacket data(SMSG_MOVE_KNOCK_BACK, (8 + 4 + 4 + 4 + 4 + 4));
12219+
data << GetPackGUID();
12220+
data << uint32(0); // counter
12221+
data << TaggedPosition<Position::XY>(vcos, vsin);
12222+
data << float(speedXY); // Horizontal speed
12223+
data << float(speedZ); // Z Movement speed (vertical)
12224+
player->SendDirectMessage(&data);
12225+
}
12226+
1221512227
void Unit::KnockbackFrom(float x, float y, float speedXY, float speedZ)
1221612228
{
1221712229
if (IsMovedByServer())
@@ -12222,15 +12234,7 @@ void Unit::KnockbackFrom(float x, float y, float speedXY, float speedZ)
1222212234
{
1222312235
float vcos, vsin;
1222412236
GetSinCos(x, y, vsin, vcos);
12225-
12226-
WorldPacket data(SMSG_MOVE_KNOCK_BACK, (8 + 4 + 4 + 4 + 4 + 4));
12227-
data << GetPackGUID();
12228-
data << uint32(0); // counter
12229-
data << TaggedPosition<Position::XY>(vcos, vsin);
12230-
data << float(speedXY); // Horizontal speed
12231-
data << float(-speedZ); // Z Movement speed (vertical)
12232-
12233-
GetGameClientMovingMe()->SendDirectMessage(&data);
12237+
SendMoveKnockBack(GetGameClientMovingMe()->GetBasePlayer(), speedXY, -speedZ, vcos, vsin);
1223412238

1223512239
if (HasAuraType(SPELL_AURA_MOD_INCREASE_MOUNTED_FLIGHT_SPEED) || HasAuraType(SPELL_AURA_FLY))
1223612240
SetCanFly(true, true);
@@ -12476,15 +12480,7 @@ void Unit::JumpTo(float speedXY, float speedZ, bool forward, Optional<Position>
1247612480
{
1247712481
float vcos = std::cos(angle+GetOrientation());
1247812482
float vsin = std::sin(angle+GetOrientation());
12479-
12480-
WorldPacket data(SMSG_MOVE_KNOCK_BACK, (8+4+4+4+4+4));
12481-
data << GetPackGUID();
12482-
data << uint32(0); // Sequence
12483-
data << TaggedPosition<Position::XY>(vcos, vsin);
12484-
data << float(speedXY); // Horizontal speed
12485-
data << float(-speedZ); // Z Movement speed (vertical)
12486-
12487-
ToPlayer()->SendDirectMessage(&data);
12483+
SendMoveKnockBack(ToPlayer(), speedXY, -speedZ, vcos, vsin);
1248812484
}
1248912485
}
1249012486

src/server/game/Entities/Unit/Unit.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1204,6 +1204,7 @@ class TC_GAME_API Unit : public WorldObject
12041204
void UpdateOrientation(float orientation);
12051205
void UpdateHeight(float newZ);
12061206

1207+
void SendMoveKnockBack(Player* player, float speedXY, float speedZ, float vcos, float vsin);
12071208
void KnockbackFrom(float x, float y, float speedXY, float speedZ);
12081209
void JumpTo(float speedXY, float speedZ, bool forward = true, Optional<Position> dest = {});
12091210
void JumpTo(WorldObject* obj, float speedZ, bool withOrientation = false);

src/server/game/Globals/ObjectMgr.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10041,7 +10041,7 @@ void ObjectMgr::LoadCreatureClassLevelStats()
1004110041

1004210042
for (uint8 i = 0; i < MAX_EXPANSIONS; ++i)
1004310043
{
10044-
stats.BaseHealth[i] = fields[2 + i].GetUInt16();
10044+
stats.BaseHealth[i] = fields[2 + i].GetUInt32();
1004510045

1004610046
if (stats.BaseHealth[i] == 0)
1004710047
{
@@ -10057,8 +10057,8 @@ void ObjectMgr::LoadCreatureClassLevelStats()
1005710057
}
1005810058
}
1005910059

10060-
stats.BaseMana = fields[5].GetUInt16();
10061-
stats.BaseArmor = fields[6].GetUInt16();
10060+
stats.BaseMana = fields[5].GetUInt32();
10061+
stats.BaseArmor = fields[6].GetUInt32();
1006210062

1006310063
stats.AttackPower = fields[7].GetUInt16();
1006410064
stats.RangedAttackPower = fields[8].GetUInt16();

0 commit comments

Comments
 (0)