diff --git a/src/game/Spell.cpp b/src/game/Spell.cpp index a0ce5591757..9c209ba8b1b 100644 --- a/src/game/Spell.cpp +++ b/src/game/Spell.cpp @@ -3037,8 +3037,11 @@ void Spell::cast(bool skipCheck) break; case SPELLFAMILY_HUNTER: { + // Deterrence + if (m_spellInfo->Id == 19263) + AddPrecastSpell(67801); // Kill Command - if (m_spellInfo->Id == 34026) + else if (m_spellInfo->Id == 34026) { if (m_caster->HasAura(37483)) // Improved Kill Command - Item set bonus m_caster->CastSpell(m_caster, 37482, true);// Exploited Weakness diff --git a/src/game/SpellAuraDefines.h b/src/game/SpellAuraDefines.h index f82fd21b0da..a975f050b3d 100644 --- a/src/game/SpellAuraDefines.h +++ b/src/game/SpellAuraDefines.h @@ -323,7 +323,7 @@ enum AuraType SPELL_AURA_MOD_ATTACK_POWER_OF_ARMOR = 285, SPELL_AURA_ABILITY_PERIODIC_CRIT = 286, SPELL_AURA_DEFLECT_SPELLS = 287, - SPELL_AURA_288 = 288, + SPELL_AURA_MOD_PARRY_FROM_BEHIND_PERCENT = 288, SPELL_AURA_289 = 289, SPELL_AURA_MOD_ALL_CRIT_CHANCE = 290, SPELL_AURA_MOD_QUEST_XP_PCT = 291, diff --git a/src/game/SpellAuras.cpp b/src/game/SpellAuras.cpp index badf2890639..bf57a786a4c 100644 --- a/src/game/SpellAuras.cpp +++ b/src/game/SpellAuras.cpp @@ -338,7 +338,7 @@ pAuraHandler AuraHandler[TOTAL_AURAS]= &Aura::HandleAuraModAttackPowerOfArmor, //285 SPELL_AURA_MOD_ATTACK_POWER_OF_ARMOR implemented in Player::UpdateAttackPowerAndDamage &Aura::HandleNoImmediateEffect, //286 SPELL_AURA_ABILITY_PERIODIC_CRIT implemented in Aura::IsCritFromAbilityAura called from Aura::PeriodicTick &Aura::HandleNoImmediateEffect, //287 SPELL_AURA_DEFLECT_SPELLS implemented in Unit::MagicSpellHitResult and Unit::MeleeSpellHitResult - &Aura::HandleNULL, //288 increase parry/deflect, prevent attack (single spell used 67801) + &Aura::HandleNoImmediateEffect, //288 SPELL_AURA_MOD_PARRY_FROM_BEHIND_PERCENT percent from normal parry/deflect applied to from behind attack case (single spell used 67801, also look 4.1.0 spell 97574) &Aura::HandleUnused, //289 unused (3.2.2a) &Aura::HandleAuraModAllCritChance, //290 SPELL_AURA_MOD_ALL_CRIT_CHANCE &Aura::HandleNoImmediateEffect, //291 SPELL_AURA_MOD_QUEST_XP_PCT implemented in Player::GiveXP diff --git a/src/game/SpellMgr.cpp b/src/game/SpellMgr.cpp index 45a42706ba1..efaa920a27d 100644 --- a/src/game/SpellMgr.cpp +++ b/src/game/SpellMgr.cpp @@ -2210,6 +2210,10 @@ bool SpellMgr::IsNoStackSpellDueToSpell(uint32 spellId_1, uint32 spellId_2) cons ((spellInfo_2->SpellFamilyFlags & UI64LIT(0x4)) && (spellInfo_1->SpellFamilyFlags & UI64LIT(0x00000004000)))) return false; + // Deterrence + if (spellInfo_1->SpellIconID == 83 && spellInfo_2->SpellIconID == 83) + return false; + // Bestial Wrath if (spellInfo_1->SpellIconID == 1680 && spellInfo_2->SpellIconID == 1680) return false; diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp index 129e23ba024..583ba819e77 100644 --- a/src/game/Unit.cpp +++ b/src/game/Unit.cpp @@ -2678,23 +2678,26 @@ MeleeHitOutcome Unit::RollMeleeOutcomeAgainst (const Unit *pVictim, WeaponAttack } // parry chances - // check if attack comes from behind, nobody can parry or block if attacker is behind - if (!from_behind) + // check if attack comes from behind, nobody can parry or block if attacker is behind if not have + if (!from_behind || pVictim->HasAuraType(SPELL_AURA_MOD_PARRY_FROM_BEHIND_PERCENT)) { // Reduce parry chance by attacker expertise rating if (GetTypeId() == TYPEID_PLAYER) - parry_chance-= int32(((Player*)this)->GetExpertiseDodgeOrParryReduction(attType)*100); + parry_chance -= int32(((Player*)this)->GetExpertiseDodgeOrParryReduction(attType)*100); else parry_chance -= GetTotalAuraModifier(SPELL_AURA_MOD_EXPERTISE)*25; - if(pVictim->GetTypeId()==TYPEID_PLAYER || !(((Creature*)pVictim)->GetCreatureInfo()->flags_extra & CREATURE_FLAG_EXTRA_NO_PARRY) ) + if (parry_chance > 0 && (pVictim->GetTypeId()==TYPEID_PLAYER || !(((Creature*)pVictim)->GetCreatureInfo()->flags_extra & CREATURE_FLAG_EXTRA_NO_PARRY))) { - int32 tmp2 = int32(parry_chance); - if ( (tmp2 > 0) // check if unit _can_ parry - && ((tmp2 -= skillBonus) > 0) - && (roll < (sum += tmp2))) + parry_chance -= skillBonus; + + //if (from_behind) -- only 100% currently and not 100% sure way value apply + // parry_chance = int32(parry_chance * (pVictim->GetTotalAuraMultiplier(SPELL_AURA_MOD_PARRY_FROM_BEHIND_PERCENT) - 1); + + if (parry_chance > 0 && // check if unit _can_ parry + (roll < (sum += parry_chance))) { - DEBUG_FILTER_LOG(LOG_FILTER_COMBAT, "RollMeleeOutcomeAgainst: PARRY <%d, %d)", sum-tmp2, sum); + DEBUG_FILTER_LOG(LOG_FILTER_COMBAT, "RollMeleeOutcomeAgainst: PARRY <%d, %d)", sum - parry_chance, sum); return MELEE_HIT_PARRY; } } @@ -2987,14 +2990,20 @@ SpellMissInfo Unit::MeleeSpellHitResult(Unit *pVictim, SpellEntry const *spell) if (spell->Attributes & SPELL_ATTR_IMPOSSIBLE_DODGE_PARRY_BLOCK) return SPELL_MISS_NONE; + bool from_behind = !pVictim->HasInArc(M_PI_F,this); + // Ranged attack cannot be parry/dodge only deflect if (attType == RANGED_ATTACK) { - // only if in front - if (pVictim->HasInArc(M_PI_F,this)) + // only if in front or special ability + if (!from_behind || pVictim->HasAuraType(SPELL_AURA_MOD_PARRY_FROM_BEHIND_PERCENT)) { int32 deflect_chance = pVictim->GetTotalAuraModifier(SPELL_AURA_DEFLECT_SPELLS)*100; - tmp+=deflect_chance; + + //if (from_behind) -- only 100% currently and not 100% sure way value apply + // deflect_chance = int32(deflect_chance * (pVictim->GetTotalAuraMultiplier(SPELL_AURA_MOD_PARRY_FROM_BEHIND_PERCENT) - 1); + + tmp += deflect_chance; if (roll < tmp) return SPELL_MISS_DEFLECT; } @@ -3002,13 +3011,14 @@ SpellMissInfo Unit::MeleeSpellHitResult(Unit *pVictim, SpellEntry const *spell) } // Check for attack from behind - if (!pVictim->HasInArc(M_PI_F,this)) + if (from_behind) { // Can`t dodge from behind in PvP (but its possible in PvE) if (GetTypeId() == TYPEID_PLAYER && pVictim->GetTypeId() == TYPEID_PLAYER) canDodge = false; - // Can`t parry - canParry = false; + // Can`t parry without special ability + if (!pVictim->HasAuraType(SPELL_AURA_MOD_PARRY_FROM_BEHIND_PERCENT)) + canParry = false; } // Check creatures flags_extra for disable parry if(pVictim->GetTypeId()==TYPEID_UNIT) @@ -3065,6 +3075,9 @@ SpellMissInfo Unit::MeleeSpellHitResult(Unit *pVictim, SpellEntry const *spell) if (parryChance < 0) parryChance = 0; + //if (from_behind) -- only 100% currently and not 100% sure way value apply + // parryChance = int32(parryChance * (pVictim->GetTotalAuraMultiplier(SPELL_AURA_MOD_PARRY_FROM_BEHIND_PERCENT) - 1)); + tmp += parryChance; if (roll < tmp) return SPELL_MISS_PARRY; @@ -3142,11 +3155,17 @@ SpellMissInfo Unit::MagicSpellHitResult(Unit *pVictim, SpellEntry const *spell) if (rand < tmp) return SPELL_MISS_MISS; - // cast by caster in front of victim - if (pVictim->HasInArc(M_PI_F,this)) + bool from_behind = !pVictim->HasInArc(M_PI_F,this); + + // cast by caster in front of victim or behind with special ability + if (!from_behind || pVictim->HasAuraType(SPELL_AURA_MOD_PARRY_FROM_BEHIND_PERCENT)) { int32 deflect_chance = pVictim->GetTotalAuraModifier(SPELL_AURA_DEFLECT_SPELLS)*100; - tmp+=deflect_chance; + + //if (from_behind) -- only 100% currently and not 100% sure way value apply + // deflect_chance = int32(deflect_chance * (pVictim->GetTotalAuraMultiplier(SPELL_AURA_MOD_PARRY_FROM_BEHIND_PERCENT)) - 1); + + tmp += deflect_chance; if (rand < tmp) return SPELL_MISS_DEFLECT; } diff --git a/src/shared/revision_nr.h b/src/shared/revision_nr.h index 2f5e32fe3b4..8d2b1593431 100644 --- a/src/shared/revision_nr.h +++ b/src/shared/revision_nr.h @@ -1,4 +1,4 @@ #ifndef __REVISION_NR_H__ #define __REVISION_NR_H__ - #define REVISION_NR "11509" + #define REVISION_NR "11510" #endif // __REVISION_NR_H__