Skip to content

Commit 7473a6d

Browse files
author
Github Actions
committed
Merge 3.3.5 to 3.3.5-vas-autobalance
2 parents 2bba6ae + 00875fe commit 7473a6d

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
@@ -251,7 +251,7 @@ Player::Player(WorldSession* session): Unit(true)
251251
SetLastRuneGraceTimer(i, 0);
252252
}
253253

254-
for (uint8 i=0; i < MAX_TIMERS; i++)
254+
for (uint8 i = 0; i < MAX_TIMERS; i++)
255255
m_MirrorTimer[i] = DISABLED_MIRROR_TIMER;
256256

257257
m_MirrorTimerFlags = UNDERWATER_NONE;
@@ -512,7 +512,7 @@ bool Player::Create(ObjectGuid::LowType guidlow, CharacterCreateInfo* createInfo
512512
SetArenaFaction(0);
513513

514514
SetUInt32Value(PLAYER_GUILDID, 0);
515-
SetRank(0);
515+
SetGuildRank(0);
516516
SetUInt32Value(PLAYER_GUILD_TIMESTAMP, 0);
517517

518518
for (int i = 0; i < KNOWN_TITLES_SIZE; ++i)
@@ -16674,14 +16674,17 @@ void Player::SendQuestReward(Quest const* quest, uint32 XP) const
1667416674
{
1667516675
uint32 questId = quest->GetQuestId();
1667616676
sGameEventMgr->HandleQuestComplete(questId);
16677-
WorldPacket data(SMSG_QUESTGIVER_QUEST_COMPLETE, (4+4+4+4+4));
16678-
data << uint32(questId);
16677+
16678+
uint32 xp;
1667916679

1668016680
if (!IsMaxLevel())
16681-
data << uint32(XP);
16681+
xp = XP;
1668216682
else
16683-
data << uint32(0);
16683+
xp = 0;
1668416684

16685+
WorldPacket data(SMSG_QUESTGIVER_QUEST_COMPLETE, (4+4+4+4+4));
16686+
data << uint32(questId);
16687+
data << uint32(xp);
1668516688
data << uint32(quest->GetRewOrReqMoney(this));
1668616689
data << uint32(10 * quest->CalculateHonorGain(GetQuestLevel(quest)));
1668716690
data << uint32(quest->GetBonusTalents()); // bonus talents
@@ -18918,8 +18921,8 @@ void Player::SendSavedInstances()
1891818921
}
1891918922
}
1892018923

18921-
//Send opcode 811. true or false means, whether you have current raid/heroic instances
18922-
data.Initialize(SMSG_UPDATE_INSTANCE_OWNERSHIP);
18924+
//Send opcode SMSG_UPDATE_INSTANCE_OWNERSHIP. true or false means, whether you have current raid/heroic instances
18925+
data.Initialize(SMSG_UPDATE_INSTANCE_OWNERSHIP, 4);
1892318926
data << uint32(hasBeenSaved);
1892418927
SendDirectMessage(&data);
1892518928

@@ -18932,7 +18935,7 @@ void Player::SendSavedInstances()
1893218935
{
1893318936
if (itr->second.perm)
1893418937
{
18935-
data.Initialize(SMSG_UPDATE_LAST_INSTANCE);
18938+
data.Initialize(SMSG_UPDATE_LAST_INSTANCE, 4);
1893618939
data << uint32(itr->second.save->GetMapId());
1893718940
SendDirectMessage(&data);
1893818941
}
@@ -19699,7 +19702,7 @@ void Player::_SaveInventory(CharacterDatabaseTransaction trans)
1969919702
// save all changes to the item...
1970019703
if (item->GetState() != ITEM_NEW) // only for existing items, no duplicates
1970119704
item->SaveToDB(trans);
19702-
// ...but do not save position in invntory
19705+
// ...but do not save position in inventory
1970319706
continue;
1970419707
}
1970519708
}
@@ -20365,7 +20368,7 @@ void Player::SendResetInstanceFailed(uint32 reason, uint32 MapId) const
2036520368
// 1: There are players offline in your party.
2036620369
// 2>: There are players in your party attempting to zone into an instance.
2036720370
*/
20368-
WorldPacket data(SMSG_INSTANCE_RESET_FAILED, 4);
20371+
WorldPacket data(SMSG_INSTANCE_RESET_FAILED, 8);
2036920372
data << uint32(reason);
2037020373
data << uint32(MapId);
2037120374
SendDirectMessage(&data);
@@ -20675,6 +20678,16 @@ void Player::TextEmote(std::string_view text, WorldObject const* /*= nullptr*/,
2067520678
SendMessageToSetInRange(&data, sWorld->getFloatConfig(CONFIG_LISTEN_RANGE_TEXTEMOTE), true, !GetSession()->HasPermission(rbac::RBAC_PERM_TWO_SIDE_INTERACTION_CHAT), true);
2067620679
}
2067720680

