Merge branch 'master' into eqemu_config_json

This commit is contained in:
Akkadius 2017-07-23 00:55:06 -05:00
commit dad6f2ead5
23 changed files with 124 additions and 98 deletions

View File

@ -305,6 +305,7 @@ union
uint8 DestructibleUnk8; uint8 DestructibleUnk8;
uint32 DestructibleUnk9; uint32 DestructibleUnk9;
bool targetable_with_hotkey; bool targetable_with_hotkey;
bool show_name;
}; };

View File

@ -87,6 +87,7 @@ enum LogCategory {
Client_Login, Client_Login,
Headless_Client, Headless_Client,
HP_Update, HP_Update,
FixZ,
MaxCategoryID /* Don't Remove this*/ MaxCategoryID /* Don't Remove this*/
}; };
@ -138,7 +139,8 @@ static const char* LogCategoryName[LogCategory::MaxCategoryID] = {
"Login Server", "Login Server",
"Client Login", "Client Login",
"Headless Client", "Headless Client",
"HP Update" "HP Update",
"FixZ"
}; };
} }

View File

@ -3930,7 +3930,7 @@ namespace RoF
if (strlen(emu->suffix)) if (strlen(emu->suffix))
PacketSize += strlen(emu->suffix) + 1; PacketSize += strlen(emu->suffix) + 1;
bool ShowName = 1; bool ShowName = emu->show_name;
if (emu->bodytype >= 66) if (emu->bodytype >= 66)
{ {
emu->race = 127; emu->race = 127;

View File

@ -4086,7 +4086,7 @@ namespace RoF2
PacketSize += strlen(emu->DestructibleString) + 1; PacketSize += strlen(emu->DestructibleString) + 1;
} }
bool ShowName = 1; bool ShowName = emu->show_name;
if (emu->bodytype >= 66) if (emu->bodytype >= 66)
{ {
emu->race = 127; emu->race = 127;

View File

@ -2560,7 +2560,7 @@ namespace SoD
PacketSize += strlen(emu->DestructibleString) + 1; PacketSize += strlen(emu->DestructibleString) + 1;
} }
bool ShowName = 1; bool ShowName = emu->show_name;
if (emu->bodytype >= 66) if (emu->bodytype >= 66)
{ {
emu->race = 127; emu->race = 127;

View File

@ -2097,7 +2097,7 @@ namespace SoF
int k; int k;
for (r = 0; r < entrycount; r++, eq++, emu++) { for (r = 0; r < entrycount; r++, eq++, emu++) {
eq->showname = 1; //New Field - Toggles Name Display on or off - 0 = off, 1 = on eq->showname = emu->show_name ? 1 : 0; //New Field - Toggles Name Display on or off - 0 = off, 1 = on
eq->linkdead = 0; //New Field - Toggles LD on or off after name - 0 = off, 1 = on eq->linkdead = 0; //New Field - Toggles LD on or off after name - 0 = off, 1 = on
eq->statue = 0; //New Field - 1 freezes animation eq->statue = 0; //New Field - 1 freezes animation
eq->showhelm = emu->showhelm; eq->showhelm = emu->showhelm;
@ -2136,10 +2136,10 @@ namespace SoF
eq->findable = emu->findable; eq->findable = emu->findable;
if (emu->bodytype >= 66) if (emu->bodytype >= 66)
{ {
eq->bodytype = 11; //non-targetable eq->bodytype = 11; //non-targetable
eq->showname = 0; //no visible name eq->showname = 0; //no visible name
eq->race = 127; //invisible man eq->race = 127; //invisible man
eq->gender = 0; //invisible men are gender 0 eq->gender = 0; //invisible men are gender 0
} }
else else
{ {

View File

@ -2844,7 +2844,7 @@ namespace UF
PacketSize += strlen(emu->DestructibleString) + 1; PacketSize += strlen(emu->DestructibleString) + 1;
} }
bool ShowName = 1; bool ShowName = emu->show_name;
if (emu->bodytype >= 66) if (emu->bodytype >= 66)
{ {
emu->race = 127; emu->race = 127;

View File

@ -290,7 +290,7 @@ RULE_BOOL(Pathing, AggroReturnToGrid, true) // Enable pathing for aggroed roamin
RULE_BOOL(Pathing, Guard, true) // Enable pathing for mobs moving to their guard point. RULE_BOOL(Pathing, Guard, true) // Enable pathing for mobs moving to their guard point.
RULE_BOOL(Pathing, Find, true) // Enable pathing for FindPerson requests from the client. RULE_BOOL(Pathing, Find, true) // Enable pathing for FindPerson requests from the client.
RULE_BOOL(Pathing, Fear, true) // Enable pathing for fear RULE_BOOL(Pathing, Fear, true) // Enable pathing for fear
RULE_REAL(Pathing, ZDiffThreshold, 10) // If a mob las LOS to it's target, it will run to it if the Z difference is < this. RULE_REAL(Pathing, ZDiffThresholdNew, 80) // If a mob las LOS to it's target, it will run to it if the Z difference is < this.
RULE_INT(Pathing, LOSCheckFrequency, 1000) // A mob will check for LOS to it's target this often (milliseconds). RULE_INT(Pathing, LOSCheckFrequency, 1000) // A mob will check for LOS to it's target this often (milliseconds).
RULE_INT(Pathing, RouteUpdateFrequencyShort, 1000) // How often a new route will be calculated if the target has moved. RULE_INT(Pathing, RouteUpdateFrequencyShort, 1000) // How often a new route will be calculated if the target has moved.
RULE_INT(Pathing, RouteUpdateFrequencyLong, 5000) // How often a new route will be calculated if the target has moved. RULE_INT(Pathing, RouteUpdateFrequencyLong, 5000) // How often a new route will be calculated if the target has moved.

View File

@ -30,7 +30,7 @@
Manifest: https://github.com/EQEmu/Server/blob/master/utils/sql/db_update_manifest.txt Manifest: https://github.com/EQEmu/Server/blob/master/utils/sql/db_update_manifest.txt
*/ */
#define CURRENT_BINARY_DATABASE_VERSION 9112 #define CURRENT_BINARY_DATABASE_VERSION 9113
#ifdef BOTS #ifdef BOTS
#define CURRENT_BINARY_BOTS_DATABASE_VERSION 9017 #define CURRENT_BINARY_BOTS_DATABASE_VERSION 9017
#else #else

View File

@ -1454,7 +1454,7 @@ sub map_files_fetch_bulk{
get_remote_file("http://github.com/Akkadius/EQEmuMaps/archive/master.zip", "maps/maps.zip", 1); get_remote_file("http://github.com/Akkadius/EQEmuMaps/archive/master.zip", "maps/maps.zip", 1);
unzip('maps/maps.zip', 'maps/'); unzip('maps/maps.zip', 'maps/');
my @files; my @files;
my $start_dir = "maps/EQEmuMaps-master/maps"; my $start_dir = "maps/EQEmuMaps-master/";
find( find(
sub { push @files, $File::Find::name unless -d; }, sub { push @files, $File::Find::name unless -d; },
$start_dir $start_dir
@ -2179,4 +2179,5 @@ sub generate_random_password {
map $alphanumeric[rand @alphanumeric], 0..$passwordsize; map $alphanumeric[rand @alphanumeric], 0..$passwordsize;
return $randpassword; return $randpassword;
} }

View File

@ -366,6 +366,7 @@
9110|2017_04_10_graveyard.sql|show index from graveyard WHERE key_name = 'zone_id_nonunique'|empty| 9110|2017_04_10_graveyard.sql|show index from graveyard WHERE key_name = 'zone_id_nonunique'|empty|
9111|2017_06_24_saylink_index.sql|SHOW INDEX FROM `saylink` WHERE `key_name` = 'phrase_index'|empty| 9111|2017_06_24_saylink_index.sql|SHOW INDEX FROM `saylink` WHERE `key_name` = 'phrase_index'|empty|
9112|2017_06_24_rule_values_expand.sql|SHOW COLUMNS FROM rule_values WHERE Field = 'rule_value' and Type = 'varchar(30)'|empty| 9112|2017_06_24_rule_values_expand.sql|SHOW COLUMNS FROM rule_values WHERE Field = 'rule_value' and Type = 'varchar(30)'|empty|
9113|2017_07_19_show_name.sql|SHOW COLUMNS FROM `npc_types` LIKE 'show_name'|empty|
# Upgrade conditions: # Upgrade conditions:
# This won't be needed after this system is implemented, but it is used database that are not # This won't be needed after this system is implemented, but it is used database that are not

View File

@ -0,0 +1,3 @@
ALTER TABLE `npc_types` ADD COLUMN `show_name` TINYINT(2) NOT NULL DEFAULT 1;
ALTER TABLE `npc_types` ADD COLUMN `untargetable` TINYINT(2) NOT NULL DEFAULT 0;
UPDATE `npc_types` SET `show_name` = 0, `untargetable` = 1 WHERE `bodytype` >= 66;

View File

@ -1281,6 +1281,10 @@ void Client::Clearance(int8 response)
} else { } else {
zs_addr = zs->GetIP().c_str(); zs_addr = zs->GetIP().c_str();
if (!zs_addr[0]) {
zs_addr = WorldConfig::get()->LocalAddress.c_str();
}
if(strcmp(zs_addr, "127.0.0.1") == 0) if(strcmp(zs_addr, "127.0.0.1") == 0)
{ {
Log(Logs::Detail, Logs::World_Server, "Local zone address was %s, setting local address to: %s", zs_addr, WorldConfig::get()->LocalAddress.c_str()); Log(Logs::Detail, Logs::World_Server, "Local zone address was %s, setting local address to: %s", zs_addr, WorldConfig::get()->LocalAddress.c_str());

View File

@ -1944,6 +1944,7 @@ void Client::FillSpawnStruct(NewSpawn_Struct* ns, Mob* ForWho)
ns->spawn.guildID = GuildID(); ns->spawn.guildID = GuildID();
// ns->spawn.linkdead = IsLD() ? 1 : 0; // ns->spawn.linkdead = IsLD() ? 1 : 0;
// ns->spawn.pvp = GetPVP() ? 1 : 0; // ns->spawn.pvp = GetPVP() ? 1 : 0;
ns->spawn.show_name = true;
strcpy(ns->spawn.title, m_pp.title); strcpy(ns->spawn.title, m_pp.title);

View File

@ -4599,14 +4599,14 @@ void Client::Handle_OP_ClientUpdate(const EQApplicationPacket *app)
} }
} }
float new_heading = EQ19toFloat(ppu->heading);
int32 new_animation = ppu->animation;
/* Update internal server position from what the client has sent */ /* Update internal server position from what the client has sent */
m_Position.x = ppu->x_pos; m_Position.x = ppu->x_pos;
m_Position.y = ppu->y_pos; m_Position.y = ppu->y_pos;
m_Position.z = ppu->z_pos; m_Position.z = ppu->z_pos;
m_Position.w = EQ19toFloat(ppu->heading);
animation = ppu->animation;
/* Visual Debugging */ /* Visual Debugging */
if (RuleB(Character, OPClientUpdateVisualDebug)) { if (RuleB(Character, OPClientUpdateVisualDebug)) {
Log(Logs::General, Logs::Debug, "ClientUpdate: ppu x: %f y: %f z: %f h: %u", ppu->x_pos, ppu->y_pos, ppu->z_pos, ppu->heading); Log(Logs::General, Logs::Debug, "ClientUpdate: ppu x: %f y: %f z: %f h: %u", ppu->x_pos, ppu->y_pos, ppu->z_pos, ppu->heading);
@ -4615,7 +4615,10 @@ void Client::Handle_OP_ClientUpdate(const EQApplicationPacket *app)
} }
/* Only feed real time updates when client is moving */ /* Only feed real time updates when client is moving */
if (is_client_moving) { if (is_client_moving || new_heading != m_Position.w || new_animation != animation) {
animation = ppu->animation;
m_Position.w = EQ19toFloat(ppu->heading);
/* Broadcast update to other clients */ /* Broadcast update to other clients */
auto outapp = new EQApplicationPacket(OP_ClientUpdate, sizeof(PlayerPositionUpdateServer_Struct)); auto outapp = new EQApplicationPacket(OP_ClientUpdate, sizeof(PlayerPositionUpdateServer_Struct));

View File

@ -659,6 +659,8 @@ void EntityList::AddNPC(NPC *npc, bool SendSpawnPacket, bool dontqueue)
QueueClients(npc, app); QueueClients(npc, app);
npc->SendArmorAppearance(); npc->SendArmorAppearance();
npc->SetAppearance(npc->GetGuardPointAnim(),false); npc->SetAppearance(npc->GetGuardPointAnim(),false);
if (!npc->IsTargetable())
npc->SendTargetable(false);
safe_delete(app); safe_delete(app);
} else { } else {
auto ns = new NewSpawn_Struct; auto ns = new NewSpawn_Struct;
@ -799,6 +801,8 @@ void EntityList::CheckSpawnQueue()
NPC *pnpc = it->second; NPC *pnpc = it->second;
pnpc->SendArmorAppearance(); pnpc->SendArmorAppearance();
pnpc->SetAppearance(pnpc->GetGuardPointAnim(), false); pnpc->SetAppearance(pnpc->GetGuardPointAnim(), false);
if (!pnpc->IsTargetable())
pnpc->SendTargetable(false);
} }
safe_delete(outapp); safe_delete(outapp);
iterator.RemoveCurrent(); iterator.RemoveCurrent();

View File

@ -173,7 +173,5 @@ void Mob::CalculateNewFearpoint()
} }
if (currently_fleeing) if (currently_fleeing)
m_FearWalkTarget = glm::vec3(ranx, rany, ranz); m_FearWalkTarget = glm::vec3(ranx, rany, ranz);
else //Break fear
BuffFadeByEffect(SE_Fear);
} }

View File

@ -375,6 +375,7 @@ NPC::NPC(const NPCType* d, Spawn2* in_respawn, const glm::vec4& position, int if
CalcBonuses(); CalcBonuses();
raid_target = d->raid_target; raid_target = d->raid_target;
ignore_despawn = d->ignore_despawn; ignore_despawn = d->ignore_despawn;
m_targetable = !d->untargetable;
} }
NPC::~NPC() NPC::~NPC()
@ -1906,6 +1907,7 @@ void NPC::FillSpawnStruct(NewSpawn_Struct* ns, Mob* ForWho)
ns->spawn.is_npc = 1; ns->spawn.is_npc = 1;
UpdateActiveLight(); UpdateActiveLight();
ns->spawn.light = GetActiveLightType(); ns->spawn.light = GetActiveLightType();
ns->spawn.show_name = NPCTypedata->show_name;
} }
void NPC::PetOnSpawn(NewSpawn_Struct* ns) void NPC::PetOnSpawn(NewSpawn_Struct* ns)

