*Implement aura type SPELL_AURA_MOD_CRIT_PCT(290).
--HG-- branch : trunk
This commit is contained in:
@@ -130,7 +130,6 @@ bool SpellClickInfo::IsFitToRequirements(Player const* player, Creature const *
|
||||
if (!player->HasAura(auraRequired))
|
||||
return false;
|
||||
|
||||
sLog.outError("Aura forbid: %d", auraForbidden);
|
||||
if (auraForbidden)
|
||||
if (player->HasAura(auraForbidden))
|
||||
return false;
|
||||
|
||||
+1
-1
@@ -7096,7 +7096,7 @@ void Player::_ApplyItemBonuses(ItemPrototype const *proto, uint8 slot, bool appl
|
||||
|
||||
void Player::_ApplyWeaponDependentAuraMods(Item *item,WeaponAttackType attackType,bool apply)
|
||||
{
|
||||
AuraEffectList const& auraCritList = GetAurasByType(SPELL_AURA_MOD_CRIT_PERCENT);
|
||||
AuraEffectList const& auraCritList = GetAurasByType(SPELL_AURA_MOD_WEAPON_CRIT_PERCENT);
|
||||
for(AuraEffectList::const_iterator itr = auraCritList.begin(); itr!=auraCritList.end();++itr)
|
||||
_ApplyWeaponDependentAuraCritMod(item,attackType,*itr,apply);
|
||||
|
||||
|
||||
@@ -97,7 +97,7 @@ enum AuraType
|
||||
SPELL_AURA_MOD_DODGE_PERCENT = 49,
|
||||
SPELL_AURA_MOD_CRITICAL_HEALING_AMOUNT = 50,
|
||||
SPELL_AURA_MOD_BLOCK_PERCENT = 51,
|
||||
SPELL_AURA_MOD_CRIT_PERCENT = 52,
|
||||
SPELL_AURA_MOD_WEAPON_CRIT_PERCENT = 52,
|
||||
SPELL_AURA_PERIODIC_LEECH = 53,
|
||||
SPELL_AURA_MOD_HIT_CHANCE = 54,
|
||||
SPELL_AURA_MOD_SPELL_HIT_CHANCE = 55,
|
||||
@@ -335,7 +335,7 @@ enum AuraType
|
||||
SPELL_AURA_DEFLECT_SPELLS,
|
||||
SPELL_AURA_288,
|
||||
SPELL_AURA_289,
|
||||
SPELL_AURA_MOD_CRIT_CHANCE,
|
||||
SPELL_AURA_MOD_CRIT_PCT,
|
||||
SPELL_AURA_MOD_XP_QUEST_PCT,
|
||||
SPELL_AURA_292,
|
||||
SPELL_AURA_293,
|
||||
|
||||
+20
-4
@@ -105,7 +105,7 @@ pAuraHandler AuraHandler[TOTAL_AURAS]=
|
||||
&Aura::HandleAuraModDodgePercent, // 49 SPELL_AURA_MOD_DODGE_PERCENT
|
||||
&Aura::HandleNoImmediateEffect, // 50 SPELL_AURA_MOD_CRITICAL_HEALING_AMOUNT implemented in Unit::SpellCriticalHealingBonus
|
||||
&Aura::HandleAuraModBlockPercent, // 51 SPELL_AURA_MOD_BLOCK_PERCENT
|
||||
&Aura::HandleAuraModCritPercent, // 52 SPELL_AURA_MOD_CRIT_PERCENT
|
||||
&Aura::HandleAuraModWeaponCritPercent, // 52 SPELL_AURA_MOD_WEAPON_CRIT_PERCENT
|
||||
&Aura::HandlePeriodicLeech, // 53 SPELL_AURA_PERIODIC_LEECH
|
||||
&Aura::HandleModHitChance, // 54 SPELL_AURA_MOD_HIT_CHANCE
|
||||
&Aura::HandleModSpellHitChance, // 55 SPELL_AURA_MOD_SPELL_HIT_CHANCE
|
||||
@@ -337,13 +337,13 @@ pAuraHandler AuraHandler[TOTAL_AURAS]=
|
||||
&Aura::HandleNoImmediateEffect, //281 SPELL_AURA_MOD_HONOR_GAIN_PCT implemented in Player::RewardHonor
|
||||
&Aura::HandleAuraIncreaseBaseHealthPercent, //282 SPELL_AURA_INCREASE_BASE_HEALTH_PERCENT
|
||||
&Aura::HandleNoImmediateEffect, //283 SPELL_AURA_MOD_HEALING_RECEIVED implemented in Unit::SpellHealingBonus
|
||||
&Aura::HandleNULL, //284 SPELL_AURA_LINKED - probably not sent to client
|
||||
&Aura::HandleNULL, //284 SPELL_AURA_LINKED
|
||||
&Aura::HandleAuraModAttackPowerOfArmor, //285 SPELL_AURA_MOD_ATTACK_POWER_OF_ARMOR implemented in Player::UpdateAttackPowerAndDamage
|
||||
&Aura::HandleNoImmediateEffect, //286 SPELL_AURA_ABILITY_PERIODIC_CRIT implemented in AuraEffect::PeriodicTick
|
||||
&Aura::HandleNoImmediateEffect, //287 SPELL_AURA_DEFLECT_SPELLS implemented in Unit::MagicSpellHitResult and Unit::MeleeSpellHitResult
|
||||
&Aura::HandleUnused, //288 unused
|
||||
&Aura::HandleUnused, //289 unused
|
||||
&Aura::HandleNULL, //290 mod all critical hit chances?
|
||||
&Aura::HandleAuraModCritPct, //290 SPELL_AURA_MOD_CRIT_PCT
|
||||
&Aura::HandleNoImmediateEffect, //291 SPELL_AURA_MOD_XP_QUEST_PCT implemented in Player::RewardQuest
|
||||
&Aura::HandleNULL, //292 call stabled pet
|
||||
&Aura::HandleNULL, //293 2 test spells
|
||||
@@ -4950,7 +4950,7 @@ void AuraEffect::HandleAuraModRegenInterrupt(bool /*apply*/, bool Real, bool cha
|
||||
((Player*)m_target)->UpdateManaRegen();
|
||||
}
|
||||
|
||||
void AuraEffect::HandleAuraModCritPercent(bool apply, bool Real, bool changeAmount)
|
||||
void AuraEffect::HandleAuraModWeaponCritPercent(bool apply, bool Real, bool changeAmount)
|
||||
{
|
||||
if(m_target->GetTypeId()!=TYPEID_PLAYER)
|
||||
return;
|
||||
@@ -6830,6 +6830,22 @@ void AuraEffect::HandleAuraCloneCaster( bool Apply, bool Real , bool /*changeAmo
|
||||
}
|
||||
}
|
||||
|
||||
void AuraEffect::HandleAuraModCritPct(bool apply, bool Real, bool changeAmount)
|
||||
{
|
||||
if(m_target->GetTypeId() != TYPEID_PLAYER)
|
||||
{
|
||||
m_target->m_baseSpellCritChance += apply ? m_amount:-m_amount;
|
||||
return;
|
||||
}
|
||||
|
||||
if(Real || changeAmount)
|
||||
((Player*)m_target)->UpdateAllSpellCritChances();
|
||||
|
||||
((Player*)m_target)->HandleBaseModValue(CRIT_PERCENTAGE, FLAT_MOD, float (m_amount), apply);
|
||||
((Player*)m_target)->HandleBaseModValue(OFFHAND_CRIT_PERCENTAGE, FLAT_MOD, float (m_amount), apply);
|
||||
((Player*)m_target)->HandleBaseModValue(RANGED_CRIT_PERCENTAGE, FLAT_MOD, float (m_amount), apply);
|
||||
}
|
||||
|
||||
int32 AuraEffect::CalculateCrowdControlAuraAmount(Unit * caster)
|
||||
{
|
||||
// Damage cap for CC effects
|
||||
|
||||
@@ -248,7 +248,7 @@ class TRINITY_DLL_SPEC AuraEffect
|
||||
void HandleAuraModParryPercent(bool Apply, bool Real, bool changeAmount);
|
||||
void HandleAuraModDodgePercent(bool Apply, bool Real, bool changeAmount);
|
||||
void HandleAuraModBlockPercent(bool Apply, bool Real, bool changeAmount);
|
||||
void HandleAuraModCritPercent(bool Apply, bool Real, bool changeAmount);
|
||||
void HandleAuraModWeaponCritPercent(bool Apply, bool Real, bool changeAmount);
|
||||
void HandlePeriodicLeech(bool Apply, bool Real, bool changeAmount);
|
||||
void HandleModHitChance(bool Apply, bool Real, bool changeAmount);
|
||||
void HandleModSpellHitChance(bool Apply, bool Real, bool changeAmount);
|
||||
@@ -327,6 +327,7 @@ class TRINITY_DLL_SPEC AuraEffect
|
||||
void HandleCharmConvert(bool apply, bool Real, bool changeAmount);
|
||||
void HandleAuraInitializeImages(bool Apply, bool Real, bool changeAmount);
|
||||
void HandleAuraCloneCaster(bool Apply, bool Real, bool changeAmount);
|
||||
void HandleAuraModCritPct(bool Apply, bool Real, bool changeAmount);
|
||||
|
||||
void HandleAuraEffectSpecificMods(bool apply, bool Real, bool changeAmount);
|
||||
int32 CalculateCrowdControlAuraAmount(Unit * caster);
|
||||
|
||||
@@ -795,6 +795,7 @@ bool SpellMgr::_isPositiveEffect(uint32 spellId, uint32 effIndex, bool deep) con
|
||||
if(spellproto->CalculateSimpleValue(effIndex) > 0)
|
||||
return false;
|
||||
break;
|
||||
case SPELL_AURA_MOD_CRIT_PCT:
|
||||
case SPELL_AURA_MOD_SPELL_CRIT_CHANCE:
|
||||
if(spellproto->CalculateSimpleValue(effIndex) > 0)
|
||||
return true; // some expected positive spells have SPELL_ATTR_EX_NEGATIVE
|
||||
|
||||
@@ -619,6 +619,8 @@ void Player::UpdateSpellCritChance(uint32 school)
|
||||
crit += GetSpellCritFromIntellect();
|
||||
// Increase crit from SPELL_AURA_MOD_SPELL_CRIT_CHANCE
|
||||
crit += GetTotalAuraModifier(SPELL_AURA_MOD_SPELL_CRIT_CHANCE);
|
||||
// Increase crit from SPELL_AURA_MOD_CRIT_PCT
|
||||
crit += GetTotalAuraModifier(SPELL_AURA_MOD_CRIT_PCT);
|
||||
// Increase crit by school from SPELL_AURA_MOD_SPELL_CRIT_CHANCE_SCHOOL
|
||||
crit += GetTotalAuraModifierByMiscMask(SPELL_AURA_MOD_SPELL_CRIT_CHANCE_SCHOOL, 1<<school);
|
||||
// Increase crit from spell crit ratings
|
||||
|
||||
+2
-1
@@ -3082,7 +3082,8 @@ float Unit::GetUnitCriticalChance(WeaponAttackType attackType, const Unit *pVict
|
||||
else
|
||||
{
|
||||
crit = 5.0f;
|
||||
crit += GetTotalAuraModifier(SPELL_AURA_MOD_CRIT_PERCENT);
|
||||
crit += GetTotalAuraModifier(SPELL_AURA_MOD_WEAPON_CRIT_PERCENT);
|
||||
crit += GetTotalAuraModifier(SPELL_AURA_MOD_CRIT_PCT);
|
||||
}
|
||||
|
||||
// flat aura mods
|
||||
|
||||
Reference in New Issue
Block a user