Skip to content

Commit 0b55c6b

Browse files
author
Github Actions
committed
Merge 3.3.5 to 3.3.5-base_patch
2 parents 760ef3b + 00875fe commit 0b55c6b

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
@@ -263,7 +263,7 @@ Player::Player(WorldSession* session): Unit(true)
263263
SetLastRuneGraceTimer(i, 0);
264264
}
265265

266-
for (uint8 i=0; i < MAX_TIMERS; i++)
266+
for (uint8 i = 0; i < MAX_TIMERS; i++)
267267
m_MirrorTimer[i] = DISABLED_MIRROR_TIMER;
268268

269269
m_MirrorTimerFlags = UNDERWATER_NONE;
@@ -524,7 +524,7 @@ bool Player::Create(ObjectGuid::LowType guidlow, CharacterCreateInfo* createInfo
524524
SetArenaFaction(0);
525525

526526
SetUInt32Value(PLAYER_GUILDID, 0);
527-
SetRank(0);
527+
SetGuildRank(0);
528528
SetUInt32Value(PLAYER_GUILD_TIMESTAMP, 0);
529529

530530
for (int i = 0; i < KNOWN_TITLES_SIZE; ++i)
@@ -16686,14 +16686,17 @@ void Player::SendQuestReward(Quest const* quest, uint32 XP) const
1668616686
{
1668716687
uint32 questId = quest->GetQuestId();
1668816688
sGameEventMgr->HandleQuestComplete(questId);
16689-
WorldPacket data(SMSG_QUESTGIVER_QUEST_COMPLETE, (4+4+4+4+4));
16690-
data << uint32(questId);
16689+
16690+
uint32 xp;
1669116691

1669216692
if (!IsMaxLevel())
16693-
data << uint32(XP);
16693+
xp = XP;
1669416694
else
16695-
data << uint32(0);
16695+
xp = 0;
1669616696

16697+
WorldPacket data(SMSG_QUESTGIVER_QUEST_COMPLETE, (4+4+4+4+4));
16698+
data << uint32(questId);
16699+
data << uint32(xp);
1669716700
data << uint32(quest->GetRewOrReqMoney(this));
1669816701
data << uint32(10 * quest->CalculateHonorGain(GetQuestLevel(quest)));
1669916702
data << uint32(quest->GetBonusTalents()); // bonus talents
@@ -18930,8 +18933,8 @@ void Player::SendSavedInstances()
1893018933
}
1893118934
}
1893218935

18933-
//Send opcode 811. true or false means, whether you have current raid/heroic instances
18934-
data.Initialize(SMSG_UPDATE_INSTANCE_OWNERSHIP);
18936+
//Send opcode SMSG_UPDATE_INSTANCE_OWNERSHIP. true or false means, whether you have current raid/heroic instances
18937+
data.Initialize(SMSG_UPDATE_INSTANCE_OWNERSHIP, 4);
1893518938
data << uint32(hasBeenSaved);
1893618939
SendDirectMessage(&data);
1893718940

@@ -18944,7 +18947,7 @@ void Player::SendSavedInstances()
1894418947
{
1894518948
if (itr->second.perm)
1894618949
{
18947-
data.Initialize(SMSG_UPDATE_LAST_INSTANCE);
18950+
data.Initialize(SMSG_UPDATE_LAST_INSTANCE, 4);
1894818951
data << uint32(itr->second.save->GetMapId());
1894918952
SendDirectMessage(&data);
1895018953
}
@@ -19711,7 +19714,7 @@ void Player::_SaveInventory(CharacterDatabaseTransaction trans)
1971119714
// save all changes to the item...
1971219715
if (item->GetState() != ITEM_NEW) // only for existing items, no duplicates
1971319716
item->SaveToDB(trans);
19714-
// ...but do not save position in invntory
19717+
// ...but do not save position in inventory
1971519718
continue;
1971619719
}
1971719720
}
@@ -20377,7 +20380,7 @@ void Player::SendResetInstanceFailed(uint32 reason, uint32 MapId) const
2037720380
// 1: There are players offline in your party.
2037820381
// 2>: There are players in your party attempting to zone into an instance.
2037920382
*/
20380-
WorldPacket data(SMSG_INSTANCE_RESET_FAILED, 4);
20383+
WorldPacket data(SMSG_INSTANCE_RESET_FAILED, 8);
2038120384
data << uint32(reason);
2038220385
data << uint32(MapId);
2038320386
SendDirectMessage(&data);
@@ -20687,6 +20690,16 @@ void Player::TextEmote(std::string_view text, WorldObject const* /*= nullptr*/,
2068720690
SendMessageToSetInRange(&data, sWorld->getFloatConfig(CONFIG_LISTEN_RANGE_TEXTEMOTE), true, !GetSession()->HasPermission(rbac::RBAC_PERM_TWO_SIDE_INTERACTION_CHAT), true);
2068820691
}
2068920692

