From d215ccfa8c30086d5ba460e3d1776689bb7988e3 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Mon, 19 Nov 2018 02:40:10 -0600 Subject: [PATCH] Few adjustments --- zone/mob_info.cpp | 21 +++++++++++++++++---- zone/npc.cpp | 2 +- zone/npc_scale_manager.cpp | 23 +++++++++++++++++++++-- zone/npc_scale_manager.h | 1 + 4 files changed, 40 insertions(+), 7 deletions(-) diff --git a/zone/mob_info.cpp b/zone/mob_info.cpp index 0e66cb2cc..0bdef2904 100644 --- a/zone/mob_info.cpp +++ b/zone/mob_info.cpp @@ -22,6 +22,7 @@ #include "mob.h" #include "../common/races.h" #include "../common/say_link.h" +#include "npc_scale_manager.h" std::string commify(const std::string &number) { @@ -588,9 +589,13 @@ inline void NPCCommandsMenu(Client* client, NPC* npc) menu_commands += "[" + EQEmu::SayLinkEngine::GenerateQuestSaylink(saylink, false, "Emotes") + "] "; } + if (npc->GetLoottableID() > 0) { + menu_commands += "[" + EQEmu::SayLinkEngine::GenerateQuestSaylink("#npcloot show", false, "Loot") + "] "; + } + if (menu_commands.length() > 0) { - client->Message(0, "| # Show Commmands"); - client->Message(0, "| %s", menu_commands.c_str()); + // client->Message(0, "| # Show Commmands"); + client->Message(0, "| [Show Commands] %s", menu_commands.c_str()); } } @@ -676,6 +681,7 @@ void Mob::DisplayInfo(Mob *mob) "DSMit", "avoidance", }; + window_text += WriteDisplayInfoSection(mob, "Mod Defensive", mod_defensive, 1, true); std::vector mod_offensive = { @@ -764,13 +770,20 @@ void Mob::DisplayInfo(Mob *mob) window_text += WriteDisplayInfoSection(mob, "Proximity", npc_proximity, 1, true); } - npc->QueryLoot(client); + int8 npc_type = npc_scale_manager->GetNPCScalingType(npc); + std::string npc_type_string = npc_scale_manager->GetNPCScalingTypeName(npc); + + client->Message( + 0, + "| # Target: %s Type: %i (%s)", + npc->GetCleanName(), + npc_type, + npc_type_string.c_str()); NPCCommandsMenu(client, npc); } std::cout << "Window Length: " << window_text.length() << std::endl; - // std::cout << "Window " << window_text << std::endl; if (client->GetDisplayMobInfoWindow()) { client->SendFullPopup( diff --git a/zone/npc.cpp b/zone/npc.cpp index be25a0367..4841f9276 100644 --- a/zone/npc.cpp +++ b/zone/npc.cpp @@ -603,7 +603,7 @@ void NPC::ClearItemList() { void NPC::QueryLoot(Client* to) { - to->Message(0, "| # Loot [%s]", GetName()); + to->Message(0, "| # Current Loot (%s) LootTableID: %i", GetName(), GetLoottableID()); int item_count = 0; for (auto cur = itemlist.begin(); cur != itemlist.end(); ++cur, ++item_count) { diff --git a/zone/npc_scale_manager.cpp b/zone/npc_scale_manager.cpp index a35fbe88e..bc8d6ebbe 100644 --- a/zone/npc_scale_manager.cpp +++ b/zone/npc_scale_manager.cpp @@ -408,13 +408,13 @@ uint32 NpcScaleManager::GetClassLevelDamageMod(uint32 level, uint32 npc_class) /** * @param npc - * @return + * @return int8 */ int8 NpcScaleManager::GetNPCScalingType(NPC *&npc) { std::string npc_name = npc->GetName(); - if (npc->IsRareSpawn() || npc_name.find('#') != std::string::npos) { + if (npc->IsRareSpawn() || npc_name.find('#') != std::string::npos || isupper(npc_name[0])) { return 1; } @@ -425,6 +425,25 @@ int8 NpcScaleManager::GetNPCScalingType(NPC *&npc) return 0; } +/** + * @param npc + * @return std::string + */ +std::string NpcScaleManager::GetNPCScalingTypeName(NPC *&npc) +{ + int8 scaling_type = GetNPCScalingType(npc); + + if (scaling_type == 1) { + return "Named"; + } + + if (npc->IsRaidTarget()) { + return "Raid"; + } + + return "Trash"; +} + /** * Returns false if scaling data not found * @param npc diff --git a/zone/npc_scale_manager.h b/zone/npc_scale_manager.h index 23bf90c48..afee566bd 100644 --- a/zone/npc_scale_manager.h +++ b/zone/npc_scale_manager.h @@ -95,6 +95,7 @@ public: std::map, global_npc_scale> npc_global_base_scaling_data; int8 GetNPCScalingType(NPC * &npc); + std::string GetNPCScalingTypeName(NPC * &npc); bool ApplyGlobalBaseScalingToNPCStatically(NPC * &npc); bool ApplyGlobalBaseScalingToNPCDynamically(NPC * &npc);