mirror of
https://github.com/mangosfour/server.git
synced 2025-12-13 22:37:03 +00:00
[6983] Revert [6978]. Useless for master branch. But ported to mangos-0.12 version will useful at branch.
* Remove unused arg of Unit::RollMeleeOutcomeAgainst and cleanup related code: Block crit implemented for spell by another way, * Also comment out SPELL_AURA_IGNORE_COMBAT_RESULT aura check for block: not exist currently spell with this aura for bloc case.
This commit is contained in:
parent
73ca2b7a54
commit
71c67a5202
3 changed files with 11 additions and 19 deletions
|
|
@ -1904,10 +1904,10 @@ MeleeHitOutcome Unit::RollMeleeOutcomeAgainst(const Unit *pVictim, WeaponAttackT
|
|||
// Useful if want to specify crit & miss chances for melee, else it could be removed
|
||||
DEBUG_LOG("MELEE OUTCOME: miss %f crit %f dodge %f parry %f block %f", miss_chance,crit_chance,dodge_chance,parry_chance,block_chance);
|
||||
|
||||
return RollMeleeOutcomeAgainst(pVictim, attType, int32(crit_chance*100), int32(miss_chance*100), int32(dodge_chance*100),int32(parry_chance*100),int32(block_chance*100), false);
|
||||
return RollMeleeOutcomeAgainst(pVictim, attType, int32(crit_chance*100), int32(miss_chance*100), int32(dodge_chance*100),int32(parry_chance*100),int32(block_chance*100));
|
||||
}
|
||||
|
||||
MeleeHitOutcome Unit::RollMeleeOutcomeAgainst (const Unit *pVictim, WeaponAttackType attType, int32 crit_chance, int32 miss_chance, int32 dodge_chance, int32 parry_chance, int32 block_chance, bool SpellCasted ) const
|
||||
MeleeHitOutcome Unit::RollMeleeOutcomeAgainst (const Unit *pVictim, WeaponAttackType attType, int32 crit_chance, int32 miss_chance, int32 dodge_chance, int32 parry_chance, int32 block_chance) const
|
||||
{
|
||||
if(pVictim->GetTypeId()==TYPEID_UNIT && ((Creature*)pVictim)->IsInEvadeMode())
|
||||
return MELEE_HIT_EVADE;
|
||||
|
|
@ -2001,16 +2001,6 @@ MeleeHitOutcome Unit::RollMeleeOutcomeAgainst (const Unit *pVictim, WeaponAttack
|
|||
&& ((tmp -= skillBonus) > 0)
|
||||
&& (roll < (sum += tmp)))
|
||||
{
|
||||
// Critical chance
|
||||
tmp = crit_chance + skillBonus2;
|
||||
if ( GetTypeId() == TYPEID_PLAYER && SpellCasted && tmp > 0 )
|
||||
{
|
||||
if ( roll_chance_i(tmp/100))
|
||||
{
|
||||
DEBUG_LOG ("RollMeleeOutcomeAgainst: BLOCKED CRIT");
|
||||
return MELEE_HIT_BLOCK_CRIT;
|
||||
}
|
||||
}
|
||||
DEBUG_LOG ("RollMeleeOutcomeAgainst: BLOCK <%d, %d)", sum-tmp, sum);
|
||||
return MELEE_HIT_BLOCK;
|
||||
}
|
||||
|
|
@ -2027,7 +2017,7 @@ MeleeHitOutcome Unit::RollMeleeOutcomeAgainst (const Unit *pVictim, WeaponAttack
|
|||
}
|
||||
|
||||
// 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)
|
||||
if( attType != RANGED_ATTACK && !SpellCasted &&
|
||||
if( attType != RANGED_ATTACK &&
|
||||
(GetTypeId() == TYPEID_PLAYER || ((Creature*)this)->isPet()) &&
|
||||
pVictim->GetTypeId() != TYPEID_PLAYER && !((Creature*)pVictim)->isPet() &&
|
||||
getLevel() < pVictim->getLevelForTarget(this) )
|
||||
|
|
@ -2046,8 +2036,7 @@ MeleeHitOutcome Unit::RollMeleeOutcomeAgainst (const Unit *pVictim, WeaponAttack
|
|||
}
|
||||
}
|
||||
|
||||
if ((GetTypeId()!=TYPEID_PLAYER && !(((Creature*)this)->GetCreatureInfo()->flags_extra & CREATURE_FLAG_EXTRA_NO_CRUSH) && !((Creature*)this)->isPet()) &&
|
||||
!SpellCasted /*Only autoattack can be crashing blow*/ )
|
||||
if ((GetTypeId()!=TYPEID_PLAYER && !(((Creature*)this)->GetCreatureInfo()->flags_extra & CREATURE_FLAG_EXTRA_NO_CRUSH) && !((Creature*)this)->isPet()))
|
||||
{
|
||||
// mobs can score crushing blows if they're 3 or more levels above victim
|
||||
// or when their weapon skill is 15 or more above victim's defense skill
|
||||
|
|
@ -2160,15 +2149,17 @@ bool Unit::isSpellBlocked(Unit *pVictim, SpellEntry const *spellProto, WeaponAtt
|
|||
{
|
||||
if (pVictim->HasInArc(M_PI,this))
|
||||
{
|
||||
/* Currently not exist spells with ignore block
|
||||
// Ignore combat result aura (parry/dodge check on prepare)
|
||||
AuraList const& ignore = GetAurasByType(SPELL_AURA_IGNORE_COMBAT_RESULT);
|
||||
for(AuraList::const_iterator i = ignore.begin(); i != ignore.end(); ++i)
|
||||
{
|
||||
if (!(*i)->isAffectedOnSpell(spellProto))
|
||||
continue;
|
||||
if ((*i)->GetModifier()->m_miscvalue == MELEE_HIT_BLOCK)
|
||||
if ((*i)->GetModifier()->m_miscvalue == )
|
||||
return false;
|
||||
}
|
||||
*/
|
||||
float blockChance = GetUnitBlockChance();
|
||||
blockChance += (GetWeaponSkillValue(attackType) - pVictim->GetMaxSkillValueForLevel() )*0.04;
|
||||
if (roll_chance_f(blockChance))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue