diff options
| author | Rat <gmstreetrat@gmail.com> | 2014-11-11 16:22:31 +0100 |
|---|---|---|
| committer | Rat <gmstreetrat@gmail.com> | 2014-11-11 16:22:31 +0100 |
| commit | 1918a3be6aedaf7a137e5c6dd8f3c0f791b96a2f (patch) | |
| tree | 211407137d1ff5d4c4a0f43a1c452f0645f0f0be /src/server/scripts/Commands | |
| parent | b978f0286c4ff1f00d4806b332f825df80c0112e (diff) | |
| parent | 9120eef500bacbe7d54cdf4c5e1e07528854a49a (diff) | |
Merge pull request #13529 from Intel/talents
Core/Talents: Update talent system, remove talent points. author: Intel
Diffstat (limited to 'src/server/scripts/Commands')
| -rw-r--r-- | src/server/scripts/Commands/cs_learn.cpp | 43 | ||||
| -rw-r--r-- | src/server/scripts/Commands/cs_list.cpp | 2 | ||||
| -rw-r--r-- | src/server/scripts/Commands/cs_lookup.cpp | 12 | ||||
| -rw-r--r-- | src/server/scripts/Commands/cs_modify.cpp | 3 |
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 ee3b7ce124b..1c689aadd47 100644 --- a/src/server/scripts/Commands/cs_modify.cpp +++ b/src/server/scripts/Commands/cs_modify.cpp @@ -420,6 +420,7 @@ public: //Edit Player TP static bool HandleModifyTalentCommand (ChatHandler* handler, const char* args) { + /* TODO: 6.x remove this if (!*args) return false; @@ -460,7 +461,7 @@ public: handler->SendSysMessage(LANG_NO_CHAR_SELECTED); handler->SetSentErrorMessage(true); - return false; + return false;*/ } //Edit Player Aspeed |
