Core/Spells: Reimplemented automatic spell learning

* Fixed learning/unlearning talents
This commit is contained in:
Shauren
2015-01-30 23:58:16 +01:00
parent beb1a06ea5
commit 3f28fd304d
30 changed files with 724 additions and 674 deletions

View File

@@ -204,7 +204,7 @@ public:
// learn highest rank of talent and learn all non-talent spell ranks (recursive by tree)
player->LearnSpellHighestRank(talentInfo->SpellID);
player->AddTalent(talentInfo->SpellID, player->GetActiveTalentGroup(), true);
player->AddTalent(talentInfo, player->GetActiveTalentGroup(), true);
}
handler->SendSysMessage(LANG_COMMAND_LEARN_CLASS_TALENTS);

View File

@@ -435,11 +435,11 @@ public:
handler->PSendSysMessage(LANG_COMMAND_TARGET_LISTAURAS, auras.size());
for (Unit::AuraApplicationMap::const_iterator itr = auras.begin(); itr != auras.end(); ++itr)
{
bool talent = (GetTalentBySpellID(itr->second->GetBase()->GetId()) != nullptr);
AuraApplication const* aurApp = itr->second;
Aura const* aura = aurApp->GetBase();
char const* name = aura->GetSpellInfo()->SpellName;
bool talent = aura->GetSpellInfo()->HasAttribute(SPELL_ATTR0_CU_IS_TALENT);
std::ostringstream ss_name;
ss_name << "|cffffffff|Hspell:" << aura->GetId() << "|h[" << name << "]|h|r";

View File

@@ -814,7 +814,7 @@ public:
SpellInfo const* learnSpellInfo = effect ? sSpellMgr->GetSpellInfo(effect->TriggerSpell) : NULL;
bool talent = (GetTalentBySpellID(id) != nullptr);
bool talent = spellInfo->HasAttribute(SPELL_ATTR0_CU_IS_TALENT);
bool passive = spellInfo->IsPassive();
bool active = target && target->HasAura(id);
@@ -886,7 +886,7 @@ public:
SpellInfo const* learnSpellInfo = effect ? sSpellMgr->GetSpellInfo(effect->TriggerSpell) : NULL;
bool talent = (GetTalentBySpellID(id) != nullptr);
bool talent = spellInfo->HasAttribute(SPELL_ATTR0_CU_IS_TALENT);
bool passive = spellInfo->IsPassive();
bool active = target && target->HasAura(id);

View File

@@ -164,7 +164,7 @@ class spell_dru_eclipse_energize : public SpellScriptLoader
Player* caster = GetCaster()->ToPlayer();
// No boomy, no deal.
if (caster->GetActiveTalentSpec() != TALENT_SPEC_DRUID_BALANCE)
if (caster->GetSpecId(caster->GetActiveTalentGroup()) != TALENT_SPEC_DRUID_BALANCE)
return;
switch (GetSpellInfo()->Id)