mirror of
https://github.com/mangosfour/server.git
synced 2025-12-12 19:37:03 +00:00
[11510] Implement SPELL_AURA_MOD_PARRY_FROM_BEHIND_PERCENT (288) and related spell 19263.
Original patchs provided by KAPATEJIb and Roshnak.
This commit is contained in:
parent
b7cc436571
commit
0564b622c2
6 changed files with 48 additions and 22 deletions
|
|
@ -3037,8 +3037,11 @@ void Spell::cast(bool skipCheck)
|
||||||
break;
|
break;
|
||||||
case SPELLFAMILY_HUNTER:
|
case SPELLFAMILY_HUNTER:
|
||||||
{
|
{
|
||||||
|
// Deterrence
|
||||||
|
if (m_spellInfo->Id == 19263)
|
||||||
|
AddPrecastSpell(67801);
|
||||||
// Kill Command
|
// Kill Command
|
||||||
if (m_spellInfo->Id == 34026)
|
else if (m_spellInfo->Id == 34026)
|
||||||
{
|
{
|
||||||
if (m_caster->HasAura(37483)) // Improved Kill Command - Item set bonus
|
if (m_caster->HasAura(37483)) // Improved Kill Command - Item set bonus
|
||||||
m_caster->CastSpell(m_caster, 37482, true);// Exploited Weakness
|
m_caster->CastSpell(m_caster, 37482, true);// Exploited Weakness
|
||||||
|
|
|
||||||
|
|
@ -323,7 +323,7 @@ enum AuraType
|
||||||
SPELL_AURA_MOD_ATTACK_POWER_OF_ARMOR = 285,
|
SPELL_AURA_MOD_ATTACK_POWER_OF_ARMOR = 285,
|
||||||
SPELL_AURA_ABILITY_PERIODIC_CRIT = 286,
|
SPELL_AURA_ABILITY_PERIODIC_CRIT = 286,
|
||||||
SPELL_AURA_DEFLECT_SPELLS = 287,
|
SPELL_AURA_DEFLECT_SPELLS = 287,
|
||||||
SPELL_AURA_288 = 288,
|
SPELL_AURA_MOD_PARRY_FROM_BEHIND_PERCENT = 288,
|
||||||
SPELL_AURA_289 = 289,
|
SPELL_AURA_289 = 289,
|
||||||
SPELL_AURA_MOD_ALL_CRIT_CHANCE = 290,
|
SPELL_AURA_MOD_ALL_CRIT_CHANCE = 290,
|
||||||
SPELL_AURA_MOD_QUEST_XP_PCT = 291,
|
SPELL_AURA_MOD_QUEST_XP_PCT = 291,
|
||||||
|
|
|
||||||
|
|
@ -338,7 +338,7 @@ pAuraHandler AuraHandler[TOTAL_AURAS]=
|
||||||
&Aura::HandleAuraModAttackPowerOfArmor, //285 SPELL_AURA_MOD_ATTACK_POWER_OF_ARMOR implemented in Player::UpdateAttackPowerAndDamage
|
&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, //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::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::HandleUnused, //289 unused (3.2.2a)
|
||||||
&Aura::HandleAuraModAllCritChance, //290 SPELL_AURA_MOD_ALL_CRIT_CHANCE
|
&Aura::HandleAuraModAllCritChance, //290 SPELL_AURA_MOD_ALL_CRIT_CHANCE
|
||||||
&Aura::HandleNoImmediateEffect, //291 SPELL_AURA_MOD_QUEST_XP_PCT implemented in Player::GiveXP
|
&Aura::HandleNoImmediateEffect, //291 SPELL_AURA_MOD_QUEST_XP_PCT implemented in Player::GiveXP
|
||||||
|
|
|
||||||
|
|
@ -2210,6 +2210,10 @@ bool SpellMgr::IsNoStackSpellDueToSpell(uint32 spellId_1, uint32 spellId_2) cons
|
||||||
((spellInfo_2->SpellFamilyFlags & UI64LIT(0x4)) && (spellInfo_1->SpellFamilyFlags & UI64LIT(0x00000004000))))
|
((spellInfo_2->SpellFamilyFlags & UI64LIT(0x4)) && (spellInfo_1->SpellFamilyFlags & UI64LIT(0x00000004000))))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
// Deterrence
|
||||||
|
if (spellInfo_1->SpellIconID == 83 && spellInfo_2->SpellIconID == 83)
|
||||||
|
return false;
|
||||||
|
|
||||||
// Bestial Wrath
|
// Bestial Wrath
|
||||||
if (spellInfo_1->SpellIconID == 1680 && spellInfo_2->SpellIconID == 1680)
|
if (spellInfo_1->SpellIconID == 1680 && spellInfo_2->SpellIconID == 1680)
|
||||||
return false;
|
return false;
|
||||||
|
|
|
||||||
|
|
@ -2678,23 +2678,26 @@ MeleeHitOutcome Unit::RollMeleeOutcomeAgainst (const Unit *pVictim, WeaponAttack
|
||||||
}
|
}
|
||||||
|
|
||||||
// parry chances
|
// parry chances
|
||||||
// check if attack comes from behind, nobody can parry or block if attacker is behind
|
// check if attack comes from behind, nobody can parry or block if attacker is behind if not have
|
||||||
if (!from_behind)
|
if (!from_behind || pVictim->HasAuraType(SPELL_AURA_MOD_PARRY_FROM_BEHIND_PERCENT))
|
||||||
{
|
{
|
||||||
// Reduce parry chance by attacker expertise rating
|
// Reduce parry chance by attacker expertise rating
|
||||||
if (GetTypeId() == TYPEID_PLAYER)
|
if (GetTypeId() == TYPEID_PLAYER)
|
||||||
parry_chance-= int32(((Player*)this)->GetExpertiseDodgeOrParryReduction(attType)*100);
|
parry_chance -= int32(((Player*)this)->GetExpertiseDodgeOrParryReduction(attType)*100);
|
||||||
else
|
else
|
||||||
parry_chance -= GetTotalAuraModifier(SPELL_AURA_MOD_EXPERTISE)*25;
|
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);
|
parry_chance -= skillBonus;
|
||||||
if ( (tmp2 > 0) // check if unit _can_ parry
|
|
||||||
&& ((tmp2 -= skillBonus) > 0)
|
//if (from_behind) -- only 100% currently and not 100% sure way value apply
|
||||||
&& (roll < (sum += tmp2)))
|
// 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;
|
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)
|
if (spell->Attributes & SPELL_ATTR_IMPOSSIBLE_DODGE_PARRY_BLOCK)
|
||||||
return SPELL_MISS_NONE;
|
return SPELL_MISS_NONE;
|
||||||
|
|
||||||
|
bool from_behind = !pVictim->HasInArc(M_PI_F,this);
|
||||||
|
|
||||||
// Ranged attack cannot be parry/dodge only deflect
|
// Ranged attack cannot be parry/dodge only deflect
|
||||||
if (attType == RANGED_ATTACK)
|
if (attType == RANGED_ATTACK)
|
||||||
{
|
{
|
||||||
// only if in front
|
// only if in front or special ability
|
||||||
if (pVictim->HasInArc(M_PI_F,this))
|
if (!from_behind || pVictim->HasAuraType(SPELL_AURA_MOD_PARRY_FROM_BEHIND_PERCENT))
|
||||||
{
|
{
|
||||||
int32 deflect_chance = pVictim->GetTotalAuraModifier(SPELL_AURA_DEFLECT_SPELLS)*100;
|
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)
|
if (roll < tmp)
|
||||||
return SPELL_MISS_DEFLECT;
|
return SPELL_MISS_DEFLECT;
|
||||||
}
|
}
|
||||||
|
|
@ -3002,12 +3011,13 @@ SpellMissInfo Unit::MeleeSpellHitResult(Unit *pVictim, SpellEntry const *spell)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Check for attack from behind
|
// 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)
|
// Can`t dodge from behind in PvP (but its possible in PvE)
|
||||||
if (GetTypeId() == TYPEID_PLAYER && pVictim->GetTypeId() == TYPEID_PLAYER)
|
if (GetTypeId() == TYPEID_PLAYER && pVictim->GetTypeId() == TYPEID_PLAYER)
|
||||||
canDodge = false;
|
canDodge = false;
|
||||||
// Can`t parry
|
// Can`t parry without special ability
|
||||||
|
if (!pVictim->HasAuraType(SPELL_AURA_MOD_PARRY_FROM_BEHIND_PERCENT))
|
||||||
canParry = false;
|
canParry = false;
|
||||||
}
|
}
|
||||||
// Check creatures flags_extra for disable parry
|
// Check creatures flags_extra for disable parry
|
||||||
|
|
@ -3065,6 +3075,9 @@ SpellMissInfo Unit::MeleeSpellHitResult(Unit *pVictim, SpellEntry const *spell)
|
||||||
if (parryChance < 0)
|
if (parryChance < 0)
|
||||||
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;
|
tmp += parryChance;
|
||||||
if (roll < tmp)
|
if (roll < tmp)
|
||||||
return SPELL_MISS_PARRY;
|
return SPELL_MISS_PARRY;
|
||||||
|
|
@ -3142,11 +3155,17 @@ SpellMissInfo Unit::MagicSpellHitResult(Unit *pVictim, SpellEntry const *spell)
|
||||||
if (rand < tmp)
|
if (rand < tmp)
|
||||||
return SPELL_MISS_MISS;
|
return SPELL_MISS_MISS;
|
||||||
|
|
||||||
// cast by caster in front of victim
|
bool from_behind = !pVictim->HasInArc(M_PI_F,this);
|
||||||
if (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;
|
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)
|
if (rand < tmp)
|
||||||
return SPELL_MISS_DEFLECT;
|
return SPELL_MISS_DEFLECT;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
#ifndef __REVISION_NR_H__
|
#ifndef __REVISION_NR_H__
|
||||||
#define __REVISION_NR_H__
|
#define __REVISION_NR_H__
|
||||||
#define REVISION_NR "11509"
|
#define REVISION_NR "11510"
|
||||||
#endif // __REVISION_NR_H__
|
#endif // __REVISION_NR_H__
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue