mangos zero 去掉怪物从玩家身后攻击造成玩家眩晕

找到game/object/unit.cpp:2009 行

// If this is a creature and it attacks from behind it has a probability to daze it's victim
if ((!damageInfo->absorb) && (damageInfo->hitOutCome == MELEE_HIT_CRIT || damageInfo->hitOutCome == MELEE_HIT_CRUSHING || damageInfo->hitOutCome == MELEE_HIT_NORMAL || damageInfo->hitOutCome == MELEE_HIT_GLANCING) &&
GetTypeId() != TYPEID_PLAYER && !((Creature*)this)->GetCharmerOrOwnerGuid() && !pVictim->HasInArc(M_PI_F, this))
{
// -probability is between 0% and 40%
// 20% base chance
float Probability = 20.0f;

// there is a newbie protection, at level 10 just 7% base chance; assuming linear function
if (pVictim->getLevel() < 30)
{
Probability = 0.65f * pVictim->getLevel() + 0.5f;
}

uint32 VictimDefense = pVictim->GetDefenseSkillValue();
uint32 AttackerMeleeSkill = GetUnitMeleeSkill();

Probability *= AttackerMeleeSkill / (float)VictimDefense;

if (Probability > 40.0f)
{
Probability = 40.0f;
}

if (roll_chance_f(Probability))
{
CastSpell(pVictim, 1604, true);
}

}
 
去除以上代码

posted on 2022-05-25 18:42  ctcrst  阅读(56)  评论(0编辑  收藏  举报