25529Fermer25531
WarptenLe 25/04/2013 à 03:23
./25529 Empry ? picol
void HandleDummy(SpellEffIndex effIndex) { PreventHitDefaultEffect(effIndex); Player* target = GetHitPlayer(); if (!target) return; // Add all mastery spells but only activates the ones we can have uint32 const* talentTabs = GetTalentTabPages(target->getClass()); uint32 currentSpec = target->GetPrimaryTalentTree(target->GetActiveSpec()); for (uint32 i = 0; i < MAX_TALENT_TABS; ++i) if (TalentTabEntry const* talentTab = sTalentTabStore.LookupEntry(talentTabs[i])) for (uint32 i = 0; i < 2; ++i) // Max mastery spells per spec if (uint32 mastery = talentTab->MasterySpells[i]) target->addSpell(mastery, currentSpec == talentTabs[i], true, false, currentSpec != talentTabs[i]); // Activate mastery handling target->SetMasteryState(true); uint32 const MasterySpellBookSpells[11] = { 86479, 86474, 86472, 86476, 86475, 86471, 86477, 86473, 86478, 0, 86470 }; if (uint32 spellId = MasterySpellBookSpells[target->getClass() - 1]) target->learnSpell(spellId, false); } void Register() { OnEffectHitTarget += SpellEffectFn(spell_gen_enable_mastery_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY); }