Skip to content

Commit

Permalink
Merge pull request #8280 from DjYXA/patch-1
Browse files Browse the repository at this point in the history
Daze mechanics Fix - By Arrakio
  • Loading branch information
Subv committed Nov 14, 2012
2 parents 6325060 + 532077d commit cb9dd9b
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/server/game/Entities/Unit/Unit.cpp
Expand Up @@ -1328,7 +1328,7 @@ void Unit::DealMeleeDamage(CalcDamageInfo* damageInfo, bool durabilityLoss)
// If this is a creature and it attacks from behind it has a probability to daze it's victim
if ((damageInfo->hitOutCome == MELEE_HIT_CRIT || damageInfo->hitOutCome == MELEE_HIT_CRUSHING || damageInfo->hitOutCome == MELEE_HIT_NORMAL || damageInfo->hitOutCome == MELEE_HIT_GLANCING) &&
GetTypeId() != TYPEID_PLAYER && !ToCreature()->IsControlledByPlayer() && !victim->HasInArc(M_PI, this)
&& (victim->GetTypeId() == TYPEID_PLAYER || !victim->ToCreature()->isWorldBoss()))
&& (victim->GetTypeId() == TYPEID_PLAYER || !victim->ToCreature()->isWorldBoss())&& !victim->IsVehicle())
{
// -probability is between 0% and 40%
// 20% base chance
Expand All @@ -1341,7 +1341,10 @@ void Unit::DealMeleeDamage(CalcDamageInfo* damageInfo, bool durabilityLoss)
uint32 VictimDefense=victim->GetDefenseSkillValue();
uint32 AttackerMeleeSkill=GetUnitMeleeSkill();

Probability *= AttackerMeleeSkill/(float)VictimDefense;
Probability *= AttackerMeleeSkill/(float)VictimDefense*0.16;

if (Probability < 0)
Probability = 0;

if (Probability > 40.0f)
Probability = 40.0f;
Expand Down

0 comments on commit cb9dd9b

Please sign in to comment.