mirror of
https://github.com/EQEmu/Server.git
synced 2025-12-27 20:21:30 +00:00
Added rogue evade to bot combat (nothing is every really fixed until you do it a second time and add a timer...)
This commit is contained in:
parent
36300d6df1
commit
104a0998ce
41
zone/bot.cpp
41
zone/bot.cpp
@ -176,6 +176,9 @@ Bot::Bot(uint32 botID, uint32 botOwnerCharacterID, uint32 botSpellsID, double to
|
||||
for (int i = 0; i < MaxTimer; i++)
|
||||
timers[i] = 0;
|
||||
|
||||
if (GetClass() == ROGUE)
|
||||
evade_timer.Start();
|
||||
|
||||
GenerateBaseStats();
|
||||
|
||||
if (!botdb.LoadTimers(this) && bot_owner)
|
||||
@ -2306,14 +2309,36 @@ void Bot::AI_Process() {
|
||||
|
||||
if(AI_movement_timer->Check()) {
|
||||
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;
|
||||
if (GetClass() == ROGUE) {
|
||||
if ((GetTarget()->GetTarget() == this) && !GetTarget()->IsFeared() && !GetTarget()->IsStunned()) {
|
||||
if (evade_timer.Check(false)) {
|
||||
// Hate redux actions
|
||||
uint32 timer_duration = (HideReuseTime * 1000);
|
||||
evade_timer.Start(timer_duration);
|
||||
|
||||
Bot::BotGroupSay(this, "Attempting to evade %s", GetTarget()->GetCleanName());
|
||||
if (zone->random.Int(0, 260) < (int)GetSkill(EQEmu::skills::SkillHide))
|
||||
RogueEvade(GetTarget());
|
||||
|
||||
return;
|
||||
}
|
||||
//else if (GetTarget()->IsRooted()) {
|
||||
// Should move rogue backwards, out of combat range
|
||||
//}
|
||||
|
||||
// Could add a bot accessor like..
|
||||
// bool NeedsHateRedux() { return (GetClass() == Rogue && evade_timer.check(false)); } - or something like this
|
||||
// ..then add hate redux spells to caster combat repertoires
|
||||
}
|
||||
else if (!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 (GetClass() != ROGUE && (DistanceSquaredNoZ(m_Position, GetTarget()->GetPosition()) < GetTarget()->GetSize())) {
|
||||
|
||||
@ -670,6 +670,8 @@ private:
|
||||
glm::vec3 m_PreSummonLocation;
|
||||
uint8 _spellCastingChances[MaxStances][MaxSpellTypes];
|
||||
|
||||
Timer evade_timer;
|
||||
|
||||
std::shared_ptr<HealRotation> m_member_of_heal_rotation;
|
||||
|
||||
std::map<uint32, BotAA> botAAs;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user