I'm Trying to fix this talent ( http://www.wowhead.com/?spell=14195 ).
It should add another combo point if an ability that add it have a crit chance.
I tested it and it _don't_ work.
it work only for a gounge's damage crit.
so, if it partially work, won't be so hard to add other spells to the crit check
so, searching in the mangos code, i found this:
// Hemorrhage
if (m_spellInfo->SpellFamilyName==SPELLFAMILY_ROGUE && (m_spellInfo->SpellFamilyFlags & UI64LIT(0x2000000)))
{
if(m_caster->GetTypeId()==TYPEID_PLAYER)
((Player*)m_caster)->AddComboPoints(unitTarget, 1);
}
so, this is the part of the code that add a combo point to the hemo spell.
now, shouldn't be so hard to add a check of the talent and a check to the crit right?
on unit.cpp i found:
MeleeHitOutcome Unit::RollMeleeOutcomeAgainst (const Unit *pVictim, WeaponAttackType attType, int32 crit_chance, int32 miss_chance, int32 dodge_chance, int32 parry_chance, int32 block_chance, bool SpellCasted ) const
this is the declaration a a function that check the crit or dodge/miss of a certain spell.
the funcition return an anumerator, for us will be return MELEE_HIT_CRIT,
so should be
// Hemorrhage
if (m_spellInfo->SpellFamilyName==SPELLFAMILY_ROGUE && (m_spellInfo->SpellFamilyFlags & UI64LIT(0x2000000)))
{
if(m_caster->GetTypeId()==TYPEID_PLAYER)
((Player*)m_caster)->AddComboPoints(unitTarget, 1);
talent_check(); // ?
//outcome = RollPhysicalOutcomeAgainst (pVictim, attType, spellCasted); //if crit
if(outcome == MELEE_HIT_CRIT)
((Player*)m_caster)->AddComboPoints(unitTarget, 1);
}
now, this function is declared in unit.cpp and not on the included unit.h, so, how i can add this code o spelleffect.cpp? and how i check the talent learning?