20693+
void Player::WhisperAddon(std::string const& text, Player* receiver)
20694+
{
20695+
std::string _text(text);
20696+
sScriptMgr->OnPlayerChat(this, CHAT_MSG_WHISPER, uint32(LANG_ADDON), _text, receiver);
20697+
20698+
WorldPacket data;
20699+
ChatHandler::BuildChatPacket(data, CHAT_MSG_WHISPER, LANG_ADDON, this, this, _text);
20700+
receiver->SendDirectMessage(&data);
20701+
}
20702+
2069020703
void Player::TextEmote(uint32 textId, WorldObject const* target /*= nullptr*/, bool /*isBossEmote = false*/)
2069120704
{
2069220705
Talk(textId, CHAT_MSG_EMOTE, sWorld->getFloatConfig(CONFIG_LISTEN_RANGE_TEXTEMOTE), target);
@@ -26116,14 +26129,15 @@ void Player::SetReputation(uint32 factionentry, uint32 value)
2611626129
{
2611726130
GetReputationMgr().SetReputation(sFactionStore.LookupEntry(factionentry), value);
2611826131
}
26132+
2611926133
uint32 Player::GetReputation(uint32 factionentry) const
2612026134
{
2612126135
return GetReputationMgr().GetReputation(sFactionStore.LookupEntry(factionentry));
2612226136
}
2612326137

26124-
std::string const& Player::GetGuildName() const
26138+
std::string Player::GetGuildName() const
2612526139
{
26126-
return sGuildMgr->GetGuildById(GetGuildId())->GetName();
26140+
return GetGuildId() ? sGuildMgr->GetGuildById(GetGuildId())->GetName() : "";
2612726141
}
2612826142

2612926143
void Player::SendDuelCountdown(uint32 counter)
@@ -26216,6 +26230,26 @@ PetStable& Player::GetOrInitPetStable()
2621626230
return *m_petStable;
2621726231
}
2621826232

