aboutsummaryrefslogtreecommitdiff
path: root/src/server/scripts/Commands
diff options
context:
space:
mode:
authorIntel <chemicstry@gmail.com>2014-11-10 21:09:18 +0200
committerIntel <chemicstry@gmail.com>2014-11-10 21:09:18 +0200
commit24850994b4fc1b285e84f2f44f2278bf3a091900 (patch)
tree774312cc1e1918f7878947a7024e13827eb6eabd /src/server/scripts/Commands
parente90ef4fa24a1da7f4d7433a1522e5cb43ef68d29 (diff)
Core/Talents: Update talent system, remove talent points
Diffstat (limited to 'src/server/scripts/Commands')
-rw-r--r--src/server/scripts/Commands/cs_learn.cpp43
-rw-r--r--src/server/scripts/Commands/cs_list.cpp2
-rw-r--r--src/server/scripts/Commands/cs_lookup.cpp12
-rw-r--r--src/server/scripts/Commands/cs_modify.cpp3
4 files changed, 14 insertions, 46 deletions
diff --git a/src/server/scripts/Commands/cs_learn.cpp b/src/server/scripts/Commands/cs_learn.cpp
index eb5be0950aa..81499567b72 100644
--- a/src/server/scripts/Commands/cs_learn.cpp
+++ b/src/server/scripts/Commands/cs_learn.cpp
@@ -116,9 +116,6 @@ public:
else
targetPlayer->LearnSpell(spell, false);
- if (GetTalentSpellCost(spellInfo->GetFirstRankSpell()->Id))
- targetPlayer->SendTalentsInfoData(false);
-
return true;
}
@@ -176,10 +173,6 @@ public:
if (spellInfo->SpellFamilyName != family)
continue;
- // skip spells with first rank learned as talent (and all talents then also)
- if (GetTalentSpellCost(spellInfo->GetFirstRankSpell()->Id) > 0)
- continue;
-
// skip broken spells
if (!SpellMgr::IsSpellValid(spellInfo, handler->GetSession()->GetPlayer(), false))
continue;
@@ -194,7 +187,7 @@ public:
static bool HandleLearnAllMyTalentsCommand(ChatHandler* handler, char const* /*args*/)
{
Player* player = handler->GetSession()->GetPlayer();
- uint32 classMask = player->getClassMask();
+ uint32 playerClass = player->getClass();
for (uint32 i = 0; i < sTalentStore.GetNumRows(); ++i)
{
@@ -202,44 +195,25 @@ public:
if (!talentInfo)
continue;
- TalentTabEntry const* talentTabInfo = sTalentTabStore.LookupEntry(talentInfo->TalentTab);
- if (!talentTabInfo)
- continue;
-
- if ((classMask & talentTabInfo->ClassMask) == 0)
+ if (playerClass != talentInfo->ClassID)
continue;
- // search highest talent rank
- uint32 spellId = 0;
- for (int8 rank = MAX_TALENT_RANK - 1; rank >= 0; --rank)
- {
- if (talentInfo->RankID[rank] != 0)
- {
- spellId = talentInfo->RankID[rank];
- break;
- }
- }
-
- if (!spellId) // ??? none spells in talent
- continue;
-
- SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(spellId);
+ SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(talentInfo->SpellID);
if (!spellInfo || !SpellMgr::IsSpellValid(spellInfo, handler->GetSession()->GetPlayer(), false))
continue;
// learn highest rank of talent and learn all non-talent spell ranks (recursive by tree)
- player->LearnSpellHighestRank(spellId);
- player->AddTalent(spellId, player->GetActiveSpec(), true);
+ player->LearnSpellHighestRank(talentInfo->SpellID);
+ player->AddTalent(talentInfo->SpellID, player->GetActiveSpec(), true);
}
- player->SetFreeTalentPoints(0);
-
handler->SendSysMessage(LANG_COMMAND_LEARN_CLASS_TALENTS);
return true;
}
static bool HandleLearnAllMyPetTalentsCommand(ChatHandler* handler, char const* /*args*/)
{
+ /* TODO: 6.x remove pet talents
Player* player = handler->GetSession()->GetPlayer();
Pet* pet = player->GetPet();
@@ -312,7 +286,7 @@ public:
pet->SetFreeTalentPoints(0);
- handler->SendSysMessage(LANG_COMMAND_LEARN_PET_TALENTS);
+ handler->SendSysMessage(LANG_COMMAND_LEARN_PET_TALENTS);*/
return true;
}
@@ -484,9 +458,6 @@ public:
else
handler->SendSysMessage(LANG_FORGET_SPELL);
- if (GetTalentSpellCost(spellId))
- target->SendTalentsInfoData(false);
-
return true;
}
};
diff --git a/src/server/scripts/Commands/cs_list.cpp b/src/server/scripts/Commands/cs_list.cpp
index 2a090aa70a8..deb714d1ef8 100644
--- a/src/server/scripts/Commands/cs_list.cpp
+++ b/src/server/scripts/Commands/cs_list.cpp
@@ -435,7 +435,7 @@ public:
handler->PSendSysMessage(LANG_COMMAND_TARGET_LISTAURAS, auras.size());
for (Unit::AuraApplicationMap::const_iterator itr = auras.begin(); itr != auras.end(); ++itr)
{
- bool talent = GetTalentSpellCost(itr->second->GetBase()->GetId()) > 0;
+ bool talent = (GetTalentBySpellID(itr->second->GetBase()->GetId()) != nullptr);
AuraApplication const* aurApp = itr->second;
Aura const* aura = aurApp->GetBase();
diff --git a/src/server/scripts/Commands/cs_lookup.cpp b/src/server/scripts/Commands/cs_lookup.cpp
index 7d8fec52143..55468788d9f 100644
--- a/src/server/scripts/Commands/cs_lookup.cpp
+++ b/src/server/scripts/Commands/cs_lookup.cpp
@@ -812,15 +812,13 @@ public:
SpellInfo const* learnSpellInfo = sSpellMgr->GetSpellInfo(spellInfo->Effects[0].TriggerSpell);
- uint32 talentCost = GetTalentSpellCost(id);
-
- bool talent = (talentCost > 0);
+ bool talent = (GetTalentBySpellID(id) != nullptr);
bool passive = spellInfo->IsPassive();
bool active = target && target->HasAura(id);
// unit32 used to prevent interpreting uint8 as char at output
// find rank of learned spell for learning spell, or talent rank
- uint32 rank = talentCost ? talentCost : learn && learnSpellInfo ? learnSpellInfo->GetRank() : spellInfo->GetRank();
+ uint32 rank = learn && learnSpellInfo ? learnSpellInfo->GetRank() : spellInfo->GetRank();
// send spell in "id - [name, rank N] [talent] [passive] [learn] [known]" format
std::ostringstream ss;
@@ -884,15 +882,13 @@ public:
SpellInfo const* learnSpellInfo = sSpellMgr->GetSpellInfo(spellInfo->Effects[0].TriggerSpell);
- uint32 talentCost = GetTalentSpellCost(id);
-
- bool talent = (talentCost > 0);
+ bool talent = (GetTalentBySpellID(id) != nullptr);
bool passive = spellInfo->IsPassive();
bool active = target && target->HasAura(id);
// unit32 used to prevent interpreting uint8 as char at output
// find rank of learned spell for learning spell, or talent rank
- uint32 rank = talentCost ? talentCost : learn && learnSpellInfo ? learnSpellInfo->GetRank() : spellInfo->GetRank();
+ uint32 rank = learn && learnSpellInfo ? learnSpellInfo->GetRank() : spellInfo->GetRank();
// send spell in "id - [name, rank N] [talent] [passive] [learn] [known]" format
std::ostringstream ss;
diff --git a/src/server/scripts/Commands/cs_modify.cpp b/src/server/scripts/Commands/cs_modify.cpp
index 24283dca7ac..d520c1cf765 100644
--- a/src/server/scripts/Commands/cs_modify.cpp
+++ b/src/server/scripts/Commands/cs_modify.cpp
@@ -419,6 +419,7 @@ public:
//Edit Player TP
static bool HandleModifyTalentCommand (ChatHandler* handler, const char* args)
{
+ /* TODO: 6.x remove this
if (!*args)
return false;
@@ -459,7 +460,7 @@ public:
handler->SendSysMessage(LANG_NO_CHAR_SELECTED);
handler->SetSentErrorMessage(true);
- return false;
+ return false;*/
}
//Edit Player Aspeed