Add npc_scale_global_base table and add devtools command and toggling functionality

This commit is contained in:
Akkadius
2018-12-16 03:59:08 -06:00
parent bc6109ec8f
commit c32b31ffff
9 changed files with 407 additions and 15 deletions
+1 -11
View File
@@ -5473,14 +5473,4 @@ int32 Mob::GetHPRegen() const
int32 Mob::GetManaRegen() const
{
return mana_regen;
}
bool Client::GetDisplayMobInfoWindow() const
{
return display_mob_info_window;
}
void Client::SetDisplayMobInfoWindow(bool display_mob_info_window)
{
Client::display_mob_info_window = display_mob_info_window;
}
}
+26 -2
View File
@@ -38,6 +38,7 @@ extern volatile bool RunLoops;
#include "../common/rulesys.h"
#include "../common/string_util.h"
#include "../common/data_verification.h"
#include "data_bucket.h"
#include "position.h"
#include "net.h"
#include "worldserver.h"
@@ -166,7 +167,6 @@ Client::Client(EQStreamInterface* ieqs)
for (int client_filter = 0; client_filter < _FilterCount; client_filter++)
ClientFilters[client_filter] = FilterShow;
display_mob_info_window = true;
character_id = 0;
conn_state = NoPacketsReceived;
client_data_loaded = false;
@@ -335,6 +335,12 @@ Client::Client(EQStreamInterface* ieqs)
temp_pvp = false;
is_client_moving = false;
/**
* GM
*/
display_mob_info_window = true;
dev_tools_window_enabled = true;
#ifdef BOTS
bot_owner_options = DefaultBotOwnerOptions;
#endif
@@ -1648,7 +1654,6 @@ void Client::FriendsWho(char *FriendsString) {
}
}
void Client::UpdateAdmin(bool iFromDB) {
int16 tmp = admin;
if (iFromDB)
@@ -9322,3 +9327,22 @@ void Client::InitInnates()
}
}
bool Client::GetDisplayMobInfoWindow() const
{
return display_mob_info_window;
}
void Client::SetDisplayMobInfoWindow(bool display_mob_info_window)
{
Client::display_mob_info_window = display_mob_info_window;
}
bool Client::IsDevToolsWindowEnabled() const
{
return dev_tools_window_enabled;
}
void Client::SetDevToolsWindowEnabled(bool in_dev_tools_window_enabled)
{
Client::dev_tools_window_enabled = in_dev_tools_window_enabled;
}
+4
View File
@@ -249,6 +249,9 @@ public:
void SetDisplayMobInfoWindow(bool display_mob_info_window);
bool GetDisplayMobInfoWindow() const;
bool IsDevToolsWindowEnabled() const;
void SetDevToolsWindowEnabled(bool dev_tools_window_enabled);
//abstract virtual function implementations required by base abstract class
virtual bool Death(Mob* killerMob, int32 damage, uint16 spell_id, EQEmu::skills::SkillType attack_skill);
virtual void Damage(Mob* from, int32 damage, uint16 spell_id, EQEmu::skills::SkillType attack_skill, bool avoidable = true, int8 buffslot = -1, bool iBuffTic = false, eSpecialAttacks special = eSpecialAttacks::None);
@@ -1464,6 +1467,7 @@ private:
uint32 tmSitting; // time stamp started sitting, used for HP regen bonus added on MAY 5, 2004
bool display_mob_info_window;
bool dev_tools_window_enabled;
int32 max_end;
int32 current_endurance;
+10
View File
@@ -47,6 +47,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#include "../common/spdat.h"
#include "../common/string_util.h"
#include "../common/zone_numbers.h"
#include "data_bucket.h"
#include "event_codes.h"
#include "guild_mgr.h"
#include "merc.h"
@@ -1746,6 +1747,15 @@ void Client::Handle_Connect_OP_ZoneEntry(const EQApplicationPacket *app)
/* Task Packets */
LoadClientTaskState();
/**
* DevTools Load Settings
*/
if (Admin() > 200) {
std::string dev_tools_window_key = StringFormat("%i-dev-tools-window-disabled", AccountID());
if (DataBucket::GetData(dev_tools_window_key) == "true") {
dev_tools_window_enabled = false;
}
}
if (m_ClientVersionBit & EQEmu::versions::bit_UFAndLater) {
outapp = new EQApplicationPacket(OP_XTargetResponse, 8);
+45 -1
View File
@@ -55,7 +55,7 @@
#include "../say_link.h"
#include "../common/eqemu_logsys.h"
#include "data_bucket.h"
#include "command.h"
#include "guild_mgr.h"
#include "map.h"
@@ -185,6 +185,7 @@ int command_init(void)
command_add("delpetition", "[petition number] - Delete a petition", 20, command_delpetition) ||
command_add("depop", "- Depop your NPC target", 50, command_depop) ||
command_add("depopzone", "- Depop the zone", 100, command_depopzone) ||
command_add("devtools", "- Manages devtools", 200, command_devtools) ||
command_add("details", "- Change the details of your target (Drakkin Only)", 80, command_details) ||
command_add("disablerecipe", "[recipe_id] - Disables a recipe using the recipe id.", 80, command_disablerecipe) ||
command_add("disarmtrap", "Analog for ldon disarm trap for the newer clients since we still don't have it working.", 80, command_disarmtrap) ||
@@ -4600,6 +4601,49 @@ void command_depopzone(Client *c, const Seperator *sep)
c->Message(0, "Zone depoped.");
}
void command_devtools(Client *c, const Seperator *sep)
{
std::string menu_commands_search;
std::string window_toggle_command;
/**
* Search entity commands
*/
menu_commands_search += "[" + EQEmu::SayLinkEngine::GenerateQuestSaylink("#list npcs", false, "NPC") + "] ";
menu_commands_search += "[" + EQEmu::SayLinkEngine::GenerateQuestSaylink("#list players", false, "Players") + "] ";
menu_commands_search += "[" + EQEmu::SayLinkEngine::GenerateQuestSaylink("#list corpses", false, "Corpses") + "] ";
menu_commands_search += "[" + EQEmu::SayLinkEngine::GenerateQuestSaylink("#list doors", false, "Doors") + "] ";
menu_commands_search += "[" + EQEmu::SayLinkEngine::GenerateQuestSaylink("#list objects", false, "Objects") + "] ";
std::string dev_tools_window_key = StringFormat("%i-dev-tools-window-disabled", c->AccountID());
/**
* Handle window toggle
*/
if (strcasecmp(sep->arg[1], "disable_window") == 0) {
DataBucket::SetData(dev_tools_window_key, "true");
c->SetDevToolsWindowEnabled(false);
}
if (strcasecmp(sep->arg[1], "enable_window") == 0) {
DataBucket::DeleteData(dev_tools_window_key);
c->SetDevToolsWindowEnabled(true);
}
/**
* Show window status
*/
window_toggle_command = "Disabled [" + EQEmu::SayLinkEngine::GenerateQuestSaylink("#devtools enable_window", false, "Enable") + "] ";
if (c->IsDevToolsWindowEnabled()) {
window_toggle_command = "Enabled [" + EQEmu::SayLinkEngine::GenerateQuestSaylink("#devtools disable_window", false, "Disable") + "] ";
}
/**
* Print menu
*/
c->Message(0, "| [Devtools] Window %s", window_toggle_command.c_str());
c->Message(0, "| [Devtools] Search %s", menu_commands_search.c_str());
}
void command_repop(Client *c, const Seperator *sep)
{
int timearg = 1;
+1
View File
@@ -84,6 +84,7 @@ void command_deletegraveyard(Client *c, const Seperator *sep);
void command_delpetition(Client *c, const Seperator *sep);
void command_depop(Client *c, const Seperator *sep);
void command_depopzone(Client *c, const Seperator *sep);
void command_devtools(Client *c, const Seperator *sep);
void command_details(Client *c, const Seperator *sep);
void command_disablerecipe(Client *c, const Seperator *sep);
void command_disarmtrap(Client *c, const Seperator *sep);
+5
View File
@@ -630,10 +630,15 @@ void Mob::DisplayInfo(Mob *mob)
}
if (this->IsClient()) {
std::string window_text = "<c \"#FFFF66\">*Drag window open vertically to see all</c><br>";
Client *client = this->CastToClient();
if (!client->IsDevToolsWindowEnabled()) {
return;
}
std::vector<std::string> info_attributes = {
"name",
"race",
+1 -1
View File
@@ -449,7 +449,7 @@ std::string NpcScaleManager::GetNPCScalingTypeName(NPC *&npc)
/**
* Determines based on minimum criteria if NPC is auto scaled for certain things to be scaled like
* special abilities. We use this so we don't blindly assume we want things to be applied
*
*
* @param npc
* @return
*/