diff --git a/zone/aggro.cpp b/zone/aggro.cpp index 7ea4040542..aef65a7d68 100644 --- a/zone/aggro.cpp +++ b/zone/aggro.cpp @@ -789,24 +789,26 @@ bool Mob::IsBeneficialAllowed(Mob *target) bool Mob::CombatRange(Mob* other, float fixed_size_mod, bool aeRampage) { - if(!other) + if (!other) { return(false); + } float size_mod = GetSize(); float other_size_mod = other->GetSize(); - if(GetRace() == 49 || GetRace() == 158 || GetRace() == 196) //For races with a fixed size + if (GetRace() == RACE_LAVA_DRAGON_49 || GetRace() == RACE_WURM_158 || GetRace() == RACE_GHOST_DRAGON_196) { //For races with a fixed size size_mod = 60.0f; - else if (size_mod < 6.0) + } else if (size_mod < 6.0) { size_mod = 8.0f; + } - if(other->GetRace() == 49 || other->GetRace() == 158 || other->GetRace() == 196) //For races with a fixed size + if (other->GetRace() == RACE_LAVA_DRAGON_49 || other->GetRace() == RACE_WURM_158 || other->GetRace() == RACE_GHOST_DRAGON_196) { //For races with a fixed size other_size_mod = 60.0f; - else if (other_size_mod < 6.0) + } else if (other_size_mod < 6.0) { other_size_mod = 8.0f; + } - if (other_size_mod > size_mod) - { + if (other_size_mod > size_mod) { size_mod = other_size_mod; } @@ -838,44 +840,48 @@ bool Mob::CombatRange(Mob* other, float fixed_size_mod, bool aeRampage) // improved playability and "you are too far away" while chasing // a fleeing mob. The Blind check is to make sure that this does not // apply to disoriented fleeing mobs who need proximity to turn and fight. - if (other->currently_fleeing && !other->IsBlind()) - { + if (other->currently_fleeing && !other->IsBlind()) { size_mod *= 3; } // prevention of ridiculously sized hit boxes - if (size_mod > 10000) + if (size_mod > 10000) { size_mod = size_mod / 7; + } float _DistNoRoot = DistanceSquaredNoZ(m_Position, other->GetPosition()); float _zDist = m_Position.z - other->GetZ(); _zDist *= _zDist; - if (GetSpecialAbility(NPC_CHASE_DISTANCE)){ + if (GetSpecialAbility(NPC_CHASE_DISTANCE)) { bool DoLoSCheck = true; float max_dist = static_cast(GetSpecialAbilityParam(NPC_CHASE_DISTANCE, 0)); float min_distance = static_cast(GetSpecialAbilityParam(NPC_CHASE_DISTANCE, 1)); - if (GetSpecialAbilityParam(NPC_CHASE_DISTANCE, 2)) + if (GetSpecialAbilityParam(NPC_CHASE_DISTANCE, 2)) { DoLoSCheck = false; //Ignore line of sight check + } - if (max_dist == 1) + if (max_dist == 1) { max_dist = 250.0f; //Default it to 250 if you forget to put a value + } max_dist = max_dist * max_dist; - if (!min_distance) + if (!min_distance) { min_distance = size_mod; //Default to melee range - else + } else { min_distance = min_distance * min_distance; + } - if ((DoLoSCheck && CheckLastLosState()) && (_DistNoRoot >= min_distance && _DistNoRoot <= max_dist)) + if ((DoLoSCheck && CheckLastLosState()) && (_DistNoRoot >= min_distance && _DistNoRoot <= max_dist)) { SetPseudoRoot(true); - else + } else { SetPseudoRoot(false); + } } - if(aeRampage) { + if (aeRampage) { float multiplyer = GetSize() * RuleR(Combat, AERampageSafeZone); float ramp_range = (size_mod * multiplyer); if (_DistNoRoot <= ramp_range) { @@ -885,8 +891,7 @@ bool Mob::CombatRange(Mob* other, float fixed_size_mod, bool aeRampage) } } - if (_DistNoRoot <= size_mod) - { + if (_DistNoRoot <= size_mod) { //A hack to kill an exploit till we get something better. if (flymode != GravityBehavior::Flying && _zDist > 500 && !CheckLastLosState()) { return false;