aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/server/database/Database/Implementation/CharacterDatabase.cpp3
-rw-r--r--src/server/database/Database/Implementation/CharacterDatabase.h3
-rw-r--r--src/server/game/DataStores/DB2Stores.cpp44
-rw-r--r--src/server/game/DataStores/DB2Stores.h2
-rw-r--r--src/server/game/DataStores/DBCEnums.h1
-rw-r--r--src/server/game/Entities/Item/Item.cpp9
-rw-r--r--src/server/game/Entities/Player/Player.cpp386
-rw-r--r--src/server/game/Entities/Player/Player.h22
-rw-r--r--src/server/game/Handlers/CharacterHandler.cpp5
-rw-r--r--src/server/game/Handlers/InspectHandler.cpp4
-rw-r--r--src/server/game/Handlers/SkillHandler.cpp22
-rw-r--r--src/server/game/Miscellaneous/SharedDefines.h2
-rw-r--r--src/server/game/Server/Packets/InspectPackets.cpp3
-rw-r--r--src/server/game/Server/Packets/InspectPackets.h6
-rw-r--r--src/server/game/Server/Packets/MiscPackets.cpp1
-rw-r--r--src/server/game/Server/Packets/MiscPackets.h1
-rw-r--r--src/server/game/Server/Packets/TalentPackets.h2
-rw-r--r--src/server/game/Spells/Auras/SpellAuraEffects.cpp10
-rw-r--r--src/server/game/Spells/Spell.cpp11
-rw-r--r--src/server/game/Spells/SpellEffects.cpp10
-rw-r--r--src/server/scripts/Commands/cs_reset.cpp1
21 files changed, 50 insertions, 498 deletions
diff --git a/src/server/database/Database/Implementation/CharacterDatabase.cpp b/src/server/database/Database/Implementation/CharacterDatabase.cpp
index 07d69d37e4b..e6b325b36d7 100644
--- a/src/server/database/Database/Implementation/CharacterDatabase.cpp
+++ b/src/server/database/Database/Implementation/CharacterDatabase.cpp
@@ -151,7 +151,6 @@ void CharacterDatabaseConnection::DoPrepareStatements()
PrepareStatement(CHAR_SEL_CHARACTER_BGDATA, "SELECT instanceId, team, joinX, joinY, joinZ, joinO, joinMapId, taxiStart, taxiEnd, mountSpell, queueId FROM character_battleground_data WHERE guid = ?", CONNECTION_ASYNC);
PrepareStatement(CHAR_SEL_CHARACTER_GLYPHS, "SELECT talentGroup, glyphId FROM character_glyphs WHERE guid = ?", CONNECTION_ASYNC);
PrepareStatement(CHAR_SEL_CHARACTER_TALENTS, "SELECT talentId, talentGroup FROM character_talent WHERE guid = ?", CONNECTION_ASYNC);
- PrepareStatement(CHAR_SEL_CHARACTER_PVP_TALENTS, "SELECT talentId0, talentId1, talentId2, talentId3, talentGroup FROM character_pvp_talent WHERE guid = ?", CONNECTION_ASYNC);
PrepareStatement(CHAR_SEL_CHARACTER_SKILLS, "SELECT skill, value, max, professionSlot FROM character_skills WHERE guid = ?", CONNECTION_ASYNC);
PrepareStatement(CHAR_SEL_CHARACTER_RANDOMBG, "SELECT guid FROM character_battleground_random WHERE guid = ?", CONNECTION_ASYNC);
PrepareStatement(CHAR_SEL_CHARACTER_BANNED, "SELECT guid FROM character_banned WHERE guid = ? AND active = 1", CONNECTION_ASYNC);
@@ -624,7 +623,6 @@ void CharacterDatabaseConnection::DoPrepareStatements()
PrepareStatement(CHAR_DEL_GUILD_BANK_EVENTLOG_BY_PLAYER, "DELETE FROM guild_bank_eventlog WHERE PlayerGuid = ?", CONNECTION_ASYNC);
PrepareStatement(CHAR_DEL_CHAR_GLYPHS, "DELETE FROM character_glyphs WHERE guid = ?", CONNECTION_ASYNC);
PrepareStatement(CHAR_DEL_CHAR_TALENT, "DELETE FROM character_talent WHERE guid = ?", CONNECTION_ASYNC);
- PrepareStatement(CHAR_DEL_CHAR_PVP_TALENT, "DELETE FROM character_pvp_talent WHERE guid = ?", CONNECTION_ASYNC);
PrepareStatement(CHAR_DEL_CHAR_SKILLS, "DELETE FROM character_skills WHERE guid = ?", CONNECTION_ASYNC);
PrepareStatement(CHAR_UPD_CHAR_MONEY, "UPDATE characters SET money = ? WHERE guid = ?", CONNECTION_ASYNC);
PrepareStatement(CHAR_INS_CHAR_ACTION, "INSERT INTO character_action (guid, spec, traitConfigId, button, action, type) VALUES (?, ?, ?, ?, ?, ?)", CONNECTION_ASYNC);
@@ -661,7 +659,6 @@ void CharacterDatabaseConnection::DoPrepareStatements()
PrepareStatement(CHAR_DEL_PETITION_SIGNATURE_BY_OWNER, "DELETE FROM petition_sign WHERE ownerguid = ?", CONNECTION_ASYNC);
PrepareStatement(CHAR_INS_CHAR_GLYPHS, "INSERT INTO character_glyphs VALUES(?, ?, ?)", CONNECTION_ASYNC);
PrepareStatement(CHAR_INS_CHAR_TALENT, "INSERT INTO character_talent (guid, talentId, talentGroup) VALUES (?, ?, ?)", CONNECTION_ASYNC);
- PrepareStatement(CHAR_INS_CHAR_PVP_TALENT, "INSERT INTO character_pvp_talent (guid, talentId0, talentId1, talentId2, talentId3, talentGroup) VALUES (?, ?, ?, ?, ?, ?)", CONNECTION_ASYNC);
PrepareStatement(CHAR_UPD_CHAR_LIST_SLOT, "UPDATE characters SET slot = ? WHERE guid = ? AND account = ?", CONNECTION_ASYNC);
PrepareStatement(CHAR_INS_CHAR_FISHINGSTEPS, "INSERT INTO character_fishingsteps (guid, fishingSteps) VALUES (?, ?)", CONNECTION_ASYNC);
PrepareStatement(CHAR_DEL_CHAR_FISHINGSTEPS, "DELETE FROM character_fishingsteps WHERE guid = ?", CONNECTION_ASYNC);
diff --git a/src/server/database/Database/Implementation/CharacterDatabase.h b/src/server/database/Database/Implementation/CharacterDatabase.h
index b9628d20b10..abe245ea056 100644
--- a/src/server/database/Database/Implementation/CharacterDatabase.h
+++ b/src/server/database/Database/Implementation/CharacterDatabase.h
@@ -109,7 +109,6 @@ enum CharacterDatabaseStatements : uint32
CHAR_SEL_CHARACTER_BGDATA,
CHAR_SEL_CHARACTER_GLYPHS,
CHAR_SEL_CHARACTER_TALENTS,
- CHAR_SEL_CHARACTER_PVP_TALENTS,
CHAR_SEL_CHARACTER_SKILLS,
CHAR_SEL_CHARACTER_RANDOMBG,
CHAR_SEL_CHARACTER_BANNED,
@@ -497,7 +496,6 @@ enum CharacterDatabaseStatements : uint32
CHAR_DEL_GUILD_BANK_EVENTLOG_BY_PLAYER,
CHAR_DEL_CHAR_GLYPHS,
CHAR_DEL_CHAR_TALENT,
- CHAR_DEL_CHAR_PVP_TALENT,
CHAR_DEL_CHAR_SKILLS,
CHAR_UPD_CHAR_MONEY,
CHAR_INS_CHAR_ACTION,
@@ -532,7 +530,6 @@ enum CharacterDatabaseStatements : uint32
CHAR_DEL_PETITION_SIGNATURE_BY_OWNER,
CHAR_INS_CHAR_GLYPHS,
CHAR_INS_CHAR_TALENT,
- CHAR_INS_CHAR_PVP_TALENT,
CHAR_UPD_CHAR_LIST_SLOT,
CHAR_INS_CHAR_FISHINGSTEPS,
CHAR_DEL_CHAR_FISHINGSTEPS,
diff --git a/src/server/game/DataStores/DB2Stores.cpp b/src/server/game/DataStores/DB2Stores.cpp
index d47477319be..96eb19dddc8 100644
--- a/src/server/game/DataStores/DB2Stores.cpp
+++ b/src/server/game/DataStores/DB2Stores.cpp
@@ -472,7 +472,6 @@ namespace
PhaseGroupContainer _phasesByGroup;
PowerTypesContainer _powerTypes;
std::unordered_map<uint32, uint8> _pvpItemBonus;
- PvpTalentSlotUnlockEntry const* _pvpTalentSlotUnlock[MAX_PVP_TALENT_SLOTS];
std::unordered_map<uint32, std::vector<QuestLineXQuestEntry const*>> _questsByQuestLine;
QuestPackageItemContainer _questPackages;
std::unordered_map<uint32, std::vector<RewardPackXCurrencyTypeEntry const*>> _rewardPackCurrencyTypes;
@@ -1346,19 +1345,6 @@ uint32 DB2Manager::LoadStores(std::string const& dataPath, LocaleConstant defaul
for (PVPItemEntry const* pvpItem : sPVPItemStore)
_pvpItemBonus[pvpItem->ItemID] = pvpItem->ItemLevelDelta;
- for (PvpTalentSlotUnlockEntry const* talentUnlock : sPvpTalentSlotUnlockStore)
- {
- ASSERT(talentUnlock->Slot < (1 << MAX_PVP_TALENT_SLOTS));
- for (int8 i = 0; i < MAX_PVP_TALENT_SLOTS; ++i)
- {
- if (talentUnlock->Slot & (1 << i))
- {
- ASSERT(!_pvpTalentSlotUnlock[i]);
- _pvpTalentSlotUnlock[i] = talentUnlock;
- }
- }
- }
-
for (QuestLineXQuestEntry const* questLineQuest : sQuestLineXQuestStore)
_questsByQuestLine[questLineQuest->QuestLineID].push_back(questLineQuest);
@@ -2607,36 +2593,6 @@ PVPDifficultyEntry const* DB2Manager::GetBattlegroundBracketById(uint32 mapid, B
return nullptr;
}
-uint32 DB2Manager::GetRequiredLevelForPvpTalentSlot(uint8 slot, Classes class_) const
-{
- ASSERT(slot < MAX_PVP_TALENT_SLOTS);
- if (_pvpTalentSlotUnlock[slot])
- {
- switch (class_)
- {
- case CLASS_DEATH_KNIGHT:
- return _pvpTalentSlotUnlock[slot]->DeathKnightLevelRequired;
- case CLASS_DEMON_HUNTER:
- return _pvpTalentSlotUnlock[slot]->DemonHunterLevelRequired;
- default:
- break;
- }
- return _pvpTalentSlotUnlock[slot]->LevelRequired;
- }
-
- return 0;
-}
-
-int32 DB2Manager::GetPvpTalentNumSlotsAtLevel(uint32 level, Classes class_) const
-{
- int32 slots = 0;
- for (uint8 slot = 0; slot < MAX_PVP_TALENT_SLOTS; ++slot)
- if (level >= GetRequiredLevelForPvpTalentSlot(slot, class_))
- ++slots;
-
- return slots;
-}
-
std::vector<QuestLineXQuestEntry const*> const* DB2Manager::GetQuestsForQuestLine(uint32 questLineId) const
{
return Trinity::Containers::MapGetValuePtr(_questsByQuestLine, questLineId);
diff --git a/src/server/game/DataStores/DB2Stores.h b/src/server/game/DataStores/DB2Stores.h
index 5f8b611f26b..7f935189268 100644
--- a/src/server/game/DataStores/DB2Stores.h
+++ b/src/server/game/DataStores/DB2Stores.h
@@ -476,8 +476,6 @@ public:
uint8 GetPvpItemLevelBonus(uint32 itemId) const;
static PVPDifficultyEntry const* GetBattlegroundBracketByLevel(uint32 mapid, uint32 level);
static PVPDifficultyEntry const* GetBattlegroundBracketById(uint32 mapid, BattlegroundBracketId id);
- uint32 GetRequiredLevelForPvpTalentSlot(uint8 slot, Classes class_) const;
- int32 GetPvpTalentNumSlotsAtLevel(uint32 level, Classes class_) const;
std::vector<QuestLineXQuestEntry const*> const* GetQuestsForQuestLine(uint32 questLineId) const;
std::vector<QuestPackageItemEntry const*> const* GetQuestPackageItems(uint32 questPackageID) const;
std::vector<QuestPackageItemEntry const*> const* GetQuestPackageItemsFallback(uint32 questPackageID) const;
diff --git a/src/server/game/DataStores/DBCEnums.h b/src/server/game/DataStores/DBCEnums.h
index bde5f00f8c0..0e6d293fc68 100644
--- a/src/server/game/DataStores/DBCEnums.h
+++ b/src/server/game/DataStores/DBCEnums.h
@@ -2129,7 +2129,6 @@ DEFINE_ENUM_FLAG(SummonPropertiesFlags);
#define MAX_TALENT_TIERS 11
#define MAX_TALENT_COLUMNS 4
-#define MAX_PVP_TALENT_SLOTS 4
enum class TaxiNodeFlags : int32
{
diff --git a/src/server/game/Entities/Item/Item.cpp b/src/server/game/Entities/Item/Item.cpp
index 4aa432afb26..de36d39ec8c 100644
--- a/src/server/game/Entities/Item/Item.cpp
+++ b/src/server/game/Entities/Item/Item.cpp
@@ -276,27 +276,18 @@ ItemModifier const AppearanceModifierSlotBySpec[MAX_SPECIALIZATIONS] =
{
ITEM_MODIFIER_TRANSMOG_APPEARANCE_SPEC_1,
ITEM_MODIFIER_TRANSMOG_APPEARANCE_SPEC_2,
- ITEM_MODIFIER_TRANSMOG_APPEARANCE_SPEC_3,
- ITEM_MODIFIER_TRANSMOG_APPEARANCE_SPEC_4,
- ITEM_MODIFIER_TRANSMOG_APPEARANCE_SPEC_5
};
ItemModifier const IllusionModifierSlotBySpec[MAX_SPECIALIZATIONS] =
{
ITEM_MODIFIER_ENCHANT_ILLUSION_SPEC_1,
ITEM_MODIFIER_ENCHANT_ILLUSION_SPEC_2,
- ITEM_MODIFIER_ENCHANT_ILLUSION_SPEC_3,
- ITEM_MODIFIER_ENCHANT_ILLUSION_SPEC_4,
- ITEM_MODIFIER_ENCHANT_ILLUSION_SPEC_5
};
ItemModifier const SecondaryAppearanceModifierSlotBySpec[MAX_SPECIALIZATIONS] =
{
ITEM_MODIFIER_TRANSMOG_SECONDARY_APPEARANCE_SPEC_1,
ITEM_MODIFIER_TRANSMOG_SECONDARY_APPEARANCE_SPEC_2,
- ITEM_MODIFIER_TRANSMOG_SECONDARY_APPEARANCE_SPEC_3,
- ITEM_MODIFIER_TRANSMOG_SECONDARY_APPEARANCE_SPEC_4,
- ITEM_MODIFIER_TRANSMOG_SECONDARY_APPEARANCE_SPEC_5
};
void ItemAdditionalLoadInfo::Init(std::unordered_map<ObjectGuid::LowType, ItemAdditionalLoadInfo>* loadInfo,
diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp
index faaae178942..09d98ec22e4 100644
--- a/src/server/game/Entities/Player/Player.cpp
+++ b/src/server/game/Entities/Player/Player.cpp
@@ -553,13 +553,7 @@ bool Player::Create(ObjectGuid::LowType guidlow, WorldPackets::Character::Charac
}
}
// all item positions resolved
-
- if (ChrSpecializationEntry const* defaultSpec = sDB2Manager.GetDefaultChrSpecializationForClass(GetClass()))
- {
- SetActiveTalentGroup(defaultSpec->OrderIndex);
- SetPrimarySpecialization(defaultSpec->ID);
- }
-
+ SetActiveTalentGroup(0);
GetThreatManager().Initialize();
return true;
@@ -2348,7 +2342,6 @@ void Player::GiveLevel(uint8 level)
packet.StatDelta[i] = int32(info.stats[i]) - GetCreateStat(Stats(i));
packet.NumNewTalents = DB2Manager::GetNumTalentsAtLevel(level, Classes(GetClass())) - DB2Manager::GetNumTalentsAtLevel(oldLevel, Classes(GetClass()));
- packet.NumNewPvpTalentSlots = sDB2Manager.GetPvpTalentNumSlotsAtLevel(level, Classes(GetClass())) - sDB2Manager.GetPvpTalentNumSlotsAtLevel(oldLevel, Classes(GetClass()));
SendDirectMessage(packet.Write());
@@ -2420,18 +2413,14 @@ bool Player::IsMaxLevel() const
void Player::InitTalentForLevel()
{
uint8 level = GetLevel();
- // talents base at level diff (talents = level - 9 but some can be used already)
if (level < MIN_SPECIALIZATION_LEVEL)
- ResetTalentSpecialization();
-
- int32 talentTiers = DB2Manager::GetNumTalentsAtLevel(level, Classes(GetClass()));
- if (level < 15)
{
// Remove all talent points
ResetTalents(true);
}
else
{
+ int32 talentTiers = DB2Manager::GetNumTalentsAtLevel(level, Classes(GetClass()));
if (!GetSession()->HasPermission(rbac::RBAC_PERM_SKIP_CHECK_MORE_TALENTS_THAN_ALLOWED))
for (int32 t = talentTiers; t < MAX_TALENT_TIERS; ++t)
for (uint32 c = 0; c < MAX_TALENT_COLUMNS; ++c)
@@ -2439,14 +2428,6 @@ void Player::InitTalentForLevel()
RemoveTalent(talent);
}
- SetUpdateFieldValue(m_values.ModifyValue(&Player::m_activePlayerData).ModifyValue(&UF::ActivePlayerData::MaxTalentTiers), talentTiers);
-
- if (!GetSession()->HasPermission(rbac::RBAC_PERM_SKIP_CHECK_MORE_TALENTS_THAN_ALLOWED))
- for (uint8 spec = 0; spec < MAX_SPECIALIZATIONS; ++spec)
- for (size_t slot = sDB2Manager.GetPvpTalentNumSlotsAtLevel(level, Classes(GetClass())); slot < MAX_PVP_TALENT_SLOTS; ++slot)
- if (PvpTalentEntry const* pvpTalent = sPvpTalentStore.LookupEntry(GetPvpTalentMap(spec)[slot]))
- RemovePvpTalent(pvpTalent, spec);
-
if (!GetSession()->PlayerLoading())
SendTalentsInfoData(); // update at client
}
@@ -3639,14 +3620,6 @@ bool Player::ResetTalents(bool noCost)
return true;
}
-void Player::ResetPvpTalents()
-{
- for (uint8 spec = 0; spec < MAX_SPECIALIZATIONS; ++spec)
- for (uint32 talentId : GetPvpTalentMap(spec))
- if (PvpTalentEntry const* talentInfo = sPvpTalentStore.LookupEntry(talentId))
- RemovePvpTalent(talentInfo, spec);
-}
-
Mail* Player::GetMail(uint64 id)
{
for (PlayerMails::iterator itr = m_mail.begin(); itr != m_mail.end(); ++itr)
@@ -17700,9 +17673,6 @@ bool Player::LoadFromDB(ObjectGuid guid, CharacterDatabaseQueryHolder const& hol
SetNumRespecs(fields.numRespecs);
SetPrimarySpecialization(fields.primarySpecialization);
SetActiveTalentGroup(fields.activeTalentGroup);
- ChrSpecializationEntry const* primarySpec = GetPrimarySpecializationEntry();
- if (!primarySpec || primarySpec->ClassID != GetClass() || GetActiveTalentGroup() >= MAX_SPECIALIZATIONS)
- ResetTalentSpecialization();
uint32 lootSpecId = fields.lootSpecId;
if (ChrSpecializationEntry const* chrSpec = sChrSpecializationStore.LookupEntry(lootSpecId))
@@ -17711,7 +17681,6 @@ bool Player::LoadFromDB(ObjectGuid guid, CharacterDatabaseQueryHolder const& hol
UpdateDisplayPower();
_LoadTalents(holder.GetPreparedResult(PLAYER_LOGIN_QUERY_LOAD_TALENTS));
- _LoadPvpTalents(holder.GetPreparedResult(PLAYER_LOGIN_QUERY_LOAD_PVP_TALENTS));
_LoadSpells(holder.GetPreparedResult(PLAYER_LOGIN_QUERY_LOAD_SPELLS), holder.GetPreparedResult(PLAYER_LOGIN_QUERY_LOAD_SPELL_FAVORITES));
GetSession()->GetCollectionMgr()->LoadToys();
GetSession()->GetCollectionMgr()->LoadHeirlooms();
@@ -20603,7 +20572,7 @@ void Player::outDebugValues() const
sLog->OutMessage("entities.unit", LOG_LEVEL_DEBUG, "HP is: \t\t\t{}\t\tMP is: \t\t\t{}", GetMaxHealth(), GetMaxPower(POWER_MANA));
sLog->OutMessage("entities.unit", LOG_LEVEL_DEBUG, "AGILITY is: \t\t{}\t\tSTRENGTH is: \t\t{}", GetStat(STAT_AGILITY), GetStat(STAT_STRENGTH));
- sLog->OutMessage("entities.unit", LOG_LEVEL_DEBUG, "INTELLECT is: \t\t{}\t\SPIRIT is: \t\t{}", GetStat(STAT_INTELLECT), GetStat(STAT_SPIRIT));
+ sLog->OutMessage("entities.unit", LOG_LEVEL_DEBUG, "INTELLECT is: \t\t{}\t\tSPIRIT is: \t\t{}", GetStat(STAT_INTELLECT), GetStat(STAT_SPIRIT));
sLog->OutMessage("entities.unit", LOG_LEVEL_DEBUG, "STAMINA is: \t\t{}", GetStat(STAT_STAMINA));
sLog->OutMessage("entities.unit", LOG_LEVEL_DEBUG, "Armor is: \t\t{}\t\tBlock is: \t\t{}", GetArmor(), *m_activePlayerData->BlockPercentage);
sLog->OutMessage("entities.unit", LOG_LEVEL_DEBUG, "HolyRes is: \t\t{}\t\tFireRes is: \t\t{}", GetResistance(SPELL_SCHOOL_MASK_HOLY), GetResistance(SPELL_SCHOOL_MASK_FIRE));
@@ -26175,160 +26144,6 @@ TalentLearnResult Player::LearnTalent(uint32 talentId, int32* spellOnCooldown)
return TALENT_LEARN_OK;
}
-void Player::ResetTalentSpecialization()
-{
- /*
- // Reset only talents that have different spells for each spec
- uint32 class_ = GetClass();
- for (uint32 t = 0; t < MAX_TALENT_TIERS; ++t)
- for (uint32 c = 0; c < MAX_TALENT_COLUMNS; ++c)
- if (sDB2Manager.GetTalentsByPosition(class_, t, c).size() > 1)
- for (TalentEntry const* talent : sDB2Manager.GetTalentsByPosition(class_, t, c))
- RemoveTalent(talent);
-
- ResetPvpTalents();
-
- RemoveSpecializationSpells();
-
- ChrSpecializationEntry const* defaultSpec = ASSERT_NOTNULL(sDB2Manager.GetDefaultChrSpecializationForClass(GetClass()));
- SetPrimarySpecialization(defaultSpec->ID);
- SetActiveTalentGroup(defaultSpec->OrderIndex);
-
- LearnSpecializationSpells();
-
- SendTalentsInfoData();
- UpdateItemSetAuras(false);
- */
-}
-
-TalentLearnResult Player::LearnPvpTalent(uint32 talentID, uint8 slot, int32* spellOnCooldown)
-{
- if (slot >= MAX_PVP_TALENT_SLOTS)
- return TALENT_FAILED_UNKNOWN;
-
- if (IsInCombat())
- return TALENT_FAILED_AFFECTING_COMBAT;
-
- if (isDead())
- return TALENT_FAILED_CANT_DO_THAT_RIGHT_NOW;
-
- PvpTalentEntry const* talentInfo = sPvpTalentStore.LookupEntry(talentID);
- if (!talentInfo)
- return TALENT_FAILED_UNKNOWN;
-
- if (talentInfo->SpecID != int32(GetPrimarySpecialization()))
- return TALENT_FAILED_UNKNOWN;
-
- if (talentInfo->LevelRequired > GetLevel())
- return TALENT_FAILED_UNKNOWN;
-
- if (sDB2Manager.GetRequiredLevelForPvpTalentSlot(slot, Classes(GetClass())) > GetLevel())
- return TALENT_FAILED_UNKNOWN;
-
- if (PvpTalentCategoryEntry const* talentCategory = sPvpTalentCategoryStore.LookupEntry(talentInfo->PvpTalentCategoryID))
- if (!(talentCategory->TalentSlotMask & (1 << slot)))
- return TALENT_FAILED_UNKNOWN;
-
- // Check if player doesn't have this talent in other slot
- if (HasPvpTalent(talentID, GetActiveTalentGroup()))
- return TALENT_FAILED_UNKNOWN;
-
- if (PvpTalentEntry const* talent = sPvpTalentStore.LookupEntry(GetPvpTalentMap(GetActiveTalentGroup())[slot]))
- {
- if (!HasPlayerFlag(PLAYER_FLAGS_RESTING) && !HasUnitFlag2(UNIT_FLAG2_ALLOW_CHANGING_TALENTS))
- return TALENT_FAILED_REST_AREA;
-
- if (GetSpellHistory()->HasCooldown(talent->SpellID))
- {
- *spellOnCooldown = talent->SpellID;
- return TALENT_FAILED_CANT_REMOVE_TALENT;
- }
-
- RemovePvpTalent(talent, GetActiveTalentGroup());
- }
-
- if (!AddPvpTalent(talentInfo, GetActiveTalentGroup(), slot))
- return TALENT_FAILED_UNKNOWN;
-
- return TALENT_LEARN_OK;
-}
-
-bool Player::AddPvpTalent(PvpTalentEntry const* talent, uint8 activeTalentGroup, uint8 slot)
-{
- ASSERT(talent);
- SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(talent->SpellID, DIFFICULTY_NONE);
- if (!spellInfo)
- {
- TC_LOG_ERROR("spells", "Player::AddTalent: Spell (ID: {}) does not exist.", talent->SpellID);
- return false;
- }
-
- if (!SpellMgr::IsSpellValid(spellInfo, this, false))
- {
- TC_LOG_ERROR("spells", "Player::AddTalent: Spell (ID: {}) is invalid", talent->SpellID);
- return false;
- }
-
- if (activeTalentGroup == GetActiveTalentGroup() && HasAuraType(SPELL_AURA_PVP_TALENTS))
- {
- LearnSpell(talent->SpellID, true);
-
- // Move this to toggle ?
- if (talent->OverridesSpellID)
- AddOverrideSpell(talent->OverridesSpellID, talent->SpellID);
- }
-
- GetPvpTalentMap(activeTalentGroup)[slot] = talent->ID;
-
- return true;
-}
-
-void Player::RemovePvpTalent(PvpTalentEntry const* talent, uint8 activeTalentGroup)
-{
- SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(talent->SpellID, DIFFICULTY_NONE);
- if (!spellInfo)
- return;
-
- RemoveSpell(talent->SpellID, true);
-
- // Move this to toggle ?
- if (talent->OverridesSpellID)
- RemoveOverrideSpell(talent->OverridesSpellID, talent->SpellID);
-
- // if this talent rank can be found in the PlayerTalentMap, mark the talent as removed so it gets deleted
- auto plrPvpTalent = std::find(GetPvpTalentMap(activeTalentGroup).begin(), GetPvpTalentMap(activeTalentGroup).end(), talent->ID);
- if (plrPvpTalent != GetPvpTalentMap(activeTalentGroup).end())
- *plrPvpTalent = 0;
-}
-
-void Player::TogglePvpTalents(bool enable)
-{
- PlayerPvpTalentMap const& pvpTalents = GetPvpTalentMap(GetActiveTalentGroup());
- for (uint32 pvpTalentId : pvpTalents)
- {
- if (PvpTalentEntry const* pvpTalentInfo = sPvpTalentStore.LookupEntry(pvpTalentId))
- {
- if (enable)
- {
- LearnSpell(pvpTalentInfo->SpellID, false);
- if (pvpTalentInfo->OverridesSpellID)
- AddOverrideSpell(pvpTalentInfo->OverridesSpellID, pvpTalentInfo->SpellID);
- }
- else
- {
- if (pvpTalentInfo->OverridesSpellID)
- RemoveOverrideSpell(pvpTalentInfo->OverridesSpellID, pvpTalentInfo->SpellID);
- RemoveSpell(pvpTalentInfo->SpellID, true);
- }
- }
- }
-}
-
-bool Player::HasPvpTalent(uint32 talentID, uint8 activeTalentGroup) const
-{
- return std::find(GetPvpTalentMap(activeTalentGroup).begin(), GetPvpTalentMap(activeTalentGroup).end(), talentID) != GetPvpTalentMap(activeTalentGroup).end();
-}
-
void Player::EnablePvpRules(bool dueToCombat /*= false*/)
{
if (!HasPvpRulesEnabled())
@@ -26517,80 +26332,54 @@ bool Player::CanSeeSpellClickOn(Creature const* c) const
void Player::SendTalentsInfoData()
{
WorldPackets::Talent::UpdateTalentData packet;
- /*
- packet.Info.PrimarySpecialization = AsUnderlyingType(GetPrimarySpecialization());
-
- for (uint8 i = 0; i < MAX_SPECIALIZATIONS; ++i)
- {
- ChrSpecializationEntry const* spec = sDB2Manager.GetChrSpecializationByIndex(GetClass(), i);
- if (!spec)
- continue;
- PlayerTalentMap* talents = GetTalentMap(i);
- PlayerPvpTalentMap const& pvpTalents = GetPvpTalentMap(i);
+ uint8 activeGroup = GetActiveTalentGroup();
+ packet.ActiveGroup = activeGroup;
- WorldPackets::Talent::TalentGroupInfo groupInfoPkt;
- groupInfoPkt.SpecID = spec->ID;
- groupInfoPkt.TalentIDs.reserve(talents->size());
+ printf("sending talent info data for group %u\n", activeGroup);
- for (PlayerTalentMap::const_iterator itr = talents->begin(); itr != talents->end(); ++itr)
+ for (uint8 i = 0; i < MAX_SPECIALIZATIONS; ++i)
+ {
+ WorldPackets::Talent::TalentGroupInfo& groupInfo = packet.TalentGroupInfos.emplace_back();
+ groupInfo.SpecID = MAX_SPECIALIZATIONS;
+ if (PlayerTalentMap const* talentMap = GetTalentMap(i))
{
- if (itr->second == PLAYERSPELL_REMOVED)
- continue;
+ groupInfo.Talents.reserve(talentMap->size());
- TalentEntry const* talentInfo = sTalentStore.LookupEntry(itr->first);
- if (!talentInfo)
+ for (auto const& pair : *talentMap)
{
- TC_LOG_ERROR("entities.player", "Player::SendTalentsInfoData: Player '{}' ({}) has unknown talent id: {}",
- GetName(), GetGUID().ToString(), itr->first);
- continue;
- }
-
- SpellInfo const* spellEntry = sSpellMgr->GetSpellInfo(talentInfo->SpellID, DIFFICULTY_NONE);
- if (!spellEntry)
- {
- TC_LOG_ERROR("entities.player", "Player::SendTalentsInfoData: Player '{}' ({}) has unknown talent spell: {}",
- GetName(), GetGUID().ToString(), talentInfo->SpellID);
- continue;
- }
-
- groupInfoPkt.TalentIDs.push_back(uint16(itr->first));
- }
+ if (pair.second == PLAYERSPELL_REMOVED)
+ continue;
- for (std::size_t slot = 0; slot < MAX_PVP_TALENT_SLOTS; ++slot)
- {
- if (!pvpTalents[slot])
- continue;
+ TalentEntry const* talentInfo = sTalentStore.LookupEntry(pair.first);
+ if (!talentInfo)
+ {
+ TC_LOG_ERROR("entities.player", "Player::SendTalentsInfoData: Player '{}' ({}) has unknown talent id: {}",
+ GetName(), GetGUID().ToString(), pair.first);
+ continue;
+ }
- PvpTalentEntry const* talentInfo = sPvpTalentStore.LookupEntry(pvpTalents[slot]);
- if (!talentInfo)
- {
- TC_LOG_ERROR("entities.player", "Player::SendTalentsInfoData: Player '{}' ({}) has unknown pvp talent id: {}",
- GetName(), GetGUID().ToString(), pvpTalents[slot]);
- continue;
- }
+ SpellInfo const* spellEntry = sSpellMgr->GetSpellInfo(talentInfo->SpellID, DIFFICULTY_NONE);
+ if (!spellEntry)
+ {
+ TC_LOG_ERROR("entities.player", "Player::SendTalentsInfoData: Player '{}' ({}) has unknown talent spell: {}",
+ GetName(), GetGUID().ToString(), talentInfo->SpellID);
+ continue;
+ }
- SpellInfo const* spellEntry = sSpellMgr->GetSpellInfo(talentInfo->SpellID, DIFFICULTY_NONE);
- if (!spellEntry)
- {
- TC_LOG_ERROR("entities.player", "Player::SendTalentsInfoData: Player '{}' ({}) has unknown pvp talent spell: {}",
- GetName(), GetGUID().ToString(), talentInfo->SpellID);
- continue;
+ groupInfo.Talents.push_back(uint16(pair.first));
}
-
- groupInfoPkt.PvPTalents.emplace_back();
- WorldPackets::Talent::PvPTalent& pvpTalent = groupInfoPkt.PvPTalents.back();
- pvpTalent.PvPTalentID = pvpTalents[slot];
- pvpTalent.Slot = slot;
}
- if (i == GetActiveTalentGroup())
- packet.Info.ActiveGroup = packet.Info.TalentGroups.size();
+ if (i == activeGroup)
+ packet.UnspentTalentPoints = std::max<int32>(0, DB2Manager::GetNumTalentsAtLevel(GetLevel(), Classes(GetClass())) - groupInfo.Talents.size());
- if (!groupInfoPkt.TalentIDs.empty() || !groupInfoPkt.PvPTalents.empty() || i == GetActiveTalentGroup())
- packet.Info.TalentGroups.push_back(groupInfoPkt);
+ std::vector<uint32> glyphs = GetGlyphs(activeGroup);
+ glyphs.resize(MAX_GLYPH_SLOT_INDEX, 0); // Blizzard always sends 6 glyph slots, no matter if they are used or not
+ groupInfo.GlyphIDs.reserve(MAX_GLYPH_SLOT_INDEX);
+ for (uint32 glyph : glyphs)
+ groupInfo.GlyphIDs.push_back(glyph);
}
- */
SendDirectMessage(packet.Write());
}
@@ -26864,19 +26653,6 @@ void Player::_LoadTalents(PreparedQueryResult result)
}
}
-void Player::_LoadPvpTalents(PreparedQueryResult result)
-{
- // "SELECT talentID0, talentID1, talentID2, talentID3, talentGroup FROM character_pvp_talent WHERE guid = ?"
- if (result)
- {
- do
- for (uint8 slot = 0; slot < MAX_PVP_TALENT_SLOTS; ++slot)
- if (PvpTalentEntry const* talent = sPvpTalentStore.LookupEntry((*result)[slot].GetUInt32()))
- AddPvpTalent(talent, (*result)[4].GetUInt8(), slot);
- while (result->NextRow());
- }
-}
-
void Player::_LoadTraits(PreparedQueryResult configsResult, PreparedQueryResult entriesResult)
{
std::unordered_multimap<int32, WorldPackets::Traits::TraitEntry> traitEntriesByConfig;
@@ -27042,23 +26818,6 @@ void Player::_SaveTalents(CharacterDatabaseTransaction trans)
++itr;
}
}
-
- stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_CHAR_PVP_TALENT);
- stmt->setUInt64(0, GetGUID().GetCounter());
- trans->Append(stmt);
-
- for (uint8 group = 0; group < MAX_SPECIALIZATIONS; ++group)
- {
- PlayerPvpTalentMap const& talents = GetPvpTalentMap(group);
- stmt = CharacterDatabase.GetPreparedStatement(CHAR_INS_CHAR_PVP_TALENT);
- stmt->setUInt64(0, GetGUID().GetCounter());
- stmt->setUInt32(1, talents[0]);
- stmt->setUInt32(2, talents[1]);
- stmt->setUInt32(3, talents[2]);
- stmt->setUInt32(4, talents[3]);
- stmt->setUInt8(5, group);
- trans->Append(stmt);
- }
}
void Player::_SaveTraits(CharacterDatabaseTransaction trans)
@@ -27152,9 +26911,9 @@ void Player::_SaveTraits(CharacterDatabaseTransaction trans)
m_traitConfigStates.clear();
}
-void Player::ActivateTalentGroup(ChrSpecializationEntry const* spec)
+void Player::ActivateTalentGroup(uint8 talentGroup)
{
- if (GetActiveTalentGroup() == spec->OrderIndex)
+ if (GetActiveTalentGroup() == talentGroup)
return;
if (IsNonMeleeSpellCast(false))
@@ -27228,27 +26987,6 @@ void Player::ActivateTalentGroup(ChrSpecializationEntry const* spec)
RemoveOverrideSpell(talentInfo->OverridesSpellID, talentInfo->SpellID);
}
- for (uint32 pvpTalentID = 0; pvpTalentID < sPvpTalentStore.GetNumRows(); ++pvpTalentID)
- {
- PvpTalentEntry const* talentInfo = sPvpTalentStore.LookupEntry(pvpTalentID);
- if (!talentInfo)
- continue;
-
- SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(talentInfo->SpellID, DIFFICULTY_NONE);
- if (!spellInfo)
- continue;
-
- RemoveSpell(talentInfo->SpellID, true);
-
- // search for spells that the talent teaches and unlearn them
- for (SpellEffectInfo const& spellEffectInfo : spellInfo->GetEffects())
- if (spellEffectInfo.IsEffect(SPELL_EFFECT_LEARN_SPELL) && spellEffectInfo.TriggerSpell > 0)
- RemoveSpell(spellEffectInfo.TriggerSpell, true);
-
- if (talentInfo->OverridesSpellID)
- RemoveOverrideSpell(talentInfo->OverridesSpellID, talentInfo->SpellID);
- }
-
ApplyTraitConfig(m_activePlayerData->ActiveCombatTraitConfigID, false);
// Remove spec specific spells
@@ -27257,18 +26995,8 @@ void Player::ActivateTalentGroup(ChrSpecializationEntry const* spec)
for (uint32 glyphId : GetGlyphs(GetActiveTalentGroup()))
RemoveAurasDueToSpell(sGlyphPropertiesStore.AssertEntry(glyphId)->SpellID);
- SetActiveTalentGroup(spec->OrderIndex);
- SetPrimarySpecialization(spec->ID);
- int32 specTraitConfigIndex = m_activePlayerData->TraitConfigs.FindIndexIf([spec](UF::TraitConfig const& traitConfig)
- {
- return static_cast<TraitConfigType>(*traitConfig.Type) == TraitConfigType::Combat
- && traitConfig.ChrSpecializationID == int32(spec->ID)
- && (static_cast<TraitCombatConfigFlags>(*traitConfig.CombatConfigFlags) & TraitCombatConfigFlags::ActiveForSpec) != TraitCombatConfigFlags::None;
- });
- if (specTraitConfigIndex >= 0)
- SetActiveCombatTraitConfigID(m_activePlayerData->TraitConfigs[specTraitConfigIndex].ID);
- else
- SetActiveCombatTraitConfigID(0);
+ SetActiveTalentGroup(talentGroup);
+ SetPrimarySpecialization(0);
for (uint32 talentId = 0; talentId < sTalentStore.GetNumRows(); ++talentId)
{
@@ -27292,27 +27020,8 @@ void Player::ActivateTalentGroup(ChrSpecializationEntry const* spec)
}
}
- for (uint8 slot = 0; slot < MAX_PVP_TALENT_SLOTS; ++slot)
- {
- PvpTalentEntry const* talentInfo = sPvpTalentStore.LookupEntry(GetPvpTalentMap(GetActiveTalentGroup())[slot]);
- if (!talentInfo)
- continue;
-
- if (!talentInfo->SpellID)
- continue;
-
- AddPvpTalent(talentInfo, GetActiveTalentGroup(), slot);
- }
-
LearnSpecializationSpells();
- if (CanUseMastery())
- for (uint32 i = 0; i < MAX_MASTERY_SPELLS; ++i)
- if (uint32 mastery = spec->MasterySpellID[i])
- LearnSpell(mastery, true);
-
- ApplyTraitConfig(m_activePlayerData->ActiveCombatTraitConfigID, true);
-
InitTalentForLevel();
StartLoadingActionButtons();
@@ -27329,20 +27038,9 @@ void Player::ActivateTalentGroup(ChrSpecializationEntry const* spec)
if (Item* equippedItem = GetItemByPos(INVENTORY_SLOT_BAG_0, i))
SetVisibleItemSlot(i, equippedItem);
- for (uint32 glyphId : GetGlyphs(spec->OrderIndex))
+ for (uint32 glyphId : GetGlyphs(talentGroup))
CastSpell(this, sGlyphPropertiesStore.AssertEntry(glyphId)->SpellID, true);
- WorldPackets::Talent::ActiveGlyphs activeGlyphs;
- activeGlyphs.Glyphs.reserve(GetGlyphs(spec->OrderIndex).size());
- for (uint32 glyphId : GetGlyphs(spec->OrderIndex))
- if (std::vector<uint32> const* bindableSpells = sDB2Manager.GetGlyphBindableSpells(glyphId))
- for (uint32 bindableSpell : *bindableSpells)
- if (HasSpell(bindableSpell) && m_overrideSpells.find(bindableSpell) == m_overrideSpells.end())
- activeGlyphs.Glyphs.emplace_back(uint32(bindableSpell), uint16(glyphId));
-
- activeGlyphs.IsFullUpdate = true;
- SendDirectMessage(activeGlyphs.Write());
-
Unit::AuraEffectList const& shapeshiftAuras = GetAuraEffectsByType(SPELL_AURA_MOD_SHAPESHIFT);
for (AuraEffect* aurEff : shapeshiftAuras)
{
diff --git a/src/server/game/Entities/Player/Player.h b/src/server/game/Entities/Player/Player.h
index e7139610517..214c326d32f 100644
--- a/src/server/game/Entities/Player/Player.h
+++ b/src/server/game/Entities/Player/Player.h
@@ -265,7 +265,6 @@ struct PlayerCurrency
};
typedef std::unordered_map<uint32, PlayerSpellState> PlayerTalentMap;
-typedef std::array<uint32, MAX_PVP_TALENT_SLOTS> PlayerPvpTalentMap;
typedef std::unordered_map<uint32, PlayerSpell> PlayerSpellMap;
typedef std::unordered_set<SpellModifier*> SpellModContainer;
typedef std::unordered_map<uint32, PlayerCurrency> PlayerCurrenciesMap;
@@ -868,7 +867,6 @@ enum PlayerLoginQueryIndex
PLAYER_LOGIN_QUERY_LOAD_BG_DATA,
PLAYER_LOGIN_QUERY_LOAD_GLYPHS,
PLAYER_LOGIN_QUERY_LOAD_TALENTS,
- PLAYER_LOGIN_QUERY_LOAD_PVP_TALENTS,
PLAYER_LOGIN_QUERY_LOAD_ACCOUNT_DATA,
PLAYER_LOGIN_QUERY_LOAD_SKILLS,
PLAYER_LOGIN_QUERY_LOAD_WEEKLY_QUEST_STATUS,
@@ -1066,14 +1064,10 @@ enum TalentLearnResult : int32
struct TC_GAME_API SpecializationInfo
{
- SpecializationInfo() : PvpTalents(), ResetTalentsCost(0), ResetTalentsTime(0), ActiveGroup(0)
- {
- for (PlayerPvpTalentMap& pvpTalents : PvpTalents)
- pvpTalents.fill(0);
- }
+
+ SpecializationInfo() : ResetTalentsCost(0), ResetTalentsTime(0), ActiveGroup(0) { }
PlayerTalentMap Talents[MAX_SPECIALIZATIONS];
- PlayerPvpTalentMap PvpTalents[MAX_SPECIALIZATIONS];
std::vector<uint32> Glyphs[MAX_SPECIALIZATIONS];
uint32 ResetTalentsCost;
time_t ResetTalentsTime;
@@ -1831,7 +1825,6 @@ class TC_GAME_API Player : public Unit, public GridObject<Player>
ChrSpecializationEntry const* GetPrimarySpecializationEntry() const;
bool ResetTalents(bool noCost = false);
- void ResetPvpTalents();
uint32 GetNextResetTalentsCost() const;
void InitTalentForLevel();
void SendTalentsInfoData();
@@ -1839,13 +1832,7 @@ class TC_GAME_API Player : public Unit, public GridObject<Player>
bool AddTalent(TalentEntry const* talent, uint8 spec, bool learning);
bool HasTalent(uint32 spell_id, uint8 spec) const;
void RemoveTalent(TalentEntry const* talent);
- void ResetTalentSpecialization();
- TalentLearnResult LearnPvpTalent(uint32 talentID, uint8 slot, int32* spellOnCooldown);
- bool AddPvpTalent(PvpTalentEntry const* talent, uint8 activeTalentGroup, uint8 slot);
- void RemovePvpTalent(PvpTalentEntry const* talent, uint8 activeTalentGroup);
- void TogglePvpTalents(bool enable);
- bool HasPvpTalent(uint32 talentID, uint8 activeTalentGroup) const;
void EnablePvpRules(bool dueToCombat = false);
void DisablePvpRules();
bool HasPvpRulesEnabled() const;
@@ -1853,12 +1840,10 @@ class TC_GAME_API Player : public Unit, public GridObject<Player>
bool IsAreaThatActivatesPvpTalents(uint32 areaID) const;
// Dual Spec
- void ActivateTalentGroup(ChrSpecializationEntry const* spec);
+ void ActivateTalentGroup(uint8 talentGroup);
PlayerTalentMap const* GetTalentMap(uint8 spec) const { return &_specializationInfo.Talents[spec]; }
PlayerTalentMap* GetTalentMap(uint8 spec) { return &_specializationInfo.Talents[spec]; }
- PlayerPvpTalentMap const& GetPvpTalentMap(uint8 spec) const { return _specializationInfo.PvpTalents[spec]; }
- PlayerPvpTalentMap& GetPvpTalentMap(uint8 spec) { return _specializationInfo.PvpTalents[spec]; }
std::vector<uint32> const& GetGlyphs(uint8 spec) const { return _specializationInfo.Glyphs[spec]; }
std::vector<uint32>& GetGlyphs(uint8 spec) { return _specializationInfo.Glyphs[spec]; }
ActionButtonList const& GetActionButtons() const { return m_actionButtons; }
@@ -2913,7 +2898,6 @@ class TC_GAME_API Player : public Unit, public GridObject<Player>
void _LoadBGData(PreparedQueryResult result);
void _LoadGlyphs(PreparedQueryResult result);
void _LoadTalents(PreparedQueryResult result);
- void _LoadPvpTalents(PreparedQueryResult result);
void _LoadTraits(PreparedQueryResult configsResult, PreparedQueryResult entriesResult);
void _LoadInstanceTimeRestrictions(PreparedQueryResult result);
void _LoadPetStable(uint32 summonedPetNumber, PreparedQueryResult result);
diff --git a/src/server/game/Handlers/CharacterHandler.cpp b/src/server/game/Handlers/CharacterHandler.cpp
index 93d02ae0606..f83b7a41df7 100644
--- a/src/server/game/Handlers/CharacterHandler.cpp
+++ b/src/server/game/Handlers/CharacterHandler.cpp
@@ -272,10 +272,6 @@ bool LoginQueryHolder::Initialize()
stmt->setUInt64(0, lowGuid);
res &= SetPreparedQuery(PLAYER_LOGIN_QUERY_LOAD_TALENTS, stmt);
- stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_CHARACTER_PVP_TALENTS);
- stmt->setUInt64(0, lowGuid);
- res &= SetPreparedQuery(PLAYER_LOGIN_QUERY_LOAD_PVP_TALENTS, stmt);
-
stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_PLAYER_ACCOUNT_DATA);
stmt->setUInt64(0, lowGuid);
res &= SetPreparedQuery(PLAYER_LOGIN_QUERY_LOAD_ACCOUNT_DATA, stmt);
@@ -1339,7 +1335,6 @@ void WorldSession::HandlePlayerLogin(LoginQueryHolder const& holder)
if (pCurrChar->HasAtLoginFlag(AT_LOGIN_RESET_TALENTS))
{
pCurrChar->ResetTalents(true);
- pCurrChar->ResetTalentSpecialization();
pCurrChar->SendTalentsInfoData(); // original talents send already in to SendInitialPacketsBeforeAddToMap, resend reset state
SendNotification(LANG_RESET_TALENTS);
}
diff --git a/src/server/game/Handlers/InspectHandler.cpp b/src/server/game/Handlers/InspectHandler.cpp
index a6a664fee14..865dcc25152 100644
--- a/src/server/game/Handlers/InspectHandler.cpp
+++ b/src/server/game/Handlers/InspectHandler.cpp
@@ -52,10 +52,6 @@ void WorldSession::HandleInspectOpcode(WorldPackets::Inspect::Inspect& inspect)
if (v.second != PLAYERSPELL_REMOVED)
inspectResult.Talents.push_back(v.first);
- PlayerPvpTalentMap const& pvpTalents = player->GetPvpTalentMap(player->GetActiveTalentGroup());
- for (std::size_t i = 0; i < pvpTalents.size(); ++i)
- inspectResult.PvpTalents[i] = pvpTalents[i];
-
inspectResult.TalentTraits.Level = player->GetLevel();
inspectResult.TalentTraits.ChrSpecializationID = AsUnderlyingType(player->GetPrimarySpecialization());
if (UF::TraitConfig const* traitConfig = player->GetTraitConfig(player->m_activePlayerData->ActiveCombatTraitConfigID))
diff --git a/src/server/game/Handlers/SkillHandler.cpp b/src/server/game/Handlers/SkillHandler.cpp
index 2d51a1fa08e..f7447b6ba7a 100644
--- a/src/server/game/Handlers/SkillHandler.cpp
+++ b/src/server/game/Handlers/SkillHandler.cpp
@@ -50,28 +50,8 @@ void WorldSession::HandleLearnTalentsOpcode(WorldPackets::Talent::LearnTalents&
_player->SendTalentsInfoData();
}
-void WorldSession::HandleLearnPvpTalentsOpcode(WorldPackets::Talent::LearnPvpTalents& packet)
+void WorldSession::HandleLearnPvpTalentsOpcode(WorldPackets::Talent::LearnPvpTalents& /*packet*/)
{
- WorldPackets::Talent::LearnPvpTalentFailed learnPvpTalentFailed;
- bool anythingLearned = false;
- for (WorldPackets::Talent::PvPTalent pvpTalent : packet.Talents)
- {
- if (TalentLearnResult result = _player->LearnPvpTalent(pvpTalent.PvPTalentID, pvpTalent.Slot, &learnPvpTalentFailed.SpellID))
- {
- if (!learnPvpTalentFailed.Reason)
- learnPvpTalentFailed.Reason = result;
-
- learnPvpTalentFailed.Talents.push_back(pvpTalent);
- }
- else
- anythingLearned = true;
- }
-
- if (learnPvpTalentFailed.Reason)
- SendPacket(learnPvpTalentFailed.Write());
-
- if (anythingLearned)
- _player->SendTalentsInfoData();
}
void WorldSession::HandleConfirmRespecWipeOpcode(WorldPackets::Talent::ConfirmRespecWipe& confirmRespecWipe)
diff --git a/src/server/game/Miscellaneous/SharedDefines.h b/src/server/game/Miscellaneous/SharedDefines.h
index 3564b062a61..b2a2ecb4c85 100644
--- a/src/server/game/Miscellaneous/SharedDefines.h
+++ b/src/server/game/Miscellaneous/SharedDefines.h
@@ -965,7 +965,7 @@ enum SpellAttr14 : uint32
};
#define MIN_SPECIALIZATION_LEVEL 10
-#define MAX_SPECIALIZATIONS 5
+#define MAX_SPECIALIZATIONS 2
#define PET_SPEC_OVERRIDE_CLASS_INDEX MAX_CLASSES
#define INITIAL_SPECIALIZATION_INDEX 4
diff --git a/src/server/game/Server/Packets/InspectPackets.cpp b/src/server/game/Server/Packets/InspectPackets.cpp
index 942ffdc8f63..5d82f758176 100644
--- a/src/server/game/Server/Packets/InspectPackets.cpp
+++ b/src/server/game/Server/Packets/InspectPackets.cpp
@@ -187,7 +187,6 @@ WorldPacket const* InspectResult::Write()
_worldPacket << DisplayInfo;
_worldPacket << uint32(Glyphs.size());
_worldPacket << uint32(Talents.size());
- _worldPacket << uint32(PvpTalents.size());
_worldPacket << int32(ItemLevel);
_worldPacket << uint8(LifetimeMaxRank);
_worldPacket << uint16(TodayHK);
@@ -198,8 +197,6 @@ WorldPacket const* InspectResult::Write()
_worldPacket.append(Glyphs.data(), Glyphs.size());
if (!Talents.empty())
_worldPacket.append(Talents.data(), Talents.size());
- if (!PvpTalents.empty())
- _worldPacket.append(PvpTalents.data(), PvpTalents.size());
_worldPacket.WriteBit(GuildData.has_value());
_worldPacket.WriteBit(AzeriteLevel.has_value());
diff --git a/src/server/game/Server/Packets/InspectPackets.h b/src/server/game/Server/Packets/InspectPackets.h
index ac65e1a0785..e23bf5638da 100644
--- a/src/server/game/Server/Packets/InspectPackets.h
+++ b/src/server/game/Server/Packets/InspectPackets.h
@@ -127,17 +127,13 @@ namespace WorldPackets
class InspectResult final : public ServerPacket
{
public:
- InspectResult() : ServerPacket(SMSG_INSPECT_RESULT, 45)
- {
- PvpTalents.fill(0);
- }
+ InspectResult() : ServerPacket(SMSG_INSPECT_RESULT, 45) { }
WorldPacket const* Write() override;
PlayerModelDisplayInfo DisplayInfo;
std::vector<uint16> Glyphs;
std::vector<uint16> Talents;
- std::array<uint16, MAX_PVP_TALENT_SLOTS> PvpTalents;
Optional<InspectGuildData> GuildData;
std::array<PVPBracketData, 7> Bracket;
Optional<int32> AzeriteLevel;
diff --git a/src/server/game/Server/Packets/MiscPackets.cpp b/src/server/game/Server/Packets/MiscPackets.cpp
index f82dfc012f6..0edbe1f98dc 100644
--- a/src/server/game/Server/Packets/MiscPackets.cpp
+++ b/src/server/game/Server/Packets/MiscPackets.cpp
@@ -397,7 +397,6 @@ WorldPacket const* WorldPackets::Misc::LevelUpInfo::Write()
_worldPacket << stat;
_worldPacket << int32(NumNewTalents);
- _worldPacket << int32(NumNewPvpTalentSlots);
return &_worldPacket;
}
diff --git a/src/server/game/Server/Packets/MiscPackets.h b/src/server/game/Server/Packets/MiscPackets.h
index faca3a0646e..de34549338f 100644
--- a/src/server/game/Server/Packets/MiscPackets.h
+++ b/src/server/game/Server/Packets/MiscPackets.h
@@ -507,7 +507,6 @@ namespace WorldPackets
std::array<int32, MAX_POWERS_PER_CLASS> PowerDelta = { };
std::array<int32, MAX_STATS> StatDelta = { };
int32 NumNewTalents = 0;
- int32 NumNewPvpTalentSlots = 0;
};
class PlayMusic final : public ServerPacket
diff --git a/src/server/game/Server/Packets/TalentPackets.h b/src/server/game/Server/Packets/TalentPackets.h
index 3cc97674f18..494866575ae 100644
--- a/src/server/game/Server/Packets/TalentPackets.h
+++ b/src/server/game/Server/Packets/TalentPackets.h
@@ -135,7 +135,7 @@ namespace WorldPackets
class LearnPvpTalentFailed final : public ServerPacket
{
public:
- LearnPvpTalentFailed() : ServerPacket(SMSG_LEARN_PVP_TALENT_FAILED, 1 + 4 + 4 + (2 + 1) * MAX_PVP_TALENT_SLOTS) { }
+ LearnPvpTalentFailed() : ServerPacket(SMSG_LEARN_PVP_TALENT_FAILED, 1 + 4 + 4 + (2 + 1)) { }
WorldPacket const* Write() override;
diff --git a/src/server/game/Spells/Auras/SpellAuraEffects.cpp b/src/server/game/Spells/Auras/SpellAuraEffects.cpp
index c1021a53447..af36a0adfe2 100644
--- a/src/server/game/Spells/Auras/SpellAuraEffects.cpp
+++ b/src/server/game/Spells/Auras/SpellAuraEffects.cpp
@@ -6125,16 +6125,6 @@ void AuraEffect::HandleCreateAreaTrigger(AuraApplication const* aurApp, uint8 mo
void AuraEffect::HandleAuraPvpTalents(AuraApplication const* auraApp, uint8 mode, bool apply) const
{
- if (!(mode & AURA_EFFECT_HANDLE_REAL))
- return;
-
- if (Player* target = auraApp->GetTarget()->ToPlayer())
- {
- if (apply)
- target->TogglePvpTalents(true);
- else if (!target->HasAuraType(SPELL_AURA_PVP_TALENTS))
- target->TogglePvpTalents(false);
- }
}
void AuraEffect::HandleLinkedSummon(AuraApplication const* aurApp, uint8 mode, bool apply) const
diff --git a/src/server/game/Spells/Spell.cpp b/src/server/game/Spells/Spell.cpp
index 9de34355dc6..1f322e5ace2 100644
--- a/src/server/game/Spells/Spell.cpp
+++ b/src/server/game/Spells/Spell.cpp
@@ -6485,21 +6485,10 @@ SpellCastResult Spell::CheckCast(bool strict, int32* param1 /*= nullptr*/, int32
}
case SPELL_EFFECT_TALENT_SPEC_SELECT:
{
- ChrSpecializationEntry const* spec = sChrSpecializationStore.LookupEntry(m_misc.SpecializationId);
Player* player = m_caster->ToPlayer();
if (!player)
return SPELL_FAILED_TARGET_NOT_PLAYER;
- if (!spec || (spec->ClassID != player->GetClass() && !spec->IsPetSpecialization()))
- return SPELL_FAILED_NO_SPEC;
-
- if (spec->IsPetSpecialization())
- {
- Pet* pet = player->GetPet();
- if (!pet || pet->getPetType() != HUNTER_PET || !pet->GetCharmInfo())
- return SPELL_FAILED_NO_PET;
- }
-
// can't change during already started arena/battleground
if (Battleground const* bg = player->GetBattleground())
if (bg->GetStatus() == STATUS_IN_PROGRESS)
diff --git a/src/server/game/Spells/SpellEffects.cpp b/src/server/game/Spells/SpellEffects.cpp
index 6080c8ad392..389e27c459e 100644
--- a/src/server/game/Spells/SpellEffects.cpp
+++ b/src/server/game/Spells/SpellEffects.cpp
@@ -4990,15 +4990,7 @@ void Spell::EffectActivateSpec()
if (!unitTarget || unitTarget->GetTypeId() != TYPEID_PLAYER)
return;
- Player* player = unitTarget->ToPlayer();
- uint32 specID = m_misc.SpecializationId;
- ChrSpecializationEntry const* spec = sChrSpecializationStore.AssertEntry(specID);
-
- // Safety checks done in Spell::CheckCast
- if (!spec->IsPetSpecialization())
- player->ActivateTalentGroup(spec);
- else
- player->GetPet()->SetSpecialization(specID);
+ unitTarget->ToPlayer()->ActivateTalentGroup(static_cast<uint8>(effectInfo->BasePoints));
}
void Spell::EffectPlaySound()
diff --git a/src/server/scripts/Commands/cs_reset.cpp b/src/server/scripts/Commands/cs_reset.cpp
index 56c5f8b0ef8..6870f822ebd 100644
--- a/src/server/scripts/Commands/cs_reset.cpp
+++ b/src/server/scripts/Commands/cs_reset.cpp
@@ -237,7 +237,6 @@ public:
if (target)
{
target->ResetTalents(true);
- target->ResetTalentSpecialization();
target->SendTalentsInfoData();
ChatHandler(target->GetSession()).SendSysMessage(LANG_RESET_TALENTS);
if (!handler->GetSession() || handler->GetSession()->GetPlayer() != target)