View File

@ -206,7 +206,7 @@ glm::vec3 PathManager::GetPathNodeCoordinates(int NodeNumber, bool BestZ)
std::deque<int> PathManager::FindRoute(int startID, int endID) std::deque<int> PathManager::FindRoute(int startID, int endID)
{ {
Log(Logs::Detail, Logs::None, "FindRoute from node %i to %i", startID, endID); Log(Logs::Detail, Logs::Pathing, "FindRoute from node %i to %i", startID, endID);
memset(ClosedListFlag, 0, sizeof(int) * Head.PathNodeCount); memset(ClosedListFlag, 0, sizeof(int) * Head.PathNodeCount);
@ -329,7 +329,7 @@ std::deque<int> PathManager::FindRoute(int startID, int endID)
} }
} }
Log(Logs::Detail, Logs::None, "Unable to find a route."); Log(Logs::Detail, Logs::Pathing, "Unable to find a route.");
return Route; return Route;
} }
@ -351,7 +351,7 @@ auto path_compare = [](const PathNodeSortStruct& a, const PathNodeSortStruct& b)
std::deque<int> PathManager::FindRoute(glm::vec3 Start, glm::vec3 End) std::deque<int> PathManager::FindRoute(glm::vec3 Start, glm::vec3 End)
{ {
Log(Logs::Detail, Logs::None, "FindRoute(%8.3f, %8.3f, %8.3f, %8.3f, %8.3f, %8.3f)", Start.x, Start.y, Start.z, End.x, End.y, End.z); Log(Logs::Detail, Logs::Pathing, "FindRoute(%8.3f, %8.3f, %8.3f, %8.3f, %8.3f, %8.3f)", Start.x, Start.y, Start.z, End.x, End.y, End.z);
std::deque<int> noderoute; std::deque<int> noderoute;
@ -384,7 +384,7 @@ std::deque<int> PathManager::FindRoute(glm::vec3 Start, glm::vec3 End)
for(auto Iterator = SortedByDistance.begin(); Iterator != SortedByDistance.end(); ++Iterator) for(auto Iterator = SortedByDistance.begin(); Iterator != SortedByDistance.end(); ++Iterator)
{ {
Log(Logs::Detail, Logs::None, "Checking Reachability of Node %i from Start Position.", PathNodes[(*Iterator).id].id); Log(Logs::Detail, Logs::Pathing, "Checking Reachability of Node %i from Start Position.", PathNodes[(*Iterator).id].id);
if(!zone->zonemap->LineIntersectsZone(Start, PathNodes[(*Iterator).id].v, 1.0f, nullptr)) if(!zone->zonemap->LineIntersectsZone(Start, PathNodes[(*Iterator).id].v, 1.0f, nullptr))
{ {
@ -394,11 +394,11 @@ std::deque<int> PathManager::FindRoute(glm::vec3 Start, glm::vec3 End)
} }
if(ClosestPathNodeToStart <0 ) { if(ClosestPathNodeToStart <0 ) {
Log(Logs::Detail, Logs::None, "No LOS to any starting Path Node within range."); Log(Logs::Detail, Logs::Pathing, "No LOS to any starting Path Node within range.");
return noderoute; return noderoute;
} }
Log(Logs::Detail, Logs::None, "Closest Path Node To Start: %2d", ClosestPathNodeToStart); Log(Logs::Detail, Logs::Pathing, "Closest Path Node To Start: %2d", ClosestPathNodeToStart);
// Find the nearest PathNode the end point has LOS to // Find the nearest PathNode the end point has LOS to
@ -421,8 +421,8 @@ std::deque<int> PathManager::FindRoute(glm::vec3 Start, glm::vec3 End)
for(auto Iterator = SortedByDistance.begin(); Iterator != SortedByDistance.end(); ++Iterator) for(auto Iterator = SortedByDistance.begin(); Iterator != SortedByDistance.end(); ++Iterator)
{ {
Log(Logs::Detail, Logs::None, "Checking Reachability of Node %i from End Position.", PathNodes[(*Iterator).id].id); Log(Logs::Detail, Logs::Pathing, "Checking Reachability of Node %i from End Position.", PathNodes[(*Iterator).id].id);
Log(Logs::Detail, Logs::None, " (%8.3f, %8.3f, %8.3f) to (%8.3f, %8.3f, %8.3f)", Log(Logs::Detail, Logs::Pathing, " (%8.3f, %8.3f, %8.3f) to (%8.3f, %8.3f, %8.3f)",
End.x, End.y, End.z, End.x, End.y, End.z,
PathNodes[(*Iterator).id].v.x, PathNodes[(*Iterator).id].v.y, PathNodes[(*Iterator).id].v.z); PathNodes[(*Iterator).id].v.x, PathNodes[(*Iterator).id].v.y, PathNodes[(*Iterator).id].v.z);
@ -434,11 +434,11 @@ std::deque<int> PathManager::FindRoute(glm::vec3 Start, glm::vec3 End)
} }
if(ClosestPathNodeToEnd < 0) { if(ClosestPathNodeToEnd < 0) {
Log(Logs::Detail, Logs::None, "No LOS to any end Path Node within range."); Log(Logs::Detail, Logs::Pathing, "No LOS to any end Path Node within range.");
return noderoute; return noderoute;
} }
Log(Logs::Detail, Logs::None, "Closest Path Node To End: %2d", ClosestPathNodeToEnd); Log(Logs::Detail, Logs::Pathing, "Closest Path Node To End: %2d", ClosestPathNodeToEnd);
if(ClosestPathNodeToStart == ClosestPathNodeToEnd) if(ClosestPathNodeToStart == ClosestPathNodeToEnd)
{ {
@ -673,7 +673,7 @@ glm::vec3 Mob::UpdatePath(float ToX, float ToY, float ToZ, float Speed, bool &Wa
if(To == From) if(To == From)
return To; return To;
Log(Logs::Detail, Logs::None, "UpdatePath. From(%8.3f, %8.3f, %8.3f) To(%8.3f, %8.3f, %8.3f)", From.x, From.y, From.z, To.x, To.y, To.z); Log(Logs::Detail, Logs::Pathing, "UpdatePath. From(%8.3f, %8.3f, %8.3f) To(%8.3f, %8.3f, %8.3f)", From.x, From.y, From.z, To.x, To.y, To.z);
if(From == PathingLastPosition) if(From == PathingLastPosition)
{ {
@ -681,7 +681,7 @@ glm::vec3 Mob::UpdatePath(float ToX, float ToY, float ToZ, float Speed, bool &Wa
if((PathingLoopCount > 5) && !IsRooted()) if((PathingLoopCount > 5) && !IsRooted())
{ {
Log(Logs::Detail, Logs::None, "appears to be stuck. Teleporting them to next position.", GetName()); Log(Logs::Detail, Logs::Pathing, "appears to be stuck. Teleporting them to next position.", GetName());
if(Route.empty()) if(Route.empty())
{ {
@ -721,7 +721,7 @@ glm::vec3 Mob::UpdatePath(float ToX, float ToY, float ToZ, float Speed, bool &Wa
// If we are already pathing, and the destination is the same as before ... // If we are already pathing, and the destination is the same as before ...
if(SameDestination) if(SameDestination)
{ {
Log(Logs::Detail, Logs::None, " Still pathing to the same destination."); Log(Logs::Detail, Logs::Pathing, " Still pathing to the same destination.");
// Get the coordinates of the first path node we are going to. // Get the coordinates of the first path node we are going to.
NextNode = Route.front(); NextNode = Route.front();
@ -730,9 +730,9 @@ glm::vec3 Mob::UpdatePath(float ToX, float ToY, float ToZ, float Speed, bool &Wa
// May need to refine this as rounding errors may mean we never have equality // May need to refine this as rounding errors may mean we never have equality
// We have reached the path node. // We have reached the path node.
if(NodeLoc == From) if(NodeLoc.x == From.x && NodeLoc.y == From.y)
{ {
Log(Logs::Detail, Logs::None, " Arrived at node %i", NextNode); Log(Logs::Detail, Logs::Pathing, " Arrived at node %i", NextNode);
NodeReached = true; NodeReached = true;
@ -746,36 +746,36 @@ glm::vec3 Mob::UpdatePath(float ToX, float ToY, float ToZ, float Speed, bool &Wa
// target, and we may run past the target if we don't check LOS at this point. // target, and we may run past the target if we don't check LOS at this point.
int RouteSize = Route.size(); int RouteSize = Route.size();
Log(Logs::Detail, Logs::None, "Route size is %i", RouteSize); Log(Logs::Detail, Logs::Pathing, "Route size is %i", RouteSize);
if((RouteSize == 2) if((RouteSize == 2)
|| ((PathingTraversedNodes >= RuleI(Pathing, MinNodesTraversedForLOSCheck)) || ((PathingTraversedNodes >= RuleI(Pathing, MinNodesTraversedForLOSCheck))
&& (RouteSize <= RuleI(Pathing, MinNodesLeftForLOSCheck)) && (RouteSize <= RuleI(Pathing, MinNodesLeftForLOSCheck))
&& PathingLOSCheckTimer->Check())) && PathingLOSCheckTimer->Check()))
{ {
Log(Logs::Detail, Logs::None, " Checking distance to target."); Log(Logs::Detail, Logs::Pathing, " Checking distance to target.");
float Distance = VectorDistanceNoRoot(From, To); float Distance = VectorDistanceNoRoot(From, To);
Log(Logs::Detail, Logs::None, " Distance between From and To (NoRoot) is %8.3f", Distance); Log(Logs::Detail, Logs::Pathing, " Distance between From and To (NoRoot) is %8.3f", Distance);
if ((Distance <= RuleR(Pathing, MinDistanceForLOSCheckShort)) && if ((Distance <= RuleR(Pathing, MinDistanceForLOSCheckShort)) &&
(std::abs(From.z - To.z) <= RuleR(Pathing, ZDiffThreshold))) { (std::abs(From.z - To.z) <= RuleR(Pathing, ZDiffThresholdNew))) {
if(!zone->zonemap->LineIntersectsZone(HeadPosition, To, 1.0f, nullptr)) if(!zone->zonemap->LineIntersectsZone(HeadPosition, To, 1.0f, nullptr))
PathingLOSState = HaveLOS; PathingLOSState = HaveLOS;
else else
PathingLOSState = NoLOS; PathingLOSState = NoLOS;
Log(Logs::Detail, Logs::None, "NoLOS"); Log(Logs::Detail, Logs::Pathing, "NoLOS");
if((PathingLOSState == HaveLOS) && zone->pathing->NoHazards(From, To)) if((PathingLOSState == HaveLOS) && zone->pathing->NoHazards(From, To))
{ {
Log(Logs::Detail, Logs::None, " No hazards. Running directly to target."); Log(Logs::Detail, Logs::Pathing, " No hazards. Running directly to target.");
Route.clear(); Route.clear();
return To; return To;
} }
else else
{ {
Log(Logs::Detail, Logs::None, " Continuing on node path."); Log(Logs::Detail, Logs::Pathing, " Continuing on node path.");
} }
} }
else else
@ -801,7 +801,7 @@ glm::vec3 Mob::UpdatePath(float ToX, float ToY, float ToZ, float Speed, bool &Wa
if(Route.empty()) if(Route.empty())
{ {
Log(Logs::Detail, Logs::None, "Missing node after teleport."); Log(Logs::Detail, Logs::Pathing, "Missing node after teleport.");
return To; return To;
} }
@ -811,7 +811,7 @@ glm::vec3 Mob::UpdatePath(float ToX, float ToY, float ToZ, float Speed, bool &Wa
Teleport(NodeLoc); Teleport(NodeLoc);
Log(Logs::Detail, Logs::None, " TELEPORTED to %8.3f, %8.3f, %8.3f\n", NodeLoc.x, NodeLoc.y, NodeLoc.z); Log(Logs::Detail, Logs::Pathing, " TELEPORTED to %8.3f, %8.3f, %8.3f\n", NodeLoc.x, NodeLoc.y, NodeLoc.z);
Route.pop_front(); Route.pop_front();
@ -822,7 +822,7 @@ glm::vec3 Mob::UpdatePath(float ToX, float ToY, float ToZ, float Speed, bool &Wa
} }
zone->pathing->OpenDoors(PathingLastNodeVisited, NextNode, this); zone->pathing->OpenDoors(PathingLastNodeVisited, NextNode, this);
Log(Logs::Detail, Logs::None, " Now moving to node %i", NextNode); Log(Logs::Detail, Logs::Pathing, " Now moving to node %i", NextNode);
return zone->pathing->GetPathNodeCoordinates(NextNode); return zone->pathing->GetPathNodeCoordinates(NextNode);
} }
@ -830,7 +830,7 @@ glm::vec3 Mob::UpdatePath(float ToX, float ToY, float ToZ, float Speed, bool &Wa
{ {
// we have run all the nodes, all that is left is the direct path from the last node // we have run all the nodes, all that is left is the direct path from the last node
// to the destination // to the destination
Log(Logs::Detail, Logs::None, " Reached end of node path, running direct to target."); Log(Logs::Detail, Logs::Pathing, " Reached end of node path, running direct to target.");
return To; return To;
} }
@ -844,30 +844,30 @@ glm::vec3 Mob::UpdatePath(float ToX, float ToY, float ToZ, float Speed, bool &Wa
&& (RouteSize <= RuleI(Pathing, MinNodesLeftForLOSCheck)) && (RouteSize <= RuleI(Pathing, MinNodesLeftForLOSCheck))
&& PathingLOSCheckTimer->Check()) && PathingLOSCheckTimer->Check())
{ {
Log(Logs::Detail, Logs::None, " Checking distance to target."); Log(Logs::Detail, Logs::Pathing, " Checking distance to target.");
float Distance = VectorDistanceNoRoot(From, To); float Distance = VectorDistanceNoRoot(From, To);
Log(Logs::Detail, Logs::None, " Distance between From and To (NoRoot) is %8.3f", Distance); Log(Logs::Detail, Logs::Pathing, " Distance between From and To (NoRoot) is %8.3f", Distance);
if ((Distance <= RuleR(Pathing, MinDistanceForLOSCheckShort)) && if ((Distance <= RuleR(Pathing, MinDistanceForLOSCheckShort)) &&
(std::abs(From.z - To.z) <= RuleR(Pathing, ZDiffThreshold))) { (std::abs(From.z - To.z) <= RuleR(Pathing, ZDiffThresholdNew))) {
if(!zone->zonemap->LineIntersectsZone(HeadPosition, To, 1.0f, nullptr)) if(!zone->zonemap->LineIntersectsZone(HeadPosition, To, 1.0f, nullptr))
PathingLOSState = HaveLOS; PathingLOSState = HaveLOS;
else else
PathingLOSState = NoLOS; PathingLOSState = NoLOS;
Log(Logs::Detail, Logs::None, "NoLOS"); Log(Logs::Detail, Logs::Pathing, "NoLOS");
if((PathingLOSState == HaveLOS) && zone->pathing->NoHazards(From, To)) if((PathingLOSState == HaveLOS) && zone->pathing->NoHazards(From, To))
{ {
Log(Logs::Detail, Logs::None, " No hazards. Running directly to target."); Log(Logs::Detail, Logs::Pathing, " No hazards. Running directly to target.");
Route.clear(); Route.clear();
return To; return To;
} }
else else
{ {
Log(Logs::Detail, Logs::None, " Continuing on node path."); Log(Logs::Detail, Logs::Pathing, " Continuing on node path.");
} }
} }
else else
@ -879,7 +879,7 @@ glm::vec3 Mob::UpdatePath(float ToX, float ToY, float ToZ, float Speed, bool &Wa
{ {
// We get here if we were already pathing, but our destination has now changed. // We get here if we were already pathing, but our destination has now changed.
// //
Log(Logs::Detail, Logs::None, " Target has changed position."); Log(Logs::Detail, Logs::Pathing, " Target has changed position.");
// Update our record of where we are going to. // Update our record of where we are going to.
PathingDestination = To; PathingDestination = To;
// Check if we now have LOS etc to the new destination. // Check if we now have LOS etc to the new destination.
@ -888,24 +888,24 @@ glm::vec3 Mob::UpdatePath(float ToX, float ToY, float ToZ, float Speed, bool &Wa
float Distance = VectorDistanceNoRoot(From, To); float Distance = VectorDistanceNoRoot(From, To);
if ((Distance <= RuleR(Pathing, MinDistanceForLOSCheckShort)) && if ((Distance <= RuleR(Pathing, MinDistanceForLOSCheckShort)) &&
(std::abs(From.z - To.z) <= RuleR(Pathing, ZDiffThreshold))) { (std::abs(From.z - To.z) <= RuleR(Pathing, ZDiffThresholdNew))) {
Log(Logs::Detail, Logs::None, " Checking for short LOS at distance %8.3f.", Distance); Log(Logs::Detail, Logs::Pathing, " Checking for short LOS at distance %8.3f.", Distance);
if(!zone->zonemap->LineIntersectsZone(HeadPosition, To, 1.0f, nullptr)) if(!zone->zonemap->LineIntersectsZone(HeadPosition, To, 1.0f, nullptr))
PathingLOSState = HaveLOS; PathingLOSState = HaveLOS;
else else
PathingLOSState = NoLOS; PathingLOSState = NoLOS;
Log(Logs::Detail, Logs::None, "NoLOS"); Log(Logs::Detail, Logs::Pathing, "NoLOS");
if((PathingLOSState == HaveLOS) && zone->pathing->NoHazards(From, To)) if((PathingLOSState == HaveLOS) && zone->pathing->NoHazards(From, To))
{ {
Log(Logs::Detail, Logs::None, " No hazards. Running directly to target."); Log(Logs::Detail, Logs::Pathing, " No hazards. Running directly to target.");
Route.clear(); Route.clear();
return To; return To;
} }
else else
{ {
Log(Logs::Detail, Logs::None, " Continuing on node path."); Log(Logs::Detail, Logs::Pathing, " Continuing on node path.");
} }
} }
} }
@ -916,19 +916,19 @@ glm::vec3 Mob::UpdatePath(float ToX, float ToY, float ToZ, float Speed, bool &Wa
{ {
if(!PathingRouteUpdateTimerShort->Check()) if(!PathingRouteUpdateTimerShort->Check())
{ {
Log(Logs::Detail, Logs::None, "Short route update timer not yet expired."); Log(Logs::Detail, Logs::Pathing, "Short route update timer not yet expired.");
return zone->pathing->GetPathNodeCoordinates(Route.front()); return zone->pathing->GetPathNodeCoordinates(Route.front());
} }
Log(Logs::Detail, Logs::None, "Short route update timer expired."); Log(Logs::Detail, Logs::Pathing, "Short route update timer expired.");
} }
else else
{ {
if(!PathingRouteUpdateTimerLong->Check()) if(!PathingRouteUpdateTimerLong->Check())
{ {
Log(Logs::Detail, Logs::None, "Long route update timer not yet expired."); Log(Logs::Detail, Logs::Pathing, "Long route update timer not yet expired.");
return zone->pathing->GetPathNodeCoordinates(Route.front()); return zone->pathing->GetPathNodeCoordinates(Route.front());
} }
Log(Logs::Detail, Logs::None, "Long route update timer expired."); Log(Logs::Detail, Logs::Pathing, "Long route update timer expired.");
} }
// We are already pathing, destination changed, no LOS. Find the nearest node to our destination. // We are already pathing, destination changed, no LOS. Find the nearest node to our destination.
@ -937,7 +937,7 @@ glm::vec3 Mob::UpdatePath(float ToX, float ToY, float ToZ, float Speed, bool &Wa
// Destination unreachable via pathing, return direct route. // Destination unreachable via pathing, return direct route.
if(DestinationPathNode == -1) if(DestinationPathNode == -1)
{ {
Log(Logs::Detail, Logs::None, " Unable to find path node for new destination. Running straight to target."); Log(Logs::Detail, Logs::Pathing, " Unable to find path node for new destination. Running straight to target.");
Route.clear(); Route.clear();
return To; return To;
} }
@ -945,15 +945,15 @@ glm::vec3 Mob::UpdatePath(float ToX, float ToY, float ToZ, float Speed, bool &Wa
// one, we will carry on on our path. // one, we will carry on on our path.
if(DestinationPathNode == Route.back()) if(DestinationPathNode == Route.back())
{ {
Log(Logs::Detail, Logs::None, " Same destination Node (%i). Continue with current path.", DestinationPathNode); Log(Logs::Detail, Logs::Pathing, " Same destination Node (%i). Continue with current path.", DestinationPathNode);
NodeLoc = zone->pathing->GetPathNodeCoordinates(Route.front()); NodeLoc = zone->pathing->GetPathNodeCoordinates(Route.front());
// May need to refine this as rounding errors may mean we never have equality // May need to refine this as rounding errors may mean we never have equality
// Check if we have reached a path node. // Check if we have reached a path node.
if(NodeLoc == From) if(NodeLoc.x == From.x && NodeLoc.y == From.y)
{ {
Log(Logs::Detail, Logs::None, " Arrived at node %i, moving to next one.\n", Route.front()); Log(Logs::Detail, Logs::Pathing, " Arrived at node %i, moving to next one.\n", Route.front());
NodeReached = true; NodeReached = true;
@ -976,7 +976,7 @@ glm::vec3 Mob::UpdatePath(float ToX, float ToY, float ToZ, float Speed, bool &Wa
if(Route.empty()) if(Route.empty())
{ {
Log(Logs::Detail, Logs::None, "Missing node after teleport."); Log(Logs::Detail, Logs::Pathing, "Missing node after teleport.");
return To; return To;
} }
@ -986,7 +986,7 @@ glm::vec3 Mob::UpdatePath(float ToX, float ToY, float ToZ, float Speed, bool &Wa
Teleport(NodeLoc); Teleport(NodeLoc);
Log(Logs::Detail, Logs::None, " TELEPORTED to %8.3f, %8.3f, %8.3f\n", NodeLoc.x, NodeLoc.y, NodeLoc.z); Log(Logs::Detail, Logs::Pathing, " TELEPORTED to %8.3f, %8.3f, %8.3f\n", NodeLoc.x, NodeLoc.y, NodeLoc.z);
Route.pop_front(); Route.pop_front();
@ -996,7 +996,7 @@ glm::vec3 Mob::UpdatePath(float ToX, float ToY, float ToZ, float Speed, bool &Wa
NextNode = Route.front(); NextNode = Route.front();
} }
// Return the coords of our next path node on the route. // Return the coords of our next path node on the route.
Log(Logs::Detail, Logs::None, " Now moving to node %i", NextNode); Log(Logs::Detail, Logs::Pathing, " Now moving to node %i", NextNode);
zone->pathing->OpenDoors(PathingLastNodeVisited, NextNode, this); zone->pathing->OpenDoors(PathingLastNodeVisited, NextNode, this);
@ -1004,7 +1004,7 @@ glm::vec3 Mob::UpdatePath(float ToX, float ToY, float ToZ, float Speed, bool &Wa
} }
else else
{ {
Log(Logs::Detail, Logs::None, " Reached end of path grid. Running direct to target."); Log(Logs::Detail, Logs::Pathing, " Reached end of path grid. Running direct to target.");
return To; return To;
} }
} }
@ -1012,7 +1012,7 @@ glm::vec3 Mob::UpdatePath(float ToX, float ToY, float ToZ, float Speed, bool &Wa
} }
else else
{ {
Log(Logs::Detail, Logs::None, " Target moved. End node is different. Clearing route."); Log(Logs::Detail, Logs::Pathing, " Target moved. End node is different. Clearing route.");
Route.clear(); Route.clear();
// We will now fall through to get a new route. // We will now fall through to get a new route.
@ -1022,11 +1022,11 @@ glm::vec3 Mob::UpdatePath(float ToX, float ToY, float ToZ, float Speed, bool &Wa
} }
Log(Logs::Detail, Logs::None, " Our route list is empty."); Log(Logs::Detail, Logs::Pathing, " Our route list is empty.");
if((SameDestination) && !PathingLOSCheckTimer->Check()) if((SameDestination) && !PathingLOSCheckTimer->Check())
{ {
Log(Logs::Detail, Logs::None, " Destination same as before, LOS check timer not reached. Returning To."); Log(Logs::Detail, Logs::Pathing, " Destination same as before, LOS check timer not reached. Returning To.");
return To; return To;
} }
@ -1039,23 +1039,23 @@ glm::vec3 Mob::UpdatePath(float ToX, float ToY, float ToZ, float Speed, bool &Wa
float Distance = VectorDistanceNoRoot(From, To); float Distance = VectorDistanceNoRoot(From, To);
if ((Distance <= RuleR(Pathing, MinDistanceForLOSCheckLong)) && if ((Distance <= RuleR(Pathing, MinDistanceForLOSCheckLong)) &&
(std::abs(From.z - To.z) <= RuleR(Pathing, ZDiffThreshold))) { (std::abs(From.z - To.z) <= RuleR(Pathing, ZDiffThresholdNew))) {
Log(Logs::Detail, Logs::None, " Checking for long LOS at distance %8.3f.", Distance); Log(Logs::Detail, Logs::Pathing, " Checking for long LOS at distance %8.3f.", Distance);
if(!zone->zonemap->LineIntersectsZone(HeadPosition, To, 1.0f, nullptr)) if(!zone->zonemap->LineIntersectsZone(HeadPosition, To, 1.0f, nullptr))
PathingLOSState = HaveLOS; PathingLOSState = HaveLOS;
else else
PathingLOSState = NoLOS; PathingLOSState = NoLOS;
Log(Logs::Detail, Logs::None, "NoLOS"); Log(Logs::Detail, Logs::Pathing, "NoLOS");
if((PathingLOSState == HaveLOS) && zone->pathing->NoHazards(From, To)) if((PathingLOSState == HaveLOS) && zone->pathing->NoHazards(From, To))
{ {
Log(Logs::Detail, Logs::None, "Target is reachable. Running directly there."); Log(Logs::Detail, Logs::Pathing, "Target is reachable. Running directly there.");
return To; return To;
} }
} }
Log(Logs::Detail, Logs::None, " Calculating new route to target."); Log(Logs::Detail, Logs::Pathing, " Calculating new route to target.");
Route = zone->pathing->FindRoute(From, To); Route = zone->pathing->FindRoute(From, To);
@ -1063,14 +1063,14 @@ glm::vec3 Mob::UpdatePath(float ToX, float ToY, float ToZ, float Speed, bool &Wa
if(Route.empty()) if(Route.empty())
{ {
Log(Logs::Detail, Logs::None, " No route available, running direct."); Log(Logs::Detail, Logs::Pathing, " No route available, running direct.");
return To; return To;
} }
if(SameDestination && (Route.front() == PathingLastNodeVisited)) if(SameDestination && (Route.front() == PathingLastNodeVisited))
{ {
Log(Logs::Detail, Logs::None, " Probable loop detected. Same destination and Route.front() == PathingLastNodeVisited."); Log(Logs::Detail, Logs::Pathing, " Probable loop detected. Same destination and Route.front() == PathingLastNodeVisited.");
Route.clear(); Route.clear();
@ -1078,7 +1078,7 @@ glm::vec3 Mob::UpdatePath(float ToX, float ToY, float ToZ, float Speed, bool &Wa
} }
NodeLoc = zone->pathing->GetPathNodeCoordinates(Route.front()); NodeLoc = zone->pathing->GetPathNodeCoordinates(Route.front());
Log(Logs::Detail, Logs::None, " New route determined, heading for node %i", Route.front()); Log(Logs::Detail, Logs::Pathing, " New route determined, heading for node %i", Route.front());
PathingLoopCount = 0; PathingLoopCount = 0;
@ -1119,7 +1119,7 @@ int PathManager::FindNearestPathNode(glm::vec3 Position)
for(auto Iterator = SortedByDistance.begin(); Iterator != SortedByDistance.end(); ++Iterator) for(auto Iterator = SortedByDistance.begin(); Iterator != SortedByDistance.end(); ++Iterator)
{ {
Log(Logs::Detail, Logs::None, "Checking Reachability of Node %i from Start Position.", PathNodes[(*Iterator).id].id); Log(Logs::Detail, Logs::Pathing, "Checking Reachability of Node %i from Start Position.", PathNodes[(*Iterator).id].id);
if(!zone->zonemap->LineIntersectsZone(Position, PathNodes[(*Iterator).id].v, 1.0f, nullptr)) if(!zone->zonemap->LineIntersectsZone(Position, PathNodes[(*Iterator).id].v, 1.0f, nullptr))
{ {
@ -1129,7 +1129,7 @@ int PathManager::FindNearestPathNode(glm::vec3 Position)
} }
if(ClosestPathNodeToStart <0 ) { if(ClosestPathNodeToStart <0 ) {
Log(Logs::Detail, Logs::None, "No LOS to any starting Path Node within range."); Log(Logs::Detail, Logs::Pathing, "No LOS to any starting Path Node within range.");
return -1; return -1;
} }
return ClosestPathNodeToStart; return ClosestPathNodeToStart;
@ -1143,15 +1143,15 @@ bool PathManager::NoHazards(glm::vec3 From, glm::vec3 To)
float NewZ = zone->zonemap->FindBestZ(MidPoint, nullptr); float NewZ = zone->zonemap->FindBestZ(MidPoint, nullptr);
if (std::abs(NewZ - From.z) > RuleR(Pathing, ZDiffThreshold)) { if (std::abs(NewZ - From.z) > RuleR(Pathing, ZDiffThresholdNew)) {
Log(Logs::Detail, Logs::None, " HAZARD DETECTED moving from %8.3f, %8.3f, %8.3f to %8.3f, %8.3f, %8.3f. Z Change is %8.3f", Log(Logs::Detail, Logs::Pathing, " HAZARD DETECTED moving from %8.3f, %8.3f, %8.3f to %8.3f, %8.3f, %8.3f. Z Change is %8.3f",
From.x, From.y, From.z, MidPoint.x, MidPoint.y, MidPoint.z, NewZ - From.z); From.x, From.y, From.z, MidPoint.x, MidPoint.y, MidPoint.z, NewZ - From.z);
return false; return false;
} }
else else
{ {
Log(Logs::Detail, Logs::None, "No HAZARD DETECTED moving from %8.3f, %8.3f, %8.3f to %8.3f, %8.3f, %8.3f. Z Change is %8.3f", Log(Logs::Detail, Logs::Pathing, "No HAZARD DETECTED moving from %8.3f, %8.3f, %8.3f to %8.3f, %8.3f, %8.3f. Z Change is %8.3f",
From.x, From.y, From.z, MidPoint.x, MidPoint.y, MidPoint.z, NewZ - From.z); From.x, From.y, From.z, MidPoint.x, MidPoint.y, MidPoint.z, NewZ - From.z);
} }
@ -1182,7 +1182,7 @@ bool PathManager::NoHazardsAccurate(glm::vec3 From, glm::vec3 To)
glm::vec3 TestPoint(curx, cury, curz); glm::vec3 TestPoint(curx, cury, curz);
float NewZ = zone->zonemap->FindBestZ(TestPoint, nullptr); float NewZ = zone->zonemap->FindBestZ(TestPoint, nullptr);
if (std::abs(NewZ - last_z) > 5.0f) { if (std::abs(NewZ - last_z) > 5.0f) {
Log(Logs::Detail, Logs::None, " HAZARD DETECTED moving from %8.3f, %8.3f, %8.3f to %8.3f, %8.3f, %8.3f. Best Z %8.3f, Z Change is %8.3f", Log(Logs::Detail, Logs::Pathing, " HAZARD DETECTED moving from %8.3f, %8.3f, %8.3f to %8.3f, %8.3f, %8.3f. Best Z %8.3f, Z Change is %8.3f",
From.x, From.y, From.z, TestPoint.x, TestPoint.y, TestPoint.z, NewZ, NewZ - From.z); From.x, From.y, From.z, TestPoint.x, TestPoint.y, TestPoint.z, NewZ, NewZ - From.z);
return false; return false;
} }
@ -1210,20 +1210,20 @@ bool PathManager::NoHazardsAccurate(glm::vec3 From, glm::vec3 To)
} }
if (best_z2 == -999990) if (best_z2 == -999990)
{ {
Log(Logs::Detail, Logs::None, " HAZARD DETECTED, really deep water/lava!"); Log(Logs::Detail, Logs::Pathing, " HAZARD DETECTED, really deep water/lava!");
return false; return false;
} }
else else
{ {
if (std::abs(NewZ - best_z2) > RuleR(Pathing, ZDiffThreshold)) { if (std::abs(NewZ - best_z2) > RuleR(Pathing, ZDiffThresholdNew)) {
Log(Logs::Detail, Logs::None, Log(Logs::Detail, Logs::Pathing,
" HAZARD DETECTED, water is fairly deep at %8.3f units deep", " HAZARD DETECTED, water is fairly deep at %8.3f units deep",
std::abs(NewZ - best_z2)); std::abs(NewZ - best_z2));
return false; return false;
} }
else else
{ {
Log(Logs::Detail, Logs::None, Log(Logs::Detail, Logs::Pathing,
" HAZARD NOT DETECTED, water is shallow at %8.3f units deep", " HAZARD NOT DETECTED, water is shallow at %8.3f units deep",
std::abs(NewZ - best_z2)); std::abs(NewZ - best_z2));
} }
@ -1231,12 +1231,12 @@ bool PathManager::NoHazardsAccurate(glm::vec3 From, glm::vec3 To)
} }
else else
{ {
Log(Logs::Detail, Logs::None, "Hazard point not in water or lava!"); Log(Logs::Detail, Logs::Pathing, "Hazard point not in water or lava!");
} }
} }
else else
{ {
Log(Logs::Detail, Logs::None, "No water map loaded for hazards!"); Log(Logs::Detail, Logs::Pathing, "No water map loaded for hazards!");
} }
curx += stepx; curx += stepx;
@ -1291,7 +1291,7 @@ void PathManager::OpenDoors(int Node1, int Node2, Mob *ForWho)
if(d && !d->IsDoorOpen() ) if(d && !d->IsDoorOpen() )
{ {
Log(Logs::Detail, Logs::None, "Opening door %i for %s", PathNodes[Node1].Neighbours[i].DoorID, ForWho->GetName()); Log(Logs::Detail, Logs::Pathing, "Opening door %i for %s", PathNodes[Node1].Neighbours[i].DoorID, ForWho->GetName());
d->ForceOpen(ForWho); d->ForceOpen(ForWho);
} }

View File

@ -3640,7 +3640,7 @@ void Mob::DoBuffTic(const Buffs_Struct &buff, int slot, Mob *caster)
case SE_Fear: { case SE_Fear: {
if (zone->random.Roll(RuleI(Spells, FearBreakCheckChance))) { if (zone->random.Roll(RuleI(Spells, FearBreakCheckChance))) {
float resist_check = ResistSpell(spells[buff.spellid].resisttype, buff.spellid, caster); float resist_check = ResistSpell(spells[buff.spellid].resisttype, buff.spellid, caster,0,0,true);
if (resist_check == 100) if (resist_check == 100)
break; break;

View File

@ -855,7 +855,7 @@ void Mob::FixZ() {
Log( Log(
Logs::Moderate, Logs::Moderate,
Logs::Pathing, Logs::FixZ,
"Mob::FixZ() (%s) returned %4.3f at %4.3f, %4.3f, %4.3f - Took %lf", "Mob::FixZ() (%s) returned %4.3f at %4.3f, %4.3f, %4.3f - Took %lf",
this->GetCleanName(), this->GetCleanName(),
new_z, new_z,
@ -875,7 +875,7 @@ void Mob::FixZ() {
if (RuleB(Map, MobZVisualDebug)) if (RuleB(Map, MobZVisualDebug))
this->SendAppearanceEffect(103, 0, 0, 0, 0); this->SendAppearanceEffect(103, 0, 0, 0, 0);
Log(Logs::General, Logs::Debug, "%s is failing to find Z %f", this->GetCleanName(), std::abs(m_Position.z - new_z)); Log(Logs::General, Logs::FixZ, "%s is failing to find Z %f", this->GetCleanName(), std::abs(m_Position.z - new_z));
} }
last_z = m_Position.z; last_z = m_Position.z;

View File

@ -1967,7 +1967,9 @@ const NPCType* ZoneDatabase::LoadNPCTypesData(uint32 npc_type_id, bool bulk_load
"npc_types.handtexture, " "npc_types.handtexture, "
"npc_types.legtexture, " "npc_types.legtexture, "
"npc_types.feettexture, " "npc_types.feettexture, "
"npc_types.ignore_despawn " "npc_types.ignore_despawn, "
"npc_types.show_name, "
"npc_types.untargetable "
"FROM npc_types %s", "FROM npc_types %s",
where_condition.c_str() where_condition.c_str()
); );
@ -2143,6 +2145,8 @@ const NPCType* ZoneDatabase::LoadNPCTypesData(uint32 npc_type_id, bool bulk_load
temp_npctype_data->legtexture = atoi(row[95]); temp_npctype_data->legtexture = atoi(row[95]);
temp_npctype_data->feettexture = atoi(row[96]); temp_npctype_data->feettexture = atoi(row[96]);
temp_npctype_data->ignore_despawn = atoi(row[97]) == 1 ? true : false; temp_npctype_data->ignore_despawn = atoi(row[97]) == 1 ? true : false;
temp_npctype_data->show_name = atoi(row[98]) != 0 ? true : false;
temp_npctype_data->untargetable = atoi(row[99]) != 0 ? true : false;
// If NPC with duplicate NPC id already in table, // If NPC with duplicate NPC id already in table,
// free item we attempted to add. // free item we attempted to add.

View File

@ -133,6 +133,8 @@ struct NPCType
uint8 legtexture; uint8 legtexture;
uint8 feettexture; uint8 feettexture;
bool ignore_despawn; bool ignore_despawn;
bool show_name; // should default on
bool untargetable;
}; };
namespace player_lootitem { namespace player_lootitem {