mirror of
https://github.com/EQEmu/Server.git
synced 2026-03-03 02:52:26 +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++)
|
for (int i = 0; i < MaxTimer; i++)
|
||||||
timers[i] = 0;
|
timers[i] = 0;
|
||||||
|
|
||||||
|
if (GetClass() == ROGUE)
|
||||||
|
evade_timer.Start();
|
||||||
|
|
||||||
GenerateBaseStats();
|
GenerateBaseStats();
|
||||||
|
|
||||||
if (!botdb.LoadTimers(this) && bot_owner)
|
if (!botdb.LoadTimers(this) && bot_owner)
|
||||||
@ -2306,14 +2309,36 @@ void Bot::AI_Process() {
|
|||||||
|
|
||||||
if(AI_movement_timer->Check()) {
|
if(AI_movement_timer->Check()) {
|
||||||
if (!IsMoving()) {
|
if (!IsMoving()) {
|
||||||
if (GetClass() == ROGUE && (GetTarget() != this || GetTarget()->IsFeared()) && !BehindMob(GetTarget(), GetX(), GetY())) {
|
if (GetClass() == ROGUE) {
|
||||||
// Move the rogue to behind the mob
|
if ((GetTarget()->GetTarget() == this) && !GetTarget()->IsFeared() && !GetTarget()->IsStunned()) {
|
||||||
float newX = 0;
|
if (evade_timer.Check(false)) {
|
||||||
float newY = 0;
|
// Hate redux actions
|
||||||
float newZ = 0;
|
uint32 timer_duration = (HideReuseTime * 1000);
|
||||||
if (PlotPositionAroundTarget(GetTarget(), newX, newY, newZ)) {
|
evade_timer.Start(timer_duration);
|
||||||
CalculateNewPosition2(newX, newY, newZ, GetRunspeed());
|
|
||||||
return;
|
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())) {
|
else if (GetClass() != ROGUE && (DistanceSquaredNoZ(m_Position, GetTarget()->GetPosition()) < GetTarget()->GetSize())) {
|
||||||
|
|||||||
@ -670,6 +670,8 @@ private:
|
|||||||
glm::vec3 m_PreSummonLocation;
|
glm::vec3 m_PreSummonLocation;
|
||||||
uint8 _spellCastingChances[MaxStances][MaxSpellTypes];
|
uint8 _spellCastingChances[MaxStances][MaxSpellTypes];
|
||||||
|
|
||||||
|
Timer evade_timer;
|
||||||
|
|
||||||
std::shared_ptr<HealRotation> m_member_of_heal_rotation;
|
std::shared_ptr<HealRotation> m_member_of_heal_rotation;
|
||||||
|
|
||||||
std::map<uint32, BotAA> botAAs;
|
std::map<uint32, BotAA> botAAs;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user