20681+
void Player::WhisperAddon(std::string const& text, Player* receiver)
20682+
{
20683+
std::string _text(text);
20684+
sScriptMgr->OnPlayerChat(this, CHAT_MSG_WHISPER, uint32(LANG_ADDON), _text, receiver);
20685+
20686+
WorldPacket data;
20687+
ChatHandler::BuildChatPacket(data, CHAT_MSG_WHISPER, LANG_ADDON, this, this, _text);
20688+
receiver->SendDirectMessage(&data);
20689+
}
20690+
2067820691
void Player::TextEmote(uint32 textId, WorldObject const* target /*= nullptr*/, bool /*isBossEmote = false*/)
2067920692
{
2068020693
Talk(textId, CHAT_MSG_EMOTE, sWorld->getFloatConfig(CONFIG_LISTEN_RANGE_TEXTEMOTE), target);
@@ -26104,14 +26117,15 @@ void Player::SetReputation(uint32 factionentry, uint32 value)
2610426117
{
2610526118
GetReputationMgr().SetReputation(sFactionStore.LookupEntry(factionentry), value);
2610626119
}
26120+
2610726121
uint32 Player::GetReputation(uint32 factionentry) const
2610826122
{
2610926123
return GetReputationMgr().GetReputation(sFactionStore.LookupEntry(factionentry));
2611026124
}
2611126125

26112-
std::string const& Player::GetGuildName() const
26126+
std::string Player::GetGuildName() const
2611326127
{
26114-
return sGuildMgr->GetGuildById(GetGuildId())->GetName();
26128+
return GetGuildId() ? sGuildMgr->GetGuildById(GetGuildId())->GetName() : "";
2611526129
}
2611626130

2611726131
void Player::SendDuelCountdown(uint32 counter)
@@ -26204,6 +26218,26 @@ PetStable& Player::GetOrInitPetStable()
2620426218
return *m_petStable;
2620526219
}
2620626220

26221+
void Player::SendItemRefundResult(Item* item, ItemExtendedCostEntry const* iece, uint8 error) const
26222+
{
26223+
WorldPacket data(SMSG_ITEM_REFUND_RESULT, 8 + 4 + 4 + 4 + 4 + 4 * 4 + 4 * 4);
26224+
data << uint64(item->GetGUID()); // item guid
26225+
data << uint32(error); // 0, or error code
26226+
if (!error)
26227+
{
26228+
data << uint32(item->GetPaidMoney()); // money cost
26229+
data << uint32(iece->HonorPoints); // honor point cost
26230+
data << uint32(iece->ArenaPoints); // arena point cost
26231+
for (uint8 i = 0; i < MAX_ITEM_EXTENDED_COST_REQUIREMENTS; ++i) // item cost data
26232+
{
26233+
data << uint32(iece->ItemID[i]);
26234+
data << uint32(iece->ItemCount[i]);
26235+
}
26236+
}
26237+
26238+
SendDirectMessage(&data);
26239+
}
26240+
2620726241
void Player::RefundItem(Item* item)
2620826242
{
2620926243
if (!item->IsRefundable())
@@ -26215,10 +26249,7 @@ void Player::RefundItem(Item* item)
2621526249
if (item->IsRefundExpired()) // item refund has expired
2621626250
{
2621726251
item->SetNotRefundable(this);
26218-
WorldPacket data(SMSG_ITEM_REFUND_RESULT, 8+4);
26219-
data << uint64(item->GetGUID()); // Guid
26220-
data << uint32(10); // Error!
26221-
SendDirectMessage(&data);
26252+
SendItemRefundResult(item, nullptr, 10);
2622226253
return;
2622326254
}
2622426255

@@ -26256,25 +26287,11 @@ void Player::RefundItem(Item* item)
2625626287

2625726288
if (store_error)
2625826289
{
26259-
WorldPacket data(SMSG_ITEM_REFUND_RESULT, 8+4);
26260-
data << uint64(item->GetGUID()); // Guid
26261-
data << uint32(10); // Error!
26262-
SendDirectMessage(&data);
26290+
SendItemRefundResult(item, iece, 10);
2626326291
return;
2626426292
}
2626526293

26266-
WorldPacket data(SMSG_ITEM_REFUND_RESULT, 8+4+4+4+4+4*4+4*4);
26267-
data << uint64(item->GetGUID()); // item guid
26268-
data << uint32(0); // 0, or error code
26269-
data << uint32(item->GetPaidMoney()); // money cost
26270-
data << uint32(iece->HonorPoints); // honor point cost
26271-
data << uint32(iece->ArenaPoints); // arena point cost
26272-
for (uint8 i = 0; i < MAX_ITEM_EXTENDED_COST_REQUIREMENTS; ++i) // item cost data
26273-
{
26274-
data << uint32(iece->ItemID[i]);
26275-
data << uint32(iece->ItemCount[i]);
26276-
}
26277-
SendDirectMessage(&data);
26294+
SendItemRefundResult(item, iece, 0);
2627826295

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

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
@@ -11103,8 +11103,9 @@ bool Unit::InitTamedPet(Pet* pet, uint8 level, uint32 spell_id)
1110311103
// only if not player and not controlled by player pet. And not at BG
1110411104
if ((durabilityLoss && !player && !victim->ToPlayer()->InBattleground()) || (player && sWorld->getBoolConfig(CONFIG_DURABILITY_LOSS_IN_PVP)))
1110511105
{
11106-
TC_LOG_DEBUG("entities.unit", "We are dead, losing {} percent durability", sWorld->getRate(RATE_DURABILITY_LOSS_ON_DEATH));
11107-
plrVictim->DurabilityLossAll(sWorld->getRate(RATE_DURABILITY_LOSS_ON_DEATH), false);
11106+
double baseLoss = sWorld->getRate(RATE_DURABILITY_LOSS_ON_DEATH);
11107+
TC_LOG_DEBUG("entities.unit", "We are dead, losing {} percent durability", baseLoss);
11108+
plrVictim->DurabilityLossAll(baseLoss, false);
1110811109
// durability lost message
1110911110
plrVictim->SendDurabilityLoss();
1111011111
}
@@ -12213,6 +12214,17 @@ void Unit::UpdateObjectVisibility(bool forced)
1221312214
}
1221412215
}
1221512216

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

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

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)