From 41e48ff2e1464e0ea1271b4b171d2ea4460c41eb Mon Sep 17 00:00:00 2001 From: Shocker Date: Sat, 26 Nov 2011 23:41:21 +0200 Subject: [PATCH 1/6] Core/Battlegrounds: Remove temporary currency bonus auras before rewarding player at battleground end (cherry picked from commit a2f6a2b6ca1473bb2581960132958d869feaa7cd) --- src/server/game/Battlegrounds/Battleground.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/server/game/Battlegrounds/Battleground.cpp b/src/server/game/Battlegrounds/Battleground.cpp index 938ac559b4c..b8fdda378f1 100644 --- a/src/server/game/Battlegrounds/Battleground.cpp +++ b/src/server/game/Battlegrounds/Battleground.cpp @@ -769,6 +769,10 @@ void Battleground::EndBattleground(uint32 winner) CharacterDatabase.Execute(stmt); } + // remove temporary currency bonus auras before rewarding player + player->RemoveAura(SPELL_HONORABLE_DEFENDER_25Y); + player->RemoveAura(SPELL_HONORABLE_DEFENDER_60Y); + // Reward winner team if (team == winner) { From e492944b901f3f088e624a888660cf7b0d3279ec Mon Sep 17 00:00:00 2001 From: Shauren Date: Sat, 1 Feb 2025 19:34:30 +0100 Subject: [PATCH 2/6] Core/Misc: Reduce code differences between branches --- .../Implementation/CharacterDatabase.cpp | 2 +- .../Implementation/CharacterDatabase.h | 2 +- src/server/game/Entities/Player/Player.cpp | 27 +++++++++++++------ src/server/game/Entities/Player/Player.h | 7 ++--- src/server/game/Guilds/Guild.cpp | 24 ++++++++--------- src/server/game/Guilds/Guild.h | 5 ++-- src/server/game/Handlers/CharacterHandler.cpp | 4 +-- src/server/game/Handlers/ChatHandler.cpp | 5 +++- src/server/game/Handlers/GuildHandler.cpp | 4 +-- src/server/game/Handlers/ItemHandler.cpp | 24 +++-------------- src/server/game/Handlers/PetitionsHandler.cpp | 2 +- src/server/game/Petitions/PetitionMgr.h | 20 ++++++++------ 12 files changed, 64 insertions(+), 62 deletions(-) diff --git a/src/server/database/Database/Implementation/CharacterDatabase.cpp b/src/server/database/Database/Implementation/CharacterDatabase.cpp index 4e576e207a6..776eb7dbe87 100644 --- a/src/server/database/Database/Implementation/CharacterDatabase.cpp +++ b/src/server/database/Database/Implementation/CharacterDatabase.cpp @@ -176,7 +176,7 @@ void CharacterDatabaseConnection::DoPrepareStatements() // 0: uint32, 1: uint8, 3: string, 4: uint32, 5: uint32 PrepareStatement(CHAR_INS_GUILD_RANK, "INSERT INTO guild_rank (guildid, rid, rname, rights, BankMoneyPerDay) VALUES (?, ?, ?, ?, ?)", CONNECTION_ASYNC); PrepareStatement(CHAR_DEL_GUILD_RANKS, "DELETE FROM guild_rank WHERE guildid = ?", CONNECTION_ASYNC); // 0: uint32 - PrepareStatement(CHAR_DEL_GUILD_LOWEST_RANK, "DELETE FROM guild_rank WHERE guildid = ? AND rid >= ?", CONNECTION_ASYNC); // 0: uint32, 1: uint8 + PrepareStatement(CHAR_DEL_GUILD_RANK, "DELETE FROM guild_rank WHERE guildid = ? AND rid = ?", CONNECTION_ASYNC); // 0: uint32, 1: uint8 PrepareStatement(CHAR_INS_GUILD_BANK_TAB, "INSERT INTO guild_bank_tab (guildid, TabId) VALUES (?, ?)", CONNECTION_ASYNC); // 0: uint32, 1: uint8 PrepareStatement(CHAR_DEL_GUILD_BANK_TAB, "DELETE FROM guild_bank_tab WHERE guildid = ? AND TabId = ?", CONNECTION_ASYNC); // 0: uint32, 1: uint8 PrepareStatement(CHAR_DEL_GUILD_BANK_TABS, "DELETE FROM guild_bank_tab WHERE guildid = ?", CONNECTION_ASYNC); // 0: uint32 diff --git a/src/server/database/Database/Implementation/CharacterDatabase.h b/src/server/database/Database/Implementation/CharacterDatabase.h index 7404a615c61..4258d1b5788 100644 --- a/src/server/database/Database/Implementation/CharacterDatabase.h +++ b/src/server/database/Database/Implementation/CharacterDatabase.h @@ -155,7 +155,7 @@ enum CharacterDatabaseStatements : uint32 CHAR_DEL_GUILD_MEMBERS, CHAR_INS_GUILD_RANK, CHAR_DEL_GUILD_RANKS, - CHAR_DEL_GUILD_LOWEST_RANK, + CHAR_DEL_GUILD_RANK, CHAR_INS_GUILD_BANK_TAB, CHAR_DEL_GUILD_BANK_TAB, CHAR_DEL_GUILD_BANK_TABS, diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index 66a46284fb3..d0dd91e5796 100644 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -251,7 +251,7 @@ Player::Player(WorldSession* session): Unit(true) SetLastRuneGraceTimer(i, 0); } - for (uint8 i=0; i < MAX_TIMERS; i++) + for (uint8 i = 0; i < MAX_TIMERS; i++) m_MirrorTimer[i] = DISABLED_MIRROR_TIMER; m_MirrorTimerFlags = UNDERWATER_NONE; @@ -512,7 +512,7 @@ bool Player::Create(ObjectGuid::LowType guidlow, CharacterCreateInfo* createInfo SetArenaFaction(0); SetUInt32Value(PLAYER_GUILDID, 0); - SetRank(0); + SetGuildRank(0); SetUInt32Value(PLAYER_GUILD_TIMESTAMP, 0); for (int i = 0; i < KNOWN_TITLES_SIZE; ++i) @@ -18918,8 +18918,8 @@ void Player::SendSavedInstances() } } - //Send opcode 811. true or false means, whether you have current raid/heroic instances - data.Initialize(SMSG_UPDATE_INSTANCE_OWNERSHIP); + //Send opcode SMSG_UPDATE_INSTANCE_OWNERSHIP. true or false means, whether you have current raid/heroic instances + data.Initialize(SMSG_UPDATE_INSTANCE_OWNERSHIP, 4); data << uint32(hasBeenSaved); SendDirectMessage(&data); @@ -18932,7 +18932,7 @@ void Player::SendSavedInstances() { if (itr->second.perm) { - data.Initialize(SMSG_UPDATE_LAST_INSTANCE); + data.Initialize(SMSG_UPDATE_LAST_INSTANCE, 4); data << uint32(itr->second.save->GetMapId()); SendDirectMessage(&data); } @@ -19699,7 +19699,7 @@ void Player::_SaveInventory(CharacterDatabaseTransaction trans) // save all changes to the item... if (item->GetState() != ITEM_NEW) // only for existing items, no duplicates item->SaveToDB(trans); - // ...but do not save position in invntory + // ...but do not save position in inventory continue; } } @@ -20675,6 +20675,16 @@ void Player::TextEmote(std::string_view text, WorldObject const* /*= nullptr*/, SendMessageToSetInRange(&data, sWorld->getFloatConfig(CONFIG_LISTEN_RANGE_TEXTEMOTE), true, !GetSession()->HasPermission(rbac::RBAC_PERM_TWO_SIDE_INTERACTION_CHAT), true); } +void Player::WhisperAddon(std::string const& text, Player* receiver) +{ + std::string _text(text); + sScriptMgr->OnPlayerChat(this, CHAT_MSG_WHISPER, uint32(LANG_ADDON), _text, receiver); + + WorldPacket data; + ChatHandler::BuildChatPacket(data, CHAT_MSG_WHISPER, LANG_ADDON, this, this, _text); + receiver->SendDirectMessage(&data); +} + void Player::TextEmote(uint32 textId, WorldObject const* target /*= nullptr*/, bool /*isBossEmote = false*/) { Talk(textId, CHAT_MSG_EMOTE, sWorld->getFloatConfig(CONFIG_LISTEN_RANGE_TEXTEMOTE), target); @@ -26104,14 +26114,15 @@ void Player::SetReputation(uint32 factionentry, uint32 value) { GetReputationMgr().SetReputation(sFactionStore.LookupEntry(factionentry), value); } + uint32 Player::GetReputation(uint32 factionentry) const { return GetReputationMgr().GetReputation(sFactionStore.LookupEntry(factionentry)); } -std::string const& Player::GetGuildName() const +std::string Player::GetGuildName() const { - return sGuildMgr->GetGuildById(GetGuildId())->GetName(); + return GetGuildId() ? sGuildMgr->GetGuildById(GetGuildId())->GetName() : ""; } void Player::SendDuelCountdown(uint32 counter) diff --git a/src/server/game/Entities/Player/Player.h b/src/server/game/Entities/Player/Player.h index 6a0e544d312..c2d05d43d87 100644 --- a/src/server/game/Entities/Player/Player.h +++ b/src/server/game/Entities/Player/Player.h @@ -1079,6 +1079,7 @@ class TC_GAME_API Player : public Unit, public GridObject /// Handles whispers from Addons and players based on sender, receiver's guid and language. void Whisper(std::string_view text, Language language, Player* receiver, bool = false) override; void Whisper(uint32 textId, Player* target, bool isBossWhisper = false) override; + void WhisperAddon(std::string const& text, Player* receiver); /*********************************************************/ /*** STORAGE SYSTEM ***/ @@ -1471,7 +1472,7 @@ class TC_GAME_API Player : public Unit, public GridObject void RemoveTemporarySpell(uint32 spellId); void SetReputation(uint32 factionentry, uint32 value); uint32 GetReputation(uint32 factionentry) const; - std::string const& GetGuildName() const; + std::string GetGuildName() const; // Talents uint32 GetFreeTalentPoints() const { return GetUInt32Value(PLAYER_CHARACTER_POINTS1); } @@ -1605,8 +1606,8 @@ class TC_GAME_API Player : public Unit, public GridObject void SendUpdateToOutOfRangeGroupMembers(); void SetInGuild(uint32 guildId); - void SetRank(uint8 rankId) { SetUInt32Value(PLAYER_GUILDRANK, rankId); } - uint8 GetRank() const { return uint8(GetUInt32Value(PLAYER_GUILDRANK)); } + void SetGuildRank(uint8 rankId) { SetUInt32Value(PLAYER_GUILDRANK, rankId); } + uint8 GetGuildRank() const { return uint8(GetUInt32Value(PLAYER_GUILDRANK)); } void SetGuildIdInvited(uint32 GuildId) { m_GuildIdInvited = GuildId; } uint32 GetGuildId() const { return GetUInt32Value(PLAYER_GUILDID); } Guild* GetGuild(); diff --git a/src/server/game/Guilds/Guild.cpp b/src/server/game/Guilds/Guild.cpp index d548d226bfb..9dcc3cdfd77 100644 --- a/src/server/game/Guilds/Guild.cpp +++ b/src/server/game/Guilds/Guild.cpp @@ -581,7 +581,7 @@ void Guild::Member::ChangeRank(CharacterDatabaseTransaction trans, uint8 newRank // Update rank information in player's field, if he is online. if (Player* player = FindConnectedPlayer()) - player->SetRank(newRank); + player->SetGuildRank(newRank); CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_GUILD_MEMBER_RANK); stmt->setUInt8 (0, newRank); @@ -1398,17 +1398,17 @@ void Guild::HandleSetBankTabInfo(WorldSession* session, uint8 tabId, std::string _BroadcastEvent(GE_BANK_TAB_UPDATED, ObjectGuid::Empty, std::to_string(tabId), tab->GetName(), tab->GetIcon()); } -void Guild::HandleSetMemberNote(WorldSession* session, std::string_view name, std::string_view note, bool officer) +void Guild::HandleSetMemberNote(WorldSession* session, std::string_view note, std::string_view name, bool isPublic) { // Player must have rights to set public/officer note - if (!_HasRankRight(session->GetPlayer(), officer ? GR_RIGHT_EOFFNOTE : GR_RIGHT_EPNOTE)) + if (!_HasRankRight(session->GetPlayer(), isPublic ? GR_RIGHT_EPNOTE : GR_RIGHT_EOFFNOTE)) SendCommandResult(session, GUILD_COMMAND_PUBLIC_NOTE, ERR_GUILD_PERMISSIONS); else if (Member* member = GetMember(name)) { - if (officer) - member->SetOfficerNote(note); - else + if (isPublic) member->SetPublicNote(note); + else + member->SetOfficerNote(note); HandleRoster(session); } @@ -1579,12 +1579,12 @@ void Guild::HandleRemoveMember(WorldSession* session, std::string_view name) else { ObjectGuid guid = member->GetGUID(); + _LogEvent(GUILD_EVENT_LOG_UNINVITE_PLAYER, player->GetGUID().GetCounter(), guid.GetCounter()); + _BroadcastEvent(GE_REMOVED, ObjectGuid::Empty, name, player->GetName()); // After call to DeleteMember pointer to member becomes invalid CharacterDatabaseTransaction trans(nullptr); DeleteMember(trans, guid, false, true); - _LogEvent(GUILD_EVENT_LOG_UNINVITE_PLAYER, player->GetGUID().GetCounter(), guid.GetCounter()); - _BroadcastEvent(GE_REMOVED, ObjectGuid::Empty, name, player->GetName()); } } } @@ -1676,7 +1676,7 @@ void Guild::HandleRemoveRank(WorldSession* session, uint8 rankId) stmt->setUInt8(1, rankId); CharacterDatabase.Execute(stmt); // Delete rank - stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_GUILD_LOWEST_RANK); + stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_GUILD_RANK); stmt->setUInt32(0, m_id); stmt->setUInt8(1, rankId); CharacterDatabase.Execute(stmt); @@ -2218,7 +2218,7 @@ bool Guild::AddMember(CharacterDatabaseTransaction trans, ObjectGuid guid, uint8 { player->SetInGuild(m_id); player->SetGuildIdInvited(0); - player->SetRank(rankId); + player->SetGuildRank(rankId); member.SetStats(player); SendLoginInfo(player->GetSession()); name = player->GetName(); @@ -2294,7 +2294,7 @@ bool Guild::DeleteMember(CharacterDatabaseTransaction trans, ObjectGuid guid, bo // If player not online data in data field will be loaded from guild tabs no need to update it !! if (Player* newLeaderPlayer = newLeader->FindPlayer()) - newLeaderPlayer->SetRank(GR_GUILDMASTER); + newLeaderPlayer->SetGuildRank(GR_GUILDMASTER); // If leader does not exist (at guild loading with deleted leader) do not send broadcasts if (oldLeader) @@ -2312,7 +2312,7 @@ bool Guild::DeleteMember(CharacterDatabaseTransaction trans, ObjectGuid guid, bo if (player) { player->SetInGuild(0); - player->SetRank(0); + player->SetGuildRank(0); } else sCharacterCache->UpdateCharacterGuildId(guid, 0); diff --git a/src/server/game/Guilds/Guild.h b/src/server/game/Guilds/Guild.h index c83b2233404..c1583a29a1b 100644 --- a/src/server/game/Guilds/Guild.h +++ b/src/server/game/Guilds/Guild.h @@ -313,8 +313,8 @@ class TC_GAME_API Guild std::string GetPublicNote() const { return m_publicNote; } std::string GetOfficerNote() const { return m_officerNote; } uint8 GetClass() const { return m_class; } - uint8 GetLevel() const { return m_level; } uint8 GetGender() const { return m_gender; } + uint8 GetLevel() const { return m_level; } uint8 GetFlags() const { return m_flags; } uint32 GetZoneId() const { return m_zoneId; } bool IsOnline() const { return (m_flags & GUILDMEMBER_STATUS_ONLINE); } @@ -501,7 +501,6 @@ class TC_GAME_API Guild private: ObjectGuid::LowType m_guildId; - uint8 m_rankId; std::string m_name; uint32 m_rights; @@ -655,7 +654,7 @@ class TC_GAME_API Guild void HandleSetEmblem(WorldSession* session, EmblemInfo const& emblemInfo); void HandleSetLeader(WorldSession* session, std::string_view name); void HandleSetBankTabInfo(WorldSession* session, uint8 tabId, std::string_view name, std::string_view icon); - void HandleSetMemberNote(WorldSession* session, std::string_view name, std::string_view note, bool officer); + void HandleSetMemberNote(WorldSession* session, std::string_view note, std::string_view name, bool isPublic); void HandleSetRankInfo(WorldSession* session, uint8 rankId, std::string_view name, uint32 rights, uint32 moneyPerDay, std::array const& rightsAndSlots); void HandleBuyBankTab(WorldSession* session, uint8 tabId); void HandleInviteMember(WorldSession* session, std::string_view name); diff --git a/src/server/game/Handlers/CharacterHandler.cpp b/src/server/game/Handlers/CharacterHandler.cpp index 1b47558c802..97cd53e6c22 100644 --- a/src/server/game/Handlers/CharacterHandler.cpp +++ b/src/server/game/Handlers/CharacterHandler.cpp @@ -776,12 +776,12 @@ void WorldSession::HandlePlayerLogin(LoginQueryHolder const& holder) { Field* fields = resultGuild->Fetch(); pCurrChar->SetInGuild(fields[0].GetUInt32()); - pCurrChar->SetRank(fields[1].GetUInt8()); + pCurrChar->SetGuildRank(fields[1].GetUInt8()); } else if (pCurrChar->GetGuildId()) // clear guild related fields in case wrong data about non existed membership { pCurrChar->SetInGuild(0); - pCurrChar->SetRank(0); + pCurrChar->SetGuildRank(0); } if (pCurrChar->GetGuildId() != 0) diff --git a/src/server/game/Handlers/ChatHandler.cpp b/src/server/game/Handlers/ChatHandler.cpp index c6e0d7e2fc8..ef38b1edef0 100644 --- a/src/server/game/Handlers/ChatHandler.cpp +++ b/src/server/game/Handlers/ChatHandler.cpp @@ -366,7 +366,10 @@ void WorldSession::HandleMessagechatOpcode(WorldPacket& recvData) (HasPermission(rbac::RBAC_PERM_CAN_FILTER_WHISPERS) && !sender->isAcceptWhispers() && !sender->IsInWhisperWhiteList(receiver->GetGUID()))) sender->AddWhisperWhiteList(receiver->GetGUID()); - GetPlayer()->Whisper(msg, Language(lang), receiver); + if (lang == LANG_ADDON) + GetPlayer()->WhisperAddon(msg, receiver); + else + GetPlayer()->Whisper(msg, Language(lang), receiver); break; } case CHAT_MSG_PARTY: diff --git a/src/server/game/Handlers/GuildHandler.cpp b/src/server/game/Handlers/GuildHandler.cpp index 8a8e1c8d85e..fe27bac75eb 100644 --- a/src/server/game/Handlers/GuildHandler.cpp +++ b/src/server/game/Handlers/GuildHandler.cpp @@ -151,7 +151,7 @@ void WorldSession::HandleGuildSetPublicNoteOpcode(WorldPackets::Guild::GuildSetM if (normalizePlayerName(packet.NoteeName)) if (Guild* guild = GetPlayer()->GetGuild()) - guild->HandleSetMemberNote(this, packet.NoteeName, packet.Note, false); + guild->HandleSetMemberNote(this, packet.Note, packet.NoteeName, false); } void WorldSession::HandleGuildSetOfficerNoteOpcode(WorldPackets::Guild::GuildSetMemberNote& packet) @@ -161,7 +161,7 @@ void WorldSession::HandleGuildSetOfficerNoteOpcode(WorldPackets::Guild::GuildSet if (normalizePlayerName(packet.NoteeName)) if (Guild* guild = GetPlayer()->GetGuild()) - guild->HandleSetMemberNote(this, packet.NoteeName, packet.Note, true); + guild->HandleSetMemberNote(this, packet.Note, packet.NoteeName, true); } void WorldSession::HandleGuildSetRankPermissions(WorldPackets::Guild::GuildSetRankPermissions& packet) diff --git a/src/server/game/Handlers/ItemHandler.cpp b/src/server/game/Handlers/ItemHandler.cpp index ec546fcbf97..bd12131c11b 100644 --- a/src/server/game/Handlers/ItemHandler.cpp +++ b/src/server/game/Handlers/ItemHandler.cpp @@ -549,28 +549,12 @@ void WorldSession::HandleBuyItemInSlotOpcode(WorldPacket& recvData) else return; // cheating - uint8 bag = NULL_BAG; // init for case invalid bagGUID - - // find bag slot by bag guid - if (bagguid == _player->GetGUID()) + uint8 bag = NULL_BAG; + if (bagguid == GetPlayer()->GetGUID()) // The client sends the player guid when trying to store an item in the default backpack bag = INVENTORY_SLOT_BAG_0; + else if (Item* bagItem = _player->GetItemByGuid(bagguid)) + bag = bagItem->GetSlot(); else - { - for (int i = INVENTORY_SLOT_BAG_START; i < INVENTORY_SLOT_BAG_END; ++i) - { - if (Bag* pBag = _player->GetBagByPos(i)) - { - if (bagguid == pBag->GetGUID()) - { - bag = i; - break; - } - } - } - } - - // bag not found, cheating? - if (bag == NULL_BAG) return; GetPlayer()->BuyItemFromVendorSlot(vendorguid, slot, item, count, bag, bagslot); diff --git a/src/server/game/Handlers/PetitionsHandler.cpp b/src/server/game/Handlers/PetitionsHandler.cpp index 47640072dbe..e233c83b868 100644 --- a/src/server/game/Handlers/PetitionsHandler.cpp +++ b/src/server/game/Handlers/PetitionsHandler.cpp @@ -463,7 +463,7 @@ void WorldSession::HandleSignPetition(WorldPacket& recvData) WorldPacket data(SMSG_PETITION_SIGN_RESULTS, (8+8+4)); data << uint64(petitionGuid); data << uint64(_player->GetGUID()); - data << (uint32)PETITION_SIGN_ALREADY_SIGNED; + data << uint32(PETITION_SIGN_ALREADY_SIGNED); // close at signer side SendPacket(&data); diff --git a/src/server/game/Petitions/PetitionMgr.h b/src/server/game/Petitions/PetitionMgr.h index 4e38ba0da02..16fddfa2f47 100644 --- a/src/server/game/Petitions/PetitionMgr.h +++ b/src/server/game/Petitions/PetitionMgr.h @@ -27,18 +27,22 @@ enum PetitionTurns { - PETITION_TURN_OK = 0, - PETITION_TURN_ALREADY_IN_GUILD = 2, - PETITION_TURN_NEED_MORE_SIGNATURES = 4 + PETITION_TURN_OK = 0, + PETITION_TURN_ALREADY_IN_GUILD = 2, + PETITION_TURN_NEED_MORE_SIGNATURES = 4, + PETITION_TURN_GUILD_PERMISSIONS = 11, }; enum PetitionSigns { - PETITION_SIGN_OK = 0, - PETITION_SIGN_ALREADY_SIGNED = 1, - PETITION_SIGN_ALREADY_IN_GUILD = 2, - PETITION_SIGN_CANT_SIGN_OWN = 3, - PETITION_SIGN_NOT_SERVER = 4 + PETITION_SIGN_OK = 0, + PETITION_SIGN_ALREADY_SIGNED = 1, + PETITION_SIGN_ALREADY_IN_GUILD = 2, + PETITION_SIGN_CANT_SIGN_OWN = 3, + PETITION_SIGN_NOT_SERVER = 5, + PETITION_SIGN_FULL = 8, + PETITION_SIGN_ALREADY_SIGNED_OTHER = 10, + PETITION_SIGN_RESTRICTED_ACCOUNT = 11, }; typedef std::pair Signature; From ba0ed27e3298c3cd997ec211f988d8de145e2e0d Mon Sep 17 00:00:00 2001 From: Kandera Date: Mon, 6 Aug 2012 09:32:35 -0400 Subject: [PATCH 3/6] Core/Spells: add name for cast_flag_unknown_2 to cast_flag_has_trajectory (cherry picked from commit 450a6a66c7dc27ea3c0ae1b13436f067adaf5924) --- src/server/game/Spells/Spell.cpp | 2 +- src/server/game/Spells/Spell.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/server/game/Spells/Spell.cpp b/src/server/game/Spells/Spell.cpp index 4251ccc3e17..6ca71f2cbb0 100644 --- a/src/server/game/Spells/Spell.cpp +++ b/src/server/game/Spells/Spell.cpp @@ -4218,7 +4218,7 @@ void Spell::SendSpellStart() //TC_LOG_DEBUG("spells", "Sending SMSG_SPELL_START id={}", m_spellInfo->Id); - uint32 castFlags = CAST_FLAG_UNKNOWN_2; + uint32 castFlags = CAST_FLAG_HAS_TRAJECTORY; uint32 schoolImmunityMask = 0; uint32 mechanicImmunityMask = 0; if (Unit* unitCaster = m_caster->ToUnit()) diff --git a/src/server/game/Spells/Spell.h b/src/server/game/Spells/Spell.h index 7abeb67b13c..5ca78741a18 100644 --- a/src/server/game/Spells/Spell.h +++ b/src/server/game/Spells/Spell.h @@ -76,7 +76,7 @@ enum SpellCastFlags { CAST_FLAG_NONE = 0x00000000, CAST_FLAG_PENDING = 0x00000001, // aoe combat log? - CAST_FLAG_UNKNOWN_2 = 0x00000002, + CAST_FLAG_HAS_TRAJECTORY = 0x00000002, CAST_FLAG_UNKNOWN_3 = 0x00000004, CAST_FLAG_UNKNOWN_4 = 0x00000008, // ignore AOE visual CAST_FLAG_UNKNOWN_5 = 0x00000010, From 8268ab34b74353ed6a4a07f69f3cc16e4ca3e3d7 Mon Sep 17 00:00:00 2001 From: Nay Date: Mon, 6 Aug 2012 19:21:04 +0100 Subject: [PATCH 4/6] DB/Schema: Change basehp/mana/armor in creature_classlevelstatus to unsigned mediumint There's no reason to be cheap... (cherry picked from commit 4d8b06d0bdf691ed81e0ba417ab4d2486702f0dd) --- ...5_02_01_00_world_2012_08_06_01_world_classlevelstats.sql | 5 +++++ src/server/game/Globals/ObjectMgr.cpp | 6 +++--- 2 files changed, 8 insertions(+), 3 deletions(-) create mode 100644 sql/updates/world/3.3.5/2025_02_01_00_world_2012_08_06_01_world_classlevelstats.sql diff --git a/sql/updates/world/3.3.5/2025_02_01_00_world_2012_08_06_01_world_classlevelstats.sql b/sql/updates/world/3.3.5/2025_02_01_00_world_2012_08_06_01_world_classlevelstats.sql new file mode 100644 index 00000000000..880bde5f2e9 --- /dev/null +++ b/sql/updates/world/3.3.5/2025_02_01_00_world_2012_08_06_01_world_classlevelstats.sql @@ -0,0 +1,5 @@ +ALTER TABLE `creature_classlevelstats` CHANGE `basehp0` `basehp0` int unsigned NOT NULL DEFAULT '1'; +ALTER TABLE `creature_classlevelstats` CHANGE `basehp1` `basehp1` int unsigned NOT NULL DEFAULT '1'; +ALTER TABLE `creature_classlevelstats` CHANGE `basehp2` `basehp2` int unsigned NOT NULL DEFAULT '1'; +ALTER TABLE `creature_classlevelstats` CHANGE `basemana` `basemana` int unsigned NOT NULL DEFAULT '1'; +ALTER TABLE `creature_classlevelstats` CHANGE `basearmor` `basearmor` int unsigned NOT NULL DEFAULT '1'; diff --git a/src/server/game/Globals/ObjectMgr.cpp b/src/server/game/Globals/ObjectMgr.cpp index a369d0dd5bb..ec6301829d4 100644 --- a/src/server/game/Globals/ObjectMgr.cpp +++ b/src/server/game/Globals/ObjectMgr.cpp @@ -10041,7 +10041,7 @@ void ObjectMgr::LoadCreatureClassLevelStats() for (uint8 i = 0; i < MAX_EXPANSIONS; ++i) { - stats.BaseHealth[i] = fields[2 + i].GetUInt16(); + stats.BaseHealth[i] = fields[2 + i].GetUInt32(); if (stats.BaseHealth[i] == 0) { @@ -10057,8 +10057,8 @@ void ObjectMgr::LoadCreatureClassLevelStats() } } - stats.BaseMana = fields[5].GetUInt16(); - stats.BaseArmor = fields[6].GetUInt16(); + stats.BaseMana = fields[5].GetUInt32(); + stats.BaseArmor = fields[6].GetUInt32(); stats.AttackPower = fields[7].GetUInt16(); stats.RangedAttackPower = fields[8].GetUInt16(); From 7782a17bc2fd663e6c7ec8420bade36c40c4ad25 Mon Sep 17 00:00:00 2001 From: CraftedRO <24683355+CraftedRO@users.noreply.github.com> Date: Sun, 2 Feb 2025 21:21:44 +0200 Subject: [PATCH 5/6] DB/Quest: Move Priest Garments quest series from c++ to database (#30627) Co-authored-by: Jonne733 <40151102+Jonne733@users.noreply.github.com> --- .../world/3.3.5/2025_02_02_00_world.sql | 215 ++++++++++++++++++ src/server/scripts/World/npcs_special.cpp | 170 -------------- 2 files changed, 215 insertions(+), 170 deletions(-) create mode 100644 sql/updates/world/3.3.5/2025_02_02_00_world.sql diff --git a/sql/updates/world/3.3.5/2025_02_02_00_world.sql b/sql/updates/world/3.3.5/2025_02_02_00_world.sql new file mode 100644 index 00000000000..9bdbe83e920 --- /dev/null +++ b/sql/updates/world/3.3.5/2025_02_02_00_world.sql @@ -0,0 +1,215 @@ +-- "Sentinel Shaya", "Guard Roberts", "Mountaineer Dolf", "Grunt Kor'ja" and "Deathguard Kel" script and fixes for Garments of... Quests +-- Remove pointer to old script and add SmartAI to creature template +UPDATE `creature_template` SET `ScriptName`='' WHERE `entry` IN (12423,12427,12428,12429,12430); +UPDATE `creature_template` SET `AIName`="SmartAI" WHERE `entry` IN (12423,12427,12428,12429,12430); + +-- Creature Text +DELETE FROM `creature_text` WHERE `CreatureID` IN (12423,12427,12428,12429,12430) AND `GroupID`=3; +INSERT INTO `creature_text` (`CreatureID`,`GroupID`,`ID`,`Text`,`Type`,`Language`,`Probability`,`Emote`,`Duration`,`Sound`,`BroadcastTextId`,`TextRange`,`comment`) VALUES + +-- Guard Roberts creature text +(12423,3,0,"Argh, the pain. Will it ever leave me?",12,0,100,0,0,0,7669,0,"Guard Roberts"), + +-- Mountaineer Dolf creature text +(12427,3,0,"Argh, the pain. Will it ever leave me?",12,0,100,0,0,0,7669,0,"Mountaineer Dolf"), + +-- Deathguard Kel creature text +(12428,3,0,"Argh, the pain. Will it ever leave me?",12,0,100,0,0,0,7669,0,"Deathguard Kel"), + +-- Sentinel Shaya creature text +(12429,3,0,"Argh, the pain. Will it ever leave me?",12,0,100,0,0,0,7779,0,"Sentinel Shaya"), + +-- Grunt Kor'ja creature text +(12430,3,0,"Argh, the pain. Will it ever leave me?",12,0,100,0,0,0,7783,0,"Grunt Kor'ja"); + +-- Grunt Kor'ja Missing Emote +UPDATE `creature_text` SET `Emote`=1 WHERE `CreatureID`=12430 AND `GroupID`=0; + +-- Scripts +DELETE FROM `smart_scripts` WHERE `entryorguid` IN (12423,12427,12428,12429,12430); +DELETE FROM `smart_scripts` WHERE `entryorguid` IN (1242300,1242301,1242700,1242701,1242800,1242801,1242900,1242901,1243000,1243001) AND `source_type`=9; +INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`event_param5`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_param4`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES + +-- Guard Roberts Script +(12423,0,0,1,25,0,100,0,0,0,0,0,0,22,1,0,0,0,0,0,1,0,0,0,0,0,0,0,0,"Guard Roberts - On Reset - Set Phase 1"), +(12423,0,1,2,61,1,100,0,0,0,0,0,0,90,8,0,0,0,0,0,1,0,0,0,0,0,0,0,0,"Guard Roberts - On Link - Set Flag Standstate Kneel (Phase 1)"), +(12423,0,2,0,61,1,100,0,0,0,0,0,0,142,70,0,0,0,0,0,1,0,0,0,0,0,0,0,0,"Guard Roberts - On Link - Set Health 70% (Phase 1)"), +(12423,0,3,0,40,2,100,0,2,12423,0,0,0,41,1000,0,0,0,0,0,1,0,0,0,0,0,0,0,0,"Guard Roberts - On Waypoint 2 Reached - Despawn (Phase 2)"), +(12423,0,4,5,8,1,100,1,2052,0,0,0,0,22,2,0,0,0,0,0,1,0,0,0,0,0,0,0,0,"Guard Roberts - On Spellhit - Set Phase 2 (No Repeat) (Phase 1)"), +(12423,0,5,0,61,2,100,0,0,0,0,0,0,80,1242300,0,0,0,0,0,1,0,0,0,0,0,0,0,0,"Guard Roberts - On Link - Run Script (Phase 2)"), +(12423,0,6,0,8,2,100,1,1243,0,0,0,0,80,1242301,0,1,0,0,0,1,0,0,0,0,0,0,0,0,"Guard Roberts - On Spellhit - Run Script (No Repeat) (Phase 2)"), + +-- Guard Roberts Timed List 1 +(1242300,9,0,0,0,0,100,0,500,500,0,0,0,91,8,0,0,0,0,0,1,0,0,0,0,0,0,0,0,"Guard Roberts - On Script - Remove Flag Standstate 'Kneel'"), +(1242300,9,1,0,0,0,100,0,2000,2000,0,0,0,66,0,0,0,0,0,0,7,0,0,0,0,0,0,0,0,"Guard Roberts - On Script - Set Orientation Invoker"), +(1242300,9,2,0,0,0,100,0,1000,1000,0,0,0,1,2,0,0,0,0,0,1,0,0,0,0,0,0,0,0,"Guard Roberts - On Script - Say Line 2"), +(1242300,9,3,0,0,0,100,0,60000,60000,0,0,0,142,70,0,0,0,0,0,1,0,0,0,0,0,0,0,0,"Guard Roberts - On Script - Set Health 70%"), +(1242300,9,4,0,0,0,100,0,0,0,0,0,0,5,33,0,0,0,0,0,1,0,0,0,0,0,0,0,0, "Guard Roberts - On Script - Play Emote"), +(1242300,9,5,0,0,0,100,0,500,500,0,0,0,1,3,0,0,0,0,0,1,0,0,0,0,0,0,0,0,"Guard Roberts - On Script - Say Line 3"), +(1242300,9,6,0,0,0,100,0,500,500,0,0,0,78,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,"Guard Roberts - On Script - Reset Script"), + +-- Guard Roberts Timed List 2 +(1242301,9,0,0,0,0,100,0,0,0,0,0,0,91,8,0,0,0,0,0,1,0,0,0,0,0,0,0,0,"Guard Roberts - On Script - Remove Flag Standstate 'Kneel'"), +(1242301,9,1,0,0,0,100,0,0,0,0,0,0,33,12423,0,0,0,0,0,16,0,0,0,0,0,0,0,0,"Guard Roberts - On Script - Give Quest Credit"), +(1242301,9,2,0,0,0,100,0,0,0,0,0,0,5,4,0,0,0,0,0,1,0,0,0,0,0,0,0,0, "Guard Roberts - On Script - Play Emote"), +(1242301,9,3,0,0,0,100,0,2500,2500,0,0,0,66,0,0,0,0,0,0,7,0,0,0,0,0,0,0,0,"Guard Roberts - On Script - Set Orientation Invoker"), +(1242301,9,4,0,0,0,100,0,500,500,0,0,0,1,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,"Guard Roberts - On Script - Say Line 0"), +(1242301,9,5,0,0,0,100,0,4000,4000,0,0,0,1,1,0,0,0,0,0,1,0,0,0,0,0,0,0,0,"Guard Roberts - On Script - Say Line 1"), +(1242301,9,6,0,0,0,100,0,2000,2000,0,0,0,53,1,12423,0,0,0,0,1,0,0,0,0,0,0,0,0,"Guard Roberts - On Script - Start Waypoint"), + +-- Mountaineer Dolf Script +(12427,0,0,1,25,0,100,0,0,0,0,0,0,22,1,0,0,0,0,0,1,0,0,0,0,0,0,0,0,"Mountaineer Dolf - On Reset - Set Phase 1"), +(12427,0,1,2,61,1,100,0,0,0,0,0,0,90,8,0,0,0,0,0,1,0,0,0,0,0,0,0,0,"Mountaineer Dolf - On Link - Set Flag Standstate Kneel (Phase 1)"), +(12427,0,2,0,61,1,100,0,0,0,0,0,0,142,70,0,0,0,0,0,1,0,0,0,0,0,0,0,0,"Mountaineer Dolf - On Link - Set Health 70% (Phase 1)"), +(12427,0,3,0,40,2,100,0,2,12427,0,0,0,41,1000,0,0,0,0,0,1,0,0,0,0,0,0,0,0,"Mountaineer Dolf - On Waypoint 2 Reached - Despawn (Phase 2)"), +(12427,0,4,5,8,1,100,1,2052,0,0,0,0,22,2,0,0,0,0,0,1,0,0,0,0,0,0,0,0,"Mountaineer Dolf - On Spellhit - Set Phase 2 (No Repeat) (Phase 1)"), +(12427,0,5,0,61,2,100,0,0,0,0,0,0,80,1242700,0,0,0,0,0,1,0,0,0,0,0,0,0,0,"Mountaineer Dolf - On Link - Run Script (Phase 2)"), +(12427,0,6,0,8,2,100,1,1243,0,0,0,0,80,1242701,0,1,0,0,0,1,0,0,0,0,0,0,0,0,"Mountaineer Dolf - On Spellhit - Run Script (No Repeat) (Phase 2)"), + +-- Mountaineer Dolf Timed List 1 +(1242700,9,0,0,0,0,100,0,500,500,0,0,0,91,8,0,0,0,0,0,1,0,0,0,0,0,0,0,0,"Mountaineer Dolf - On Script - Remove Flag Standstate 'Kneel'"), +(1242700,9,1,0,0,0,100,0,2000,2000,0,0,0,66,0,0,0,0,0,0,7,0,0,0,0,0,0,0,0,"Mountaineer Dolf - On Script - Set Orientation Invoker"), +(1242700,9,2,0,0,0,100,0,1000,1000,0,0,0,1,2,0,0,0,0,0,1,0,0,0,0,0,0,0,0,"Mountaineer Dolf - On Script - Say Line 2"), +(1242700,9,3,0,0,0,100,0,60000,60000,0,0,0,142,70,0,0,0,0,0,1,0,0,0,0,0,0,0,0,"Mountaineer Dolf - On Script - Set Health 70%"), +(1242700,9,4,0,0,0,100,0,0,0,0,0,0,5,33,0,0,0,0,0,1,0,0,0,0,0,0,0,0, "Mountaineer Dolf - On Script - Play Emote"), +(1242700,9,5,0,0,0,100,0,500,500,0,0,0,1,3,0,0,0,0,0,1,0,0,0,0,0,0,0,0,"Mountaineer Dolf - On Script - Say Line 3"), +(1242700,9,6,0,0,0,100,0,500,500,0,0,0,78,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,"Mountaineer Dolf - On Script - Reset Script"), + +-- Mountaineer Dolf Timed List 2 +(1242701,9,0,0,0,0,100,0,0,0,0,0,0,91,8,0,0,0,0,0,1,0,0,0,0,0,0,0,0,"Mountaineer Dolf - On Script - Remove Flag Standstate 'Kneel'"), +(1242701,9,1,0,0,0,100,0,0,0,0,0,0,33,12427,0,0,0,0,0,16,0,0,0,0,0,0,0,0,"Mountaineer Dolf - On Script - Give Quest Credit"), +(1242701,9,2,0,0,0,100,0,0,0,0,0,0,5,4,0,0,0,0,0,1,0,0,0,0,0,0,0,0, "Mountaineer Dolf - On Script - Play Emote"), +(1242701,9,3,0,0,0,100,0,3500,3500,0,0,0,66,0,0,0,0,0,0,7,0,0,0,0,0,0,0,0,"Mountaineer Dolf - On Script - Set Orientation Invoker"), +(1242701,9,4,0,0,0,100,0,500,500,0,0,0,1,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,"Mountaineer Dolf - On Script - Say Line 0"), +(1242701,9,5,0,0,0,100,0,4000,4000,0,0,0,1,1,0,0,0,0,0,1,0,0,0,0,0,0,0,0,"Mountaineer Dolf - On Script - Say Line 1"), +(1242701,9,6,0,0,0,100,0,2000,2000,0,0,0,53,1,12427,0,0,0,0,1,0,0,0,0,0,0,0,0,"Mountaineer Dolf - On Script - Start Waypoint"), + +-- Deathguard Kel Script +(12428,0,0,1,25,0,100,0,0,0,0,0,0,22,1,0,0,0,0,0,1,0,0,0,0,0,0,0,0,"Deathguard Kel - On Reset - Set Phase 1"), +(12428,0,1,2,61,1,100,0,0,0,0,0,0,90,8,0,0,0,0,0,1,0,0,0,0,0,0,0,0,"Deathguard Kel - On Link - Set Flag Standstate Kneel (Phase 1)"), +(12428,0,2,0,61,1,100,0,0,0,0,0,0,142,70,0,0,0,0,0,1,0,0,0,0,0,0,0,0,"Deathguard Kel - On Link - Set Health 70% (Phase 1)"), +(12428,0,3,0,40,2,100,0,2,12428,0,0,0,41,1000,0,0,0,0,0,1,0,0,0,0,0,0,0,0,"Deathguard Kel - On Waypoint 2 Reached - Despawn (Phase 2)"), +(12428,0,4,5,8,1,100,1,2052,0,0,0,0,22,2,0,0,0,0,0,1,0,0,0,0,0,0,0,0,"Deathguard Kel - On Spellhit - Set Phase 2 (No Repeat) (Phase 1)"), +(12428,0,5,0,61,2,100,0,0,0,0,0,0,80,1242800,0,0,0,0,0,1,0,0,0,0,0,0,0,0,"Deathguard Kel - On Link - Run Script (Phase 2)"), +(12428,0,6,0,8,2,100,1,1243,0,0,0,0,80,1242801,0,1,0,0,0,1,0,0,0,0,0,0,0,0,"Deathguard Kel - On Spellhit - Run Script (No Repeat) (Phase 2)"), + +-- Deathguard Kel Timed List 1 +(1242800,9,0,0,0,0,100,0,500,500,0,0,0,91,8,0,0,0,0,0,1,0,0,0,0,0,0,0,0,"Deathguard Kel - On Script - Remove Flag Standstate 'Kneel'"), +(1242800,9,1,0,0,0,100,0,2000,2000,0,0,0,66,0,0,0,0,0,0,7,0,0,0,0,0,0,0,0,"Deathguard Kel - On Script - Set Orientation Invoker"), +(1242800,9,2,0,0,0,100,0,1000,1000,0,0,0,1,2,0,0,0,0,0,1,0,0,0,0,0,0,0,0,"Deathguard Kel - On Script - Say Line 2"), +(1242800,9,3,0,0,0,100,0,60000,60000,0,0,0,142,70,0,0,0,0,0,1,0,0,0,0,0,0,0,0,"Deathguard Kel - On Script - Set Health 70%"), +(1242800,9,4,0,0,0,100,0,0,0,0,0,0,5,33,0,0,0,0,0,1,0,0,0,0,0,0,0,0, "Deathguard Kel - On Script - Play Emote"), +(1242800,9,5,0,0,0,100,0,500,500,0,0,0,1,3,0,0,0,0,0,1,0,0,0,0,0,0,0,0,"Deathguard Kel - On Script - Say Line 3"), +(1242800,9,6,0,0,0,100,0,500,500,0,0,0,78,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,"Deathguard Kel - On Script - Reset Script"), + +-- Deathguard Kel Timed List 2 +(1242801,9,0,0,0,0,100,0,0,0,0,0,0,91,8,0,0,0,0,0,1,0,0,0,0,0,0,0,0,"Deathguard Kel - On Script - Remove Flag Standstate 'Kneel'"), +(1242801,9,1,0,0,0,100,0,0,0,0,0,0,33,12428,0,0,0,0,0,16,0,0,0,0,0,0,0,0,"Deathguard Kel - On Script - Give Quest Credit"), +(1242801,9,2,0,0,0,100,0,0,0,0,0,0,5,4,0,0,0,0,0,1,0,0,0,0,0,0,0,0, "Deathguard Kel - On Script - Play Emote"), +(1242801,9,3,0,0,0,100,0,2500,2500,0,0,0,66,0,0,0,0,0,0,7,0,0,0,0,0,0,0,0,"Deathguard Kel - On Script - Set Orientation Invoker"), +(1242801,9,4,0,0,0,100,0,500,500,0,0,0,1,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,"Deathguard Kel - On Script - Say Line 0"), +(1242801,9,5,0,0,0,100,0,4000,4000,0,0,0,1,1,0,0,0,0,0,1,0,0,0,0,0,0,0,0,"Deathguard Kel - On Script - Say Line 1"), +(1242801,9,6,0,0,0,100,0,2000,2000,0,0,0,53,1,12428,0,0,0,0,1,0,0,0,0,0,0,0,0,"Deathguard Kel - On Script - Start Waypoint"), + +-- Sentinel Shaya Script +(12429,0,0,1,25,0,100,0,0,0,0,0,0,22,1,0,0,0,0,0,1,0,0,0,0,0,0,0,0,"Sentinel Shaya - On Reset - Set Phase 1"), +(12429,0,1,2,61,1,100,0,0,0,0,0,0,90,8,0,0,0,0,0,1,0,0,0,0,0,0,0,0,"Sentinel Shaya - On Link - Set Flag Standstate Kneel (Phase 1)"), +(12429,0,2,0,61,1,100,0,0,0,0,0,0,142,70,0,0,0,0,0,1,0,0,0,0,0,0,0,0,"Sentinel Shaya - On Link - Set Health 70% (Phase 1)"), +(12429,0,3,0,40,2,100,0,2,12429,0,0,0,41,1000,0,0,0,0,0,1,0,0,0,0,0,0,0,0,"Sentinel Shaya - On Waypoint 2 Reached - Despawn (Phase 2)"), +(12429,0,4,5,8,1,100,1,2052,0,0,0,0,22,2,0,0,0,0,0,1,0,0,0,0,0,0,0,0,"Sentinel Shaya - On Spellhit - Set Phase 2 (No Repeat) (Phase 1)"), +(12429,0,5,0,61,2,100,0,0,0,0,0,0,80,1242900,0,0,0,0,0,1,0,0,0,0,0,0,0,0,"Sentinel Shaya - On Link - Run Script (Phase 2)"), +(12429,0,6,0,8,2,100,1,1243,0,0,0,0,80,1242901,0,1,0,0,0,1,0,0,0,0,0,0,0,0,"Sentinel Shaya - On Spellhit - Run Script (No Repeat) (Phase 2)"), + +-- Sentinel Shaya Timed List 1 +(1242900,9,0,0,0,0,100,0,500,500,0,0,0,91,8,0,0,0,0,0,1,0,0,0,0,0,0,0,0,"Sentinel Shaya - On Script - Remove Flag Standstate 'Kneel'"), +(1242900,9,1,0,0,0,100,0,2000,2000,0,0,0,66,0,0,0,0,0,0,7,0,0,0,0,0,0,0,0,"Sentinel Shaya - On Script - Set Orientation Invoker"), +(1242900,9,2,0,0,0,100,0,1000,1000,0,0,0,1,2,0,0,0,0,0,1,0,0,0,0,0,0,0,0,"Sentinel Shaya - On Script - Say Line 2"), +(1242900,9,3,0,0,0,100,0,60000,60000,0,0,0,142,70,0,0,0,0,0,1,0,0,0,0,0,0,0,0,"Sentinel Shaya - On Script - Set Health 70%"), +(1242900,9,4,0,0,0,100,0,0,0,0,0,0,5,33,0,0,0,0,0,1,0,0,0,0,0,0,0,0, "Sentinel Shaya - On Script - Play Emote"), +(1242900,9,5,0,0,0,100,0,500,500,0,0,0,1,3,0,0,0,0,0,1,0,0,0,0,0,0,0,0,"Sentinel Shaya - On Script - Say Line 3"), +(1242900,9,6,0,0,0,100,0,500,500,0,0,0,78,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,"Sentinel Shaya - On Script - Reset Script"), + +-- Sentinel Shaya Timed List 2 +(1242901,9,0,0,0,0,100,0,0,0,0,0,0,91,8,0,0,0,0,0,1,0,0,0,0,0,0,0,0,"Sentinel Shaya - On Script - Remove Flag Standstate 'Kneel'"), +(1242901,9,1,0,0,0,100,0,0,0,0,0,0,33,12429,0,0,0,0,0,16,0,0,0,0,0,0,0,0,"Sentinel Shaya - On Script - Give Quest Credit"), +(1242901,9,2,0,0,0,100,0,0,0,0,0,0,5,4,0,0,0,0,0,1,0,0,0,0,0,0,0,0, "Sentinel Shaya - On Script - Play Emote"), +(1242901,9,3,0,0,0,100,0,2500,2500,0,0,0,66,0,0,0,0,0,0,7,0,0,0,0,0,0,0,0,"Sentinel Shaya - On Script - Set Orientation Invoker"), +(1242901,9,4,0,0,0,100,0,1000,1000,0,0,0,1,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,"Sentinel Shaya - On Script - Say Line 0"), +(1242901,9,5,0,0,0,100,0,4000,4000,0,0,0,1,1,0,0,0,0,0,1,0,0,0,0,0,0,0,0,"Sentinel Shaya - On Script - Say Line 1"), +(1242901,9,6,0,0,0,100,0,2000,2000,0,0,0,53,1,12429,0,0,0,0,1,0,0,0,0,0,0,0,0,"Sentinel Shaya - On Script - Start Waypoint"), + +-- Grunt Kor'ja Script +(12430,0,0,1,25,0,100,0,0,0,0,0,0,22,1,0,0,0,0,0,1,0,0,0,0,0,0,0,0,"Grunt Kor'ja - On Reset - Set Phase 1"), +(12430,0,1,2,61,1,100,0,0,0,0,0,0,90,8,0,0,0,0,0,1,0,0,0,0,0,0,0,0,"Grunt Kor'ja - On Link - Set Flag Standstate Kneel (Phase 1)"), +(12430,0,2,0,61,1,100,0,0,0,0,0,0,142,70,0,0,0,0,0,1,0,0,0,0,0,0,0,0,"Grunt Kor'ja - On Link - Set Health 70% (Phase 1)"), +(12430,0,3,0,40,2,100,0,2,12430,0,0,0,41,1000,0,0,0,0,0,1,0,0,0,0,0,0,0,0,"Grunt Kor'ja - On Waypoint 2 Reached - Despawn (Phase 2)"), +(12430,0,4,5,8,1,100,1,2052,0,0,0,0,22,2,0,0,0,0,0,1,0,0,0,0,0,0,0,0,"Grunt Kor'ja - On Spellhit - Set Phase 2 (No Repeat) (Phase 1)"), +(12430,0,5,0,61,2,100,0,0,0,0,0,0,80,1243000,0,0,0,0,0,1,0,0,0,0,0,0,0,0,"Grunt Kor'ja - On Link - Run Script (Phase 2)"), +(12430,0,6,0,8,2,100,1,1243,0,0,0,0,80,1243001,0,1,0,0,0,1,0,0,0,0,0,0,0,0,"Grunt Kor'ja - On Spellhit - Run Script (No Repeat) (Phase 2)"), + +-- Grunt Kor'ja Timed List 1 +(1243000,9,0,0,0,0,100,0,500,500,0,0,0,91,8,0,0,0,0,0,1,0,0,0,0,0,0,0,0,"Grunt Kor'ja - On Script - Remove Flag Standstate 'Kneel'"), +(1243000,9,1,0,0,0,100,0,2000,2000,0,0,0,66,0,0,0,0,0,0,7,0,0,0,0,0,0,0,0,"Grunt Kor'ja - On Script - Set Orientation Invoker"), +(1243000,9,2,0,0,0,100,0,1000,1000,0,0,0,1,2,0,0,0,0,0,1,0,0,0,0,0,0,0,0,"Grunt Kor'ja - On Script - Say Line 2"), +(1243000,9,3,0,0,0,100,0,60000,60000,0,0,0,142,70,0,0,0,0,0,1,0,0,0,0,0,0,0,0,"Grunt Kor'ja - On Script - Set Health 70%"), +(1243000,9,4,0,0,0,100,0,0,0,0,0,0,5,33,0,0,0,0,0,1,0,0,0,0,0,0,0,0, "Grunt Kor'ja - On Script - Play Emote"), +(1243000,9,5,0,0,0,100,0,500,500,0,0,0,1,3,0,0,0,0,0,1,0,0,0,0,0,0,0,0,"Grunt Kor'ja - On Script - Say Line 3"), +(1243000,9,6,0,0,0,100,0,500,500,0,0,0,78,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,"Grunt Kor'ja - On Script - Reset Script"), + +-- Grunt Kor'ja Timed List 2 +(1243001,9,0,0,0,0,100,0,0,0,0,0,0,91,8,0,0,0,0,0,1,0,0,0,0,0,0,0,0,"Grunt Kor'ja - On Script - Remove Flag Standstate 'Kneel'"), +(1243001,9,1,0,0,0,100,0,0,0,0,0,0,33,12430,0,0,0,0,0,16,0,0,0,0,0,0,0,0,"Grunt Kor'ja - On Script - Give Quest Credit"), +(1243001,9,2,0,0,0,100,0,0,0,0,0,0,5,4,0,0,0,0,0,1,0,0,0,0,0,0,0,0, "Grunt Kor'ja - On Script - Play Emote"), +(1243001,9,3,0,0,0,100,0,2500,2500,0,0,0,66,0,0,0,0,0,0,7,0,0,0,0,0,0,0,0,"Grunt Kor'ja - On Script - Set Orientation Invoker"), +(1243001,9,4,0,0,0,100,0,500,500,0,0,0,1,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,"Grunt Kor'ja - On Script - Say Line 0"), +(1243001,9,5,0,0,0,100,0,4000,4000,0,0,0,1,1,0,0,0,0,0,1,0,0,0,0,0,0,0,0,"Grunt Kor'ja - On Script - Say Line 1"), +(1243001,9,6,0,0,0,100,0,2000,2000,0,0,0,53,1,12430,0,0,0,0,1,0,0,0,0,0,0,0,0,"Grunt Kor'ja - On Script - Start Waypoint"); + +-- Remove old waypoints +DELETE FROM `script_waypoint` WHERE `entry` IN (12423,12427,12428,12429,12430); + +-- Waypoints +DELETE FROM `waypoints` WHERE `entry` IN (12423,12427,12428,12429,12430); +INSERT INTO `waypoints` (`entry`,`pointid`,`position_x`,`position_y`,`position_z`,`point_comment`) VALUES + +-- Guard Roberts Waypoints +(12423,1,-9509.090,-144.348,58.772,"Guard Roberts"), +(12423,2,-9518.536,-171.302,59.214,"Guard Roberts"), + +-- Mountaineer Dolf Waypoints +(12427,1,-5689.931,-459.725,392.185,"Mountaineer Dolf"), +(12427,2,-5700.382,-450.403,393.179,"Mountaineer Dolf"), + +-- Deathguard Kel Waypoints +(12428,1,2454.314,361.823,31.4958,"Deathguard Kel"), +(12428,2,2475.569,382.817,30.644,"Deathguard Kel"), + +-- Sentinel Shaya Waypoints +(12429,1,9657.482,907.793,1273.894,"Sentinel Shaya"), +(12429,2,9643.783,908.450,1269.255,"Sentinel Shaya"), + +-- Grunt Kor'ja +(12430,1,159.649,-4779.886,14.572,"Grunt Kor'ja"), +(12430,2,140.527,-4812.074,16.830,"Grunt Kor'ja"); + +-- Conditions +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=22 AND `SourceEntry` IN (12423,12427,12428,12429,12430); +INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`SourceId`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionTarget`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`NegativeCondition`,`ErrorType`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES + +-- Guard Roberts Conditions +(22,5,12423,0,0,47,0,5624,10,0,0,0,0,"","Smart Event 4 for creature Guard Roberts only executes if player has quest 'Garments of the Light' in progress or completed"), + +-- Mountaineer Dolf Conditions +(22,5,12427,0,0,47,0,5625,10,0,0,0,0,"","Smart Event 4 for creature Mountaineer Dolf only executes if player has quest 'Garments of the Light' in progress or completed"), + +-- Deathguard Kel Conditions +(22,5,12428,0,0,47,0,5650,10,0,0,0,0,"","Smart Event 4 for creature Deathguard Kel only executes if player has quest 'Garments of Darkness' in progress or completed"), + +-- Sentinel Shaya Conditions +(22,5,12429,0,0,47,0,5621,10,0,0,0,0,"","Smart Event 4 for creature Sentinel Shaya only executes if player has quest 'Garments of the Moon' in progress or completed"), + +-- Grunt Kor'ja Conditions +(22,5,12430,0,0,47,0,5648,10,0,0,0,0,"","Smart Event 4 for creature Grunt Kor'ja only executes if player has quest 'Garments of Spirituality' in progress or completed"); + +-- Correct respawn time for "Guard Roberts", "Sentinel Shaya", "Mountaineer Dolf", "Deathguard Kel" and "Grunt Kor'ja" (Timed it on WotLK Classic) +UPDATE `creature` SET `spawntimesecs`=30 WHERE `ID` IN (12423,12427,12428,12429,12430); diff --git a/src/server/scripts/World/npcs_special.cpp b/src/server/scripts/World/npcs_special.cpp index b44cd950b87..df0e4b1e3e8 100644 --- a/src/server/scripts/World/npcs_special.cpp +++ b/src/server/scripts/World/npcs_special.cpp @@ -912,175 +912,6 @@ void npc_doctor::npc_doctorAI::UpdateAI(uint32 diff) } } -/*###### -## npc_garments_of_quests -######*/ - -/// @todo get text for each NPC - -enum Garments -{ - SPELL_LESSER_HEAL_R2 = 2052, - SPELL_FORTITUDE_R1 = 1243, - - QUEST_MOON = 5621, - QUEST_LIGHT_1 = 5624, - QUEST_LIGHT_2 = 5625, - QUEST_SPIRIT = 5648, - QUEST_DARKNESS = 5650, - - ENTRY_SHAYA = 12429, - ENTRY_ROBERTS = 12423, - ENTRY_DOLF = 12427, - ENTRY_KORJA = 12430, - ENTRY_DG_KEL = 12428, - - // used by 12429, 12423, 12427, 12430, 12428, but signed for 12429 - SAY_THANKS = 0, - SAY_GOODBYE = 1, - SAY_HEALED = 2, -}; - -class npc_garments_of_quests : public CreatureScript -{ -public: - npc_garments_of_quests() : CreatureScript("npc_garments_of_quests") { } - - struct npc_garments_of_questsAI : public EscortAI - { - npc_garments_of_questsAI(Creature* creature) : EscortAI(creature) - { - switch (me->GetEntry()) - { - case ENTRY_SHAYA: - quest = QUEST_MOON; - break; - case ENTRY_ROBERTS: - quest = QUEST_LIGHT_1; - break; - case ENTRY_DOLF: - quest = QUEST_LIGHT_2; - break; - case ENTRY_KORJA: - quest = QUEST_SPIRIT; - break; - case ENTRY_DG_KEL: - quest = QUEST_DARKNESS; - break; - default: - quest = 0; - break; - } - - Initialize(); - } - - void Initialize() - { - IsHealed = false; - CanRun = false; - - RunAwayTimer = 5000; - } - - ObjectGuid CasterGUID; - - bool IsHealed; - bool CanRun; - - uint32 RunAwayTimer; - uint32 quest; - - void Reset() override - { - CasterGUID.Clear(); - - Initialize(); - - me->SetStandState(UNIT_STAND_STATE_KNEEL); - // expect database to have RegenHealth=0 - me->SetHealth(me->CountPctFromMaxHealth(70)); - } - - void JustEngagedWith(Unit* /*who*/) override { } - - void SpellHit(WorldObject* caster, SpellInfo const* spellInfo) override - { - if (spellInfo->Id == SPELL_LESSER_HEAL_R2 || spellInfo->Id == SPELL_FORTITUDE_R1) - { - //not while in combat - if (me->IsInCombat()) - return; - - //nothing to be done now - if (IsHealed && CanRun) - return; - - if (Player* player = caster->ToPlayer()) - { - if (quest && player->GetQuestStatus(quest) == QUEST_STATUS_INCOMPLETE) - { - if (IsHealed && !CanRun && spellInfo->Id == SPELL_FORTITUDE_R1) - { - Talk(SAY_THANKS, player); - CanRun = true; - } - else if (!IsHealed && spellInfo->Id == SPELL_LESSER_HEAL_R2) - { - CasterGUID = player->GetGUID(); - me->SetStandState(UNIT_STAND_STATE_STAND); - Talk(SAY_HEALED, player); - IsHealed = true; - } - } - - // give quest credit, not expect any special quest objectives - if (CanRun) - player->TalkedToCreature(me->GetEntry(), me->GetGUID()); - } - } - } - - void UpdateAI(uint32 diff) override - { - if (CanRun && !me->IsInCombat()) - { - if (RunAwayTimer <= diff) - { - if (Unit* unit = ObjectAccessor::GetUnit(*me, CasterGUID)) - { - switch (me->GetEntry()) - { - case ENTRY_SHAYA: - case ENTRY_ROBERTS: - case ENTRY_DOLF: - case ENTRY_KORJA: - case ENTRY_DG_KEL: - Talk(SAY_GOODBYE, unit); - break; - } - - Start(false, true); - } - else - EnterEvadeMode(); //something went wrong - - RunAwayTimer = 30000; - } - else - RunAwayTimer -= diff; - } - - EscortAI::UpdateAI(diff); - } - }; - - CreatureAI* GetAI(Creature* creature) const override - { - return new npc_garments_of_questsAI(creature); - } -}; - /*###### ## npc_guardian ######*/ @@ -2456,7 +2287,6 @@ void AddSC_npcs_special() new npc_midsummer_bunny_pole(); new npc_doctor(); new npc_injured_patient(); - new npc_garments_of_quests(); new npc_guardian(); new npc_steam_tonk(); new npc_tournament_mount(); From 00875fe4a318780a4da095bad9a608e3e514ca82 Mon Sep 17 00:00:00 2001 From: Shauren Date: Sun, 2 Feb 2025 21:12:24 +0100 Subject: [PATCH 6/6] Core/Misc: Reduce code differences between branches --- src/server/game/Entities/Player/Player.cpp | 56 ++++++++++--------- src/server/game/Entities/Player/Player.h | 2 + src/server/game/Entities/Unit/Unit.cpp | 36 ++++++------ src/server/game/Entities/Unit/Unit.h | 1 + src/server/game/Handlers/ArenaTeamHandler.cpp | 10 ++-- src/server/game/Handlers/CharacterHandler.cpp | 2 +- src/server/game/Handlers/GroupHandler.cpp | 4 +- .../game/Movement/Spline/MoveSplineInit.cpp | 5 ++ .../game/Movement/Spline/MoveSplineInit.h | 1 - 9 files changed, 62 insertions(+), 55 deletions(-) diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index d0dd91e5796..050f01c6b9a 100644 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -16674,14 +16674,17 @@ void Player::SendQuestReward(Quest const* quest, uint32 XP) const { uint32 questId = quest->GetQuestId(); sGameEventMgr->HandleQuestComplete(questId); - WorldPacket data(SMSG_QUESTGIVER_QUEST_COMPLETE, (4+4+4+4+4)); - data << uint32(questId); + + uint32 xp; if (!IsMaxLevel()) - data << uint32(XP); + xp = XP; else - data << uint32(0); + xp = 0; + WorldPacket data(SMSG_QUESTGIVER_QUEST_COMPLETE, (4+4+4+4+4)); + data << uint32(questId); + data << uint32(xp); data << uint32(quest->GetRewOrReqMoney(this)); data << uint32(10 * quest->CalculateHonorGain(GetQuestLevel(quest))); data << uint32(quest->GetBonusTalents()); // bonus talents @@ -20365,7 +20368,7 @@ void Player::SendResetInstanceFailed(uint32 reason, uint32 MapId) const // 1: There are players offline in your party. // 2>: There are players in your party attempting to zone into an instance. */ - WorldPacket data(SMSG_INSTANCE_RESET_FAILED, 4); + WorldPacket data(SMSG_INSTANCE_RESET_FAILED, 8); data << uint32(reason); data << uint32(MapId); SendDirectMessage(&data); @@ -26215,6 +26218,26 @@ PetStable& Player::GetOrInitPetStable() return *m_petStable; } +void Player::SendItemRefundResult(Item* item, ItemExtendedCostEntry const* iece, uint8 error) const +{ + WorldPacket data(SMSG_ITEM_REFUND_RESULT, 8 + 4 + 4 + 4 + 4 + 4 * 4 + 4 * 4); + data << uint64(item->GetGUID()); // item guid + data << uint32(error); // 0, or error code + if (!error) + { + data << uint32(item->GetPaidMoney()); // money cost + data << uint32(iece->HonorPoints); // honor point cost + data << uint32(iece->ArenaPoints); // arena point cost + for (uint8 i = 0; i < MAX_ITEM_EXTENDED_COST_REQUIREMENTS; ++i) // item cost data + { + data << uint32(iece->ItemID[i]); + data << uint32(iece->ItemCount[i]); + } + } + + SendDirectMessage(&data); +} + void Player::RefundItem(Item* item) { if (!item->IsRefundable()) @@ -26226,10 +26249,7 @@ void Player::RefundItem(Item* item) if (item->IsRefundExpired()) // item refund has expired { item->SetNotRefundable(this); - WorldPacket data(SMSG_ITEM_REFUND_RESULT, 8+4); - data << uint64(item->GetGUID()); // Guid - data << uint32(10); // Error! - SendDirectMessage(&data); + SendItemRefundResult(item, nullptr, 10); return; } @@ -26267,25 +26287,11 @@ void Player::RefundItem(Item* item) if (store_error) { - WorldPacket data(SMSG_ITEM_REFUND_RESULT, 8+4); - data << uint64(item->GetGUID()); // Guid - data << uint32(10); // Error! - SendDirectMessage(&data); + SendItemRefundResult(item, iece, 10); return; } - WorldPacket data(SMSG_ITEM_REFUND_RESULT, 8+4+4+4+4+4*4+4*4); - data << uint64(item->GetGUID()); // item guid - data << uint32(0); // 0, or error code - data << uint32(item->GetPaidMoney()); // money cost - data << uint32(iece->HonorPoints); // honor point cost - data << uint32(iece->ArenaPoints); // arena point cost - for (uint8 i = 0; i < MAX_ITEM_EXTENDED_COST_REQUIREMENTS; ++i) // item cost data - { - data << uint32(iece->ItemID[i]); - data << uint32(iece->ItemCount[i]); - } - SendDirectMessage(&data); + SendItemRefundResult(item, iece, 0); uint32 moneyRefund = item->GetPaidMoney(); // item-> will be invalidated in DestroyItem diff --git a/src/server/game/Entities/Player/Player.h b/src/server/game/Entities/Player/Player.h index c2d05d43d87..511338c91f6 100644 --- a/src/server/game/Entities/Player/Player.h +++ b/src/server/game/Entities/Player/Player.h @@ -44,6 +44,7 @@ struct CharTitlesEntry; struct ChatChannelsEntry; struct CreatureTemplate; struct FactionEntry; +struct ItemExtendedCostEntry; struct ItemSetEffect; struct ItemTemplate; struct Loot; @@ -2496,6 +2497,7 @@ class TC_GAME_API Player : public Unit, public GridObject GuidSet m_refundableItems; void SendRefundInfo(Item* item); void RefundItem(Item* item); + void SendItemRefundResult(Item* item, ItemExtendedCostEntry const* iece, uint8 error) const; // know currencies are not removed at any point (0 displayed) void AddKnownCurrency(uint32 itemId); diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index cc67ca2da60..2f781409cac 100644 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -11100,8 +11100,9 @@ bool Unit::InitTamedPet(Pet* pet, uint8 level, uint32 spell_id) // only if not player and not controlled by player pet. And not at BG if ((durabilityLoss && !player && !victim->ToPlayer()->InBattleground()) || (player && sWorld->getBoolConfig(CONFIG_DURABILITY_LOSS_IN_PVP))) { - TC_LOG_DEBUG("entities.unit", "We are dead, losing {} percent durability", sWorld->getRate(RATE_DURABILITY_LOSS_ON_DEATH)); - plrVictim->DurabilityLossAll(sWorld->getRate(RATE_DURABILITY_LOSS_ON_DEATH), false); + double baseLoss = sWorld->getRate(RATE_DURABILITY_LOSS_ON_DEATH); + TC_LOG_DEBUG("entities.unit", "We are dead, losing {} percent durability", baseLoss); + plrVictim->DurabilityLossAll(baseLoss, false); // durability lost message plrVictim->SendDurabilityLoss(); } @@ -12210,6 +12211,17 @@ void Unit::UpdateObjectVisibility(bool forced) } } +void Unit::SendMoveKnockBack(Player* player, float speedXY, float speedZ, float vcos, float vsin) +{ + WorldPacket data(SMSG_MOVE_KNOCK_BACK, (8 + 4 + 4 + 4 + 4 + 4)); + data << GetPackGUID(); + data << uint32(0); // counter + data << TaggedPosition(vcos, vsin); + data << float(speedXY); // Horizontal speed + data << float(speedZ); // Z Movement speed (vertical) + player->SendDirectMessage(&data); +} + void Unit::KnockbackFrom(float x, float y, float speedXY, float speedZ) { if (IsMovedByServer()) @@ -12220,15 +12232,7 @@ void Unit::KnockbackFrom(float x, float y, float speedXY, float speedZ) { float vcos, vsin; GetSinCos(x, y, vsin, vcos); - - WorldPacket data(SMSG_MOVE_KNOCK_BACK, (8 + 4 + 4 + 4 + 4 + 4)); - data << GetPackGUID(); - data << uint32(0); // counter - data << TaggedPosition(vcos, vsin); - data << float(speedXY); // Horizontal speed - data << float(-speedZ); // Z Movement speed (vertical) - - GetGameClientMovingMe()->SendDirectMessage(&data); + SendMoveKnockBack(GetGameClientMovingMe()->GetBasePlayer(), speedXY, -speedZ, vcos, vsin); if (HasAuraType(SPELL_AURA_MOD_INCREASE_MOUNTED_FLIGHT_SPEED) || HasAuraType(SPELL_AURA_FLY)) SetCanFly(true, true); @@ -12474,15 +12478,7 @@ void Unit::JumpTo(float speedXY, float speedZ, bool forward, Optional { float vcos = std::cos(angle+GetOrientation()); float vsin = std::sin(angle+GetOrientation()); - - WorldPacket data(SMSG_MOVE_KNOCK_BACK, (8+4+4+4+4+4)); - data << GetPackGUID(); - data << uint32(0); // Sequence - data << TaggedPosition(vcos, vsin); - data << float(speedXY); // Horizontal speed - data << float(-speedZ); // Z Movement speed (vertical) - - ToPlayer()->SendDirectMessage(&data); + SendMoveKnockBack(ToPlayer(), speedXY, -speedZ, vcos, vsin); } } diff --git a/src/server/game/Entities/Unit/Unit.h b/src/server/game/Entities/Unit/Unit.h index 42e94a53e28..5e71f3f3ed8 100644 --- a/src/server/game/Entities/Unit/Unit.h +++ b/src/server/game/Entities/Unit/Unit.h @@ -1204,6 +1204,7 @@ class TC_GAME_API Unit : public WorldObject void UpdateOrientation(float orientation); void UpdateHeight(float newZ); + void SendMoveKnockBack(Player* player, float speedXY, float speedZ, float vcos, float vsin); void KnockbackFrom(float x, float y, float speedXY, float speedZ); void JumpTo(float speedXY, float speedZ, bool forward = true, Optional dest = {}); void JumpTo(WorldObject* obj, float speedZ, bool withOrientation = false); diff --git a/src/server/game/Handlers/ArenaTeamHandler.cpp b/src/server/game/Handlers/ArenaTeamHandler.cpp index 6a04bcce3f0..58d7b4c692d 100644 --- a/src/server/game/Handlers/ArenaTeamHandler.cpp +++ b/src/server/game/Handlers/ArenaTeamHandler.cpp @@ -403,7 +403,7 @@ void WorldSession::HandleArenaTeamLeaderOpcode(WorldPacket& recvData) void WorldSession::SendArenaTeamCommandResult(uint32 teamAction, const std::string& team, const std::string& player, uint32 errorId) { - WorldPacket data(SMSG_ARENA_TEAM_COMMAND_RESULT, 4+team.length()+1+player.length()+1+4); + WorldPacket data(SMSG_ARENA_TEAM_COMMAND_RESULT, 4 + team.length() + 1 + player.length() + 1 + 4); data << uint32(teamAction); data << team; data << player; @@ -413,10 +413,10 @@ void WorldSession::SendArenaTeamCommandResult(uint32 teamAction, const std::stri void WorldSession::SendNotInArenaTeamPacket(uint8 type) { - WorldPacket data(SMSG_ARENA_ERROR, 4+1); // 886 - You are not in a %uv%u arena team - uint32 unk = 0; - data << uint32(unk); // unk(0) - if (!unk) + WorldPacket data(SMSG_ARENA_ERROR, 4+1); + uint32 error = 0; + data << uint32(error); // 0 = ERR_ARENA_NO_TEAM_II, 1 = ERR_ARENA_EXPIRED_CAIS, 2 = ERR_LFG_CANT_USE_BATTLEGROUND + if (!error) data << uint8(type); // team type (2=2v2, 3=3v3, 5=5v5), can be used for custom types... SendPacket(&data); } diff --git a/src/server/game/Handlers/CharacterHandler.cpp b/src/server/game/Handlers/CharacterHandler.cpp index 97cd53e6c22..bd916a61f86 100644 --- a/src/server/game/Handlers/CharacterHandler.cpp +++ b/src/server/game/Handlers/CharacterHandler.cpp @@ -1305,7 +1305,7 @@ void WorldSession::HandleAlterAppearance(WorldPacket& recvData) // 0 - ok // 1, 3 - not enough money - // 2 - you have to seat on barber chair + // 2 - you have to sit on barber chair if (!_player->HasEnoughMoney(cost)) { SendBarberShopResult(BARBER_SHOP_RESULT_NO_MONEY); diff --git a/src/server/game/Handlers/GroupHandler.cpp b/src/server/game/Handlers/GroupHandler.cpp index 1cff1a545a4..5554b959763 100644 --- a/src/server/game/Handlers/GroupHandler.cpp +++ b/src/server/game/Handlers/GroupHandler.cpp @@ -525,7 +525,7 @@ void WorldSession::HandleRaidTargetUpdateOpcode(WorldPacket& recvData) if (!group) return; - uint8 x; + uint8 x; recvData >> x; /** error handling **/ @@ -533,9 +533,7 @@ void WorldSession::HandleRaidTargetUpdateOpcode(WorldPacket& recvData) // everything's fine, do it if (x == 0xFF) // target icon request - { group->SendTargetIconList(this); - } else // target icon update { if (group->isRaidGroup() && !group->IsLeader(GetPlayer()->GetGUID()) && !group->IsAssistant(GetPlayer()->GetGUID())) diff --git a/src/server/game/Movement/Spline/MoveSplineInit.cpp b/src/server/game/Movement/Spline/MoveSplineInit.cpp index 931b6ebd1d0..d09ce2c2e4e 100644 --- a/src/server/game/Movement/Spline/MoveSplineInit.cpp +++ b/src/server/game/Movement/Spline/MoveSplineInit.cpp @@ -266,6 +266,11 @@ namespace Movement args.path[1] = transform(dest); } + void MoveSplineInit::SetFall() + { + args.flags.EnableFalling(); + } + Vector3 TransportPathTransform::operator()(Vector3 input) { if (_transformForTransport) diff --git a/src/server/game/Movement/Spline/MoveSplineInit.h b/src/server/game/Movement/Spline/MoveSplineInit.h index acf57a89fb4..6fcd3258443 100644 --- a/src/server/game/Movement/Spline/MoveSplineInit.h +++ b/src/server/game/Movement/Spline/MoveSplineInit.h @@ -151,7 +151,6 @@ namespace Movement inline void MoveSplineInit::SetWalk(bool enable) { args.walk = enable; } inline void MoveSplineInit::SetSmooth() { args.flags.EnableCatmullRom(); } inline void MoveSplineInit::SetCyclic() { args.flags.cyclic = true; } - inline void MoveSplineInit::SetFall() { args.flags.EnableFalling(); } inline void MoveSplineInit::SetVelocity(float vel) { args.velocity = vel; args.HasVelocity = true; } inline void MoveSplineInit::SetBackward() { args.flags.backward = true; } inline void MoveSplineInit::SetTransportEnter() { args.flags.EnableTransportEnter(); }