mirror of
https://github.com/EQEmu/Server.git
synced 2025-12-19 16:31:29 +00:00
Adjust constants
This commit is contained in:
parent
03458b88a4
commit
850b32f2ca
@ -307,13 +307,11 @@ namespace EQEmu
|
|||||||
|
|
||||||
} // namespace bug
|
} // namespace bug
|
||||||
|
|
||||||
namespace waypoints {
|
enum WaypointStatus : int {
|
||||||
enum WaypointStatus : int {
|
RoamBoxPauseInProgress = -3,
|
||||||
wpsRoamBoxPauseInProgress = -3,
|
QuestControlNoGrid = -2,
|
||||||
wpsQuestControlNoGrid = -2,
|
QuestControlGrid = -1
|
||||||
wpsQuestControlGrid = -1
|
};
|
||||||
};
|
|
||||||
} // waypoint_status behavior
|
|
||||||
|
|
||||||
} /*EQEmu*/
|
} /*EQEmu*/
|
||||||
|
|
||||||
|
|||||||
@ -1572,14 +1572,12 @@ void NPC::AI_DoMovement() {
|
|||||||
/**
|
/**
|
||||||
* Roambox logic sets precedence
|
* Roambox logic sets precedence
|
||||||
*/
|
*/
|
||||||
using EQEmu::waypoints::WaypointStatus;
|
|
||||||
|
|
||||||
if (roambox_distance > 0) {
|
if (roambox_distance > 0) {
|
||||||
|
|
||||||
// Check if we're already moving to a WP
|
// Check if we're already moving to a WP
|
||||||
// If so, if we're not moving we have arrived and need to set delay
|
// If so, if we're not moving we have arrived and need to set delay
|
||||||
|
|
||||||
if (GetCWP() == WaypointStatus::wpsRoamBoxPauseInProgress && !IsMoving()) {
|
if (GetCWP() == EQEmu::WaypointStatus::RoamBoxPauseInProgress && !IsMoving()) {
|
||||||
// We have arrived
|
// We have arrived
|
||||||
time_until_can_move = Timer::GetCurrentTime() + RandomTimer(roambox_min_delay, roambox_delay);
|
time_until_can_move = Timer::GetCurrentTime() + RandomTimer(roambox_min_delay, roambox_delay);
|
||||||
SetCurrentWP(0);
|
SetCurrentWP(0);
|
||||||
@ -1657,7 +1655,7 @@ void NPC::AI_DoMovement() {
|
|||||||
roambox_destination_y);
|
roambox_destination_y);
|
||||||
Log(Logs::Detail, Logs::NPCRoamBox, "Dest Z is (%f)", roambox_destination_z);
|
Log(Logs::Detail, Logs::NPCRoamBox, "Dest Z is (%f)", roambox_destination_z);
|
||||||
|
|
||||||
SetCurrentWP(WaypointStatus::wpsRoamBoxPauseInProgress);
|
SetCurrentWP(EQEmu::WaypointStatus::RoamBoxPauseInProgress);
|
||||||
NavigateTo(roambox_destination_x, roambox_destination_y, roambox_destination_z);
|
NavigateTo(roambox_destination_x, roambox_destination_y, roambox_destination_z);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1671,7 +1669,7 @@ void NPC::AI_DoMovement() {
|
|||||||
|
|
||||||
int32 gridno = CastToNPC()->GetGrid();
|
int32 gridno = CastToNPC()->GetGrid();
|
||||||
|
|
||||||
if (gridno > 0 || cur_wp == WaypointStatus::wpsQuestControlNoGrid) {
|
if (gridno > 0 || cur_wp == EQEmu::WaypointStatus::QuestControlNoGrid) {
|
||||||
if (pause_timer_complete == true) { // time to pause at wp is over
|
if (pause_timer_complete == true) { // time to pause at wp is over
|
||||||
AI_SetupNextWaypoint();
|
AI_SetupNextWaypoint();
|
||||||
} // endif (pause_timer_complete==true)
|
} // endif (pause_timer_complete==true)
|
||||||
@ -1703,7 +1701,7 @@ void NPC::AI_DoMovement() {
|
|||||||
// as that is where roamer is unset and we don't want
|
// as that is where roamer is unset and we don't want
|
||||||
// the next trip through to move again based on grid stuff.
|
// the next trip through to move again based on grid stuff.
|
||||||
doMove = false;
|
doMove = false;
|
||||||
if (cur_wp == WaypointStatus::wpsQuestControlNoGrid) {
|
if (cur_wp == EQEmu::WaypointStatus::QuestControlNoGrid) {
|
||||||
AI_SetupNextWaypoint();
|
AI_SetupNextWaypoint();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1801,11 +1799,9 @@ void NPC::AI_SetupNextWaypoint() {
|
|||||||
else {
|
else {
|
||||||
pause_timer_complete = false;
|
pause_timer_complete = false;
|
||||||
Log(Logs::Detail, Logs::Pathing, "We are departing waypoint %d.", cur_wp);
|
Log(Logs::Detail, Logs::Pathing, "We are departing waypoint %d.", cur_wp);
|
||||||
|
|
||||||
using EQEmu::waypoints::WaypointStatus;
|
|
||||||
|
|
||||||
//if we were under quest control (with no grid), we are done now..
|
//if we were under quest control (with no grid), we are done now..
|
||||||
if (cur_wp == WaypointStatus::wpsQuestControlNoGrid) {
|
if (cur_wp == EQEmu::WaypointStatus::QuestControlNoGrid) {
|
||||||
Log(Logs::Detail, Logs::Pathing, "Non-grid quest mob has reached its quest ordered waypoint. Leaving pathing mode.");
|
Log(Logs::Detail, Logs::Pathing, "Non-grid quest mob has reached its quest ordered waypoint. Leaving pathing mode.");
|
||||||
roamer = false;
|
roamer = false;
|
||||||
cur_wp = 0;
|
cur_wp = 0;
|
||||||
|
|||||||
@ -108,7 +108,7 @@ void NPC::ResumeWandering()
|
|||||||
{ // we were paused by a quest
|
{ // we were paused by a quest
|
||||||
AI_walking_timer->Disable();
|
AI_walking_timer->Disable();
|
||||||
SetGrid(0 - GetGrid());
|
SetGrid(0 - GetGrid());
|
||||||
if (cur_wp == EQEmu::waypoints::WaypointStatus::wpsQuestControlGrid)
|
if (cur_wp == EQEmu::WaypointStatus::QuestControlGrid)
|
||||||
{ // got here by a MoveTo()
|
{ // got here by a MoveTo()
|
||||||
cur_wp = save_wp;
|
cur_wp = save_wp;
|
||||||
UpdateWaypoint(cur_wp); // have him head to last destination from here
|
UpdateWaypoint(cur_wp); // have him head to last destination from here
|
||||||
@ -164,31 +164,32 @@ void NPC::PauseWandering(int pausetime)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
void NPC::MoveTo(const glm::vec4& position, bool saveguardspot)
|
void NPC::MoveTo(const glm::vec4 &position, bool saveguardspot)
|
||||||
{ // makes mob walk to specified location
|
{ // makes mob walk to specified location
|
||||||
|
if (IsNPC() && GetGrid() != 0) { // he is on a grid
|
||||||
using EQEmu::waypoints::WaypointStatus;
|
if (GetGrid() < 0) { // currently stopped by a quest command
|
||||||
|
SetGrid(0 - GetGrid()); // get him moving again
|
||||||
if (IsNPC() && GetGrid() != 0)
|
Log(Logs::Detail,
|
||||||
{ // he is on a grid
|
Logs::AI,
|
||||||
if (GetGrid() < 0)
|
"MoveTo during quest wandering. Canceling quest wandering and going back to grid %d when MoveTo is done.",
|
||||||
{ // currently stopped by a quest command
|
GetGrid());
|
||||||
SetGrid(0 - GetGrid()); // get him moving again
|
|
||||||
Log(Logs::Detail, Logs::AI, "MoveTo during quest wandering. Canceling quest wandering and going back to grid %d when MoveTo is done.", GetGrid());
|
|
||||||
}
|
}
|
||||||
AI_walking_timer->Disable(); // disable timer in case he is paused at a wp
|
AI_walking_timer->Disable(); // disable timer in case he is paused at a wp
|
||||||
if (cur_wp >= 0)
|
if (cur_wp >= 0) { // we've not already done a MoveTo()
|
||||||
{ // we've not already done a MoveTo()
|
save_wp = cur_wp; // save the current waypoint
|
||||||
save_wp = cur_wp; // save the current waypoint
|
cur_wp = EQEmu::WaypointStatus::QuestControlGrid;
|
||||||
cur_wp = WaypointStatus::wpsQuestControlGrid;
|
|
||||||
}
|
}
|
||||||
Log(Logs::Detail, Logs::AI, "MoveTo %s, pausing regular grid wandering. Grid %d, save_wp %d", to_string(static_cast<glm::vec3>(position)).c_str(), -GetGrid(), save_wp);
|
Log(Logs::Detail,
|
||||||
|
Logs::AI,
|
||||||
|
"MoveTo %s, pausing regular grid wandering. Grid %d, save_wp %d",
|
||||||
|
to_string(static_cast<glm::vec3>(position)).c_str(),
|
||||||
|
-GetGrid(),
|
||||||
|
save_wp);
|
||||||
}
|
}
|
||||||
else
|
else { // not on a grid
|
||||||
{ // not on a grid
|
roamer = true;
|
||||||
roamer = true;
|
|
||||||
save_wp = 0;
|
save_wp = 0;
|
||||||
cur_wp = WaypointStatus::wpsQuestControlNoGrid;
|
cur_wp = EQEmu::WaypointStatus::QuestControlNoGrid;
|
||||||
Log(Logs::Detail, Logs::AI, "MoveTo %s without a grid.", to_string(static_cast<glm::vec3>(position)).c_str());
|
Log(Logs::Detail, Logs::AI, "MoveTo %s without a grid.", to_string(static_cast<glm::vec3>(position)).c_str());
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -197,23 +198,27 @@ void NPC::MoveTo(const glm::vec4& position, bool saveguardspot)
|
|||||||
m_CurrentWayPoint = position;
|
m_CurrentWayPoint = position;
|
||||||
m_CurrentWayPoint.z = GetFixedZ(dest);
|
m_CurrentWayPoint.z = GetFixedZ(dest);
|
||||||
|
|
||||||
if (saveguardspot)
|
if (saveguardspot) {
|
||||||
{
|
|
||||||
m_GuardPoint = m_CurrentWayPoint;
|
m_GuardPoint = m_CurrentWayPoint;
|
||||||
|
|
||||||
if (m_GuardPoint.w == 0)
|
if (m_GuardPoint.w == 0) {
|
||||||
m_GuardPoint.w = 0.0001; //hack to make IsGuarding simpler
|
m_GuardPoint.w = 0.0001;
|
||||||
|
} //hack to make IsGuarding simpler
|
||||||
|
|
||||||
if (m_GuardPoint.w == -1)
|
if (m_GuardPoint.w == -1)
|
||||||
m_GuardPoint.w = this->CalculateHeadingToTarget(position.x, position.y);
|
m_GuardPoint.w = this->CalculateHeadingToTarget(position.x, position.y);
|
||||||
|
|
||||||
Log(Logs::Detail, Logs::AI, "Setting guard position to %s", to_string(static_cast<glm::vec3>(m_GuardPoint)).c_str());
|
Log(Logs::Detail,
|
||||||
|
Logs::AI,
|
||||||
|
"Setting guard position to %s",
|
||||||
|
to_string(static_cast<glm::vec3>(m_GuardPoint)).c_str());
|
||||||
}
|
}
|
||||||
|
|
||||||
cur_wp_pause = 0;
|
cur_wp_pause = 0;
|
||||||
time_until_can_move = 0;
|
time_until_can_move = 0;
|
||||||
if (AI_walking_timer->Enabled())
|
if (AI_walking_timer->Enabled()) {
|
||||||
AI_walking_timer->Start(100);
|
AI_walking_timer->Start(100);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void NPC::UpdateWaypoint(int wp_index)
|
void NPC::UpdateWaypoint(int wp_index)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user