mirror of
https://github.com/EQEmu/Server.git
synced 2025-12-15 16:41:29 +00:00
Some changes to fix various issues
This commit is contained in:
parent
cfba613efd
commit
a26cf5f1de
@ -835,7 +835,9 @@ void Client::AI_Process()
|
|||||||
bool is_combat_range = CombatRange(GetTarget());
|
bool is_combat_range = CombatRange(GetTarget());
|
||||||
|
|
||||||
if (is_combat_range) {
|
if (is_combat_range) {
|
||||||
StopNavigation();
|
if (IsMoving()) {
|
||||||
|
StopNavigation();
|
||||||
|
}
|
||||||
|
|
||||||
if (charm_class_attacks_timer.Check()) {
|
if (charm_class_attacks_timer.Check()) {
|
||||||
DoClassAttacks(GetTarget());
|
DoClassAttacks(GetTarget());
|
||||||
@ -1196,12 +1198,12 @@ void Mob::AI_Process() {
|
|||||||
bool is_combat_range = CombatRange(target);
|
bool is_combat_range = CombatRange(target);
|
||||||
|
|
||||||
if (is_combat_range) {
|
if (is_combat_range) {
|
||||||
StopNavigation();
|
if (IsMoving()) {
|
||||||
|
StopNavigation();
|
||||||
if (AI_movement_timer->Check()) {
|
|
||||||
FaceTarget();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
FaceTarget();
|
||||||
|
|
||||||
//casting checked above...
|
//casting checked above...
|
||||||
if (target && !IsStunned() && !IsMezzed() && GetAppearance() != eaDead && !IsMeleeDisabled()) {
|
if (target && !IsStunned() && !IsMezzed() && GetAppearance() != eaDead && !IsMeleeDisabled()) {
|
||||||
|
|
||||||
@ -1356,22 +1358,6 @@ void Mob::AI_Process() {
|
|||||||
|
|
||||||
} //end is within combat rangepet
|
} //end is within combat rangepet
|
||||||
else {
|
else {
|
||||||
//we cannot reach our target...
|
|
||||||
//underwater stuff only works with water maps in the zone!
|
|
||||||
//if (IsNPC() && CastToNPC()->IsUnderwaterOnly() && zone->HasWaterMap()) {
|
|
||||||
// auto targetPosition = glm::vec3(target->GetX(), target->GetY(), target->GetZ());
|
|
||||||
// if (!zone->watermap->InLiquid(targetPosition)) {
|
|
||||||
// Mob *tar = hate_list.GetEntWithMostHateOnList(this);
|
|
||||||
// if (tar != nullptr && tar != target) {
|
|
||||||
// SetTarget(tar);
|
|
||||||
// RunTo(tar->GetX(), tar->GetY(), tar->GetZ());
|
|
||||||
// return;
|
|
||||||
// }
|
|
||||||
// else {
|
|
||||||
// RunTo(target->GetX(), target->GetY(), target->GetZ());
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
//}
|
|
||||||
|
|
||||||
// See if we can summon the mob to us
|
// See if we can summon the mob to us
|
||||||
if (!HateSummon()) {
|
if (!HateSummon()) {
|
||||||
@ -1382,7 +1368,10 @@ void Mob::AI_Process() {
|
|||||||
// Now pursue
|
// Now pursue
|
||||||
// TODO: Check here for another person on hate list with close hate value
|
// TODO: Check here for another person on hate list with close hate value
|
||||||
if (AI_PursueCastCheck()) {
|
if (AI_PursueCastCheck()) {
|
||||||
FaceTarget();
|
if (IsCasting() && GetClass() != BARD) {
|
||||||
|
StopNavigation();
|
||||||
|
FaceTarget();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else if (AI_movement_timer->Check() && target) {
|
else if (AI_movement_timer->Check() && target) {
|
||||||
if (!IsRooted()) {
|
if (!IsRooted()) {
|
||||||
@ -1428,7 +1417,9 @@ void Mob::AI_Process() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (AI_IdleCastCheck()) {
|
if (AI_IdleCastCheck()) {
|
||||||
StopNavigation();
|
if (IsCasting() && GetClass() != BARD) {
|
||||||
|
StopNavigation();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else if (zone->CanDoCombat() && CastToNPC()->WillAggroNPCs() && AI_scan_area_timer->Check()) {
|
else if (zone->CanDoCombat() && CastToNPC()->WillAggroNPCs() && AI_scan_area_timer->Check()) {
|
||||||
|
|
||||||
@ -1539,8 +1530,6 @@ void Mob::AI_Process() {
|
|||||||
running = true;
|
running = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool waypoint_changed, node_reached;
|
|
||||||
|
|
||||||
auto &Goal = follow->GetPosition();
|
auto &Goal = follow->GetPosition();
|
||||||
|
|
||||||
if (running) {
|
if (running) {
|
||||||
@ -1902,19 +1891,14 @@ void Mob::AI_Event_Engaged(Mob* attacker, bool iYellForHelp) {
|
|||||||
void Mob::AI_Event_NoLongerEngaged() {
|
void Mob::AI_Event_NoLongerEngaged() {
|
||||||
if (!IsAIControlled())
|
if (!IsAIControlled())
|
||||||
return;
|
return;
|
||||||
this->AI_walking_timer->Start(RandomTimer(3000,20000));
|
AI_walking_timer->Start(RandomTimer(3000,20000));
|
||||||
time_until_can_move = Timer::GetCurrentTime();
|
time_until_can_move = Timer::GetCurrentTime();
|
||||||
if (minLastFightingDelayMoving == maxLastFightingDelayMoving)
|
if (minLastFightingDelayMoving == maxLastFightingDelayMoving)
|
||||||
time_until_can_move += minLastFightingDelayMoving;
|
time_until_can_move += minLastFightingDelayMoving;
|
||||||
else
|
else
|
||||||
time_until_can_move += zone->random.Int(minLastFightingDelayMoving, maxLastFightingDelayMoving);
|
time_until_can_move += zone->random.Int(minLastFightingDelayMoving, maxLastFightingDelayMoving);
|
||||||
// So mobs don't keep running as a ghost until AIwalking_timer fires
|
|
||||||
// if they were moving prior to losing all hate
|
StopNavigation();
|
||||||
// except if we're a pet, then we might run into some issues with pets backing off when they should immediately be moving
|
|
||||||
if(!IsPet())
|
|
||||||
{
|
|
||||||
StopNavigation();
|
|
||||||
}
|
|
||||||
ClearRampage();
|
ClearRampage();
|
||||||
|
|
||||||
if(IsNPC())
|
if(IsNPC())
|
||||||
|
|||||||
@ -44,7 +44,7 @@ public:
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
auto rotate_to_speed = m_rotate_to_mode == MovementRunning ? 50.0 : 16.0; //todo: get this from mob
|
auto rotate_to_speed = m_rotate_to_mode == MovementRunning ? 200.0 : 16.0; //todo: get this from mob
|
||||||
|
|
||||||
auto from = FixHeading(m->GetHeading());
|
auto from = FixHeading(m->GetHeading());
|
||||||
auto to = FixHeading(m_rotate_to);
|
auto to = FixHeading(m_rotate_to);
|
||||||
@ -382,6 +382,7 @@ public:
|
|||||||
|
|
||||||
if (m->IsMoving()) {
|
if (m->IsMoving()) {
|
||||||
m->SetMoving(false);
|
m->SetMoving(false);
|
||||||
|
m->TryFixZ();
|
||||||
mgr->SendCommandToClients(m, 0.0, 0.0, 0.0, 0.0, 0, ClientRangeCloseMedium);
|
mgr->SendCommandToClients(m, 0.0, 0.0, 0.0, 0.0, 0, ClientRangeCloseMedium);
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
@ -606,8 +607,7 @@ void MobMovementManager::StopNavigation(Mob *who) {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
auto &running_cmd = ent.second.Commands.front();
|
if (!who->IsMoving()) {
|
||||||
if (false == running_cmd->Started()) {
|
|
||||||
ent.second.Commands.clear();
|
ent.second.Commands.clear();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user