26233+
void Player::SendItemRefundResult(Item* item, ItemExtendedCostEntry const* iece, uint8 error) const
26234+
{
26235+
WorldPacket data(SMSG_ITEM_REFUND_RESULT, 8 + 4 + 4 + 4 + 4 + 4 * 4 + 4 * 4);
26236+
data << uint64(item->GetGUID()); // item guid
26237+
data << uint32(error); // 0, or error code
26238+
if (!error)
26239+
{
26240+
data << uint32(item->GetPaidMoney()); // money cost
26241+
data << uint32(iece->HonorPoints); // honor point cost
26242+
data << uint32(iece->ArenaPoints); // arena point cost
26243+
for (uint8 i = 0; i < MAX_ITEM_EXTENDED_COST_REQUIREMENTS; ++i) // item cost data
26244+
{
26245+
data << uint32(iece->ItemID[i]);
26246+
data << uint32(iece->ItemCount[i]);
26247+
}
26248+
}
26249+
26250+
SendDirectMessage(&data);
26251+
}
26252+
2621926253
void Player::RefundItem(Item* item)
2622026254
{
2622126255
if (!item->IsRefundable())
@@ -26227,10 +26261,7 @@ void Player::RefundItem(Item* item)
2622726261
if (item->IsRefundExpired()) // item refund has expired
2622826262
{
2622926263
item->SetNotRefundable(this);
26230-
WorldPacket data(SMSG_ITEM_REFUND_RESULT, 8+4);
26231-
data << uint64(item->GetGUID()); // Guid
26232-
data << uint32(10); // Error!
26233-
SendDirectMessage(&data);
26264+
SendItemRefundResult(item, nullptr, 10);
2623426265
return;
2623526266
}
2623626267

@@ -26268,25 +26299,11 @@ void Player::RefundItem(Item* item)
2626826299

2626926300
if (store_error)
2627026301
{
26271-
WorldPacket data(SMSG_ITEM_REFUND_RESULT, 8+4);
26272-
data << uint64(item->GetGUID()); // Guid
26273-
data << uint32(10); // Error!
26274-
SendDirectMessage(&data);
26302+
SendItemRefundResult(item, iece, 10);
2627526303
return;
2627626304
}
2627726305

26278-
WorldPacket data(SMSG_ITEM_REFUND_RESULT, 8+4+4+4+4+4*4+4*4);
26279-
data << uint64(item->GetGUID()); // item guid
26280-
data << uint32(0); // 0, or error code
26281-
data << uint32(item->GetPaidMoney()); // money cost
26282-
data << uint32(iece->HonorPoints); // honor point cost
26283-
data << uint32(iece->ArenaPoints); // arena point cost
26284-
for (uint8 i = 0; i < MAX_ITEM_EXTENDED_COST_REQUIREMENTS; ++i) // item cost data
26285-
{
26286-
data << uint32(iece->ItemID[i]);
26287-
data << uint32(iece->ItemCount[i]);
26288-
}
26289-
SendDirectMessage(&data);
26306+
SendItemRefundResult(item, iece, 0);
2629026307

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

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();
@@ -2495,6 +2497,7 @@ class TC_GAME_API Player : public Unit, public GridObject<Player>
24952497
GuidSet m_refundableItems;
24962498
void SendRefundInfo(Item* item);
24972499
void RefundItem(Item* item);
2500+
void SendItemRefundResult(Item* item, ItemExtendedCostEntry const* iece, uint8 error) const;
24982501

24992502
// know currencies are not removed at any point (0 displayed)
25002503
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
@@ -11100,8 +11100,9 @@ bool Unit::InitTamedPet(Pet* pet, uint8 level, uint32 spell_id)
1110011100
// only if not player and not controlled by player pet. And not at BG
1110111101
if ((durabilityLoss && !player && !victim->ToPlayer()->InBattleground()) || (player && sWorld->getBoolConfig(CONFIG_DURABILITY_LOSS_IN_PVP)))
1110211102
{
11103-
TC_LOG_DEBUG("entities.unit", "We are dead, losing {} percent durability", sWorld->getRate(RATE_DURABILITY_LOSS_ON_DEATH));
11104-
plrVictim->DurabilityLossAll(sWorld->getRate(RATE_DURABILITY_LOSS_ON_DEATH), false);
11103+
double baseLoss = sWorld->getRate(RATE_DURABILITY_LOSS_ON_DEATH);
11104+
TC_LOG_DEBUG("entities.unit", "We are dead, losing {} percent durability", baseLoss);
11105+
plrVictim->DurabilityLossAll(baseLoss, false);
1110511106
// durability lost message
1110611107
plrVictim->SendDurabilityLoss();
1110711108
}
@@ -12210,6 +12211,17 @@ void Unit::UpdateObjectVisibility(bool forced)
1221012211
}
1221112212
}
1221212213

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

1223312237
if (HasAuraType(SPELL_AURA_MOD_INCREASE_MOUNTED_FLIGHT_SPEED) || HasAuraType(SPELL_AURA_FLY))
1223412238
SetCanFly(true, true);
@@ -12474,15 +12478,7 @@ void Unit::JumpTo(float speedXY, float speedZ, bool forward, Optional<Position>
1247412478
{
1247512479
float vcos = std::cos(angle+GetOrientation());
1247612480
float vsin = std::sin(angle+GetOrientation());
12477-
12478-
WorldPacket data(SMSG_MOVE_KNOCK_BACK, (8+4+4+4+4+4));
12479-
data << GetPackGUID();
12480-
data << uint32(0); // Sequence
12481-
data << TaggedPosition<Position::XY>(vcos, vsin);
12482-
data << float(speedXY); // Horizontal speed
12483-
data << float(-speedZ); // Z Movement speed (vertical)
12484-
12485-
ToPlayer()->SendDirectMessage(&data);
12481+
SendMoveKnockBack(ToPlayer(), speedXY, -speedZ, vcos, vsin);
1248612482
}
1248712483
}
1248812484

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)