Skip to content

Commit

Permalink
Doze mechanics Fix - By Arrakio
Browse files Browse the repository at this point in the history
Info here:
#8277
  • Loading branch information
DjYXA committed Nov 9, 2012
1 parent 90c9580 commit 532077d
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

1 comment on commit 532077d

@gpascualg
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In the issue it says:
find and replace (ln 1344):
Probability _= AttackerMeleeSkill/(float)VictimDefense;
with:
Probability += (AttackerMeleeSkill-(float)VictimDefense)_0.16;

While on the pull request, and this commit, its done by *= (insted of +=) and / (instead of -).
Is this correct?

Please sign in to comment.