Auntie Mangos Posted January 1, 1970 Report Posted January 1, 1970 http://getmangos.eu/community/post/136191/#p136191
Roshnak Posted March 19, 2011 Report Posted March 19, 2011 What bug does the patch fix? it fix atacks from behind when hunters use deterrence For which repository revision was the patch created? I use the branch of kero99 https://github.com/kero99/Stable Who has been writing this patch? me diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp index b4dc9f9..e9c8455 100644 --- a/src/game/Unit.cpp +++ b/src/game/Unit.cpp @@ -2929,11 +2929,23 @@ MeleeHitOutcome Unit::RollMeleeOutcomeAgainst (const Unit *pVictim, WeaponAttack bool from_behind = !pVictim->HasInArc(M_PI_F,this); - if (from_behind) + if (from_behind) { + if(pVictim->HasAura(19263)) { + int32 tmp2 = int32(parry_chance); + if ( (tmp2 > 0) // check if unit _can_ parry + && ((tmp2 -= skillBonus) > 0) + && (roll < (sum += tmp2))) + { + DEBUG_FILTER_LOG(LOG_FILTER_COMBAT, "RollMeleeOutcomeAgainst: PARRY <%d, %d)", sum-tmp2, sum); + return MELEE_HIT_PARRY; + } + } + else DEBUG_FILTER_LOG(LOG_FILTER_COMBAT, "RollMeleeOutcomeAgainst: attack came from behind."); + } // Dodge chance - + // only players can't dodge if attacker is behind if (pVictim->GetTypeId() != TYPEID_PLAYER || !from_behind) { @@ -2976,7 +2988,7 @@ MeleeHitOutcome Unit::RollMeleeOutcomeAgainst (const Unit *pVictim, WeaponAttack DEBUG_FILTER_LOG(LOG_FILTER_COMBAT, "RollMeleeOutcomeAgainst: PARRY <%d, %d)", sum-tmp2, sum); return MELEE_HIT_PARRY; } - } + } } // Max 40% chance to score a glancing blow against mobs that are higher level (can do only players and pets and not with ranged weapon) @@ -3284,6 +3296,12 @@ SpellMissInfo Unit::MeleeSpellHitResult(Unit *pVictim, SpellEntry const *spell) if (roll < tmp) return SPELL_MISS_DEFLECT; } + if(pVictim->HasAura(19263)) { + int32 deflect_chance = pVictim->GetTotalAuraModifier(SPELL_AURA_DEFLECT_SPELLS)*100; + tmp+=deflect_chance; + if (roll < tmp) + return SPELL_MISS_DEFLECT; + } return SPELL_MISS_NONE; } @@ -3294,8 +3312,10 @@ SpellMissInfo Unit::MeleeSpellHitResult(Unit *pVictim, SpellEntry const *spell) if (GetTypeId() == TYPEID_PLAYER && pVictim->GetTypeId() == TYPEID_PLAYER) canDodge = false; // Can`t parry - canParry = false; + if(!pVictim->HasAura(19263)) + canParry = false; } + // Check creatures flags_extra for disable parry if(pVictim->GetTypeId()==TYPEID_UNIT) { @@ -3436,7 +3456,12 @@ SpellMissInfo Unit::MagicSpellHitResult(Unit *pVictim, SpellEntry const *spell) if (rand < tmp) return SPELL_MISS_DEFLECT; } - + if(pVictim->HasAura(19263)) { + int32 deflect_chance = pVictim->GetTotalAuraModifier(SPELL_AURA_DEFLECT_SPELLS)*100; + tmp+=deflect_chance; + if (rand < tmp) + return SPELL_MISS_DEFLECT; + } return SPELL_MISS_NONE; }
DaC Posted March 19, 2011 Report Posted March 19, 2011 Spell Effect0 : ApplyAura is SPELL_AURA_MOD_PARRY_PERCET +100 so your hack should not be used.
Roshnak Posted March 19, 2011 Report Posted March 19, 2011 oh its true i don't think about it, thank you edited
michalpolko Posted March 19, 2011 Report Posted March 19, 2011 Deterrence should mod parry and deflection of spells and ranged attacks chance, also for attacks from behind. So auraType name and its usage is wrong or there exists some triggered aura or something...
Roshnak Posted March 21, 2011 Report Posted March 21, 2011 I made a mistake when I posted the code, wasn't complete. Now is fine
VladimirMangos Posted May 18, 2011 Report Posted May 18, 2011 As described in pre-3.2.0 parry work only for front melee (aura 47)/deflaction for spells (aura 287), and pacify (25) and exist only spell 19263 for this for players. But in 3.3.5 (added in 3.2.0) exist spell 67801 that have aura 288 (unknown), aura 185 SPELL_AURA_MOD_ATTACKER_RANGED_HIT_CHANCE -100 Aura 288 used _only_ in spell 67801 so i think its like: "percent from normal parry for attack in case attack from behind. [added]In 4.1.0 exist spell "360 Defensive Abilities" with single 288 aura with same 100 value. I will prepare alt. patch with use this aura [added]Alt. version in [11510]
Recommended Posts