mirror of
https://github.com/EQEmu/Server.git
synced 2026-04-08 18:22:26 +00:00
Tweak for rogue bot jitter code
This commit is contained in:
parent
ab65bb1d57
commit
cef4928dd0
35
zone/bot.cpp
35
zone/bot.cpp
@ -2267,6 +2267,16 @@ void Bot::AI_Process() {
|
|||||||
|
|
||||||
bool atCombatRange = false;
|
bool atCombatRange = false;
|
||||||
|
|
||||||
|
const auto* p_item = GetBotItem(EQEmu::inventory::slotPrimary);
|
||||||
|
const auto* s_item = GetBotItem(EQEmu::inventory::slotSecondary);
|
||||||
|
|
||||||
|
bool behind_mob = false;
|
||||||
|
bool backstab_weapon = false;
|
||||||
|
if (GetClass() == ROGUE) {
|
||||||
|
behind_mob = BehindMob(tar, GetX(), GetY()); // can be separated for other future use
|
||||||
|
backstab_weapon = p_item && p_item->GetItemBackstabDamage();
|
||||||
|
}
|
||||||
|
|
||||||
// Calculate melee distance
|
// Calculate melee distance
|
||||||
float melee_distance_max = 0.0f;
|
float melee_distance_max = 0.0f;
|
||||||
{
|
{
|
||||||
@ -2302,9 +2312,6 @@ void Bot::AI_Process() {
|
|||||||
|
|
||||||
float melee_distance = 0.0f;
|
float melee_distance = 0.0f;
|
||||||
|
|
||||||
const auto* p_item = GetBotItem(EQEmu::inventory::slotPrimary);
|
|
||||||
const auto* s_item = GetBotItem(EQEmu::inventory::slotSecondary);
|
|
||||||
|
|
||||||
switch (GetClass()) {
|
switch (GetClass()) {
|
||||||
case WARRIOR:
|
case WARRIOR:
|
||||||
case PALADIN:
|
case PALADIN:
|
||||||
@ -2327,6 +2334,16 @@ void Bot::AI_Process() {
|
|||||||
melee_distance = melee_distance_max * 0.75f;
|
melee_distance = melee_distance_max * 0.75f;
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
case ROGUE:
|
||||||
|
if (behind_mob && backstab_weapon) {
|
||||||
|
if (p_item->GetItem()->IsType2HWeapon()) // p_item tested above
|
||||||
|
melee_distance = melee_distance_max * 0.30f;
|
||||||
|
else
|
||||||
|
melee_distance = melee_distance_max * 0.25f;
|
||||||
|
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
// Fall-through
|
||||||
default:
|
default:
|
||||||
if (p_item && p_item->GetItem()->IsType2HWeapon())
|
if (p_item && p_item->GetItem()->IsType2HWeapon())
|
||||||
melee_distance = melee_distance_max * 0.70f;
|
melee_distance = melee_distance_max * 0.70f;
|
||||||
@ -2463,13 +2480,11 @@ void Bot::AI_Process() {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (GetClass() == ROGUE) {
|
else if (backstab_weapon && !behind_mob) { // Move the rogue to behind the mob
|
||||||
if (!BehindMob(tar, GetX(), GetY())) { // Move the rogue to behind the mob
|
if (PlotPositionAroundTarget(tar, Goal.x, Goal.y, Goal.z)) {
|
||||||
if (PlotPositionAroundTarget(tar, Goal.x, Goal.y, Goal.z)) {
|
if (DistanceSquared(Goal, tar->GetPosition()) <= melee_distance_max) {
|
||||||
if (DistanceSquared(Goal, tar->GetPosition()) <= melee_distance_max) {
|
CalculateNewPosition2(Goal.x, Goal.y, Goal.z, GetBotRunspeed()); // rogues are agile enough to run in melee range
|
||||||
CalculateNewPosition2(Goal.x, Goal.y, Goal.z, GetBotRunspeed()); // rogues are agile enough to run in melee range
|
return;
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user