Eliminated Rogue Bot twirling combat behavior.

This commit is contained in:
Uleat
2017-01-26 14:37:51 -05:00
parent 31de6a63cc
commit 3d54a4edcb
2 changed files with 22 additions and 17 deletions
+19 -17
View File
@@ -2305,24 +2305,26 @@ void Bot::AI_Process() {
}
if(AI_movement_timer->Check()) {
if(!IsMoving() && GetClass() == ROGUE && !BehindMob(GetTarget(), GetX(), GetY())) {
// Move the rogue to behind the mob
float newX = 0;
float newY = 0;
float newZ = 0;
if(PlotPositionAroundTarget(GetTarget(), newX, newY, newZ)) {
CalculateNewPosition2(newX, newY, newZ, GetRunspeed());
return;
if (!IsMoving()) {
if (GetClass() == ROGUE && (GetTarget() != this || GetTarget()->IsFeared()) && !BehindMob(GetTarget(), GetX(), GetY())) {
// Move the rogue to behind the mob
float newX = 0;
float newY = 0;
float newZ = 0;
if (PlotPositionAroundTarget(GetTarget(), newX, newY, newZ)) {
CalculateNewPosition2(newX, newY, newZ, GetRunspeed());
return;
}
}
}
else if(!IsMoving() && GetClass() != ROGUE && (DistanceSquaredNoZ(m_Position, GetTarget()->GetPosition()) < GetTarget()->GetSize())) {
// If we are not a rogue trying to backstab, let's try to adjust our melee range so we don't appear to be bunched up
float newX = 0;
float newY = 0;
float newZ = 0;
if(PlotPositionAroundTarget(GetTarget(), newX, newY, newZ, false) && GetArchetype() != ARCHETYPE_CASTER) {
CalculateNewPosition2(newX, newY, newZ, GetRunspeed());
return;
else if (GetClass() != ROGUE && (DistanceSquaredNoZ(m_Position, GetTarget()->GetPosition()) < GetTarget()->GetSize())) {
// If we are not a rogue trying to backstab, let's try to adjust our melee range so we don't appear to be bunched up
float newX = 0;
float newY = 0;
float newZ = 0;
if (PlotPositionAroundTarget(GetTarget(), newX, newY, newZ, false) && GetArchetype() != ARCHETYPE_CASTER) {
CalculateNewPosition2(newX, newY, newZ, GetRunspeed());
return;
}
}
}