mirror of
https://github.com/EQEmu/Server.git
synced 2026-06-10 23:20:25 +00:00
[Spells] Update to target types Beam and Cone to ignore invalid targets. (#2080)
This commit is contained in:
@@ -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)) {
|
||||
|
||||
Reference in New Issue
Block a user