[Spells] Update to target types Beam and Cone to ignore invalid targets. (#2080)

This commit is contained in:
KayenEQ 2022-05-01 16:50:55 -04:00 committed by GitHub
parent 35b35f85cf
commit 34dc081306
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 43 additions and 0 deletions

View File

@ -5457,6 +5457,15 @@ void EntityList::GetTargetsForConeArea(Mob *start, float min_radius, float radiu
++it;
continue;
}
if (ptr->IsClient() && !ptr->CastToClient()->ClientFinishedLoading()) {
++it;
continue;
}
if (ptr->IsAura() || ptr->IsTrap()) {
++it;
continue;
}
float x_diff = ptr->GetX() - start->GetX();
float y_diff = ptr->GetY() - start->GetY();
float z_diff = ptr->GetZ() - start->GetZ();

View File

@ -6372,6 +6372,23 @@ void Mob::BeamDirectional(uint16 spell_id, int16 resist_adjust)
}
}
if (!beneficial_targets) {
if (!IsAttackAllowed((*iter), true)) {
++iter;
continue;
}
}
else {
if (IsAttackAllowed((*iter), true)) {
++iter;
continue;
}
if (CheckAggro((*iter))) {
++iter;
continue;
}
}
//# shortest distance from line to target point
float d = std::abs((*iter)->GetY() - m * (*iter)->GetX() - b) / sqrt(m * m + 1);
@ -6447,6 +6464,23 @@ void Mob::ConeDirectional(uint16 spell_id, int16 resist_adjust)
}
}
if (!beneficial_targets) {
if (!IsAttackAllowed((*iter), true)) {
++iter;
continue;
}
}
else {
if (IsAttackAllowed((*iter), true)) {
++iter;
continue;
}
if (CheckAggro((*iter))) {
++iter;
continue;
}
}
if (angle_start > angle_end) {
if ((heading_to_target >= angle_start && heading_to_target <= 360.0f) ||
(heading_to_target >= 0.0f && heading_to_target <= angle_end)) {