From d341a1b38f7822184cb84ba23235e3b8e3b99393 Mon Sep 17 00:00:00 2001 From: Uleat Date: Fri, 30 Aug 2019 06:38:48 -0400 Subject: [PATCH 01/22] Updated the command systems to automatically add new commands and remove orphaned entries from the command settings tables --- changelog.txt | 5 +++ common/shareddb.cpp | 32 ++++++++++++++++++ common/shareddb.h | 1 + common/string_util.cpp | 50 ++++++++++++++++++++++++++++- common/string_util.h | 4 +++ zone/bot_command.cpp | 56 +++++++++++++++++++++++++++++--- zone/bot_database.cpp | 33 +++++++++++++++++++ zone/bot_database.h | 1 + zone/command.cpp | 73 ++++++++++++++++++++++++++++++++++++------ 9 files changed, 240 insertions(+), 15 deletions(-) diff --git a/changelog.txt b/changelog.txt index 84d38df4a..0a9304c64 100644 --- a/changelog.txt +++ b/changelog.txt @@ -1,5 +1,10 @@ EQEMu Changelog (Started on Sept 24, 2003 15:50) ------------------------------------------------------- +== 8/30/2019 == +Uleat: Added code to inject new commands and remove orphaned commands from both command systems + - New commands are added with their status (`access`) set to the server default value - no aliases are defined + - Defunct commands will have their orhpaned entries removed from the command settings table for each system + == 8/16/2019 == Akkadius: Simplified the use of roamboxes and improved the AI for roambox pathing https://i.imgur.com/z33u7y9.gif Akkadius: Implemented command #roambox set [move_delay] diff --git a/common/shareddb.cpp b/common/shareddb.cpp index 97585670c..c07869ec8 100644 --- a/common/shareddb.cpp +++ b/common/shareddb.cpp @@ -18,6 +18,7 @@ #include #include +#include #if defined(_MSC_VER) && _MSC_VER >= 1800 #include @@ -1469,6 +1470,37 @@ bool SharedDatabase::GetCommandSettings(std::map> &injected, const std::vector &orphaned) +{ + bool return_value = true; + + if (injected.size()) { + + std::string query = fmt::format( + "REPLACE INTO `command_settings`(`command`, `access`) VALUES {}", + implode(",", string_string("(", ")"), join_pair(string_string(), ",", string_string("'", "'"), injected)) + ); + + if (!QueryDatabase(query).Success()) { + return_value = false; + } + } + + if (orphaned.size()) { + + std::string query = fmt::format( + "DELETE FROM `command_settings` WHERE `command` IN ({})", + implode(",", string_string("'", "'"), orphaned) + ); + + if (!QueryDatabase(query).Success()) { + return_value = false; + } + } + + return return_value; +} + bool SharedDatabase::LoadSkillCaps(const std::string &prefix) { skill_caps_mmf.reset(nullptr); diff --git a/common/shareddb.h b/common/shareddb.h index f6b1879df..1fae1eb7e 100644 --- a/common/shareddb.h +++ b/common/shareddb.h @@ -71,6 +71,7 @@ class SharedDatabase : public Database void LoadCharacterInspectMessage(uint32 character_id, InspectMessage_Struct* message); void SaveCharacterInspectMessage(uint32 character_id, const InspectMessage_Struct* message); bool GetCommandSettings(std::map>> &command_settings); + bool UpdateCommandSettings(const std::vector> &injected, const std::vector &orphaned); uint32 GetTotalTimeEntitledOnAccount(uint32 AccountID); void SetMailKey(int CharID, int IPAddress, int MailKey); std::string GetMailKey(int CharID, bool key_only = false); diff --git a/common/string_util.cpp b/common/string_util.cpp index ec53663cc..a3c775777 100644 --- a/common/string_util.cpp +++ b/common/string_util.cpp @@ -16,6 +16,7 @@ #include "string_util.h" #include +#include #ifdef _WINDOWS #include @@ -144,6 +145,53 @@ std::string implode(std::string glue, std::vector src) return final_output; } +std::string implode(std::string glue, string_string encapsulation, std::vector src) +{ + if (src.empty()) { + return {}; + } + + std::ostringstream output; + std::vector::iterator src_iter; + + for (src_iter = src.begin(); src_iter != src.end(); src_iter++) { + output << encapsulation.first << *src_iter << encapsulation.second << glue; + } + + std::string final_output = output.str(); + final_output.resize(output.str().size() - glue.size()); + + return final_output; +} + +std::vector join_pair(string_string outer_encap, std::string joiner, string_string inner_encap, std::vector> src) +{ + if (src.empty()) { + return {}; + } + + std::vector output; + + for (auto src_iter : src) { + output.push_back( + fmt::format( + "{}{}{}{}{}{}{}{}{}", + outer_encap.first, + inner_encap.first, + src_iter.first, + inner_encap.second, + joiner, + inner_encap.first, + src_iter.second, + inner_encap.second, + outer_encap.second + ) + ); + } + + return output; +} + std::string EscapeString(const std::string &s) { std::string ret; @@ -514,4 +562,4 @@ bool isAlphaNumeric(const char *text) } return true; -} \ No newline at end of file +} diff --git a/common/string_util.h b/common/string_util.h index 23a8af05b..6b0ac8bbc 100644 --- a/common/string_util.h +++ b/common/string_util.h @@ -31,6 +31,10 @@ std::vector split(std::string str_to_split, char delimiter); const std::string StringFormat(const char* format, ...); const std::string vStringFormat(const char* format, va_list args); std::string implode(std::string glue, std::vector src); +typedef std::pair string_string; +std::string implode(std::string glue, string_string encapsulation, std::vector src); +// wanted to make 'join_pair' a template function..this will do for now +std::vector join_pair(string_string outer_encap, std::string joiner, string_string inner_encap, std::vector> src); std::vector SplitString(const std::string &s, char delim); std::string EscapeString(const char *src, size_t sz); std::string EscapeString(const std::string &s); diff --git a/zone/bot_command.cpp b/zone/bot_command.cpp index 31270cc0f..dfbb59502 100644 --- a/zone/bot_command.cpp +++ b/zone/bot_command.cpp @@ -1426,23 +1426,51 @@ int bot_command_init(void) std::map>> bot_command_settings; database.botdb.LoadBotCommandSettings(bot_command_settings); + std::vector> injected_bot_command_settings; + std::vector orphaned_bot_command_settings; + auto working_bcl = bot_command_list; for (auto working_bcl_iter : working_bcl) { + auto bot_command_settings_iter = bot_command_settings.find(working_bcl_iter.first); if (bot_command_settings_iter == bot_command_settings.end()) { - if (working_bcl_iter.second->access == 0) - Log(Logs::General, Logs::Commands, "bot_command_init(): Warning: Bot Command '%s' defaulting to access level 0!", working_bcl_iter.first.c_str()); + + injected_bot_command_settings.push_back(std::pair(working_bcl_iter.first, working_bcl_iter.second->access)); + Log(Logs::General, + Logs::Status, + "New Bot Command '%s' found... Adding to `bot_command_settings` table with access '%u'...", + working_bcl_iter.first.c_str(), + working_bcl_iter.second->access + ); + + if (working_bcl_iter.second->access == 0) { + Log(Logs::General, + Logs::Commands, + "bot_command_init(): Warning: Bot Command '%s' defaulting to access level 0!", + working_bcl_iter.first.c_str() + ); + } + continue; } working_bcl_iter.second->access = bot_command_settings_iter->second.first; - Log(Logs::General, Logs::Commands, "bot_command_init(): - Bot Command '%s' set to access level %d.", working_bcl_iter.first.c_str(), bot_command_settings_iter->second.first); - if (bot_command_settings_iter->second.second.empty()) + Log(Logs::General, + Logs::Commands, + "bot_command_init(): - Bot Command '%s' set to access level %d.", + working_bcl_iter.first.c_str(), + bot_command_settings_iter->second.first + ); + + if (bot_command_settings_iter->second.second.empty()) { continue; + } for (auto alias_iter : bot_command_settings_iter->second.second) { - if (alias_iter.empty()) + if (alias_iter.empty()) { continue; + } + if (bot_command_list.find(alias_iter) != bot_command_list.end()) { Log(Logs::General, Logs::Commands, "bot_command_init(): Warning: Alias '%s' already exists as a bot command - skipping!", alias_iter.c_str()); continue; @@ -1455,6 +1483,24 @@ int bot_command_init(void) } } + for (auto bcs_iter : bot_command_settings) { + + auto bcl_iter = bot_command_list.find(bcs_iter.first); + if (bcl_iter == bot_command_list.end()) { + + orphaned_bot_command_settings.push_back(bcs_iter.first); + Log(Logs::General, + Logs::Status, + "Bot Command '%s' no longer exists... Deleting orphaned entry from `bot_command_settings` table...", + bcs_iter.first.c_str() + ); + } + } + + if (injected_bot_command_settings.size() || orphaned_bot_command_settings.size()) { + database.botdb.UpdateBotCommandSettings(injected_bot_command_settings, orphaned_bot_command_settings); + } + bot_command_dispatch = bot_command_real_dispatch; BCSpells::Load(); diff --git a/zone/bot_database.cpp b/zone/bot_database.cpp index 29d0f37e9..b87ff2c00 100644 --- a/zone/bot_database.cpp +++ b/zone/bot_database.cpp @@ -18,6 +18,8 @@ #ifdef BOTS +#include + #include "../common/global_define.h" #include "../common/rulesys.h" #include "../common/string_util.h" @@ -52,6 +54,37 @@ bool BotDatabase::LoadBotCommandSettings(std::map> &injected, const std::vector &orphaned) +{ + bool return_value = true; + + if (injected.size()) { + + query = fmt::format( + "REPLACE INTO `bot_command_settings`(`bot_command`, `access`) VALUES {}", + implode(",", string_string("(", ")"), join_pair(string_string(), ",", string_string("'", "'"), injected)) + ); + + if (!database.QueryDatabase(query).Success()) { + return_value = false; + } + } + + if (orphaned.size()) { + + query = fmt::format( + "DELETE FROM `bot_command_settings` WHERE `bot_command` IN ({})", + implode(",", string_string("'", "'"), orphaned) + ); + + if (!database.QueryDatabase(query).Success()) { + return_value = false; + } + } + + return return_value; +} + bool BotDatabase::LoadBotSpellCastingChances() { query = diff --git a/zone/bot_database.h b/zone/bot_database.h index 0c18eade5..2031a575d 100644 --- a/zone/bot_database.h +++ b/zone/bot_database.h @@ -43,6 +43,7 @@ class BotDatabase { public: bool LoadBotCommandSettings(std::map>> &bot_command_settings); + bool UpdateBotCommandSettings(const std::vector> &injected, const std::vector &orphaned); bool LoadBotSpellCastingChances(); diff --git a/zone/command.cpp b/zone/command.cpp index b979716c8..45ed0cbba 100755 --- a/zone/command.cpp +++ b/zone/command.cpp @@ -453,36 +453,91 @@ int command_init(void) std::map>> command_settings; database.GetCommandSettings(command_settings); + std::vector> injected_command_settings; + std::vector orphaned_command_settings; + std::map working_cl = commandlist; for (auto iter_cl = working_cl.begin(); iter_cl != working_cl.end(); ++iter_cl) { + auto iter_cs = command_settings.find(iter_cl->first); if (iter_cs == command_settings.end()) { - if (iter_cl->second->access == 0) - Log(Logs::General, Logs::Commands, "command_init(): Warning: Command '%s' defaulting to access level 0!", iter_cl->first.c_str()); + + injected_command_settings.push_back(std::pair(iter_cl->first, iter_cl->second->access)); + Log(Logs::General, + Logs::Status, + "New Command '%s' found... Adding to `command_settings` table with access '%u'...", + iter_cl->first.c_str(), + iter_cl->second->access + ); + + if (iter_cl->second->access == 0) { + Log(Logs::General, + Logs::Commands, + "command_init(): Warning: Command '%s' defaulting to access level 0!", + iter_cl->first.c_str() + ); + } + continue; } iter_cl->second->access = iter_cs->second.first; - Log(Logs::General, Logs::Commands, "command_init(): - Command '%s' set to access level %d.", iter_cl->first.c_str(), iter_cs->second.first); - if (iter_cs->second.second.empty()) + Log(Logs::General, + Logs::Commands, + "command_init(): - Command '%s' set to access level %d.", + iter_cl->first.c_str(), + iter_cs->second.first + ); + + if (iter_cs->second.second.empty()) { continue; + } - for (auto iter_aka = iter_cs->second.second.begin(); iter_aka != iter_cs->second.second.end(); - ++iter_aka) { - if (iter_aka->empty()) + for (auto iter_aka = iter_cs->second.second.begin(); iter_aka != iter_cs->second.second.end(); ++iter_aka) { + if (iter_aka->empty()) { continue; + } + if (commandlist.find(*iter_aka) != commandlist.end()) { - Log(Logs::General, Logs::Commands, "command_init(): Warning: Alias '%s' already exists as a command - skipping!", iter_aka->c_str()); + Log(Logs::General, + Logs::Commands, + "command_init(): Warning: Alias '%s' already exists as a command - skipping!", + iter_aka->c_str() + ); + continue; } commandlist[*iter_aka] = iter_cl->second; commandaliases[*iter_aka] = iter_cl->first; - Log(Logs::General, Logs::Commands, "command_init(): - Alias '%s' added to command '%s'.", iter_aka->c_str(), commandaliases[*iter_aka].c_str()); + Log(Logs::General, + Logs::Commands, + "command_init(): - Alias '%s' added to command '%s'.", + iter_aka->c_str(), + commandaliases[*iter_aka].c_str() + ); } } + for (auto cs_iter : command_settings) { + + auto cl_iter = commandlist.find(cs_iter.first); + if (cl_iter == commandlist.end()) { + + orphaned_command_settings.push_back(cs_iter.first); + Log(Logs::General, + Logs::Status, + "Command '%s' no longer exists... Deleting orphaned entry from `command_settings` table...", + cs_iter.first.c_str() + ); + } + } + + if (injected_command_settings.size() || orphaned_command_settings.size()) { + database.UpdateCommandSettings(injected_command_settings, orphaned_command_settings); + } + command_dispatch = command_realdispatch; return commandcount; From 3092a8ba3b7b66b980e1910483441b4b515a6188 Mon Sep 17 00:00:00 2001 From: Uleat Date: Fri, 30 Aug 2019 09:41:50 -0400 Subject: [PATCH 02/22] Fix-up in command system procedural code --- zone/bot_command.cpp | 26 ++++++++++++++++++-------- zone/command.cpp | 42 +++++++++++++++++++++--------------------- 2 files changed, 39 insertions(+), 29 deletions(-) diff --git a/zone/bot_command.cpp b/zone/bot_command.cpp index dfbb59502..656a1131a 100644 --- a/zone/bot_command.cpp +++ b/zone/bot_command.cpp @@ -1432,8 +1432,8 @@ int bot_command_init(void) auto working_bcl = bot_command_list; for (auto working_bcl_iter : working_bcl) { - auto bot_command_settings_iter = bot_command_settings.find(working_bcl_iter.first); - if (bot_command_settings_iter == bot_command_settings.end()) { + auto bcs_iter = bot_command_settings.find(working_bcl_iter.first); + if (bcs_iter == bot_command_settings.end()) { injected_bot_command_settings.push_back(std::pair(working_bcl_iter.first, working_bcl_iter.second->access)); Log(Logs::General, @@ -1454,32 +1454,42 @@ int bot_command_init(void) continue; } - working_bcl_iter.second->access = bot_command_settings_iter->second.first; + working_bcl_iter.second->access = bcs_iter->second.first; Log(Logs::General, Logs::Commands, "bot_command_init(): - Bot Command '%s' set to access level %d.", working_bcl_iter.first.c_str(), - bot_command_settings_iter->second.first + bcs_iter->second.first ); - if (bot_command_settings_iter->second.second.empty()) { + if (bcs_iter->second.second.empty()) { continue; } - for (auto alias_iter : bot_command_settings_iter->second.second) { + for (auto alias_iter : bcs_iter->second.second) { if (alias_iter.empty()) { continue; } if (bot_command_list.find(alias_iter) != bot_command_list.end()) { - Log(Logs::General, Logs::Commands, "bot_command_init(): Warning: Alias '%s' already exists as a bot command - skipping!", alias_iter.c_str()); + Log(Logs::General, + Logs::Commands, + "bot_command_init(): Warning: Alias '%s' already exists as a bot command - skipping!", + alias_iter.c_str() + ); + continue; } bot_command_list[alias_iter] = working_bcl_iter.second; bot_command_aliases[alias_iter] = working_bcl_iter.first; - Log(Logs::General, Logs::Commands, "bot_command_init(): - Alias '%s' added to bot command '%s'.", alias_iter.c_str(), bot_command_aliases[alias_iter].c_str()); + Log(Logs::General, + Logs::Commands, + "bot_command_init(): - Alias '%s' added to bot command '%s'.", + alias_iter.c_str(), + bot_command_aliases[alias_iter].c_str() + ); } } diff --git a/zone/command.cpp b/zone/command.cpp index 45ed0cbba..2a0a07408 100755 --- a/zone/command.cpp +++ b/zone/command.cpp @@ -456,66 +456,66 @@ int command_init(void) std::vector> injected_command_settings; std::vector orphaned_command_settings; - std::map working_cl = commandlist; - for (auto iter_cl = working_cl.begin(); iter_cl != working_cl.end(); ++iter_cl) { + auto working_cl = commandlist; + for (auto working_cl_iter : working_cl) { - auto iter_cs = command_settings.find(iter_cl->first); - if (iter_cs == command_settings.end()) { + auto cs_iter = command_settings.find(working_cl_iter.first); + if (cs_iter == command_settings.end()) { - injected_command_settings.push_back(std::pair(iter_cl->first, iter_cl->second->access)); + injected_command_settings.push_back(std::pair(working_cl_iter.first, working_cl_iter.second->access)); Log(Logs::General, Logs::Status, "New Command '%s' found... Adding to `command_settings` table with access '%u'...", - iter_cl->first.c_str(), - iter_cl->second->access + working_cl_iter.first.c_str(), + working_cl_iter.second->access ); - if (iter_cl->second->access == 0) { + if (working_cl_iter.second->access == 0) { Log(Logs::General, Logs::Commands, "command_init(): Warning: Command '%s' defaulting to access level 0!", - iter_cl->first.c_str() + working_cl_iter.first.c_str() ); } continue; } - iter_cl->second->access = iter_cs->second.first; + working_cl_iter.second->access = cs_iter->second.first; Log(Logs::General, Logs::Commands, "command_init(): - Command '%s' set to access level %d.", - iter_cl->first.c_str(), - iter_cs->second.first + working_cl_iter.first.c_str(), + cs_iter->second.first ); - if (iter_cs->second.second.empty()) { + if (cs_iter->second.second.empty()) { continue; } - for (auto iter_aka = iter_cs->second.second.begin(); iter_aka != iter_cs->second.second.end(); ++iter_aka) { - if (iter_aka->empty()) { + for (auto alias_iter : cs_iter->second.second) { + if (alias_iter.empty()) { continue; } - if (commandlist.find(*iter_aka) != commandlist.end()) { + if (commandlist.find(alias_iter) != commandlist.end()) { Log(Logs::General, Logs::Commands, "command_init(): Warning: Alias '%s' already exists as a command - skipping!", - iter_aka->c_str() + alias_iter.c_str() ); continue; } - commandlist[*iter_aka] = iter_cl->second; - commandaliases[*iter_aka] = iter_cl->first; + commandlist[alias_iter] = working_cl_iter.second; + commandaliases[alias_iter] = working_cl_iter.first; Log(Logs::General, Logs::Commands, "command_init(): - Alias '%s' added to command '%s'.", - iter_aka->c_str(), - commandaliases[*iter_aka].c_str() + alias_iter.c_str(), + commandaliases[alias_iter].c_str() ); } } From a534ab83ec18f3edf2a2236675b3749deb2c1a00 Mon Sep 17 00:00:00 2001 From: Uleat Date: Sat, 31 Aug 2019 20:55:46 -0400 Subject: [PATCH 03/22] Converted new implode and join_pair functions to template functions --- common/shareddb.cpp | 13 ++++++++-- common/string_util.cpp | 47 ----------------------------------- common/string_util.h | 56 +++++++++++++++++++++++++++++++++++++++--- zone/bot_database.cpp | 13 ++++++++-- 4 files changed, 74 insertions(+), 55 deletions(-) diff --git a/common/shareddb.cpp b/common/shareddb.cpp index c07869ec8..e2d482cd7 100644 --- a/common/shareddb.cpp +++ b/common/shareddb.cpp @@ -1478,7 +1478,16 @@ bool SharedDatabase::UpdateCommandSettings(const std::vector('(', ')'), + join_pair( + ",", + std::pair('\'', '\''), + std::pair('\'', '\''), + injected + ) + ) ); if (!QueryDatabase(query).Success()) { @@ -1490,7 +1499,7 @@ bool SharedDatabase::UpdateCommandSettings(const std::vector('\'', '\''), orphaned) ); if (!QueryDatabase(query).Success()) { diff --git a/common/string_util.cpp b/common/string_util.cpp index a3c775777..fc171cdc2 100644 --- a/common/string_util.cpp +++ b/common/string_util.cpp @@ -16,7 +16,6 @@ #include "string_util.h" #include -#include #ifdef _WINDOWS #include @@ -145,52 +144,6 @@ std::string implode(std::string glue, std::vector src) return final_output; } -std::string implode(std::string glue, string_string encapsulation, std::vector src) -{ - if (src.empty()) { - return {}; - } - - std::ostringstream output; - std::vector::iterator src_iter; - - for (src_iter = src.begin(); src_iter != src.end(); src_iter++) { - output << encapsulation.first << *src_iter << encapsulation.second << glue; - } - - std::string final_output = output.str(); - final_output.resize(output.str().size() - glue.size()); - - return final_output; -} - -std::vector join_pair(string_string outer_encap, std::string joiner, string_string inner_encap, std::vector> src) -{ - if (src.empty()) { - return {}; - } - - std::vector output; - - for (auto src_iter : src) { - output.push_back( - fmt::format( - "{}{}{}{}{}{}{}{}{}", - outer_encap.first, - inner_encap.first, - src_iter.first, - inner_encap.second, - joiner, - inner_encap.first, - src_iter.second, - inner_encap.second, - outer_encap.second - ) - ); - } - - return output; -} std::string EscapeString(const std::string &s) { std::string ret; diff --git a/common/string_util.h b/common/string_util.h index 6b0ac8bbc..b3301ab90 100644 --- a/common/string_util.h +++ b/common/string_util.h @@ -31,10 +31,58 @@ std::vector split(std::string str_to_split, char delimiter); const std::string StringFormat(const char* format, ...); const std::string vStringFormat(const char* format, va_list args); std::string implode(std::string glue, std::vector src); -typedef std::pair string_string; -std::string implode(std::string glue, string_string encapsulation, std::vector src); -// wanted to make 'join_pair' a template function..this will do for now -std::vector join_pair(string_string outer_encap, std::string joiner, string_string inner_encap, std::vector> src); + +template +std::string implode(std::string glue, std::pair encapsulation, std::vector src) +{ + if (src.empty()) { + return {}; + } + + std::ostringstream output; + + for (const T &src_iter : src) { + output << encapsulation.first << src_iter << encapsulation.second << glue; + } + + std::string final_output = output.str(); + final_output.resize(output.str().size() - glue.size()); + + return final_output; +} + +// this requires that #include be included in whatever file the invocation is made from +template +std::vector join_pair(std::string glue, std::pair first_encap, std::pair second_encap, std::vector> src) +{ + if (src.empty()) { + return {}; + } + + std::vector output; + + for (const std::pair &src_iter : src) { + output.push_back( + // There are issues with including in a header file that result in compile + // failure. I'm not sure if this applies only within the same project or across projects. + // Since templates act similar to macros in regards to initialization, this call should be + // safe so long as the '#include' rule above is observed. + fmt::format( + "{}{}{}{}{}{}{}", + first_encap.first, + src_iter.first, + first_encap.second, + glue, + second_encap.first, + src_iter.second, + second_encap.second + ) + ); + } + + return output; +} + std::vector SplitString(const std::string &s, char delim); std::string EscapeString(const char *src, size_t sz); std::string EscapeString(const std::string &s); diff --git a/zone/bot_database.cpp b/zone/bot_database.cpp index b87ff2c00..e5511776a 100644 --- a/zone/bot_database.cpp +++ b/zone/bot_database.cpp @@ -62,7 +62,16 @@ bool BotDatabase::UpdateBotCommandSettings(const std::vector('(', ')'), + join_pair( + ",", + std::pair('\'', '\''), + std::pair('\'', '\''), + injected + ) + ) ); if (!database.QueryDatabase(query).Success()) { @@ -74,7 +83,7 @@ bool BotDatabase::UpdateBotCommandSettings(const std::vector('\'', '\''), orphaned) ); if (!database.QueryDatabase(query).Success()) { From f9536f9621b89fe72e2586993fad19656fb7470b Mon Sep 17 00:00:00 2001 From: Uleat Date: Tue, 3 Sep 2019 04:04:05 -0400 Subject: [PATCH 04/22] Updated the rule system to automatically add new rules and remove orphaned entries from the rule values tables --- changelog.txt | 11 + common/rulesys.cpp | 419 +++++++++++--- common/rulesys.h | 18 +- common/ruletypes.h | 1222 ++++++++++++++++++++--------------------- common/shareddb.cpp | 7 +- common/string_util.h | 69 ++- world/net.cpp | 20 +- zone/bot_database.cpp | 7 +- 8 files changed, 1064 insertions(+), 709 deletions(-) diff --git a/changelog.txt b/changelog.txt index 0a9304c64..716325c2d 100644 --- a/changelog.txt +++ b/changelog.txt @@ -1,5 +1,16 @@ EQEMu Changelog (Started on Sept 24, 2003 15:50) ------------------------------------------------------- +== 9/02/2019 == +Uleat: Added code to inject new rules into the 'default' ruleset and remove orphaned rules from all rulesets + - New rules are only added using the 'default' ruleset - Other rulesets will need to be added manually or through in-game updates + -- Rule notes are now loaded into the system's hard-coded entries and will now propagate properly into database updates + - Defunct rules will have their orhpaned entries removed from the `rule_values` table for the all rulesets + +Note: If you would like to add these rules before starting your server so that you can modify them, start world.exe +manually and wait for the console messages to finish. It should take 5-10 seconds, or so. The world log should contain +a list of the added and removed entries, IF the `file` field of the 'Status' logging category is set to 1 or higher. +(Don't forget to manually stop the process after the update is complete.) + == 8/30/2019 == Uleat: Added code to inject new commands and remove orphaned commands from both command systems - New commands are added with their status (`access`) set to the server default value - no aliases are defined diff --git a/common/rulesys.cpp b/common/rulesys.cpp index d4ff3d4d9..ecf8cf6cd 100644 --- a/common/rulesys.cpp +++ b/common/rulesys.cpp @@ -21,6 +21,7 @@ #include "string_util.h" #include #include +#include /* Commands: @@ -45,14 +46,14 @@ const char *RuleManager::s_categoryNames[_CatCount+1] = { const RuleManager::RuleInfo RuleManager::s_RuleInfo[_IntRuleCount+_RealRuleCount+_BoolRuleCount+1] = { /* this is done in three steps so we can reliably get to them by index*/ - #define RULE_INT(cat, rule, default_value) \ - { #cat ":" #rule, Category__##cat, IntRule, Int__##rule }, + #define RULE_INT(cat, rule, default_value, notes) \ + { #cat ":" #rule, Category__##cat, IntRule, Int__##rule, notes }, #include "ruletypes.h" - #define RULE_REAL(cat, rule, default_value) \ - { #cat ":" #rule, Category__##cat, RealRule, Real__##rule }, + #define RULE_REAL(cat, rule, default_value, notes) \ + { #cat ":" #rule, Category__##cat, RealRule, Real__##rule, notes }, #include "ruletypes.h" - #define RULE_BOOL(cat, rule, default_value) \ - { #cat ":" #rule, Category__##cat, BoolRule, Bool__##rule }, + #define RULE_BOOL(cat, rule, default_value, notes) \ + { #cat ":" #rule, Category__##cat, BoolRule, Bool__##rule, notes }, #include "ruletypes.h" { "Invalid Rule", _CatCount, IntRule } }; @@ -178,11 +179,11 @@ void RuleManager::ResetRules(bool reload) { } Log(Logs::Detail, Logs::Rules, "Resetting running rules to default values"); - #define RULE_INT(cat, rule, default_value) \ + #define RULE_INT(cat, rule, default_value, notes) \ m_RuleIntValues[ Int__##rule ] = default_value; - #define RULE_REAL(cat, rule, default_value) \ + #define RULE_REAL(cat, rule, default_value, notes) \ m_RuleRealValues[ Real__##rule ] = default_value; - #define RULE_BOOL(cat, rule, default_value) \ + #define RULE_BOOL(cat, rule, default_value, notes) \ m_RuleBoolValues[ Bool__##rule ] = default_value; #include "ruletypes.h" @@ -225,7 +226,89 @@ const char *RuleManager::_GetRuleName(RuleType type, uint16 index) { return("InvalidRule??"); } +//assumes index is valid! +const std::string &RuleManager::_GetRuleNotes(RuleType type, uint16 index) { + switch (type) { + case IntRule: + return(s_RuleInfo[index].notes); + case RealRule: + return(s_RuleInfo[index + _IntRuleCount].notes); + case BoolRule: + return(s_RuleInfo[index + _IntRuleCount + _RealRuleCount].notes); + } + //should never happen + return(std::string()); +} + +bool RuleManager::LoadRules(Database *database, const char *ruleset_name, bool reload) { + + int ruleset_id = this->GetRulesetID(database, ruleset_name); + if (ruleset_id < 0) { + Log(Logs::Detail, Logs::Rules, "Failed to find ruleset '%s' for load operation. Canceling.", ruleset_name); + return (false); + } + + m_activeRuleset = ruleset_id; + m_activeName = ruleset_name; + + /* Load default ruleset values first if we're loading something other than default */ + if (strcasecmp(ruleset_name, "default") != 0) { + + std::string default_ruleset_name = "default"; + int default_ruleset_id = GetRulesetID(database, default_ruleset_name.c_str()); + + if (default_ruleset_id < 0) { + Log(Logs::Detail, + Logs::Rules, + "Failed to find default ruleset '%s' for load operation. Canceling.", + default_ruleset_name.c_str() + ); + + return (false); + } + + Log(Logs::Detail, Logs::Rules, "Processing rule set '%s' (%d) load...", default_ruleset_name.c_str(), default_ruleset_id); + + std::string query = StringFormat( + "SELECT `rule_name`, `rule_value` FROM `rule_values` WHERE `ruleset_id` = '%d'", + default_ruleset_id + ); + + auto results = database->QueryDatabase(query); + if (!results.Success()) { + return false; + } + + for (auto row = results.begin(); row != results.end(); ++row) { + if (!SetRule(row[0], row[1], nullptr, false, reload)) { + Log(Logs::Detail, Logs::Rules, "Unable to interpret rule record for '%s'", row[0]); + } + } + } + + Log(Logs::Detail, Logs::Rules, "Processing rule set '%s' (%d) load...", ruleset_name, ruleset_id); + + std::string query = StringFormat("SELECT `rule_name`, `rule_value` FROM `rule_values` WHERE `ruleset_id` = '%d'", ruleset_id); + + auto results = database->QueryDatabase(query); + if (!results.Success()) { + return false; + } + + for (auto row = results.begin(); row != results.end(); ++row) { + if (!SetRule(row[0], row[1], nullptr, false, reload)) { + Log(Logs::Detail, Logs::Rules, "Unable to interpret rule record for '%s'", row[0]); + } + } + + return true; +} + +// convert this to a single REPLACE query (it can handle it - currently at 608 rules) void RuleManager::SaveRules(Database *database, const char *ruleset_name) { + // tbh, UpdateRules() can probably be called since it will handle deletions of + // orphaned entries of existing rulesets as well as adding the new ones + // (it already does it as a single REPLACE query) if (ruleset_name != nullptr) { //saving to a specific name @@ -245,6 +328,10 @@ void RuleManager::SaveRules(Database *database, const char *ruleset_name) { Log(Logs::Detail, Logs::Rules, "Saving running rules into running rule set %s", m_activeName.c_str(), m_activeRuleset); } + // this should be all that is needed..with the exception of handling expansion-based rules... + // (those really need to be put somewhere else - probably variables) + //UpdateRules(database, m_activeName.c_str(), m_activeRuleset, true); + int i; for (i = 0; i < _IntRuleCount; i++) { _SaveRule(database, IntRule, i); @@ -257,56 +344,6 @@ void RuleManager::SaveRules(Database *database, const char *ruleset_name) { } } -bool RuleManager::LoadRules(Database *database, const char *ruleset_name, bool reload) { - - int ruleset_id = this->GetRulesetID(database, ruleset_name); - if (ruleset_id < 0) { - Log(Logs::Detail, Logs::Rules, "Failed to find ruleset '%s' for load operation. Canceling.", ruleset_name); - return (false); - } - - Log(Logs::Detail, Logs::Rules, "Loading rule set '%s' (%d)", ruleset_name, ruleset_id); - - m_activeRuleset = ruleset_id; - m_activeName = ruleset_name; - - /* Load default ruleset values first if we're loading something other than default */ - if (strcasecmp(ruleset_name, "default") != 0) { - std::string default_ruleset_name = "default"; - int default_ruleset_id = GetRulesetID(database, default_ruleset_name.c_str()); - if (default_ruleset_id < 0) { - Log(Logs::Detail, Logs::Rules, "Failed to find default ruleset '%s' for load operation. Canceling.", - default_ruleset_name.c_str()); - return (false); - } - Log(Logs::Detail, Logs::Rules, "Loading rule set '%s' (%d)", default_ruleset_name.c_str(), default_ruleset_id); - - std::string query = StringFormat( - "SELECT rule_name, rule_value FROM rule_values WHERE ruleset_id = %d", - default_ruleset_id - ); - - auto results = database->QueryDatabase(query); - if (!results.Success()) - return false; - - for (auto row = results.begin(); row != results.end(); ++row) - if (!SetRule(row[0], row[1], nullptr, false, reload)) - Log(Logs::Detail, Logs::Rules, "Unable to interpret rule record for %s", row[0]); - } - - std::string query = StringFormat("SELECT rule_name, rule_value FROM rule_values WHERE ruleset_id=%d", ruleset_id); - auto results = database->QueryDatabase(query); - if (!results.Success()) - return false; - - for (auto row = results.begin(); row != results.end(); ++row) - if (!SetRule(row[0], row[1], nullptr, false, reload)) - Log(Logs::Detail, Logs::Rules, "Unable to interpret rule record for %s", row[0]); - - return true; -} - void RuleManager::_SaveRule(Database *database, RuleType type, uint16 index) { char value_string[100]; @@ -328,17 +365,273 @@ void RuleManager::_SaveRule(Database *database, RuleType type, uint16 index) { } std::string query = StringFormat( - "REPLACE INTO rule_values " - "(ruleset_id, rule_name, rule_value) " - " VALUES(%d, '%s', '%s')", + "REPLACE INTO `rule_values`" + "(`ruleset_id`, `rule_name`, `rule_value`, `notes`)" + " VALUES('%d', '%s', '%s', '%s')", m_activeRuleset, _GetRuleName(type, index), - value_string + value_string, + EscapeString(_GetRuleNotes(type, index)).c_str() ); database->QueryDatabase(query); } +bool RuleManager::UpdateChangedRules(Database *db, const char *ruleset_name, bool quiet_update) +{ + return false; +} + +bool RuleManager::UpdateInjectedRules(Database *db, const char *ruleset_name, bool quiet_update) +{ + std::vector database_data; + std::map> rule_data; + std::vector> injected_rule_entries; + + if (!db) { + return false; + } + + if (ruleset_name == nullptr) { + return false; + } + + int ruleset_id = GetRulesetID(db, ruleset_name); + if (ruleset_id < 0) { + return false; + } + + // load database rule names + std::string query(StringFormat("SELECT `rule_name` FROM `rule_values` WHERE `ruleset_id` = '%i'", ruleset_id)); + + auto results = db->QueryDatabase(query); + if (!results.Success()) { + return false; + } + + // build database data entries + for (auto &row : results) { + database_data.push_back(std::string(row[0])); + } + + // build rule data entries + for (const auto &ri_iter : s_RuleInfo) { + if (strcasecmp(ri_iter.name, "Invalid Rule") == 0) { + continue; + } + + char buffer[100]; + + switch (ri_iter.type) { + case IntRule: + sprintf(buffer, "%d", m_RuleIntValues[ri_iter.rule_index]); + rule_data[ri_iter.name].first = buffer; + rule_data[ri_iter.name].second = &ri_iter.notes; + break; + case RealRule: + sprintf(buffer, "%.13f", m_RuleRealValues[ri_iter.rule_index]); + rule_data[ri_iter.name].first = buffer; + rule_data[ri_iter.name].second = &ri_iter.notes; + break; + case BoolRule: + sprintf(buffer, "%s", (m_RuleBoolValues[ri_iter.rule_index] ? "true" : "false")); + rule_data[ri_iter.name].first = buffer; + rule_data[ri_iter.name].second = &ri_iter.notes; + break; + default: + break; + } + } + + // build injected entries + for (const auto &rd_iter : rule_data) { + + const auto &dd_iter = std::find(database_data.begin(), database_data.end(), rd_iter.first); + if (dd_iter == database_data.end()) { + + injected_rule_entries.push_back( + std::tuple( + ruleset_id, // `ruleset_id` + rd_iter.first, // `rule_name` + rd_iter.second.first, // `rule_value` + EscapeString(*rd_iter.second.second) // `notes` + ) + ); + + if (!quiet_update) { + Log(Logs::General, + Logs::Status, + "New Rule '%s' found... Adding to `rule_values` table with ruleset '%s' (%i) and rule value '%s'...", + rd_iter.first.c_str(), + ruleset_name, + ruleset_id, + rd_iter.second.first.c_str() + ); + } + } + } + + if (injected_rule_entries.size()) { + return _UpdateRules(db, ruleset_name, ruleset_id, injected_rule_entries, std::vector()); + } + else { + return true; + } +} + +bool RuleManager::UpdateOrphanedRules(Database *db, bool quiet_update) +{ + std::vector rule_data; + std::vector orphaned_rule_entries; + + if (!db) { + return false; + } + + // load database rule names + std::string query("SELECT `rule_name` FROM `rule_values` GROUP BY `rule_name`"); + + auto results = db->QueryDatabase(query); + if (!results.Success()) { + return false; + } + + // build rule data entries + for (const auto &ri_iter : s_RuleInfo) { + if (strcasecmp(ri_iter.name, "Invalid Rule") == 0) { + continue; + } + + rule_data.push_back(ri_iter.name); + } + + // build orphaned entries + for (auto &row : results) { + + const auto &rd_iter = std::find(rule_data.begin(), rule_data.end(), row[0]); + if (rd_iter == rule_data.end()) { + + orphaned_rule_entries.push_back(std::string(row[0])); + + if (!quiet_update) { + Log(Logs::General, + Logs::Status, + "Rule '%s' no longer exists... Deleting orphaned entry from `rule_values` table...", + row[0] + ); + } + } + } + + if (orphaned_rule_entries.size()) { + return _UpdateRules( + db, + "All Rulesets", + -1, + std::vector>(), + orphaned_rule_entries + ); + } + else { + return true; + } +} + +bool RuleManager::_UpdateRules( + Database *db, + const char *ruleset_name, + const int ruleset_id, + const std::vector> &injected, + const std::vector &orphaned +) +{ + bool return_value = true; + + if (!db) { + return false; + } + + if (ruleset_name == nullptr) { + return false; + } + + if (injected.size()) { + + if (ruleset_id >= 0 && strcasecmp(ruleset_name, "All Rulesets") != 0) { + + std::string query( + fmt::format( + "REPLACE INTO `rule_values`(`ruleset_id`, `rule_name`, `rule_value`, `notes`) VALUES {}", + implode( + ",", + std::pair('(', ')'), + join_tuple(",", std::pair('\'', '\''), injected) + ) + ) + ); + + if (!db->QueryDatabase(query).Success()) { + return_value = false; + } + else { + Log(Logs::General, + Logs::Status, + "%u New Command%s Added to ruleset '%s' (%i)", + injected.size(), + (injected.size() == 1 ? "" : "s"), + ruleset_name, + ruleset_id + ); + } + } + else { + return_value = false; + } + } + + if (orphaned.size()) { + + std::string query; + + if (ruleset_id < 0 && strcasecmp(ruleset_name, "All Rulesets") == 0) { + + query = fmt::format( + "DELETE FROM `rule_values` WHERE `rule_name` IN ({})", + implode(",", std::pair('\'', '\''), orphaned) + ); + } + else if (ruleset_id >= 0 && strcasecmp(ruleset_name, "All Rulesets") != 0) { + + query = fmt::format( + "DELETE FROM `rule_values` WHERE `ruleset_id` = '%i' AND `rule_name` IN ({})", + ruleset_id, + implode(",", std::pair('\'', '\''), orphaned) + ); + } + + if (query.size() > 0) { + + if (!db->QueryDatabase(query).Success()) { + return_value = false; + } + else { + Log(Logs::General, + Logs::Status, + "%u Orphaned Command%s Deleted from ruleset '%s' (%i)", + orphaned.size(), + (orphaned.size() == 1 ? "" : "s"), + ruleset_name, + ruleset_id + ); + } + } + else { + return_value = false; + } + } + + return return_value; +} int RuleManager::GetRulesetID(Database *database, const char *ruleset_name) { diff --git a/common/rulesys.h b/common/rulesys.h index 710c6d612..4ade97983 100644 --- a/common/rulesys.h +++ b/common/rulesys.h @@ -49,21 +49,21 @@ class RuleManager { public: //generate our rule enums: typedef enum { - #define RULE_INT(cat, rule, default_value) \ + #define RULE_INT(cat, rule, default_value, notes) \ Int__##rule, #include "ruletypes.h" _IntRuleCount } IntType; typedef enum { - #define RULE_REAL(cat, rule, default_value) \ + #define RULE_REAL(cat, rule, default_value, notes) \ Real__##rule, #include "ruletypes.h" _RealRuleCount } RealType; typedef enum { - #define RULE_BOOL(cat, rule, default_value) \ + #define RULE_BOOL(cat, rule, default_value, notes) \ Bool__##rule, #include "ruletypes.h" _BoolRuleCount @@ -113,6 +113,9 @@ public: void ResetRules(bool reload = false); bool LoadRules(Database *db, const char *ruleset = nullptr, bool reload = false); void SaveRules(Database *db, const char *ruleset = nullptr); + bool UpdateChangedRules(Database *db, const char *ruleset_name, bool quiet_update = false); + bool UpdateInjectedRules(Database *db, const char *ruleset_name, bool quiet_update = false); + bool UpdateOrphanedRules(Database *db, bool quiet_update = false); private: RuleManager(); @@ -137,8 +140,16 @@ private: static bool _FindRule(const char *rule_name, RuleType &type_into, uint16 &index_into); static const char *_GetRuleName(RuleType type, uint16 index); + static const std::string &_GetRuleNotes(RuleType type, uint16 index); static int _FindOrCreateRuleset(Database *db, const char *ruleset); void _SaveRule(Database *db, RuleType type, uint16 index); + bool _UpdateRules( + Database *db, + const char *ruleset_name, + const int ruleset_id, + const std::vector> &injected, + const std::vector &orphaned + ); static const char *s_categoryNames[]; typedef struct { @@ -146,6 +157,7 @@ private: CategoryType category; RuleType type; uint16 rule_index; //index into its 'type' array + std::string notes; } RuleInfo; static const RuleInfo s_RuleInfo[]; diff --git a/common/ruletypes.h b/common/ruletypes.h index cad8f455f..b8581e9f4 100644 --- a/common/ruletypes.h +++ b/common/ruletypes.h @@ -20,13 +20,13 @@ #define RULE_CATEGORY(name) #endif #ifndef RULE_INT -#define RULE_INT(cat, rule, default_value) +#define RULE_INT(cat, rule, default_value, notes) #endif #ifndef RULE_REAL -#define RULE_REAL(cat, rule, default_value) +#define RULE_REAL(cat, rule, default_value, notes) #endif #ifndef RULE_BOOL -#define RULE_BOOL(cat, rule, default_value) +#define RULE_BOOL(cat, rule, default_value, notes) #endif #ifndef RULE_CATEGORY_END #define RULE_CATEGORY_END() @@ -36,714 +36,714 @@ RULE_CATEGORY(Character) -RULE_INT(Character, MaxLevel, 65) -RULE_BOOL(Character, PerCharacterQglobalMaxLevel, false) // This will check for qglobal 'CharMaxLevel' character qglobal (Type 5), if player tries to level beyond that point, it will not go beyond that level -RULE_BOOL(Character, PerCharacterBucketMaxLevel, false) // This will check for data bucket 'CharMaxLevel', if player tries to level beyond that point, it will not go beyond that level -RULE_INT(Character, MaxExpLevel, 0) //Sets the Max Level attainable via Experience -RULE_INT(Character, DeathExpLossLevel, 10) // Any level greater than this will lose exp on death -RULE_INT(Character, DeathExpLossMaxLevel, 255) // Any level greater than this will no longer lose exp on death -RULE_INT(Character, DeathItemLossLevel, 10) -RULE_INT(Character, DeathExpLossMultiplier, 3) //Adjust how much exp is lost -RULE_BOOL(Character, UseDeathExpLossMult, false) //Adjust to use the above multiplier or to use code default. -RULE_BOOL(Character, UseOldRaceRezEffects, false) // older clients had ID 757 for races with high starting STR, but it doesn't seem used anymore -RULE_INT(Character, CorpseDecayTimeMS, 10800000) -RULE_INT(Character, CorpseResTimeMS, 10800000) // time before cant res corpse(3 hours) -RULE_BOOL(Character, LeaveCorpses, true) -RULE_BOOL(Character, LeaveNakedCorpses, false) -RULE_INT(Character, MaxDraggedCorpses, 2) -RULE_REAL(Character, DragCorpseDistance, 400) // If the corpse is <= this distance from the player, it won't move -RULE_REAL(Character, ExpMultiplier, 0.5) -RULE_REAL(Character, AAExpMultiplier, 0.5) -RULE_REAL(Character, GroupExpMultiplier, 0.5) -RULE_REAL(Character, RaidExpMultiplier, 0.2) -RULE_BOOL(Character, UseXPConScaling, true) -RULE_INT(Character, ShowExpValues, 0) //0 - normal, 1 - Show raw experience values, 2 - Show raw experience values AND percent. -RULE_INT(Character, GreenModifier, 20) -RULE_INT(Character, LightBlueModifier, 40) -RULE_INT(Character, BlueModifier, 90) -RULE_INT(Character, WhiteModifier, 100) -RULE_INT(Character, YellowModifier, 125) -RULE_INT(Character, RedModifier, 150) -RULE_INT(Character, AutosaveIntervalS, 300) //0=disabled -RULE_INT(Character, HPRegenMultiplier, 100) -RULE_INT(Character, ManaRegenMultiplier, 100) -RULE_INT(Character, EnduranceRegenMultiplier, 100) -RULE_BOOL(Character, OldMinMana, false) // this is used for servers that want to follow older skill cap formulas so they can still have some regen w/o mediate -RULE_INT(Character, ConsumptionMultiplier, 100) //item's hunger restored = this value * item's food level, 100 = normal, 50 = people eat 2x as fast, 200 = people eat 2x as slow -RULE_BOOL(Character, HealOnLevel, false) -RULE_BOOL(Character, FeignKillsPet, false) -RULE_INT(Character, ItemManaRegenCap, 15) -RULE_INT(Character, ItemHealthRegenCap, 30) -RULE_INT(Character, ItemDamageShieldCap, 30) -RULE_INT(Character, ItemAccuracyCap, 150) -RULE_INT(Character, ItemAvoidanceCap, 100) -RULE_INT(Character, ItemCombatEffectsCap, 100) -RULE_INT(Character, ItemShieldingCap, 35) -RULE_INT(Character, ItemSpellShieldingCap, 35) -RULE_INT(Character, ItemDoTShieldingCap, 35) -RULE_INT(Character, ItemStunResistCap, 35) -RULE_INT(Character, ItemStrikethroughCap, 35) -RULE_INT(Character, ItemATKCap, 250) -RULE_INT(Character, ItemHealAmtCap, 250) -RULE_INT(Character, ItemSpellDmgCap, 250) -RULE_INT(Character, ItemClairvoyanceCap, 250) -RULE_INT(Character, ItemDSMitigationCap, 50) -RULE_INT(Character, ItemEnduranceRegenCap, 15) -RULE_INT(Character, ItemExtraDmgCap, 150) // Cap for bonuses to melee skills like Bash, Frenzy, etc -RULE_INT(Character, HasteCap, 100) // Haste cap for non-v3(overhaste) haste. -RULE_INT(Character, SkillUpModifier, 100) //skill ups are at 100% -RULE_BOOL(Character, SharedBankPlat, false) //off by default to prevent duping for now -RULE_BOOL(Character, BindAnywhere, false) -RULE_BOOL(Character, RestRegenEnabled, true) // Enable OOC Regen -RULE_INT(Character, RestRegenTimeToActivate, 30) // Time in seconds for rest state regen to kick in. -RULE_INT(Character, RestRegenRaidTimeToActivate, 300) // Time in seconds for rest state regen to kick in with a raid target. -RULE_INT(Character, KillsPerGroupLeadershipAA, 250) // Number of dark blues or above per Group Leadership AA -RULE_INT(Character, KillsPerRaidLeadershipAA, 250) // Number of dark blues or above per Raid Leadership AA -RULE_INT(Character, MaxFearDurationForPlayerCharacter, 4) //4 tics, each tic calculates every 6 seconds. -RULE_INT(Character, MaxCharmDurationForPlayerCharacter, 15) -RULE_INT(Character, BaseHPRegenBonusRaces, 4352) //a bitmask of race(s) that receive the regen bonus. Iksar (4096) & Troll (256) = 4352. see common/races.h for the bitmask values -RULE_BOOL(Character, SoDClientUseSoDHPManaEnd, false) // Setting this to true will allow SoD clients to use the SoD HP/Mana/End formulas and previous clients will use the old formulas -RULE_BOOL(Character, UseRaceClassExpBonuses, true) // Setting this to true will enable Class and Racial experience rate bonuses -RULE_BOOL(Character, UseOldRaceExpPenalties, false) // Setting this to true will enable racial exp penalties for Iksar, Troll, Ogre, and Barbarian, as well as the bonus for Halflings -RULE_BOOL(Character, UseOldClassExpPenalties, false) // Setting this to true will enable old class exp penalties for Paladin, SK, Ranger, Bard, Monk, Wizard, Enchanter, Magician, and Necromancer, as well as the bonus for Rogues and Warriors -RULE_BOOL(Character, RespawnFromHover, false) // Use Respawn window, or not. -RULE_INT(Character, RespawnFromHoverTimer, 300) // Respawn Window countdown timer, in SECONDS -RULE_BOOL(Character, UseNewStatsWindow, true) // New stats window shows everything -RULE_BOOL(Character, ItemCastsUseFocus, false) // If true, this allows item clickies to use focuses that have limited max levels on them -RULE_INT(Character, MinStatusForNoDropExemptions, 80) // This allows status x and higher to trade no drop items. -RULE_INT(Character, SkillCapMaxLevel, 75) // Sets the Max Level used for Skill Caps (from skill_caps table). -1 makes it use MaxLevel rule value. It is set to 75 because PEQ only has skillcaps up to that level, and grabbing the players' skill past 75 will return 0, breaking all skills past that level. This helps servers with obsurd level caps (75+ level cap) function without any modifications. -RULE_INT(Character, StatCap, 0) -RULE_BOOL(Character, CheckCursorEmptyWhenLooting, true) // If true, a player cannot loot a corpse (player or NPC) with an item on their cursor -RULE_BOOL(Character, MaintainIntoxicationAcrossZones, true) // If true, alcohol effects are maintained across zoning and logging out/in. -RULE_BOOL(Character, EnableDiscoveredItems, true) // If enabled, it enables EVENT_DISCOVER_ITEM and also saves character names and timestamps for the first time an item is discovered. -RULE_BOOL(Character, EnableXTargetting, true) // Enable Extended Targetting Window, for users with UF and later clients. -RULE_BOOL(Character, EnableAggroMeter, true) // Enable Aggro Meter, for users with RoF and later clients. -RULE_BOOL(Character, KeepLevelOverMax, false) // Don't delevel a character that has somehow gone over the level cap -RULE_INT(Character, FoodLossPerUpdate, 32) // How much food/water you lose per stamina update -RULE_BOOL(Character, EnableHungerPenalties, false) // being hungry/thirsty has negative effects -- it does appear normal live servers do not have penalties -RULE_INT(Character, BaseInstrumentSoftCap, 36) // Softcap for instrument mods, 36 commonly referred to as "3.6" as well. -RULE_BOOL(Character, UseSpellFileSongCap, true) // When they removed the AA that increased the cap they removed the above and just use the spell field -RULE_INT(Character, BaseRunSpeedCap, 158) // Base Run Speed Cap, on live it's 158% which will give you a runspeed of 1.580 hard capped to 225. -RULE_INT(Character, OrnamentationAugmentType, 20) //Ornamentation Augment Type -RULE_REAL(Character, EnvironmentDamageMulipliter, 1) -RULE_BOOL(Character, UnmemSpellsOnDeath, true) -RULE_INT(Character, TradeskillUpAlchemy, 2) // Alchemy skillup rate adjust. Lower is faster. -RULE_INT(Character, TradeskillUpBaking, 2) // Baking skillup rate adjust. Lower is faster. -RULE_INT(Character, TradeskillUpBlacksmithing, 2) // Blacksmithing skillup rate adjust. Lower is faster. -RULE_INT(Character, TradeskillUpBrewing, 3) // Brewing skillup rate adjust. Lower is faster. -RULE_INT(Character, TradeskillUpFletching, 2) // Fletching skillup rate adjust. Lower is faster. -RULE_INT(Character, TradeskillUpJewelcrafting, 2) // Jewelcrafting skillup rate adjust. Lower is faster. -RULE_INT(Character, TradeskillUpMakePoison, 2) // Make Poison skillup rate adjust. Lower is faster. -RULE_INT(Character, TradeskillUpPottery, 4) // Pottery skillup rate adjust. Lower is faster. -RULE_INT(Character, TradeskillUpResearch, 1) // Research skillup rate adjust. Lower is faster. -RULE_INT(Character, TradeskillUpTinkering, 2) // Tinkering skillup rate adjust. Lower is faster. -RULE_BOOL(Character, MarqueeHPUpdates, false) // Will show Health % in center of screen < 100% -RULE_INT(Character, IksarCommonTongue, 95) // 95 By default (live-like?) -RULE_INT(Character, OgreCommonTongue, 95) // 95 By default (live-like?) -RULE_INT(Character, TrollCommonTongue, 95) // 95 By default (live-like?) -RULE_BOOL(Character, ActiveInvSnapshots, false) // Takes a periodic snapshot of inventory contents from online players -RULE_INT(Character, InvSnapshotMinIntervalM, 180) // Minimum time (in minutes) between inventory snapshots -RULE_INT(Character, InvSnapshotMinRetryM, 30) // Time (in minutes) to re-attempt an inventory snapshot after a failure -RULE_INT(Character, InvSnapshotHistoryD, 30) // Time (in days) to keep snapshot entries -RULE_BOOL(Character, RestrictSpellScribing, false) // Restricts spell scribing to allowable races/classes of spell scroll, if true -RULE_BOOL(Character, UseStackablePickPocketing, true) // Allows stackable pickpocketed items to stack instead of only being allowed in empty inventory slots -RULE_BOOL(Character, EnableAvoidanceCap, false) -RULE_INT(Character, AvoidanceCap, 750) // 750 Is a pretty good value, seen people dodge all attacks beyond 1,000 Avoidance -RULE_BOOL(Character, AllowMQTarget, false) // Disables putting players in the 'hackers' list for targeting beyond the clip plane or attempting to target something untargetable -RULE_BOOL(Character, UseOldBindWound, false) // Uses the original bind wound behavior -RULE_BOOL(Character, GrantHoTTOnCreate, false) // Grant Health of Target's Target leadership AA on character creation -RULE_BOOL(Character, UseOldConSystem, false) // Grant Health of Target's Target leadership AA on character creation -RULE_BOOL(Character, OPClientUpdateVisualDebug, false) // Shows a pulse and forward directional particle each time the client sends its position to server -RULE_BOOL(Character, AllowCrossClassTrainers, false) -RULE_BOOL(Character, PetsUseReagents, true) //Pets use reagent on spells -RULE_BOOL(Character, DismountWater, true) // Dismount horses when entering water +RULE_INT(Character, MaxLevel, 65, "") +RULE_BOOL(Character, PerCharacterQglobalMaxLevel, false, "This will check for qglobal 'CharMaxLevel' character qglobal (Type 5, \"\"), if player tries to level beyond that point, it will not go beyond that level") +RULE_BOOL(Character, PerCharacterBucketMaxLevel, false, "This will check for data bucket 'CharMaxLevel', if player tries to level beyond that point, it will not go beyond that level") +RULE_INT(Character, MaxExpLevel, 0, "Sets the Max Level attainable via Experience") +RULE_INT(Character, DeathExpLossLevel, 10, "Any level greater than this will lose exp on death") +RULE_INT(Character, DeathExpLossMaxLevel, 255, "Any level greater than this will no longer lose exp on death") +RULE_INT(Character, DeathItemLossLevel, 10, "") +RULE_INT(Character, DeathExpLossMultiplier, 3, "Adjust how much exp is lost") +RULE_BOOL(Character, UseDeathExpLossMult, false, "Adjust to use the above multiplier or to use code default") +RULE_BOOL(Character, UseOldRaceRezEffects, false, "older clients had ID 757 for races with high starting STR, but it doesn't seem used anymore") +RULE_INT(Character, CorpseDecayTimeMS, 10800000, "") +RULE_INT(Character, CorpseResTimeMS, 10800000, "time before cant res corpse(3 hours)") +RULE_BOOL(Character, LeaveCorpses, true, "") +RULE_BOOL(Character, LeaveNakedCorpses, false, "") +RULE_INT(Character, MaxDraggedCorpses, 2, "") +RULE_REAL(Character, DragCorpseDistance, 400, "If the corpse is <= this distance from the player, it won't move") +RULE_REAL(Character, ExpMultiplier, 0.5, "") +RULE_REAL(Character, AAExpMultiplier, 0.5, "") +RULE_REAL(Character, GroupExpMultiplier, 0.5, "") +RULE_REAL(Character, RaidExpMultiplier, 0.2, "") +RULE_BOOL(Character, UseXPConScaling, true, "") +RULE_INT(Character, ShowExpValues, 0, "0 - normal, 1 - Show raw experience values, 2 - Show raw experience values AND percent") +RULE_INT(Character, GreenModifier, 20, "") +RULE_INT(Character, LightBlueModifier, 40, "") +RULE_INT(Character, BlueModifier, 90, "") +RULE_INT(Character, WhiteModifier, 100, "") +RULE_INT(Character, YellowModifier, 125, "") +RULE_INT(Character, RedModifier, 150, "") +RULE_INT(Character, AutosaveIntervalS, 300, "0 = disabled") +RULE_INT(Character, HPRegenMultiplier, 100, "") +RULE_INT(Character, ManaRegenMultiplier, 100, "") +RULE_INT(Character, EnduranceRegenMultiplier, 100, "") +RULE_BOOL(Character, OldMinMana, false, "this is used for servers that want to follow older skill cap formulas so they can still have some regen w/o mediate") +RULE_INT(Character, ConsumptionMultiplier, 100, "item's hunger restored = this value * item's food level, 100 = normal, 50 = people eat 2x as fast, 200 = people eat 2x as slow") +RULE_BOOL(Character, HealOnLevel, false, "") +RULE_BOOL(Character, FeignKillsPet, false, "") +RULE_INT(Character, ItemManaRegenCap, 15, "") +RULE_INT(Character, ItemHealthRegenCap, 30, "") +RULE_INT(Character, ItemDamageShieldCap, 30, "") +RULE_INT(Character, ItemAccuracyCap, 150, "") +RULE_INT(Character, ItemAvoidanceCap, 100, "") +RULE_INT(Character, ItemCombatEffectsCap, 100, "") +RULE_INT(Character, ItemShieldingCap, 35, "") +RULE_INT(Character, ItemSpellShieldingCap, 35, "") +RULE_INT(Character, ItemDoTShieldingCap, 35, "") +RULE_INT(Character, ItemStunResistCap, 35, "") +RULE_INT(Character, ItemStrikethroughCap, 35, "") +RULE_INT(Character, ItemATKCap, 250, "") +RULE_INT(Character, ItemHealAmtCap, 250, "") +RULE_INT(Character, ItemSpellDmgCap, 250, "") +RULE_INT(Character, ItemClairvoyanceCap, 250, "") +RULE_INT(Character, ItemDSMitigationCap, 50, "") +RULE_INT(Character, ItemEnduranceRegenCap, 15, "") +RULE_INT(Character, ItemExtraDmgCap, 150, "Cap for bonuses to melee skills like Bash, Frenzy, etc") +RULE_INT(Character, HasteCap, 100, "Haste cap for non-v3(overhaste) haste") +RULE_INT(Character, SkillUpModifier, 100, "skill ups are at 100%") +RULE_BOOL(Character, SharedBankPlat, false, "off by default to prevent duping for now") +RULE_BOOL(Character, BindAnywhere, false, "") +RULE_BOOL(Character, RestRegenEnabled, true, "Enable OOC Regen") +RULE_INT(Character, RestRegenTimeToActivate, 30, "Time in seconds for rest state regen to kick in") +RULE_INT(Character, RestRegenRaidTimeToActivate, 300, "Time in seconds for rest state regen to kick in with a raid target") +RULE_INT(Character, KillsPerGroupLeadershipAA, 250, "Number of dark blues or above per Group Leadership AA") +RULE_INT(Character, KillsPerRaidLeadershipAA, 250, "Number of dark blues or above per Raid Leadership AA") +RULE_INT(Character, MaxFearDurationForPlayerCharacter, 4, "4 tics, each tic calculates every 6 seconds") +RULE_INT(Character, MaxCharmDurationForPlayerCharacter, 15, "") +RULE_INT(Character, BaseHPRegenBonusRaces, 4352, "a bitmask of race(s) that receive the regen bonus. Iksar (4096) & Troll (256) = 4352. see common/races.h for the bitmask values") +RULE_BOOL(Character, SoDClientUseSoDHPManaEnd, false, "Setting this to true will allow SoD clients to use the SoD HP/Mana/End formulas and previous clients will use the old formulas") +RULE_BOOL(Character, UseRaceClassExpBonuses, true, "Setting this to true will enable Class and Racial experience rate bonuses") +RULE_BOOL(Character, UseOldRaceExpPenalties, false, "Setting this to true will enable racial exp penalties for Iksar, Troll, Ogre, and Barbarian, as well as the bonus for Halflings") +RULE_BOOL(Character, UseOldClassExpPenalties, false, "Setting this to true will enable old class exp penalties for Paladin, SK, Ranger, Bard, Monk, Wizard, Enchanter, Magician, and Necromancer, as well as the bonus for Rogues and Warriors") +RULE_BOOL(Character, RespawnFromHover, false, "Use Respawn window, or not") +RULE_INT(Character, RespawnFromHoverTimer, 300, "Respawn Window countdown timer, in SECONDS") +RULE_BOOL(Character, UseNewStatsWindow, true, "New stats window shows everything") +RULE_BOOL(Character, ItemCastsUseFocus, false, "If true, this allows item clickies to use focuses that have limited max levels on them") +RULE_INT(Character, MinStatusForNoDropExemptions, 80, "This allows status x and higher to trade no drop items") +RULE_INT(Character, SkillCapMaxLevel, 75, "Sets the Max Level used for Skill Caps (from skill_caps table). -1 makes it use MaxLevel rule value. It is set to 75 because PEQ only has skillcaps up to that level, and grabbing the players' skill past 75 will return 0, breaking all skills past that level. This helps servers with obsurd level caps (75+ level cap) function without any modifications") +RULE_INT(Character, StatCap, 0, "") +RULE_BOOL(Character, CheckCursorEmptyWhenLooting, true, "If true, a player cannot loot a corpse (player or NPC) with an item on their cursor") +RULE_BOOL(Character, MaintainIntoxicationAcrossZones, true, "If true, alcohol effects are maintained across zoning and logging out/in") +RULE_BOOL(Character, EnableDiscoveredItems, true, "If enabled, it enables EVENT_DISCOVER_ITEM and also saves character names and timestamps for the first time an item is discovered") +RULE_BOOL(Character, EnableXTargetting, true, "Enable Extended Targetting Window, for users with UF and later clients") +RULE_BOOL(Character, EnableAggroMeter, true, "Enable Aggro Meter, for users with RoF and later clients") +RULE_BOOL(Character, KeepLevelOverMax, false, "Don't delevel a character that has somehow gone over the level cap") +RULE_INT(Character, FoodLossPerUpdate, 32, "How much food/water you lose per stamina update") +RULE_BOOL(Character, EnableHungerPenalties, false, "being hungry/thirsty has negative effects -- it does appear normal live servers do not have penalties") +RULE_INT(Character, BaseInstrumentSoftCap, 36, "Softcap for instrument mods, 36 commonly referred to as \"3.6\" as well") +RULE_BOOL(Character, UseSpellFileSongCap, true, "When they removed the AA that increased the cap they removed the above and just use the spell field") +RULE_INT(Character, BaseRunSpeedCap, 158, "Base Run Speed Cap, on live it's 158% which will give you a runspeed of 1.580 hard capped to 225") +RULE_INT(Character, OrnamentationAugmentType, 20, "Ornamentation Augment Type") +RULE_REAL(Character, EnvironmentDamageMulipliter, 1, "") +RULE_BOOL(Character, UnmemSpellsOnDeath, true, "") +RULE_INT(Character, TradeskillUpAlchemy, 2, "Alchemy skillup rate adjust. Lower is faster") +RULE_INT(Character, TradeskillUpBaking, 2, "Baking skillup rate adjust. Lower is faster") +RULE_INT(Character, TradeskillUpBlacksmithing, 2, "Blacksmithing skillup rate adjust. Lower is faster") +RULE_INT(Character, TradeskillUpBrewing, 3, "Brewing skillup rate adjust. Lower is faster") +RULE_INT(Character, TradeskillUpFletching, 2, "Fletching skillup rate adjust. Lower is faster") +RULE_INT(Character, TradeskillUpJewelcrafting, 2, "Jewelcrafting skillup rate adjust. Lower is faster") +RULE_INT(Character, TradeskillUpMakePoison, 2, "Make Poison skillup rate adjust. Lower is faster") +RULE_INT(Character, TradeskillUpPottery, 4, "Pottery skillup rate adjust. Lower is faster") +RULE_INT(Character, TradeskillUpResearch, 1, "Research skillup rate adjust. Lower is faster") +RULE_INT(Character, TradeskillUpTinkering, 2, "Tinkering skillup rate adjust. Lower is faster") +RULE_BOOL(Character, MarqueeHPUpdates, false, "Will show Health % in center of screen < 100%") +RULE_INT(Character, IksarCommonTongue, 95, "95 By default (live-like?)") +RULE_INT(Character, OgreCommonTongue, 95, "95 By default (live-like?)") +RULE_INT(Character, TrollCommonTongue, 95, "95 By default (live-like?)") +RULE_BOOL(Character, ActiveInvSnapshots, false, "Takes a periodic snapshot of inventory contents from online players") +RULE_INT(Character, InvSnapshotMinIntervalM, 180, "Minimum time (in minutes) between inventory snapshots") +RULE_INT(Character, InvSnapshotMinRetryM, 30, "Time (in minutes) to re-attempt an inventory snapshot after a failure") +RULE_INT(Character, InvSnapshotHistoryD, 30, "Time (in days) to keep snapshot entries") +RULE_BOOL(Character, RestrictSpellScribing, false, "Restricts spell scribing to allowable races/classes of spell scroll, if true") +RULE_BOOL(Character, UseStackablePickPocketing, true, "Allows stackable pickpocketed items to stack instead of only being allowed in empty inventory slots") +RULE_BOOL(Character, EnableAvoidanceCap, false, "") +RULE_INT(Character, AvoidanceCap, 750, "750 Is a pretty good value, seen people dodge all attacks beyond 1,000 Avoidance") +RULE_BOOL(Character, AllowMQTarget, false, "Disables putting players in the 'hackers' list for targeting beyond the clip plane or attempting to target something untargetable") +RULE_BOOL(Character, UseOldBindWound, false, "Uses the original bind wound behavior") +RULE_BOOL(Character, GrantHoTTOnCreate, false, "Grant Health of Target's Target leadership AA on character creation") +RULE_BOOL(Character, UseOldConSystem, false, "Grant Health of Target's Target leadership AA on character creation") +RULE_BOOL(Character, OPClientUpdateVisualDebug, false, "Shows a pulse and forward directional particle each time the client sends its position to server") +RULE_BOOL(Character, AllowCrossClassTrainers, false, "") +RULE_BOOL(Character, PetsUseReagents, true, "Pets use reagent on spells") +RULE_BOOL(Character, DismountWater, true, "Dismount horses when entering water") RULE_CATEGORY_END() RULE_CATEGORY(Mercs) -RULE_INT(Mercs, SuspendIntervalMS, 10000) -RULE_INT(Mercs, UpkeepIntervalMS, 180000) -RULE_INT(Mercs, SuspendIntervalS, 10) -RULE_INT(Mercs, UpkeepIntervalS, 180) -RULE_BOOL(Mercs, AllowMercs, false) -RULE_BOOL(Mercs, ChargeMercPurchaseCost, false) -RULE_BOOL(Mercs, ChargeMercUpkeepCost, false) -RULE_INT(Mercs, AggroRadius, 100) // Determines the distance from which a merc will aggro group member's target(also used to determine the distance at which a healer merc will begin healing a group member) -RULE_INT(Mercs, AggroRadiusPuller, 25) // Determines the distance from which a merc will aggro group member's target, if they have the group role of puller (also used to determine the distance at which a healer merc will begin healing a group member, if they have the group role of puller) -RULE_INT(Mercs, ResurrectRadius, 50) // Determines the distance from which a healer merc will attempt to resurrect a group member's corpse -RULE_INT(Mercs, ScaleRate, 100) -RULE_BOOL(Mercs, MercsUsePathing, true) // Mercs will use node pathing when moving -RULE_BOOL(Mercs, AllowMercSuspendInCombat, true) +RULE_INT(Mercs, SuspendIntervalMS, 10000, "") +RULE_INT(Mercs, UpkeepIntervalMS, 180000, "") +RULE_INT(Mercs, SuspendIntervalS, 10, "") +RULE_INT(Mercs, UpkeepIntervalS, 180, "") +RULE_BOOL(Mercs, AllowMercs, false, "") +RULE_BOOL(Mercs, ChargeMercPurchaseCost, false, "") +RULE_BOOL(Mercs, ChargeMercUpkeepCost, false, "") +RULE_INT(Mercs, AggroRadius, 100, "Determines the distance from which a merc will aggro group member's target(also used to determine the distance at which a healer merc will begin healing a group member)") +RULE_INT(Mercs, AggroRadiusPuller, 25, "Determines the distance from which a merc will aggro group member's target, if they have the group role of puller (also used to determine the distance at which a healer merc will begin healing a group member, if they have the group role of puller)") +RULE_INT(Mercs, ResurrectRadius, 50, "Determines the distance from which a healer merc will attempt to resurrect a group member's corpse") +RULE_INT(Mercs, ScaleRate, 100, "") +RULE_BOOL(Mercs, MercsUsePathing, true, "Mercs will use node pathing when moving") +RULE_BOOL(Mercs, AllowMercSuspendInCombat, true, "") RULE_CATEGORY_END() RULE_CATEGORY(Guild) -RULE_INT(Guild, MaxMembers, 2048) -RULE_BOOL(Guild, PlayerCreationAllowed, false) // Allow players to create a guild using the window in Underfoot+ -RULE_INT(Guild, PlayerCreationLimit, 1) // Only allow use of the UF+ window if the account has < than this number of guild leaders on it -RULE_INT(Guild, PlayerCreationRequiredStatus, 0) // Required admin status. -RULE_INT(Guild, PlayerCreationRequiredLevel, 0) // Required Level of the player attempting to create the guild. -RULE_INT(Guild, PlayerCreationRequiredTime, 0) // Required Time Entitled On Account (in Minutes) to create the guild. +RULE_INT(Guild, MaxMembers, 2048, "") +RULE_BOOL(Guild, PlayerCreationAllowed, false, "Allow players to create a guild using the window in Underfoot+") +RULE_INT(Guild, PlayerCreationLimit, 1, "Only allow use of the UF+ window if the account has < than this number of guild leaders on it") +RULE_INT(Guild, PlayerCreationRequiredStatus, 0, "Required admin status") +RULE_INT(Guild, PlayerCreationRequiredLevel, 0, "Required Level of the player attempting to create the guild") +RULE_INT(Guild, PlayerCreationRequiredTime, 0, "Required Time Entitled On Account (in Minutes) to create the guild") RULE_CATEGORY_END() RULE_CATEGORY(Skills) -RULE_INT(Skills, MaxTrainTradeskills, 21) -RULE_BOOL(Skills, UseLimitTradeskillSearchSkillDiff, true) -RULE_INT(Skills, MaxTradeskillSearchSkillDiff, 50) -RULE_INT(Skills, MaxTrainSpecializations, 50) // Max level a GM trainer will train casting specializations -RULE_INT(Skills, SwimmingStartValue, 100) -RULE_BOOL(Skills, TrainSenseHeading, false) -RULE_INT(Skills, SenseHeadingStartValue, 200) -RULE_BOOL(Skills, SelfLanguageLearning, true) +RULE_INT(Skills, MaxTrainTradeskills, 21, "") +RULE_BOOL(Skills, UseLimitTradeskillSearchSkillDiff, true, "") +RULE_INT(Skills, MaxTradeskillSearchSkillDiff, 50, "") +RULE_INT(Skills, MaxTrainSpecializations, 50, "Max level a GM trainer will train casting specializations") +RULE_INT(Skills, SwimmingStartValue, 100, "") +RULE_BOOL(Skills, TrainSenseHeading, false, "") +RULE_INT(Skills, SenseHeadingStartValue, 200, "") +RULE_BOOL(Skills, SelfLanguageLearning, true, "") RULE_CATEGORY_END() RULE_CATEGORY(Pets) -RULE_REAL(Pets, AttackCommandRange, 150) -RULE_BOOL(Pets, UnTargetableSwarmPet, false) -RULE_REAL(Pets, PetPowerLevelCap, 10) // Max number of levels your pet can go up with pet power -RULE_BOOL(Pets, CanTakeNoDrop, false) // Can everyone trade nodrop gear to pets +RULE_REAL(Pets, AttackCommandRange, 150, "") +RULE_BOOL(Pets, UnTargetableSwarmPet, false, "") +RULE_REAL(Pets, PetPowerLevelCap, 10, "Max number of levels your pet can go up with pet power") +RULE_BOOL(Pets, CanTakeNoDrop, false, "Can everyone trade nodrop gear to pets") RULE_CATEGORY_END() RULE_CATEGORY(GM) -RULE_INT(GM, MinStatusToSummonItem, 250) -RULE_INT(GM, MinStatusToZoneAnywhere, 250) -RULE_INT(GM, MinStatusToLevelTarget, 100) +RULE_INT(GM, MinStatusToSummonItem, 250, "") +RULE_INT(GM, MinStatusToZoneAnywhere, 250, "") +RULE_INT(GM, MinStatusToLevelTarget, 100, "") RULE_CATEGORY_END() RULE_CATEGORY(World) -RULE_INT(World, ZoneAutobootTimeoutMS, 60000) -RULE_INT(World, ClientKeepaliveTimeoutMS, 65000) -RULE_BOOL(World, UseBannedIPsTable, false) // Toggle whether or not to check incoming client connections against the Banned_IPs table. Set this value to false to disable this feature. -RULE_BOOL(World, EnableTutorialButton, true) -RULE_BOOL(World, EnableReturnHomeButton, true) -RULE_INT(World, MaxLevelForTutorial, 10) -RULE_INT(World, TutorialZoneID, 189) -RULE_INT(World, GuildBankZoneID, 345) -RULE_INT(World, MinOfflineTimeToReturnHome, 21600) // 21600 seconds is 6 Hours -RULE_INT(World, MaxClientsPerIP, -1) // Maximum number of clients allowed to connect per IP address if account status is < AddMaxClientsStatus. Default value: -1 (feature disabled) -RULE_INT(World, ExemptMaxClientsStatus, -1) // Exempt accounts from the MaxClientsPerIP and AddMaxClientsStatus rules, if their status is >= this value. Default value: -1 (feature disabled) -RULE_INT(World, AddMaxClientsPerIP, -1) // Maximum number of clients allowed to connect per IP address if account status is < ExemptMaxClientsStatus. Default value: -1 (feature disabled) -RULE_INT(World, AddMaxClientsStatus, -1) // Accounts with status >= this rule will be allowed to use the amount of accounts defined in the AddMaxClientsPerIP. Default value: -1 (feature disabled) -RULE_BOOL(World, MaxClientsSetByStatus, false) // If True, IP Limiting will be set to the status on the account as long as the status is > MaxClientsPerIP -RULE_BOOL(World, EnableIPExemptions, false) // If True, ip_exemptions table is used, if there is no entry for the IP it will default to RuleI(World, MaxClientsPerIP) -RULE_BOOL(World, ClearTempMerchantlist, true) // Clears temp merchant items when world boots. -RULE_BOOL(World, DeleteStaleCorpeBackups, true) // Deletes stale corpse backups older than 2 weeks. -RULE_BOOL(World, GMAccountIPList, false) // Check ip list against GM Accounts, AntiHack GM Accounts. -RULE_INT(World, MinGMAntiHackStatus, 1) //Minimum GM status to check against AntiHack list -RULE_INT(World, SoFStartZoneID, -1) //Sets the Starting Zone for SoF Clients separate from Titanium Clients (-1 is disabled) -RULE_INT(World, TitaniumStartZoneID, -1) //Sets the Starting Zone for Titanium Clients (-1 is disabled). Replaces the old method. -RULE_INT(World, ExpansionSettings, 16383) // Sets the expansion settings for the server, This is sent on login to world and affects client expansion settings. Defaults to all expansions enabled up to TSS. -RULE_BOOL(World, UseClientBasedExpansionSettings, true) // if true it will overrule World, ExpansionSettings and set someone's expansion based on the client they're using -RULE_INT(World, PVPSettings, 0) // Sets the PVP settings for the server, 1 = Rallos Zek RuleSet, 2 = Tallon/Vallon Zek Ruleset, 4 = Sullon Zek Ruleset, 6 = Discord Ruleset, anything above 6 is the Discord Ruleset without the no-drop restrictions removed. TODO: Edit IsAttackAllowed in Zone to accomodate for these rules. -RULE_INT(World, PVPMinLevel, 0) // minimum level to pvp -RULE_BOOL (World, IsGMPetitionWindowEnabled, false) -RULE_INT (World, FVNoDropFlag, 0) // Sets the Firiona Vie settings on the client. If set to 2, the flag will be set for GMs only, allowing trading of no-drop items. -RULE_BOOL (World, IPLimitDisconnectAll, false) -RULE_BOOL(World, MaxClientsSimplifiedLogic, false) // New logic that only uses ExemptMaxClientsStatus and MaxClientsPerIP. Done on the loginserver. This mimics the P99-style special IP rules. -RULE_INT (World, TellQueueSize, 20) -RULE_BOOL(World, StartZoneSameAsBindOnCreation, true) //Should the start zone ALWAYS be the same location as your bind? -RULE_BOOL(World, EnforceCharacterLimitAtLogin, false) +RULE_INT(World, ZoneAutobootTimeoutMS, 60000, "") +RULE_INT(World, ClientKeepaliveTimeoutMS, 65000, "") +RULE_BOOL(World, UseBannedIPsTable, false, "Toggle whether or not to check incoming client connections against the Banned_IPs table. Set this value to false to disable this feature") +RULE_BOOL(World, EnableTutorialButton, true, "") +RULE_BOOL(World, EnableReturnHomeButton, true, "") +RULE_INT(World, MaxLevelForTutorial, 10, "") +RULE_INT(World, TutorialZoneID, 189, "") +RULE_INT(World, GuildBankZoneID, 345, "") +RULE_INT(World, MinOfflineTimeToReturnHome, 21600, "21600 seconds is 6 Hours") +RULE_INT(World, MaxClientsPerIP, -1, "Maximum number of clients allowed to connect per IP address if account status is < AddMaxClientsStatus. Default value: -1 (feature disabled)") +RULE_INT(World, ExemptMaxClientsStatus, -1, "Exempt accounts from the MaxClientsPerIP and AddMaxClientsStatus rules, if their status is >= this value. Default value: -1 (feature disabled)") +RULE_INT(World, AddMaxClientsPerIP, -1, "Maximum number of clients allowed to connect per IP address if account status is < ExemptMaxClientsStatus. Default value: -1 (feature disabled)") +RULE_INT(World, AddMaxClientsStatus, -1, "Accounts with status >= this rule will be allowed to use the amount of accounts defined in the AddMaxClientsPerIP. Default value: -1 (feature disabled)") +RULE_BOOL(World, MaxClientsSetByStatus, false, "If True, IP Limiting will be set to the status on the account as long as the status is > MaxClientsPerIP") +RULE_BOOL(World, EnableIPExemptions, false, "If True, ip_exemptions table is used, if there is no entry for the IP it will default to RuleI(World, MaxClientsPerIP)") +RULE_BOOL(World, ClearTempMerchantlist, true, "Clears temp merchant items when world boots") +RULE_BOOL(World, DeleteStaleCorpeBackups, true, "Deletes stale corpse backups older than 2 weeks") +RULE_BOOL(World, GMAccountIPList, false, "Check ip list against GM Accounts, AntiHack GM Accounts") +RULE_INT(World, MinGMAntiHackStatus, 1, "Minimum GM status to check against AntiHack list") +RULE_INT(World, SoFStartZoneID, -1, "Sets the Starting Zone for SoF Clients separate from Titanium Clients (-1 is disabled)") +RULE_INT(World, TitaniumStartZoneID, -1, "Sets the Starting Zone for Titanium Clients (-1 is disabled). Replaces the old method") +RULE_INT(World, ExpansionSettings, 16383, "Sets the expansion settings for the server, This is sent on login to world and affects client expansion settings. Defaults to all expansions enabled up to TSS") +RULE_BOOL(World, UseClientBasedExpansionSettings, true, "if true it will overrule World, ExpansionSettings and set someone's expansion based on the client they're using") +RULE_INT(World, PVPSettings, 0, "Sets the PVP settings for the server, 1 = Rallos Zek RuleSet, 2 = Tallon/Vallon Zek Ruleset, 4 = Sullon Zek Ruleset, 6 = Discord Ruleset, anything above 6 is the Discord Ruleset without the no-drop restrictions removed. TODO: Edit IsAttackAllowed in Zone to accomodate for these rules") +RULE_INT(World, PVPMinLevel, 0, "minimum level to pvp") +RULE_BOOL (World, IsGMPetitionWindowEnabled, false, "") +RULE_INT (World, FVNoDropFlag, 0, "Sets the Firiona Vie settings on the client. If set to 2, the flag will be set for GMs only, allowing trading of no-drop items") +RULE_BOOL (World, IPLimitDisconnectAll, false, "") +RULE_BOOL(World, MaxClientsSimplifiedLogic, false, "New logic that only uses ExemptMaxClientsStatus and MaxClientsPerIP. Done on the loginserver. This mimics the P99-style special IP rules") +RULE_INT (World, TellQueueSize, 20, "") +RULE_BOOL(World, StartZoneSameAsBindOnCreation, true, "Should the start zone ALWAYS be the same location as your bind?") +RULE_BOOL(World, EnforceCharacterLimitAtLogin, false, "") RULE_CATEGORY_END() RULE_CATEGORY(Zone) -RULE_INT(Zone, ClientLinkdeadMS, 90000) //the time a client remains link dead on the server after a sudden disconnection -RULE_INT(Zone, GraveyardTimeMS, 1200000) //ms time until a player corpse is moved to a zone's graveyard, if one is specified for the zone -RULE_BOOL(Zone, EnableShadowrest, 1) // enables or disables the shadowrest zone feature for player corpses. Default is turned on. -RULE_BOOL(Zone, UsePlayerCorpseBackups, true) // Keeps backups of player corpses. -RULE_INT(Zone, MQWarpExemptStatus, -1) // Required status level to exempt the MQWarpDetector. Set to -1 to disable this feature. -RULE_INT(Zone, MQZoneExemptStatus, -1) // Required status level to exempt the MQZoneDetector. Set to -1 to disable this feature. -RULE_INT(Zone, MQGateExemptStatus, -1) // Required status level to exempt the MQGateDetector. Set to -1 to disable this feature. -RULE_INT(Zone, MQGhostExemptStatus, -1) // Required status level to exempt the MGhostDetector. Set to -1 to disable this feature. -RULE_BOOL(Zone, EnableMQWarpDetector, true) // Enable the MQWarp Detector. Set to False to disable this feature. -RULE_BOOL(Zone, EnableMQZoneDetector, true) // Enable the MQZone Detector. Set to False to disable this feature. -RULE_BOOL(Zone, EnableMQGateDetector, true) // Enable the MQGate Detector. Set to False to disable this feature. -RULE_BOOL(Zone, EnableMQGhostDetector, true) // Enable the MQGhost Detector. Set to False to disable this feature. -RULE_REAL(Zone, MQWarpDetectionDistanceFactor, 9.0) //clients move at 4.4 about if in a straight line but with movement and to acct for lag we raise it a bit -RULE_BOOL(Zone, MarkMQWarpLT, false) -RULE_INT(Zone, AutoShutdownDelay, 5000) //How long a dynamic zone stays loaded while empty -RULE_INT(Zone, PEQZoneReuseTime, 900) //How long, in seconds, until you can reuse the #peqzone command. -RULE_INT(Zone, PEQZoneDebuff1, 4454) //First debuff casted by #peqzone Default is Cursed Keeper's Blight. -RULE_INT(Zone, PEQZoneDebuff2, 2209) //Second debuff casted by #peqzone Default is Tendrils of Apathy. -RULE_BOOL(Zone, UsePEQZoneDebuffs, true) //Will determine if #peqzone will debuff players or not when used. -RULE_REAL(Zone, HotZoneBonus, 0.75) -RULE_INT(Zone, ReservedInstances, 30) //Will reserve this many instance ids for globals... probably not a good idea to change this while a server is running. -RULE_INT(Zone, EbonCrystalItemID, 40902) -RULE_INT(Zone, RadiantCrystalItemID, 40903) -RULE_BOOL(Zone, LevelBasedEXPMods, false) // Allows you to use the level_exp_mods table in consideration to your players EXP hits -RULE_INT(Zone, WeatherTimer, 600) // Weather timer when no duration is available -RULE_BOOL(Zone, EnableLoggedOffReplenishments, true) -RULE_INT(Zone, MinOfflineTimeToReplenishments, 21600) // 21600 seconds is 6 Hours -RULE_BOOL(Zone, UseZoneController, true) // Enables the ability to use persistent quest based zone controllers (zone_controller.pl/lua) -RULE_BOOL(Zone, EnableZoneControllerGlobals, false) // Enables the ability to use quest globals with the zone controller NPC -RULE_INT(Zone, GlobalLootMultiplier, 1) // Sets Global Loot drop multiplier for database based drops, useful for double, triple loot etc. +RULE_INT(Zone, ClientLinkdeadMS, 90000, "the time a client remains link dead on the server after a sudden disconnection") +RULE_INT(Zone, GraveyardTimeMS, 1200000, "ms time until a player corpse is moved to a zone's graveyard, if one is specified for the zone") +RULE_BOOL(Zone, EnableShadowrest, 1, "enables or disables the shadowrest zone feature for player corpses. Default is turned on") +RULE_BOOL(Zone, UsePlayerCorpseBackups, true, "Keeps backups of player corpses") +RULE_INT(Zone, MQWarpExemptStatus, -1, "Required status level to exempt the MQWarpDetector. Set to -1 to disable this feature") +RULE_INT(Zone, MQZoneExemptStatus, -1, "Required status level to exempt the MQZoneDetector. Set to -1 to disable this feature") +RULE_INT(Zone, MQGateExemptStatus, -1, "Required status level to exempt the MQGateDetector. Set to -1 to disable this feature") +RULE_INT(Zone, MQGhostExemptStatus, -1, "Required status level to exempt the MGhostDetector. Set to -1 to disable this feature") +RULE_BOOL(Zone, EnableMQWarpDetector, true, "Enable the MQWarp Detector. Set to False to disable this feature") +RULE_BOOL(Zone, EnableMQZoneDetector, true, "Enable the MQZone Detector. Set to False to disable this feature") +RULE_BOOL(Zone, EnableMQGateDetector, true, "Enable the MQGate Detector. Set to False to disable this feature") +RULE_BOOL(Zone, EnableMQGhostDetector, true, "Enable the MQGhost Detector. Set to False to disable this feature") +RULE_REAL(Zone, MQWarpDetectionDistanceFactor, 9.0, "clients move at 4.4 about if in a straight line but with movement and to acct for lag we raise it a bit") +RULE_BOOL(Zone, MarkMQWarpLT, false, "") +RULE_INT(Zone, AutoShutdownDelay, 5000, "How long a dynamic zone stays loaded while empty") +RULE_INT(Zone, PEQZoneReuseTime, 900, "How long, in seconds, until you can reuse the #peqzone command") +RULE_INT(Zone, PEQZoneDebuff1, 4454, "First debuff casted by #peqzone Default is Cursed Keeper's Blight") +RULE_INT(Zone, PEQZoneDebuff2, 2209, "Second debuff casted by #peqzone Default is Tendrils of Apathy") +RULE_BOOL(Zone, UsePEQZoneDebuffs, true, "Will determine if #peqzone will debuff players or not when used") +RULE_REAL(Zone, HotZoneBonus, 0.75, "") +RULE_INT(Zone, ReservedInstances, 30, "Will reserve this many instance ids for globals... probably not a good idea to change this while a server is running") +RULE_INT(Zone, EbonCrystalItemID, 40902, "") +RULE_INT(Zone, RadiantCrystalItemID, 40903, "") +RULE_BOOL(Zone, LevelBasedEXPMods, false, "Allows you to use the level_exp_mods table in consideration to your players EXP hits") +RULE_INT(Zone, WeatherTimer, 600, "Weather timer when no duration is available") +RULE_BOOL(Zone, EnableLoggedOffReplenishments, true, "") +RULE_INT(Zone, MinOfflineTimeToReplenishments, 21600, "21600 seconds is 6 Hours") +RULE_BOOL(Zone, UseZoneController, true, "Enables the ability to use persistent quest based zone controllers (zone_controller.pl/lua)") +RULE_BOOL(Zone, EnableZoneControllerGlobals, false, "Enables the ability to use quest globals with the zone controller NPC") +RULE_INT(Zone, GlobalLootMultiplier, 1, "Sets Global Loot drop multiplier for database based drops, useful for double, triple loot etc") RULE_CATEGORY_END() RULE_CATEGORY(Map) -RULE_BOOL(Map, FixPathingZOnSendTo, false) //try to repair Z coords in the SendTo routine as well. -RULE_BOOL(Map, FixZWhenPathing, true) // Automatically fix NPC Z coordinates when moving/pathing/engaged (Far less CPU intensive than its predecessor) -RULE_REAL(Map, DistanceCanTravelBeforeAdjustment, 10.0) // distance a mob can path before FixZ is called, depends on FixZWhenPathing -RULE_BOOL(Map, MobZVisualDebug, false) // Displays spell effects determining whether or not NPC is hitting Best Z calcs (blue for hit, red for miss) -RULE_REAL(Map, FixPathingZMaxDeltaSendTo, 20) //at runtime in SendTo: max change in Z to allow the BestZ code to apply. -RULE_INT(Map, FindBestZHeightAdjust, 1) // Adds this to the current Z before seeking the best Z position +RULE_BOOL(Map, FixPathingZOnSendTo, false, "try to repair Z coords in the SendTo routine as well") +RULE_BOOL(Map, FixZWhenPathing, true, "Automatically fix NPC Z coordinates when moving/pathing/engaged (Far less CPU intensive than its predecessor)") +RULE_REAL(Map, DistanceCanTravelBeforeAdjustment, 10.0, "distance a mob can path before FixZ is called, depends on FixZWhenPathing") +RULE_BOOL(Map, MobZVisualDebug, false, "Displays spell effects determining whether or not NPC is hitting Best Z calcs (blue for hit, red for miss)") +RULE_REAL(Map, FixPathingZMaxDeltaSendTo, 20, "at runtime in SendTo: max change in Z to allow the BestZ code to apply") +RULE_INT(Map, FindBestZHeightAdjust, 1, "Adds this to the current Z before seeking the best Z position") RULE_CATEGORY_END() RULE_CATEGORY(Pathing) -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, Fear, true) // Enable pathing for fear -RULE_REAL(Pathing, NavmeshStepSize, 100.0f) -RULE_REAL(Pathing, ShortMovementUpdateRange, 130.0f) +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, Fear, true, "Enable pathing for fear") +RULE_REAL(Pathing, NavmeshStepSize, 100.0f, "") +RULE_REAL(Pathing, ShortMovementUpdateRange, 130.0f, "") RULE_CATEGORY_END() RULE_CATEGORY(Watermap) // enable these to use the water detection code. Requires Water Maps generated by awater utility -RULE_BOOL(Watermap, CheckWaypointsInWaterWhenLoading, false) // Does not apply BestZ as waypoints are loaded if they are in water -RULE_BOOL(Watermap, CheckForWaterAtWaypoints, false) // Check if a mob has moved into/out of water when at waypoints and sets flymode -RULE_BOOL(Watermap, CheckForWaterWhenMoving, false) // Checks if a mob has moved into/out of water each time it's loc is recalculated -RULE_BOOL(Watermap, CheckForWaterOnSendTo, false) // Checks if a mob has moved into/out of water on SendTo -RULE_BOOL(Watermap, CheckForWaterWhenFishing, false) // Only lets a player fish near water (if a water map exists for the zone) -RULE_REAL(Watermap, FishingRodLength, 30) // How far in front of player water must be for fishing to work -RULE_REAL(Watermap, FishingLineLength, 100) // If water is more than this far below the player, it is considered too far to fish -RULE_REAL(Watermap, FishingLineStepSize, 1) // Basic step size for fishing calc, too small and it will eat cpu, too large and it will miss potential water +RULE_BOOL(Watermap, CheckWaypointsInWaterWhenLoading, false, "Does not apply BestZ as waypoints are loaded if they are in water") +RULE_BOOL(Watermap, CheckForWaterAtWaypoints, false, "Check if a mob has moved into/out of water when at waypoints and sets flymode") +RULE_BOOL(Watermap, CheckForWaterWhenMoving, false, "Checks if a mob has moved into/out of water each time it's loc is recalculated") +RULE_BOOL(Watermap, CheckForWaterOnSendTo, false, "Checks if a mob has moved into/out of water on SendTo") +RULE_BOOL(Watermap, CheckForWaterWhenFishing, false, "Only lets a player fish near water (if a water map exists for the zone)") +RULE_REAL(Watermap, FishingRodLength, 30, "How far in front of player water must be for fishing to work") +RULE_REAL(Watermap, FishingLineLength, 100, "If water is more than this far below the player, it is considered too far to fish") +RULE_REAL(Watermap, FishingLineStepSize, 1, "Basic step size for fishing calc, too small and it will eat cpu, too large and it will miss potential water") RULE_CATEGORY_END() RULE_CATEGORY(Spells) -RULE_INT(Spells, AutoResistDiff, 15) -RULE_REAL(Spells, ResistChance, 2.0) //chance to resist given no resists and same level -RULE_REAL(Spells, ResistMod, 0.40) //multiplier, chance to resist = this * ResistAmount -RULE_REAL(Spells, PartialHitChance, 0.7) //The chance when a spell is resisted that it will partial hit. -RULE_REAL(Spells, PartialHitChanceFear, 0.25) //The chance when a fear spell is resisted that it will partial hit. -RULE_INT(Spells, BaseCritChance, 0) //base % chance that everyone has to crit a spell -RULE_INT(Spells, BaseCritRatio, 100) //base % bonus to damage on a successful spell crit. 100 = 2x damage -RULE_INT(Spells, WizCritLevel, 12) //level wizards first get spell crits -RULE_INT(Spells, WizCritChance, 7) //wiz's crit chance, on top of BaseCritChance -RULE_INT(Spells, WizCritRatio, 0) //wiz's crit bonus, on top of BaseCritRatio (should be 0 for Live-like) -RULE_INT(Spells, ResistPerLevelDiff, 85) //8.5 resist per level difference. -RULE_INT(Spells, TranslocateTimeLimit, 0) // If not zero, time in seconds to accept a Translocate. -RULE_INT(Spells, SacrificeMinLevel, 46) //first level Sacrifice will work on -RULE_INT(Spells, SacrificeMaxLevel, 69) //last level Sacrifice will work on -RULE_INT(Spells, SacrificeItemID, 9963) //Item ID of the item Sacrifice will return (defaults to an EE) -RULE_BOOL(Spells, EnableSpellGlobals, false) // If Enabled, spells check the spell_globals table and compare character data from their quest globals before allowing the spell to scribe with scribespells/traindiscs -RULE_BOOL(Spells, EnableSpellBuckets, false) // If Enabled, spells check the spell_buckets table and compare character data from their data buckets before allowing the spell to scribe with scribespells/traindiscs -RULE_INT(Spells, MaxBuffSlotsNPC, 60) // default to Tit's limit -RULE_INT(Spells, MaxSongSlotsNPC, 0) // NPCs don't have songs ... -RULE_INT(Spells, MaxDiscSlotsNPC, 0) // NPCs don't have discs ... -RULE_INT(Spells, MaxTotalSlotsNPC, 60) // default to Tit's limit -RULE_INT(Spells, MaxTotalSlotsPET, 30) // default to Tit's limit -RULE_BOOL (Spells, EnableBlockedBuffs, true) -RULE_INT(Spells, ReflectType, 3) //0 = disabled, 1 = single target player spells only, 2 = all player spells, 3 = all single target spells, 4 = all spells -RULE_BOOL(Spells, ReflectMessagesClose, true) // Live functionality is for Reflect messages to show to players within close proximity, false shows just player reflecting -RULE_INT(Spells, VirusSpreadDistance, 30) // The distance a viral spell will jump to its next victim -RULE_BOOL(Spells, LiveLikeFocusEffects, true) // Determines whether specific healing, dmg and mana reduction focuses are randomized -RULE_INT(Spells, BaseImmunityLevel, 55) // The level that targets start to be immune to stun, fear and mez spells with a max level of 0. -RULE_BOOL(Spells, NPCIgnoreBaseImmunity, true) // Whether or not NPCs get to ignore the BaseImmunityLevel for their spells. -RULE_REAL(Spells, AvgSpellProcsPerMinute, 6.0) //Adjust rate for sympathetic spell procs -RULE_INT(Spells, ResistFalloff, 67) //Max that level that will adjust our resist chance based on level modifiers -RULE_INT(Spells, CharismaEffectiveness, 10) // Deterimes how much resist modification charisma applies to charm/pacify checks. Default 10 CHA = -1 resist mod. -RULE_INT(Spells, CharismaEffectivenessCap, 255) // Deterimes how much resist modification charisma applies to charm/pacify checks. Default 10 CHA = -1 resist mod. -RULE_BOOL(Spells, CharismaCharmDuration, false) // Allow CHA resist mod to extend charm duration. -RULE_INT(Spells, CharmBreakCheckChance, 25) //Determines chance for a charm break check to occur each buff tick. -RULE_INT(Spells, MaxCastTimeReduction, 50) //Max percent your spell cast time can be reduced by spell haste -RULE_INT(Spells, RootBreakFromSpells, 55) //Chance for root to break when cast on. -RULE_INT(Spells, DeathSaveCharismaMod, 3) //Determines how much charisma effects chance of death save firing. -RULE_INT(Spells, DivineInterventionHeal, 8000) //Divine intervention heal amount. -RULE_INT(Spells, AdditiveBonusWornType, 0) //Calc worn bonuses to add together (instead of taking highest) if set to THIS worn type. (2=Will covert live items automatically) -RULE_BOOL(Spells, UseCHAScribeHack, false) //ScribeSpells and TrainDiscs quest functions will ignore entries where field 12 is CHA. What's the best way to do this? -RULE_BOOL(Spells, BuffLevelRestrictions, true) //Buffs will not land on low level toons like live -RULE_INT(Spells, RootBreakCheckChance, 70) //Determines chance for a root break check to occur each buff tick. -RULE_INT(Spells, FearBreakCheckChance, 70) //Determines chance for a fear break check to occur each buff tick. -RULE_INT(Spells, SuccorFailChance, 2) //Determines chance for a succor spell not to teleport an invidual player -RULE_INT(Spells, FRProjectileItem_Titanium, 1113) // Item id for Titanium clients for Fire 'spell projectile'. -RULE_INT(Spells, FRProjectileItem_SOF, 80684) // Item id for SOF clients for Fire 'spell projectile'. -RULE_INT(Spells, FRProjectileItem_NPC, 80684) // Item id for NPC Fire 'spell projectile'. -RULE_BOOL(Spells, UseLiveSpellProjectileGFX, false) // Use spell projectile graphics set in the spells_new table (player_1). Server must be using UF+ spell file. -RULE_BOOL(Spells, FocusCombatProcs, false) //Allow all combat procs to receive focus effects. -RULE_BOOL(Spells, PreNerfBardAEDoT, false) //Allow bard AOE dots to damage targets when moving. -RULE_INT(Spells, AI_SpellCastFinishedFailRecast, 800) // AI spell recast time(MS) when an spell is cast but fails (ie stunned). -RULE_INT(Spells, AI_EngagedNoSpellMinRecast, 500) // AI spell recast time(MS) check when no spell is cast while engaged. (min time in random) -RULE_INT(Spells, AI_EngagedNoSpellMaxRecast, 1000) // AI spell recast time(MS) check when no spell is cast engaged.(max time in random) -RULE_INT(Spells, AI_EngagedBeneficialSelfChance, 100) // Chance during first AI Cast check to do a beneficial spell on self. -RULE_INT(Spells, AI_EngagedBeneficialOtherChance, 25) // Chance during second AI Cast check to do a beneficial spell on others. -RULE_INT(Spells, AI_EngagedDetrimentalChance, 20) // Chance during third AI Cast check to do a determental spell on others. -RULE_INT(Spells, AI_PursueNoSpellMinRecast, 500) // AI spell recast time(MS) check when no spell is cast while chasing target. (min time in random) -RULE_INT(Spells, AI_PursueNoSpellMaxRecast, 2000) // AI spell recast time(MS) check when no spell is cast while chasing target. (max time in random) -RULE_INT(Spells, AI_PursueDetrimentalChance, 90) // Chance while chasing target to cast a detrimental spell. -RULE_INT(Spells, AI_IdleNoSpellMinRecast, 6000) // AI spell recast time(MS) check when no spell is cast while idle. (min time in random) -RULE_INT(Spells, AI_IdleNoSpellMaxRecast, 60000) // AI spell recast time(MS) check when no spell is cast while chasing target. (max time in random) -RULE_INT(Spells, AI_IdleBeneficialChance, 100) // Chance while idle to do a beneficial spell on self or others. -RULE_INT(Spells, AI_HealHPPct, 50) // HP Pct NPCs will start heals at (in and out of combat) if spell's max_hp is not set -RULE_BOOL(Spells, SHDProcIDOffByOne, true) // pre June 2009 SHD spell procs were off by 1, they stopped doing this in June 2009 (so UF+ spell files need this false) -RULE_BOOL(Spells, Jun182014HundredHandsRevamp, false) // this should be true for if you import a spell file newer than June 18, 2014 -RULE_BOOL(Spells, SwarmPetTargetLock, false) // Use old method of swarm pets target locking till target dies then despawning. -RULE_BOOL(Spells, NPC_UseFocusFromSpells, true) // Allow npcs to use most spell derived focus effects. -RULE_BOOL(Spells, NPC_UseFocusFromItems, false) // Allow npcs to use most item derived focus effects. -RULE_BOOL(Spells, UseAdditiveFocusFromWornSlot, false) // Allows an additive focus effect to be calculated from worn slot. -RULE_BOOL(Spells, AlwaysSendTargetsBuffs, false) // ignore LAA level if true -RULE_BOOL(Spells, FlatItemExtraSpellAmt, false) // allow SpellDmg stat to affect all spells, regardless of cast time/cooldown/etc -RULE_BOOL(Spells, IgnoreSpellDmgLvlRestriction, false) // ignore the 5 level spread on applying SpellDmg -RULE_BOOL(Spells, AllowItemTGB, false) // TGB doesn't work with items on live, custom servers want it though -RULE_BOOL(Spells, NPCInnateProcOverride, true) // NPC innate procs override the target type to single target. -RULE_BOOL(Spells, OldRainTargets, false) // use old incorrectly implemented max targets for rains -RULE_BOOL(Spells, NPCSpellPush, false) // enable spell push on NPCs +RULE_INT(Spells, AutoResistDiff, 15, "") +RULE_REAL(Spells, ResistChance, 2.0, "chance to resist given no resists and same level") +RULE_REAL(Spells, ResistMod, 0.40, "multiplier, chance to resist = this * ResistAmount") +RULE_REAL(Spells, PartialHitChance, 0.7, "The chance when a spell is resisted that it will partial hit") +RULE_REAL(Spells, PartialHitChanceFear, 0.25, "The chance when a fear spell is resisted that it will partial hit") +RULE_INT(Spells, BaseCritChance, 0, "base % chance that everyone has to crit a spell") +RULE_INT(Spells, BaseCritRatio, 100, "base % bonus to damage on a successful spell crit. 100 = 2x damage") +RULE_INT(Spells, WizCritLevel, 12, "level wizards first get spell crits") +RULE_INT(Spells, WizCritChance, 7, "wiz's crit chance, on top of BaseCritChance") +RULE_INT(Spells, WizCritRatio, 0, "wiz's crit bonus, on top of BaseCritRatio (should be 0 for Live-like)") +RULE_INT(Spells, ResistPerLevelDiff, 85, "8.5 resist per level difference") +RULE_INT(Spells, TranslocateTimeLimit, 0, "If not zero, time in seconds to accept a Translocate") +RULE_INT(Spells, SacrificeMinLevel, 46, "first level Sacrifice will work on") +RULE_INT(Spells, SacrificeMaxLevel, 69, "last level Sacrifice will work on") +RULE_INT(Spells, SacrificeItemID, 9963, "Item ID of the item Sacrifice will return (defaults to an EE)") +RULE_BOOL(Spells, EnableSpellGlobals, false, "If Enabled, spells check the spell_globals table and compare character data from their quest globals before allowing the spell to scribe with scribespells/traindiscs") +RULE_BOOL(Spells, EnableSpellBuckets, false, "If Enabled, spells check the spell_buckets table and compare character data from their data buckets before allowing the spell to scribe with scribespells/traindiscs") +RULE_INT(Spells, MaxBuffSlotsNPC, 60, "default to Tit's limit") +RULE_INT(Spells, MaxSongSlotsNPC, 0, "NPCs don't have songs ...") +RULE_INT(Spells, MaxDiscSlotsNPC, 0, "NPCs don't have discs ...") +RULE_INT(Spells, MaxTotalSlotsNPC, 60, "default to Tit's limit") +RULE_INT(Spells, MaxTotalSlotsPET, 30, "default to Tit's limit") +RULE_BOOL (Spells, EnableBlockedBuffs, true, "") +RULE_INT(Spells, ReflectType, 3, "0 = disabled, 1 = single target player spells only, 2 = all player spells, 3 = all single target spells, 4 = all spells") +RULE_BOOL(Spells, ReflectMessagesClose, true, "Live functionality is for Reflect messages to show to players within close proximity, false shows just player reflecting") +RULE_INT(Spells, VirusSpreadDistance, 30, "The distance a viral spell will jump to its next victim") +RULE_BOOL(Spells, LiveLikeFocusEffects, true, "Determines whether specific healing, dmg and mana reduction focuses are randomized") +RULE_INT(Spells, BaseImmunityLevel, 55, "The level that targets start to be immune to stun, fear and mez spells with a max level of 0") +RULE_BOOL(Spells, NPCIgnoreBaseImmunity, true, "Whether or not NPCs get to ignore the BaseImmunityLevel for their spells") +RULE_REAL(Spells, AvgSpellProcsPerMinute, 6.0, "Adjust rate for sympathetic spell procs") +RULE_INT(Spells, ResistFalloff, 67, "Max that level that will adjust our resist chance based on level modifiers") +RULE_INT(Spells, CharismaEffectiveness, 10, "Deterimes how much resist modification charisma applies to charm/pacify checks. Default 10 CHA = -1 resist mod") +RULE_INT(Spells, CharismaEffectivenessCap, 255, "Deterimes how much resist modification charisma applies to charm/pacify checks. Default 10 CHA = -1 resist mod") +RULE_BOOL(Spells, CharismaCharmDuration, false, "Allow CHA resist mod to extend charm duration") +RULE_INT(Spells, CharmBreakCheckChance, 25, "Determines chance for a charm break check to occur each buff tick") +RULE_INT(Spells, MaxCastTimeReduction, 50, "Max percent your spell cast time can be reduced by spell haste") +RULE_INT(Spells, RootBreakFromSpells, 55, "Chance for root to break when cast on") +RULE_INT(Spells, DeathSaveCharismaMod, 3, "Determines how much charisma effects chance of death save firing") +RULE_INT(Spells, DivineInterventionHeal, 8000, "Divine intervention heal amount") +RULE_INT(Spells, AdditiveBonusWornType, 0, "Calc worn bonuses to add together (instead of taking highest) if set to THIS worn type. (2=Will covert live items automatically)") +RULE_BOOL(Spells, UseCHAScribeHack, false, "ScribeSpells and TrainDiscs quest functions will ignore entries where field 12 is CHA. What's the best way to do this?") +RULE_BOOL(Spells, BuffLevelRestrictions, true, "Buffs will not land on low level toons like live") +RULE_INT(Spells, RootBreakCheckChance, 70, "Determines chance for a root break check to occur each buff tick") +RULE_INT(Spells, FearBreakCheckChance, 70, "Determines chance for a fear break check to occur each buff tick") +RULE_INT(Spells, SuccorFailChance, 2, "Determines chance for a succor spell not to teleport an invidual player") +RULE_INT(Spells, FRProjectileItem_Titanium, 1113, "Item id for Titanium clients for Fire 'spell projectile'") +RULE_INT(Spells, FRProjectileItem_SOF, 80684, "Item id for SOF clients for Fire 'spell projectile'") +RULE_INT(Spells, FRProjectileItem_NPC, 80684, "Item id for NPC Fire 'spell projectile'") +RULE_BOOL(Spells, UseLiveSpellProjectileGFX, false, "Use spell projectile graphics set in the spells_new table (player_1). Server must be using UF+ spell file") +RULE_BOOL(Spells, FocusCombatProcs, false, "Allow all combat procs to receive focus effects") +RULE_BOOL(Spells, PreNerfBardAEDoT, false, "Allow bard AOE dots to damage targets when moving") +RULE_INT(Spells, AI_SpellCastFinishedFailRecast, 800, "AI spell recast time(MS) when an spell is cast but fails (ie stunned)") +RULE_INT(Spells, AI_EngagedNoSpellMinRecast, 500, "AI spell recast time(MS) check when no spell is cast while engaged. (min time in random)") +RULE_INT(Spells, AI_EngagedNoSpellMaxRecast, 1000, "AI spell recast time(MS) check when no spell is cast engaged.(max time in random)") +RULE_INT(Spells, AI_EngagedBeneficialSelfChance, 100, "Chance during first AI Cast check to do a beneficial spell on self") +RULE_INT(Spells, AI_EngagedBeneficialOtherChance, 25, "Chance during second AI Cast check to do a beneficial spell on others") +RULE_INT(Spells, AI_EngagedDetrimentalChance, 20, "Chance during third AI Cast check to do a determental spell on others") +RULE_INT(Spells, AI_PursueNoSpellMinRecast, 500, "AI spell recast time(MS) check when no spell is cast while chasing target. (min time in random)") +RULE_INT(Spells, AI_PursueNoSpellMaxRecast, 2000, "AI spell recast time(MS) check when no spell is cast while chasing target. (max time in random)") +RULE_INT(Spells, AI_PursueDetrimentalChance, 90, "Chance while chasing target to cast a detrimental spell") +RULE_INT(Spells, AI_IdleNoSpellMinRecast, 6000, "AI spell recast time(MS) check when no spell is cast while idle. (min time in random)") +RULE_INT(Spells, AI_IdleNoSpellMaxRecast, 60000, "AI spell recast time(MS) check when no spell is cast while chasing target. (max time in random)") +RULE_INT(Spells, AI_IdleBeneficialChance, 100, "Chance while idle to do a beneficial spell on self or others") +RULE_INT(Spells, AI_HealHPPct, 50, "HP Pct NPCs will start heals at (in and out of combat) if spell's max_hp is not set") +RULE_BOOL(Spells, SHDProcIDOffByOne, true, "pre June 2009 SHD spell procs were off by 1, they stopped doing this in June 2009 (so UF+ spell files need this false)") +RULE_BOOL(Spells, Jun182014HundredHandsRevamp, false, "this should be true for if you import a spell file newer than June 18, 2014") +RULE_BOOL(Spells, SwarmPetTargetLock, false, "Use old method of swarm pets target locking till target dies then despawning") +RULE_BOOL(Spells, NPC_UseFocusFromSpells, true, "Allow npcs to use most spell derived focus effects") +RULE_BOOL(Spells, NPC_UseFocusFromItems, false, "Allow npcs to use most item derived focus effects") +RULE_BOOL(Spells, UseAdditiveFocusFromWornSlot, false, "Allows an additive focus effect to be calculated from worn slot") +RULE_BOOL(Spells, AlwaysSendTargetsBuffs, false, "ignore LAA level if true") +RULE_BOOL(Spells, FlatItemExtraSpellAmt, false, "allow SpellDmg stat to affect all spells, regardless of cast time/cooldown/etc") +RULE_BOOL(Spells, IgnoreSpellDmgLvlRestriction, false, "ignore the 5 level spread on applying SpellDmg") +RULE_BOOL(Spells, AllowItemTGB, false, "TGB doesn't work with items on live, custom servers want it though") +RULE_BOOL(Spells, NPCInnateProcOverride, true, "NPC innate procs override the target type to single target") +RULE_BOOL(Spells, OldRainTargets, false, "use old incorrectly implemented max targets for rains") +RULE_BOOL(Spells, NPCSpellPush, false, "enable spell push on NPCs") RULE_CATEGORY_END() RULE_CATEGORY(Combat) -RULE_INT(Combat, PetBaseCritChance, 0) // Pet Base crit chance -RULE_INT(Combat, NPCBashKickLevel, 6) //The level that npcs can KICK/BASH -RULE_INT(Combat, NPCBashKickStunChance, 15) //Percent chance that a bash/kick will stun -RULE_INT(Combat, MeleeCritDifficulty, 8900) // lower is easier -RULE_INT(Combat, ArcheryCritDifficulty, 3400) // lower is easier -RULE_INT(Combat, ThrowingCritDifficulty, 1100) // lower is easier -RULE_BOOL(Combat, NPCCanCrit, false) // true allows non PC pet NPCs to crit -RULE_BOOL(Combat, UseIntervalAC, true) -RULE_INT(Combat, PetAttackMagicLevel, 30) -RULE_BOOL(Combat, EnableFearPathing, true) -RULE_REAL(Combat, FleeMultiplier, 2.0) // Determines how quickly a NPC will slow down while fleeing. Decrease multiplier to slow NPC down quicker. -RULE_BOOL(Combat, FleeGray, true) // If true FleeGrayHPRatio will be used. -RULE_INT(Combat, FleeGrayHPRatio, 50) //HP % when a Gray NPC begins to flee. -RULE_INT(Combat, FleeGrayMaxLevel, 18) // NPC's above this level won't do gray/green con flee -RULE_INT(Combat, FleeHPRatio, 25) //HP % when a NPC begins to flee. -RULE_BOOL(Combat, FleeIfNotAlone, false) // If false, mobs won't flee if other mobs are in combat with it. -RULE_BOOL(Combat, AdjustProcPerMinute, true) -RULE_REAL(Combat, AvgProcsPerMinute, 2.0) -RULE_REAL(Combat, ProcPerMinDexContrib, 0.075) -RULE_REAL(Combat, BaseProcChance, 0.035) -RULE_REAL(Combat, ProcDexDivideBy, 11000) -RULE_BOOL(Combat, AdjustSpecialProcPerMinute, true) //Set PPM for special abilities like HeadShot (Live does this as of 4-14) -RULE_REAL(Combat, AvgSpecialProcsPerMinute, 2.0) //Unclear what best value is atm. -RULE_REAL(Combat, BaseHitChance, 69.0) -RULE_REAL(Combat, NPCBonusHitChance, 26.0) -RULE_REAL(Combat, HitFalloffMinor, 5.0) //hit will fall off up to 5% over the initial level range -RULE_REAL(Combat, HitFalloffModerate, 7.0) //hit will fall off up to 7% over the three levels after the initial level range -RULE_REAL(Combat, HitFalloffMajor, 50.0) //hit will fall off sharply if we're outside the minor and moderate range -RULE_REAL(Combat, HitBonusPerLevel, 1.2) //You gain this % of hit for every level you are above your target -RULE_REAL(Combat, WeaponSkillFalloff, 0.33) //For every weapon skill point that's not maxed you lose this % of hit -RULE_REAL(Combat, ArcheryHitPenalty, 0.25) //Archery has a hit penalty to try to help balance it with the plethora of long term +hit modifiers for it -RULE_REAL(Combat, AgiHitFactor, 0.01) -RULE_REAL(Combat, MinChancetoHit, 5.0) //Minimum % chance to hit with regular melee/ranged -RULE_REAL(Combat, MaxChancetoHit, 95.0) //Maximum % chance to hit with regular melee/ranged -RULE_INT(Combat, MinRangedAttackDist, 25) //Minimum Distance to use Ranged Attacks -RULE_BOOL(Combat, ArcheryBonusRequiresStationary, true) //does the 2x archery bonus chance require a stationary npc -RULE_REAL(Combat, ArcheryBaseDamageBonus, 1) // % Modifier to Base Archery Damage (.5 = 50% base damage, 1 = 100%, 2 = 200%) -RULE_REAL(Combat, ArcheryNPCMultiplier, 1.0) // this is multiplied by the regular dmg to get the archery dmg -RULE_BOOL(Combat, AssistNoTargetSelf, true) //when assisting a target that does not have a target: true = target self, false = leave target as was before assist (false = live like) -RULE_INT(Combat, MaxRampageTargets, 3) //max number of people hit with rampage -RULE_INT(Combat, DefaultRampageTargets, 1) // default number of people to hit with rampage -RULE_BOOL(Combat, RampageHitsTarget, false) // rampage will hit the target if it still has targets left -RULE_INT(Combat, MaxFlurryHits, 2) //max number of extra hits from flurry -RULE_INT(Combat, MonkDamageTableBonus, 5) //% bonus monks get to their damage table calcs -RULE_INT(Combat, FlyingKickBonus, 25) //% Modifier that this skill gets to str and skill bonuses -RULE_INT(Combat, DragonPunchBonus, 20) //% Modifier that this skill gets to str and skill bonuses -RULE_INT(Combat, EagleStrikeBonus, 15) //% Modifier that this skill gets to str and skill bonuses -RULE_INT(Combat, TigerClawBonus, 10) //% Modifier that this skill gets to str and skill bonuses -RULE_INT(Combat, RoundKickBonus, 5) //% Modifier that this skill gets to str and skill bonuses -RULE_INT(Combat, FrenzyBonus, 0) //% Modifier to damage -RULE_INT(Combat, BackstabBonus, 0) //% Modifier to damage -RULE_BOOL(Combat, ProcTargetOnly, true) //true = procs will only affect our target, false = procs will affect all of our targets -RULE_REAL(Combat, NPCACFactor, 2.25) -RULE_INT(Combat, ClothACSoftcap, 75) -RULE_INT(Combat, LeatherACSoftcap, 100) -RULE_INT(Combat, MonkACSoftcap, 120) -RULE_INT(Combat, ChainACSoftcap, 200) -RULE_INT(Combat, PlateACSoftcap, 300) -RULE_REAL(Combat, AAMitigationACFactor, 3.0) -RULE_REAL(Combat, WarriorACSoftcapReturn, 0.45) -RULE_REAL(Combat, KnightACSoftcapReturn, 0.33) -RULE_REAL(Combat, LowPlateChainACSoftcapReturn, 0.23) -RULE_REAL(Combat, LowChainLeatherACSoftcapReturn, 0.17) -RULE_REAL(Combat, CasterACSoftcapReturn, 0.06) -RULE_REAL(Combat, MiscACSoftcapReturn, 0.3) -RULE_BOOL(Combat, OldACSoftcapRules, false) // use old softcaps -RULE_BOOL(Combat, UseOldDamageIntervalRules, false) // use old damage formulas for everything -RULE_REAL(Combat, WarACSoftcapReturn, 0.3448) // new AC returns -RULE_REAL(Combat, ClrRngMnkBrdACSoftcapReturn, 0.3030) -RULE_REAL(Combat, PalShdACSoftcapReturn, 0.3226) -RULE_REAL(Combat, DruNecWizEncMagACSoftcapReturn, 0.2000) -RULE_REAL(Combat, RogShmBstBerACSoftcapReturn, 0.2500) -RULE_REAL(Combat, SoftcapFactor, 1.88) -RULE_REAL(Combat, ACthac0Factor, 0.55) -RULE_REAL(Combat, ACthac20Factor, 0.55) -RULE_INT(Combat, HitCapPre20, 40) // live has it capped at 40 for whatever dumb reason... this is mainly for custom servers -RULE_INT(Combat, HitCapPre10, 20) // live has it capped at 20, see above :p -RULE_INT(Combat, MinHastedDelay, 400) // how fast we can get with haste. -RULE_REAL(Combat, AvgDefProcsPerMinute, 2.0) -RULE_REAL(Combat, DefProcPerMinAgiContrib, 0.075) //How much agility contributes to defensive proc rate -RULE_INT(Combat, SpecialAttackACBonus, 15) //Percent amount of damage per AC gained for certain special attacks (damage = AC*SpecialAttackACBonus/100). -RULE_INT(Combat, NPCFlurryChance, 20) // Chance for NPC to flurry. -RULE_BOOL (Combat,TauntOverLevel, 1) //Allows you to taunt NPC's over warriors level. -RULE_REAL (Combat,TauntSkillFalloff, 0.33)//For every taunt skill point that's not maxed you lose this % chance to taunt. -RULE_BOOL (Combat,EXPFromDmgShield, false) //Determine if damage from a damage shield counts for EXP gain. -RULE_INT(Combat, MonkACBonusWeight, 15) -RULE_INT(Combat, ClientStunLevel, 55) //This is the level where client kicks and bashes can stun the target -RULE_INT(Combat, QuiverHasteCap, 1000) //Quiver haste cap 1000 on live for a while, currently 700 on live -RULE_BOOL(Combat, UseArcheryBonusRoll, false) //Make the 51+ archery bonus require an actual roll -RULE_INT(Combat, ArcheryBonusChance, 50) -RULE_INT(Combat, BerserkerFrenzyStart, 35) -RULE_INT(Combat, BerserkerFrenzyEnd, 45) -RULE_BOOL(Combat, OneProcPerWeapon, true) //If enabled, One proc per weapon per round -RULE_BOOL(Combat, ProjectileDmgOnImpact, true) //If enabled, projectiles (ie arrows) will hit on impact, instead of instantly. -RULE_BOOL(Combat, MeleePush, true) // enable melee push -RULE_INT(Combat, MeleePushChance, 50) // (NPCs) chance the target will be pushed. Made up, 100 actually isn't that bad -RULE_BOOL(Combat, UseLiveCombatRounds, true) // turn this false if you don't want to worry about fixing up combat rounds for NPCs -RULE_INT(Combat, NPCAssistCap, 5) // Maxiumium number of NPCs that will assist another NPC at once -RULE_INT(Combat, NPCAssistCapTimer, 6000) // Time in milliseconds a NPC will take to clear assist aggro cap space -RULE_BOOL(Combat, UseRevampHandToHand, false) // use h2h revamped dmg/delays I believe this was implemented during SoF -RULE_BOOL(Combat, ClassicMasterWu, false) // classic master wu uses a random special, modern doesn't -RULE_INT(Combat, LevelToStopDamageCaps, 0) // 1 will effectively disable them, 20 should give basically same results as old incorrect system -RULE_BOOL(Combat, ClassicNPCBackstab, false) // true disables npc facestab - npcs get normal attack if not behind -RULE_BOOL(Combat, UseNPCDamageClassLevelMods, true) // Uses GetClassLevelDamageMod calc in npc_scale_manager +RULE_INT(Combat, PetBaseCritChance, 0, "Pet Base crit chance") +RULE_INT(Combat, NPCBashKickLevel, 6, "The level that npcs can KICK/BASH") +RULE_INT(Combat, NPCBashKickStunChance, 15, "Percent chance that a bash/kick will stun") +RULE_INT(Combat, MeleeCritDifficulty, 8900, "lower is easier") +RULE_INT(Combat, ArcheryCritDifficulty, 3400, "lower is easier") +RULE_INT(Combat, ThrowingCritDifficulty, 1100, "lower is easier") +RULE_BOOL(Combat, NPCCanCrit, false, "true allows non PC pet NPCs to crit") +RULE_BOOL(Combat, UseIntervalAC, true, "") +RULE_INT(Combat, PetAttackMagicLevel, 30, "") +RULE_BOOL(Combat, EnableFearPathing, true, "") +RULE_REAL(Combat, FleeMultiplier, 2.0, "Determines how quickly a NPC will slow down while fleeing. Decrease multiplier to slow NPC down quicker") +RULE_BOOL(Combat, FleeGray, true, "If true FleeGrayHPRatio will be used") +RULE_INT(Combat, FleeGrayHPRatio, 50, "HP % when a Gray NPC begins to flee") +RULE_INT(Combat, FleeGrayMaxLevel, 18, "NPC's above this level won't do gray/green con flee") +RULE_INT(Combat, FleeHPRatio, 25, "HP % when a NPC begins to flee") +RULE_BOOL(Combat, FleeIfNotAlone, false, "If false, mobs won't flee if other mobs are in combat with it") +RULE_BOOL(Combat, AdjustProcPerMinute, true, "") +RULE_REAL(Combat, AvgProcsPerMinute, 2.0, "") +RULE_REAL(Combat, ProcPerMinDexContrib, 0.075, "") +RULE_REAL(Combat, BaseProcChance, 0.035, "") +RULE_REAL(Combat, ProcDexDivideBy, 11000, "") +RULE_BOOL(Combat, AdjustSpecialProcPerMinute, true, "Set PPM for special abilities like HeadShot (Live does this as of 4-14)") +RULE_REAL(Combat, AvgSpecialProcsPerMinute, 2.0, "Unclear what best value is atm") +RULE_REAL(Combat, BaseHitChance, 69.0, "") +RULE_REAL(Combat, NPCBonusHitChance, 26.0, "") +RULE_REAL(Combat, HitFalloffMinor, 5.0, "hit will fall off up to 5% over the initial level range") +RULE_REAL(Combat, HitFalloffModerate, 7.0, "hit will fall off up to 7% over the three levels after the initial level range") +RULE_REAL(Combat, HitFalloffMajor, 50.0, "hit will fall off sharply if we're outside the minor and moderate range") +RULE_REAL(Combat, HitBonusPerLevel, 1.2, "You gain this % of hit for every level you are above your target") +RULE_REAL(Combat, WeaponSkillFalloff, 0.33, "For every weapon skill point that's not maxed you lose this % of hit") +RULE_REAL(Combat, ArcheryHitPenalty, 0.25, "Archery has a hit penalty to try to help balance it with the plethora of long term +hit modifiers for it") +RULE_REAL(Combat, AgiHitFactor, 0.01, "") +RULE_REAL(Combat, MinChancetoHit, 5.0, "Minimum % chance to hit with regular melee/ranged") +RULE_REAL(Combat, MaxChancetoHit, 95.0, "Maximum % chance to hit with regular melee/ranged") +RULE_INT(Combat, MinRangedAttackDist, 25, "Minimum Distance to use Ranged Attacks") +RULE_BOOL(Combat, ArcheryBonusRequiresStationary, true, "does the 2x archery bonus chance require a stationary npc") +RULE_REAL(Combat, ArcheryBaseDamageBonus, 1, "% Modifier to Base Archery Damage (.5 = 50% base damage, 1 = 100%, 2 = 200%)") +RULE_REAL(Combat, ArcheryNPCMultiplier, 1.0, "this is multiplied by the regular dmg to get the archery dmg") +RULE_BOOL(Combat, AssistNoTargetSelf, true, "when assisting a target that does not have a target: true = target self, false = leave target as was before assist (false = live like)") +RULE_INT(Combat, MaxRampageTargets, 3, "max number of people hit with rampage") +RULE_INT(Combat, DefaultRampageTargets, 1, "default number of people to hit with rampage") +RULE_BOOL(Combat, RampageHitsTarget, false, "rampage will hit the target if it still has targets left") +RULE_INT(Combat, MaxFlurryHits, 2, "max number of extra hits from flurry") +RULE_INT(Combat, MonkDamageTableBonus, 5, "% bonus monks get to their damage table calcs") +RULE_INT(Combat, FlyingKickBonus, 25, "% Modifier that this skill gets to str and skill bonuses") +RULE_INT(Combat, DragonPunchBonus, 20, "% Modifier that this skill gets to str and skill bonuses") +RULE_INT(Combat, EagleStrikeBonus, 15, "% Modifier that this skill gets to str and skill bonuses") +RULE_INT(Combat, TigerClawBonus, 10, "% Modifier that this skill gets to str and skill bonuses") +RULE_INT(Combat, RoundKickBonus, 5, "% Modifier that this skill gets to str and skill bonuses") +RULE_INT(Combat, FrenzyBonus, 0, "% Modifier to damage") +RULE_INT(Combat, BackstabBonus, 0, "% Modifier to damage") +RULE_BOOL(Combat, ProcTargetOnly, true, "true = procs will only affect our target, false = procs will affect all of our targets") +RULE_REAL(Combat, NPCACFactor, 2.25, "") +RULE_INT(Combat, ClothACSoftcap, 75, "") +RULE_INT(Combat, LeatherACSoftcap, 100, "") +RULE_INT(Combat, MonkACSoftcap, 120, "") +RULE_INT(Combat, ChainACSoftcap, 200, "") +RULE_INT(Combat, PlateACSoftcap, 300, "") +RULE_REAL(Combat, AAMitigationACFactor, 3.0, "") +RULE_REAL(Combat, WarriorACSoftcapReturn, 0.45, "") +RULE_REAL(Combat, KnightACSoftcapReturn, 0.33, "") +RULE_REAL(Combat, LowPlateChainACSoftcapReturn, 0.23, "") +RULE_REAL(Combat, LowChainLeatherACSoftcapReturn, 0.17, "") +RULE_REAL(Combat, CasterACSoftcapReturn, 0.06, "") +RULE_REAL(Combat, MiscACSoftcapReturn, 0.3, "") +RULE_BOOL(Combat, OldACSoftcapRules, false, "use old softcaps") +RULE_BOOL(Combat, UseOldDamageIntervalRules, false, "use old damage formulas for everything") +RULE_REAL(Combat, WarACSoftcapReturn, 0.3448, "new AC returns") +RULE_REAL(Combat, ClrRngMnkBrdACSoftcapReturn, 0.3030, "") +RULE_REAL(Combat, PalShdACSoftcapReturn, 0.3226, "") +RULE_REAL(Combat, DruNecWizEncMagACSoftcapReturn, 0.2000, "") +RULE_REAL(Combat, RogShmBstBerACSoftcapReturn, 0.2500, "") +RULE_REAL(Combat, SoftcapFactor, 1.88, "") +RULE_REAL(Combat, ACthac0Factor, 0.55, "") +RULE_REAL(Combat, ACthac20Factor, 0.55, "") +RULE_INT(Combat, HitCapPre20, 40, "live has it capped at 40 for whatever dumb reason... this is mainly for custom servers") +RULE_INT(Combat, HitCapPre10, 20, "live has it capped at 20, see above") +RULE_INT(Combat, MinHastedDelay, 400, "how fast we can get with haste") +RULE_REAL(Combat, AvgDefProcsPerMinute, 2.0, "") +RULE_REAL(Combat, DefProcPerMinAgiContrib, 0.075, "How much agility contributes to defensive proc rate") +RULE_INT(Combat, SpecialAttackACBonus, 15, "Percent amount of damage per AC gained for certain special attacks (damage = AC*SpecialAttackACBonus/100)") +RULE_INT(Combat, NPCFlurryChance, 20, "Chance for NPC to flurry") +RULE_BOOL (Combat,TauntOverLevel, 1, "Allows you to taunt NPC's over warriors level") +RULE_REAL (Combat,TauntSkillFalloff, 0.33, "For every taunt skill point that's not maxed you lose this % chance to taunt") +RULE_BOOL (Combat,EXPFromDmgShield, false, "Determine if damage from a damage shield counts for EXP gain") +RULE_INT(Combat, MonkACBonusWeight, 15, "") +RULE_INT(Combat, ClientStunLevel, 55, "This is the level where client kicks and bashes can stun the target") +RULE_INT(Combat, QuiverHasteCap, 1000, "Quiver haste cap 1000 on live for a while, currently 700 on live") +RULE_BOOL(Combat, UseArcheryBonusRoll, false, "Make the 51+ archery bonus require an actual roll") +RULE_INT(Combat, ArcheryBonusChance, 50, "") +RULE_INT(Combat, BerserkerFrenzyStart, 35, "") +RULE_INT(Combat, BerserkerFrenzyEnd, 45, "") +RULE_BOOL(Combat, OneProcPerWeapon, true, "If enabled, One proc per weapon per round") +RULE_BOOL(Combat, ProjectileDmgOnImpact, true, "If enabled, projectiles (ie arrows) will hit on impact, instead of instantly") +RULE_BOOL(Combat, MeleePush, true, "enable melee push") +RULE_INT(Combat, MeleePushChance, 50, "(NPCs) chance the target will be pushed. Made up, 100 actually isn't that bad") +RULE_BOOL(Combat, UseLiveCombatRounds, true, "turn this false if you don't want to worry about fixing up combat rounds for NPCs") +RULE_INT(Combat, NPCAssistCap, 5, "Maxiumium number of NPCs that will assist another NPC at once") +RULE_INT(Combat, NPCAssistCapTimer, 6000, "Time in milliseconds a NPC will take to clear assist aggro cap space") +RULE_BOOL(Combat, UseRevampHandToHand, false, "use h2h revamped dmg/delays I believe this was implemented during SoF") +RULE_BOOL(Combat, ClassicMasterWu, false, "classic master wu uses a random special, modern doesn't") +RULE_INT(Combat, LevelToStopDamageCaps, 0, "1 will effectively disable them, 20 should give basically same results as old incorrect system") +RULE_BOOL(Combat, ClassicNPCBackstab, false, "true disables npc facestab - npcs get normal attack if not behind") +RULE_BOOL(Combat, UseNPCDamageClassLevelMods, true, "Uses GetClassLevelDamageMod calc in npc_scale_manager") RULE_CATEGORY_END() RULE_CATEGORY(NPC) -RULE_INT(NPC, MinorNPCCorpseDecayTimeMS, 450000) //level<55 -RULE_INT(NPC, MajorNPCCorpseDecayTimeMS, 1500000) //level>=55 -RULE_INT(NPC, CorpseUnlockTimer, 150000) -RULE_INT(NPC, EmptyNPCCorpseDecayTimeMS, 0) -RULE_BOOL(NPC, UseItemBonusesForNonPets, true) -RULE_BOOL(NPC, UseBaneDamage, false) -RULE_INT(NPC, SayPauseTimeInSec, 5) -RULE_INT(NPC, OOCRegen, 0) -RULE_BOOL(NPC, BuffFriends, false) -RULE_BOOL(NPC, EnableNPCQuestJournal, false) -RULE_INT(NPC, LastFightingDelayMovingMin, 10000) -RULE_INT(NPC, LastFightingDelayMovingMax, 20000) -RULE_BOOL(NPC, SmartLastFightingDelayMoving, true) -RULE_BOOL(NPC, ReturnNonQuestNoDropItems, false) // Returns NO DROP items on NPCs that don't have an EVENT_TRADE sub in their script -RULE_INT(NPC, StartEnrageValue, 9) // % HP that an NPC will begin to enrage -RULE_BOOL(NPC, LiveLikeEnrage, false) // If set to true then only player controlled pets will enrage -RULE_BOOL(NPC, EnableMeritBasedFaction, false) // If set to true, faction will given in the same way as experience (solo/group/raid) -RULE_INT(NPC, NPCToNPCAggroTimerMin, 500) -RULE_INT(NPC, NPCToNPCAggroTimerMax, 6000) -RULE_BOOL(NPC, UseClassAsLastName, true) // Uses class archetype as LastName for npcs with none -RULE_BOOL(NPC, NewLevelScaling, true) // Better level scaling, use old if new formulas would break your server -RULE_INT(NPC, NPCGatePercent, 5) // % at which the NPC Will attempt to gate at. -RULE_BOOL(NPC, NPCGateNearBind, false) // Will NPC attempt to gate when near bind location? -RULE_INT(NPC, NPCGateDistanceBind, 75) // Distance from bind before NPC will attempt to gate -RULE_BOOL(NPC, NPCHealOnGate, true) // Will the NPC Heal on Gate. -RULE_REAL(NPC, NPCHealOnGateAmount, 25) // How much the npc will heal on gate if enabled. +RULE_INT(NPC, MinorNPCCorpseDecayTimeMS, 450000, "level < 55") +RULE_INT(NPC, MajorNPCCorpseDecayTimeMS, 1500000, "level >= 55") +RULE_INT(NPC, CorpseUnlockTimer, 150000, "") +RULE_INT(NPC, EmptyNPCCorpseDecayTimeMS, 0, "") +RULE_BOOL(NPC, UseItemBonusesForNonPets, true, "") +RULE_BOOL(NPC, UseBaneDamage, false, "") +RULE_INT(NPC, SayPauseTimeInSec, 5, "") +RULE_INT(NPC, OOCRegen, 0, "") +RULE_BOOL(NPC, BuffFriends, false, "") +RULE_BOOL(NPC, EnableNPCQuestJournal, false, "") +RULE_INT(NPC, LastFightingDelayMovingMin, 10000, "") +RULE_INT(NPC, LastFightingDelayMovingMax, 20000, "") +RULE_BOOL(NPC, SmartLastFightingDelayMoving, true, "") +RULE_BOOL(NPC, ReturnNonQuestNoDropItems, false, "Returns NO DROP items on NPCs that don't have an EVENT_TRADE sub in their script") +RULE_INT(NPC, StartEnrageValue, 9, "% HP that an NPC will begin to enrage") +RULE_BOOL(NPC, LiveLikeEnrage, false, "If set to true then only player controlled pets will enrage") +RULE_BOOL(NPC, EnableMeritBasedFaction, false, "If set to true, faction will given in the same way as experience (solo/group/raid)") +RULE_INT(NPC, NPCToNPCAggroTimerMin, 500, "") +RULE_INT(NPC, NPCToNPCAggroTimerMax, 6000, "") +RULE_BOOL(NPC, UseClassAsLastName, true, "Uses class archetype as LastName for npcs with none") +RULE_BOOL(NPC, NewLevelScaling, true, "Better level scaling, use old if new formulas would break your server") +RULE_INT(NPC, NPCGatePercent, 5, "% at which the NPC Will attempt to gate at") +RULE_BOOL(NPC, NPCGateNearBind, false, "Will NPC attempt to gate when near bind location?") +RULE_INT(NPC, NPCGateDistanceBind, 75, "Distance from bind before NPC will attempt to gate") +RULE_BOOL(NPC, NPCHealOnGate, true, "Will the NPC Heal on Gate") +RULE_REAL(NPC, NPCHealOnGateAmount, 25, "How much the npc will heal on gate if enabled") RULE_CATEGORY_END() RULE_CATEGORY(Aggro) -RULE_BOOL(Aggro, SmartAggroList, true) -RULE_INT(Aggro, SittingAggroMod, 35) //35% -RULE_INT(Aggro, MeleeRangeAggroMod, 10) //10% -RULE_INT(Aggro, CurrentTargetAggroMod, 0) //0% -- will prefer our current target to any other; makes it harder for our npcs to switch targets. -RULE_INT(Aggro, CriticallyWoundedAggroMod, 100) //100% -RULE_INT(Aggro, SpellAggroMod, 100) -RULE_INT(Aggro, SongAggroMod, 33) -RULE_INT(Aggro, PetSpellAggroMod, 10) -RULE_REAL(Aggro, TunnelVisionAggroMod, 0.75) //people not currently the top hate generate this much hate on a Tunnel Vision mob -RULE_INT(Aggro, MaxScalingProcAggro, 400) // Set to -1 for no limit. Maxmimum amount of aggro that HP scaling SPA effect in a proc will add. -RULE_INT(Aggro, IntAggroThreshold, 75) // Int <= this will aggro regardless of level difference. -RULE_BOOL(Aggro, AllowTickPulling, false) // tick pulling is an exploit in an NPC's call for help fixed sometime in 2006 on live -RULE_INT(Aggro, MinAggroLevel, 18) // For use with UseLevelAggro -RULE_BOOL(Aggro, UseLevelAggro, true) // MinAggroLevel rule value+ and Undead will aggro regardless of level difference. (this will disabled Rule:IntAggroThreshold if set to true) -RULE_INT(Aggro, ClientAggroCheckInterval, 6) // Interval in which clients actually check for aggro - in seconds -RULE_REAL(Aggro, PetAttackRange, 40000.0) // max squared range /pet attack works at default is 200 -RULE_BOOL(Aggro, NPCAggroMaxDistanceEnabled, true) /* If enabled, NPC's will drop aggro beyond 600 units or what is defined at the zone level */ +RULE_BOOL(Aggro, SmartAggroList, true, "") +RULE_INT(Aggro, SittingAggroMod, 35, "35%") +RULE_INT(Aggro, MeleeRangeAggroMod, 10, "10%") +RULE_INT(Aggro, CurrentTargetAggroMod, 0, "0% -- will prefer our current target to any other; makes it harder for our npcs to switch targets") +RULE_INT(Aggro, CriticallyWoundedAggroMod, 100, "100%") +RULE_INT(Aggro, SpellAggroMod, 100, "") +RULE_INT(Aggro, SongAggroMod, 33, "") +RULE_INT(Aggro, PetSpellAggroMod, 10, "") +RULE_REAL(Aggro, TunnelVisionAggroMod, 0.75, "people not currently the top hate generate this much hate on a Tunnel Vision mob") +RULE_INT(Aggro, MaxScalingProcAggro, 400, "Set to -1 for no limit. Maxmimum amount of aggro that HP scaling SPA effect in a proc will add") +RULE_INT(Aggro, IntAggroThreshold, 75, "Int <= this will aggro regardless of level difference") +RULE_BOOL(Aggro, AllowTickPulling, false, "tick pulling is an exploit in an NPC's call for help fixed sometime in 2006 on live") +RULE_INT(Aggro, MinAggroLevel, 18, "For use with UseLevelAggro") +RULE_BOOL(Aggro, UseLevelAggro, true, "MinAggroLevel rule value+ and Undead will aggro regardless of level difference. (this will disabled Rule:IntAggroThreshold if set to true)") +RULE_INT(Aggro, ClientAggroCheckInterval, 6, "Interval in which clients actually check for aggro - in seconds") +RULE_REAL(Aggro, PetAttackRange, 40000.0, "max squared range /pet attack works at default is 200") +RULE_BOOL(Aggro, NPCAggroMaxDistanceEnabled, true, "If enabled, NPC's will drop aggro beyond 600 units or what is defined at the zone level") RULE_CATEGORY_END() RULE_CATEGORY(TaskSystem) -RULE_BOOL(TaskSystem, EnableTaskSystem, true) // Globally enable or disable the Task system -RULE_INT(TaskSystem, PeriodicCheckTimer, 5) // Seconds between checks for failed tasks. Also used by the 'Touch' activity -RULE_BOOL(TaskSystem, RecordCompletedTasks, true) -RULE_BOOL(TaskSystem, RecordCompletedOptionalActivities, false) -RULE_BOOL(TaskSystem, KeepOneRecordPerCompletedTask, true) -RULE_BOOL(TaskSystem, EnableTaskProximity, true) +RULE_BOOL(TaskSystem, EnableTaskSystem, true, "Globally enable or disable the Task system") +RULE_INT(TaskSystem, PeriodicCheckTimer, 5, "Seconds between checks for failed tasks. Also used by the 'Touch' activity") +RULE_BOOL(TaskSystem, RecordCompletedTasks, true, "") +RULE_BOOL(TaskSystem, RecordCompletedOptionalActivities, false, "") +RULE_BOOL(TaskSystem, KeepOneRecordPerCompletedTask, true, "") +RULE_BOOL(TaskSystem, EnableTaskProximity, true, "") RULE_CATEGORY_END() RULE_CATEGORY(Range) -RULE_INT(Range, Say, 15) -RULE_INT(Range, Emote, 135) -RULE_INT(Range, BeginCast, 200) -RULE_INT(Range, Anims, 135) -RULE_INT(Range, SpellParticles, 135) -RULE_INT(Range, DamageMessages, 50) -RULE_INT(Range, SpellMessages, 75) -RULE_INT(Range, SongMessages, 75) -RULE_INT(Range, MobPositionUpdates, 600) -RULE_INT(Range, ClientPositionUpdates, 300) -RULE_INT(Range, ClientForceSpawnUpdateRange, 1000) -RULE_INT(Range, CriticalDamage, 80) -RULE_INT(Range, ClientNPCScan, 300) +RULE_INT(Range, Say, 15, "") +RULE_INT(Range, Emote, 135, "") +RULE_INT(Range, BeginCast, 200, "") +RULE_INT(Range, Anims, 135, "") +RULE_INT(Range, SpellParticles, 135, "") +RULE_INT(Range, DamageMessages, 50, "") +RULE_INT(Range, SpellMessages, 75, "") +RULE_INT(Range, SongMessages, 75, "") +RULE_INT(Range, MobPositionUpdates, 600, "") +RULE_INT(Range, ClientPositionUpdates, 300, "") +RULE_INT(Range, ClientForceSpawnUpdateRange, 1000, "") +RULE_INT(Range, CriticalDamage, 80, "") +RULE_INT(Range, ClientNPCScan, 300, "") RULE_CATEGORY_END() #ifdef BOTS RULE_CATEGORY(Bots) -RULE_INT(Bots, AAExpansion, 8) // Bots get AAs through this expansion -RULE_BOOL(Bots, AllowCamelCaseNames, false) // Allows the use of 'MyBot' type names -RULE_INT(Bots, CommandSpellRank, 1) // Filters bot command spells by rank (1, 2 and 3 are valid filters - any other number allows all ranks) -RULE_INT(Bots, CreationLimit, 150) // Number of bots that each account can create -RULE_BOOL(Bots, FinishBuffing, false) // Allow for buffs to complete even if the bot caster is out of mana. Only affects buffing out of combat. -RULE_BOOL(Bots, GroupBuffing, false) // Bots will cast single target buffs as group buffs, default is false for single. Does not make single target buffs work for MGB. -RULE_INT(Bots, HealRotationMaxMembers, 24) // Maximum number of heal rotation members -RULE_INT(Bots, HealRotationMaxTargets, 12) // Maximum number of heal rotation targets -RULE_REAL(Bots, ManaRegen, 2.0) // Adjust mana regen for bots, 1 is fast and higher numbers slow it down 3 is about the same as players. -RULE_BOOL(Bots, PreferNoManaCommandSpells, true) // Give sorting priority to newer no-mana spells (i.e., 'Bind Affinity') -RULE_BOOL(Bots, QuestableSpawnLimit, false) // Optional quest method to manage bot spawn limits using the quest_globals name bot_spawn_limit, see: /bazaar/Aediles_Thrall.pl -RULE_BOOL(Bots, QuestableSpells, false) // Anita Thrall's (Anita_Thrall.pl) Bot Spell Scriber quests. -RULE_INT(Bots, SpawnLimit, 71) // Number of bots a character can have spawned at one time, You + 71 bots is a 12 group pseudo-raid (bots are not raidable at this time) -RULE_BOOL(Bots, UpdatePositionWithTimer, false) // Sends a position update with every positive movement timer check -RULE_BOOL(Bots, UsePathing, true) // Bots will use node pathing when moving -RULE_BOOL(Bots, BotGroupXP, false) // Determines whether client gets xp for bots outside their group. -RULE_BOOL(Bots, BotBardUseOutOfCombatSongs, true) // Determines whether bard bots use additional out of combat songs (optional script) -RULE_BOOL(Bots, BotLevelsWithOwner, false) // Auto-updates spawned bots as owner levels/de-levels (false is original behavior) -RULE_BOOL(Bots, BotCharacterLevelEnabled, false) // Enables required level to spawn bots -RULE_INT(Bots, BotCharacterLevel, 0) // 0 as default (if level > this value you can spawn bots if BotCharacterLevelEnabled is true) -RULE_INT(Bots, CasterStopMeleeLevel, 13) // Level at which caster bots stop melee attacks -RULE_INT(Bots, AllowedClasses, 0xFFFFFFFF) // Bitmask of allowed bot classes -RULE_INT(Bots, AllowedRaces, 0xFFFFFFFF) // Bitmask of allowed bot races -RULE_INT(Bots, AllowedGenders, 0x3) // Bitmask of allowed bot genders +RULE_INT(Bots, AAExpansion, 8, "Bots get AAs through this expansion") +RULE_BOOL(Bots, AllowCamelCaseNames, false, "Allows the use of 'MyBot' type names") +RULE_INT(Bots, CommandSpellRank, 1, "Filters bot command spells by rank (1, 2 and 3 are valid filters - any other number allows all ranks)") +RULE_INT(Bots, CreationLimit, 150, "Number of bots that each account can create") +RULE_BOOL(Bots, FinishBuffing, false, "Allow for buffs to complete even if the bot caster is out of mana. Only affects buffing out of combat") +RULE_BOOL(Bots, GroupBuffing, false, "Bots will cast single target buffs as group buffs, default is false for single. Does not make single target buffs work for MGB") +RULE_INT(Bots, HealRotationMaxMembers, 24, "Maximum number of heal rotation members") +RULE_INT(Bots, HealRotationMaxTargets, 12, "Maximum number of heal rotation targets") +RULE_REAL(Bots, ManaRegen, 2.0, "Adjust mana regen for bots, 1 is fast and higher numbers slow it down 3 is about the same as players") +RULE_BOOL(Bots, PreferNoManaCommandSpells, true, "Give sorting priority to newer no-mana spells (i.e., 'Bind Affinity')") +RULE_BOOL(Bots, QuestableSpawnLimit, false, "Optional quest method to manage bot spawn limits using the quest_globals name bot_spawn_limit, see: /bazaar/Aediles_Thrall.pl") +RULE_BOOL(Bots, QuestableSpells, false, "Anita Thrall's (Anita_Thrall.pl) Bot Spell Scriber quests") +RULE_INT(Bots, SpawnLimit, 71, "Number of bots a character can have spawned at one time, You + 71 bots is a 12 group pseudo-raid (bots are not raidable at this time)") +RULE_BOOL(Bots, UpdatePositionWithTimer, false, "Sends a position update with every positive movement timer check") +RULE_BOOL(Bots, UsePathing, true, "Bots will use node pathing when moving") +RULE_BOOL(Bots, BotGroupXP, false, "Determines whether client gets xp for bots outside their group") +RULE_BOOL(Bots, BotBardUseOutOfCombatSongs, true, "Determines whether bard bots use additional out of combat songs (optional script)") +RULE_BOOL(Bots, BotLevelsWithOwner, false, "Auto-updates spawned bots as owner levels/de-levels (false is original behavior)") +RULE_BOOL(Bots, BotCharacterLevelEnabled, false, "Enables required level to spawn bots") +RULE_INT(Bots, BotCharacterLevel, 0, "0 as default (if level > this value you can spawn bots if BotCharacterLevelEnabled is true)") +RULE_INT(Bots, CasterStopMeleeLevel, 13, "Level at which caster bots stop melee attacks") +RULE_INT(Bots, AllowedClasses, 0xFFFFFFFF, "Bitmask of allowed bot classes") +RULE_INT(Bots, AllowedRaces, 0xFFFFFFFF, "Bitmask of allowed bot races") +RULE_INT(Bots, AllowedGenders, 0x3, "Bitmask of allowed bot genders") RULE_CATEGORY_END() #endif RULE_CATEGORY(Chat) -RULE_BOOL(Chat, ServerWideOOC, true) -RULE_BOOL(Chat, ServerWideAuction, true) -RULE_BOOL(Chat, EnableVoiceMacros, true) -RULE_BOOL(Chat, EnableMailKeyIPVerification, true) -RULE_BOOL(Chat, EnableAntiSpam, true) -RULE_BOOL(Chat, SuppressCommandErrors, false) // Do not suppress by default -RULE_INT(Chat, MinStatusToBypassAntiSpam, 100) -RULE_INT(Chat, MinimumMessagesPerInterval, 4) -RULE_INT(Chat, MaximumMessagesPerInterval, 12) -RULE_INT(Chat, MaxMessagesBeforeKick, 20) -RULE_INT(Chat, IntervalDurationMS, 60000) -RULE_INT(Chat, KarmaUpdateIntervalMS, 1200000) -RULE_INT(Chat, KarmaGlobalChatLimit, 72) //amount of karma you need to be able to talk in ooc/auction/chat below the level limit -RULE_INT(Chat, GlobalChatLevelLimit, 8) //level limit you need to of reached to talk in ooc/auction/chat if your karma is too low. +RULE_BOOL(Chat, ServerWideOOC, true, "") +RULE_BOOL(Chat, ServerWideAuction, true, "") +RULE_BOOL(Chat, EnableVoiceMacros, true, "") +RULE_BOOL(Chat, EnableMailKeyIPVerification, true, "") +RULE_BOOL(Chat, EnableAntiSpam, true, "") +RULE_BOOL(Chat, SuppressCommandErrors, false, "Do not suppress by default") +RULE_INT(Chat, MinStatusToBypassAntiSpam, 100, "") +RULE_INT(Chat, MinimumMessagesPerInterval, 4, "") +RULE_INT(Chat, MaximumMessagesPerInterval, 12, "") +RULE_INT(Chat, MaxMessagesBeforeKick, 20, "") +RULE_INT(Chat, IntervalDurationMS, 60000, "") +RULE_INT(Chat, KarmaUpdateIntervalMS, 1200000, "") +RULE_INT(Chat, KarmaGlobalChatLimit, 72, "amount of karma you need to be able to talk in ooc/auction/chat below the level limit") +RULE_INT(Chat, GlobalChatLevelLimit, 8, "level limit you need to of reached to talk in ooc/auction/chat if your karma is too low") RULE_CATEGORY_END() RULE_CATEGORY(Merchant) -RULE_BOOL(Merchant, UsePriceMod, true) // Use faction/charisma price modifiers. -RULE_REAL(Merchant, SellCostMod, 1.05) // Modifier for NPC sell price. -RULE_REAL(Merchant, BuyCostMod, 0.95) // Modifier for NPC buy price. -RULE_INT(Merchant, PriceBonusPct, 4) // Determines maximum price bonus from having good faction/CHA. Value is a percent. -RULE_INT(Merchant, PricePenaltyPct, 4) // Determines maximum price penalty from having bad faction/CHA. Value is a percent. -RULE_REAL(Merchant, ChaBonusMod, 3.45) // Determines CHA cap, from 104 CHA. 3.45 is 132 CHA at apprehensive. 0.34 is 400 CHA at apprehensive. -RULE_REAL(Merchant, ChaPenaltyMod, 1.52) // Determines CHA bottom, up to 102 CHA. 1.52 is 37 CHA at apprehensive. 0.98 is 0 CHA at apprehensive. -RULE_BOOL(Merchant, EnableAltCurrencySell, true) // Enables the ability to resell items to alternate currency merchants +RULE_BOOL(Merchant, UsePriceMod, true, "Use faction/charisma price modifiers") +RULE_REAL(Merchant, SellCostMod, 1.05, "Modifier for NPC sell price") +RULE_REAL(Merchant, BuyCostMod, 0.95, "Modifier for NPC buy price") +RULE_INT(Merchant, PriceBonusPct, 4, "Determines maximum price bonus from having good faction/CHA. Value is a percent") +RULE_INT(Merchant, PricePenaltyPct, 4, "Determines maximum price penalty from having bad faction/CHA. Value is a percent") +RULE_REAL(Merchant, ChaBonusMod, 3.45, "Determines CHA cap, from 104 CHA. 3.45 is 132 CHA at apprehensive. 0.34 is 400 CHA at apprehensive") +RULE_REAL(Merchant, ChaPenaltyMod, 1.52, "Determines CHA bottom, up to 102 CHA. 1.52 is 37 CHA at apprehensive. 0.98 is 0 CHA at apprehensive") +RULE_BOOL(Merchant, EnableAltCurrencySell, true, "Enables the ability to resell items to alternate currency merchants") RULE_CATEGORY_END() RULE_CATEGORY(Bazaar) -RULE_BOOL(Bazaar, AuditTrail, false) -RULE_INT(Bazaar, MaxSearchResults, 50) -RULE_BOOL(Bazaar, EnableWarpToTrader, true) -RULE_INT(Bazaar, MaxBarterSearchResults, 200) // The max results returned in the /barter search +RULE_BOOL(Bazaar, AuditTrail, false, "") +RULE_INT(Bazaar, MaxSearchResults, 50, "") +RULE_BOOL(Bazaar, EnableWarpToTrader, true, "") +RULE_INT(Bazaar, MaxBarterSearchResults, 200, "The max results returned in the /barter search") RULE_CATEGORY_END() RULE_CATEGORY(Mail) -RULE_BOOL(Mail, EnableMailSystem, true) // If false, client won't bring up the Mail window. -RULE_INT(Mail, ExpireTrash, 0) // Time in seconds. 0 will delete all messages in the trash when the mailserver starts -RULE_INT(Mail, ExpireRead, 31536000) // 1 Year. Set to -1 for never -RULE_INT(Mail, ExpireUnread, 31536000) // 1 Year. Set to -1 for never +RULE_BOOL(Mail, EnableMailSystem, true, "If false, client won't bring up the Mail window") +RULE_INT(Mail, ExpireTrash, 0, "Time in seconds. 0 will delete all messages in the trash when the mailserver starts") +RULE_INT(Mail, ExpireRead, 31536000, "1 Year. Set to -1 for never") +RULE_INT(Mail, ExpireUnread, 31536000, "1 Year. Set to -1 for never") RULE_CATEGORY_END() RULE_CATEGORY(Channels) -RULE_INT(Channels, RequiredStatusAdmin, 251) // Required status to administer chat channels -RULE_INT(Channels, RequiredStatusListAll, 251) // Required status to list all chat channels -RULE_INT(Channels, DeleteTimer, 1440) // Empty password protected channels will be deleted after this many minutes +RULE_INT(Channels, RequiredStatusAdmin, 251, "Required status to administer chat channels") +RULE_INT(Channels, RequiredStatusListAll, 251, "Required status to list all chat channels") +RULE_INT(Channels, DeleteTimer, 1440, "Empty password protected channels will be deleted after this many minutes") RULE_CATEGORY_END() RULE_CATEGORY(EventLog) -RULE_BOOL(EventLog, RecordSellToMerchant, false) // Record sales from a player to an NPC merchant in eventlog table -RULE_BOOL(EventLog, RecordBuyFromMerchant, false) // Record purchases by a player from an NPC merchant in eventlog table +RULE_BOOL(EventLog, RecordSellToMerchant, false, "Record sales from a player to an NPC merchant in eventlog table") +RULE_BOOL(EventLog, RecordBuyFromMerchant, false, "Record purchases by a player from an NPC merchant in eventlog table") RULE_CATEGORY_END() RULE_CATEGORY(Adventure) -RULE_INT(Adventure, MinNumberForGroup, 2) -RULE_INT(Adventure, MaxNumberForGroup, 6) -RULE_INT(Adventure, MinNumberForRaid, 18) -RULE_INT(Adventure, MaxNumberForRaid, 36) -RULE_INT(Adventure, MaxLevelRange, 9) -RULE_INT(Adventure, NumberKillsForBossSpawn, 45) -RULE_REAL(Adventure, DistanceForRescueAccept, 10000.0) -RULE_REAL(Adventure, DistanceForRescueComplete, 2500.0) -RULE_INT(Adventure, ItemIDToEnablePorts, 41000) //0 to disable, otherwise using a LDoN portal will require the user to have this item. -RULE_INT(Adventure, LDoNTrapDistanceUse, 625) -RULE_REAL(Adventure, LDoNBaseTrapDifficulty, 15.0) -RULE_REAL(Adventure, LDoNCriticalFailTrapThreshold, 10.0) -RULE_INT(Adventure, LDoNAdventureExpireTime, 1800) //30 minutes to expire +RULE_INT(Adventure, MinNumberForGroup, 2, "") +RULE_INT(Adventure, MaxNumberForGroup, 6, "") +RULE_INT(Adventure, MinNumberForRaid, 18, "") +RULE_INT(Adventure, MaxNumberForRaid, 36, "") +RULE_INT(Adventure, MaxLevelRange, 9, "") +RULE_INT(Adventure, NumberKillsForBossSpawn, 45, "") +RULE_REAL(Adventure, DistanceForRescueAccept, 10000.0, "") +RULE_REAL(Adventure, DistanceForRescueComplete, 2500.0, "") +RULE_INT(Adventure, ItemIDToEnablePorts, 41000, "0 to disable, otherwise using a LDoN portal will require the user to have this item") +RULE_INT(Adventure, LDoNTrapDistanceUse, 625, "") +RULE_REAL(Adventure, LDoNBaseTrapDifficulty, 15.0, "") +RULE_REAL(Adventure, LDoNCriticalFailTrapThreshold, 10.0, "") +RULE_INT(Adventure, LDoNAdventureExpireTime, 1800, "30 minutes to expire") RULE_CATEGORY_END() RULE_CATEGORY(AA) -RULE_INT(AA, ExpPerPoint, 23976503) //Amount of exp per AA. Is the same as the amount of exp to go from level 51 to level 52. -RULE_BOOL(AA, Stacking, true) //Allow AA that belong to the same group to stack on SOF+ clients. -RULE_BOOL(AA, NormalizedAAEnabled, false) // TSS+ change to AA that normalizes AA XP to a fixed # of white con kills independent of level. -RULE_INT(AA, NormalizedAANumberOfWhiteConPerAA, 25) // The number of white con kills per AA point. -RULE_BOOL(AA, ModernAAScalingEnabled, false) // Are we linearly scaling AA XP based on total # of earned AA? -RULE_REAL(AA, ModernAAScalingStartPercent, 1000) // 1000% or 10x AA XP at the start of the scaling range -RULE_INT(AA, ModernAAScalingAAMinimum, 0) // The minimum number of earned AA before AA XP scaling begins. -RULE_INT(AA, ModernAAScalingAALimit, 4000) // The number of earned AA when AA XP scaling ends +RULE_INT(AA, ExpPerPoint, 23976503, "Amount of exp per AA. Is the same as the amount of exp to go from level 51 to level 52") +RULE_BOOL(AA, Stacking, true, "Allow AA that belong to the same group to stack on SOF+ clients") +RULE_BOOL(AA, NormalizedAAEnabled, false, "TSS+ change to AA that normalizes AA XP to a fixed # of white con kills independent of level") +RULE_INT(AA, NormalizedAANumberOfWhiteConPerAA, 25, "The number of white con kills per AA point") +RULE_BOOL(AA, ModernAAScalingEnabled, false, "Are we linearly scaling AA XP based on total # of earned AA?") +RULE_REAL(AA, ModernAAScalingStartPercent, 1000, "1000% or 10x AA XP at the start of the scaling range") +RULE_INT(AA, ModernAAScalingAAMinimum, 0, "The minimum number of earned AA before AA XP scaling begins") +RULE_INT(AA, ModernAAScalingAALimit, 4000, "The number of earned AA when AA XP scaling ends") RULE_CATEGORY_END() RULE_CATEGORY(Console) -RULE_INT(Console, SessionTimeOut, 600000) // Amount of time in ms for the console session to time out +RULE_INT(Console, SessionTimeOut, 600000, "Amount of time in ms for the console session to time out") RULE_CATEGORY_END() RULE_CATEGORY(Network) -RULE_INT(Network, ResendDelayBaseMS, 100) -RULE_REAL(Network, ResendDelayFactor, 1.5) -RULE_INT(Network, ResendDelayMinMS, 300) -RULE_INT(Network, ResendDelayMaxMS, 5000) -RULE_REAL(Network, ClientDataRate, 0.0) // KB / sec, 0.0 disabled -RULE_BOOL(Network, CompressZoneStream, true) +RULE_INT(Network, ResendDelayBaseMS, 100, "") +RULE_REAL(Network, ResendDelayFactor, 1.5, "") +RULE_INT(Network, ResendDelayMinMS, 300, "") +RULE_INT(Network, ResendDelayMaxMS, 5000, "") +RULE_REAL(Network, ClientDataRate, 0.0, "KB / sec, 0.0 disabled") +RULE_BOOL(Network, CompressZoneStream, true, "") RULE_CATEGORY_END() RULE_CATEGORY(QueryServ) -RULE_BOOL(QueryServ, PlayerLogChat, false) // Logs Player Chat -RULE_BOOL(QueryServ, PlayerLogTrades, false) // Logs Player Trades -RULE_BOOL(QueryServ, PlayerDropItems, false) // Logs Player dropping items -RULE_BOOL(QueryServ, PlayerLogHandins, false) // Logs Player Handins -RULE_BOOL(QueryServ, PlayerLogNPCKills, false) // Logs Player NPC Kills -RULE_BOOL(QueryServ, PlayerLogDeletes, false) // Logs Player Deletes -RULE_BOOL(QueryServ, PlayerLogMoves, false) // Logs Player Moves -RULE_BOOL(QueryServ, PlayerLogMerchantTransactions, false) // Logs Merchant Transactions -RULE_BOOL(QueryServ, PlayerLogPCCoordinates, false) // Logs Player Coordinates with certain events -RULE_BOOL(QueryServ, PlayerLogDropItem, false) // Logs Player Drop Item -RULE_BOOL(QueryServ, PlayerLogZone, false) // Logs Player Zone Events -RULE_BOOL(QueryServ, PlayerLogDeaths, false) // Logs Player Deaths -RULE_BOOL(QueryServ, PlayerLogConnectDisconnect, false) // Logs Player Connect Disconnect State -RULE_BOOL(QueryServ, PlayerLogLevels, false) // Logs Player Leveling/Deleveling -RULE_BOOL(QueryServ, PlayerLogAARate, false) // Logs Player AA Experience Rates -RULE_BOOL(QueryServ, PlayerLogQGlobalUpdate, false) // Logs Player QGlobal Updates -RULE_BOOL(QueryServ, PlayerLogTaskUpdates, false) // Logs Player Task Updates -RULE_BOOL(QueryServ, PlayerLogKeyringAddition, false) // Log PLayer Keyring additions -RULE_BOOL(QueryServ, PlayerLogAAPurchases, false) // Log Player AA Purchases -RULE_BOOL(QueryServ, PlayerLogTradeSkillEvents, false) // Log Player Tradeskill Transactions -RULE_BOOL(QueryServ, PlayerLogIssuedCommandes, false) // Log Player Issued Commands -RULE_BOOL(QueryServ, PlayerLogMoneyTransactions, false) // Log Player Money Transaction/Splits -RULE_BOOL(QueryServ, PlayerLogAlternateCurrencyTransactions, false) // Log Ploayer Alternate Currency Transactions +RULE_BOOL(QueryServ, PlayerLogChat, false, "Logs Player Chat") +RULE_BOOL(QueryServ, PlayerLogTrades, false, "Logs Player Trades") +RULE_BOOL(QueryServ, PlayerDropItems, false, "Logs Player dropping items") +RULE_BOOL(QueryServ, PlayerLogHandins, false, "Logs Player Handins") +RULE_BOOL(QueryServ, PlayerLogNPCKills, false, "Logs Player NPC Kills") +RULE_BOOL(QueryServ, PlayerLogDeletes, false, "Logs Player Deletes") +RULE_BOOL(QueryServ, PlayerLogMoves, false, "Logs Player Moves") +RULE_BOOL(QueryServ, PlayerLogMerchantTransactions, false, "Logs Merchant Transactions") +RULE_BOOL(QueryServ, PlayerLogPCCoordinates, false, "Logs Player Coordinates with certain events") +RULE_BOOL(QueryServ, PlayerLogDropItem, false, "Logs Player Drop Item") +RULE_BOOL(QueryServ, PlayerLogZone, false, "Logs Player Zone Events") +RULE_BOOL(QueryServ, PlayerLogDeaths, false, "Logs Player Deaths") +RULE_BOOL(QueryServ, PlayerLogConnectDisconnect, false, "Logs Player Connect Disconnect State") +RULE_BOOL(QueryServ, PlayerLogLevels, false, "Logs Player Leveling/Deleveling") +RULE_BOOL(QueryServ, PlayerLogAARate, false, "Logs Player AA Experience Rates") +RULE_BOOL(QueryServ, PlayerLogQGlobalUpdate, false, "Logs Player QGlobal Updates") +RULE_BOOL(QueryServ, PlayerLogTaskUpdates, false, "Logs Player Task Updates") +RULE_BOOL(QueryServ, PlayerLogKeyringAddition, false, "Log PLayer Keyring additions") +RULE_BOOL(QueryServ, PlayerLogAAPurchases, false, "Log Player AA Purchases") +RULE_BOOL(QueryServ, PlayerLogTradeSkillEvents, false, "Log Player Tradeskill Transactions") +RULE_BOOL(QueryServ, PlayerLogIssuedCommandes, false, "Log Player Issued Commands") +RULE_BOOL(QueryServ, PlayerLogMoneyTransactions, false, "Log Player Money Transaction/Splits") +RULE_BOOL(QueryServ, PlayerLogAlternateCurrencyTransactions, false, "Log Player Alternate Currency Transactions") RULE_CATEGORY_END() RULE_CATEGORY(Inventory) -RULE_BOOL(Inventory, EnforceAugmentRestriction, true) // Forces augment slot restrictions -RULE_BOOL(Inventory, EnforceAugmentUsability, true) // Forces augmented item usability -RULE_BOOL(Inventory, EnforceAugmentWear, true) // Forces augment wear slot validation -RULE_BOOL(Inventory, DeleteTransformationMold, true) //False if you want mold to last forever -RULE_BOOL(Inventory, AllowAnyWeaponTransformation, false) //Weapons can use any weapon transformation -RULE_BOOL(Inventory, TransformSummonedBags, false) //Transforms summoned bags into disenchanted ones instead of deleting +RULE_BOOL(Inventory, EnforceAugmentRestriction, true, "Forces augment slot restrictions") +RULE_BOOL(Inventory, EnforceAugmentUsability, true, "Forces augmented item usability") +RULE_BOOL(Inventory, EnforceAugmentWear, true, "Forces augment wear slot validation") +RULE_BOOL(Inventory, DeleteTransformationMold, true, "False if you want mold to last forever") +RULE_BOOL(Inventory, AllowAnyWeaponTransformation, false, "Weapons can use any weapon transformation") +RULE_BOOL(Inventory, TransformSummonedBags, false, "Transforms summoned bags into disenchanted ones instead of deleting") RULE_CATEGORY_END() RULE_CATEGORY(Client) -RULE_BOOL(Client, UseLiveFactionMessage, false) // Allows players to see faction adjustments like Live -RULE_BOOL(Client, UseLiveBlockedMessage, false) // Allows players to see faction adjustments like Live +RULE_BOOL(Client, UseLiveFactionMessage, false, "Allows players to see faction adjustments like Live") +RULE_BOOL(Client, UseLiveBlockedMessage, false, "Allows players to see faction adjustments like Live") RULE_CATEGORY_END() RULE_CATEGORY(Bugs) -RULE_BOOL(Bugs, ReportingSystemActive, true) // Activates bug reporting -RULE_BOOL(Bugs, UseOldReportingMethod, true) // Forces the use of the old bug reporting system -RULE_BOOL(Bugs, DumpTargetEntity, false) // Dumps the target entity, if one is provided +RULE_BOOL(Bugs, ReportingSystemActive, true, "Activates bug reporting") +RULE_BOOL(Bugs, UseOldReportingMethod, true, "Forces the use of the old bug reporting system") +RULE_BOOL(Bugs, DumpTargetEntity, false, "Dumps the target entity, if one is provided") RULE_CATEGORY_END() RULE_CATEGORY(Faction) -RULE_INT(Faction, AllyFactionMinimum, 1100) -RULE_INT(Faction, WarmlyFactionMinimum, 750) -RULE_INT(Faction, KindlyFactionMinimum, 500) -RULE_INT(Faction, AmiablyFactionMinimum, 100) -RULE_INT(Faction, IndifferentlyFactionMinimum, 0) -RULE_INT(Faction, ApprehensivelyFactionMinimum, -100) -RULE_INT(Faction, DubiouslyFactionMinimum, -500) -RULE_INT(Faction, ThreateninglyFactionMinimum, -750) +RULE_INT(Faction, AllyFactionMinimum, 1100, "") +RULE_INT(Faction, WarmlyFactionMinimum, 750, "") +RULE_INT(Faction, KindlyFactionMinimum, 500, "") +RULE_INT(Faction, AmiablyFactionMinimum, 100, "") +RULE_INT(Faction, IndifferentlyFactionMinimum, 0, "") +RULE_INT(Faction, ApprehensivelyFactionMinimum, -100, "") +RULE_INT(Faction, DubiouslyFactionMinimum, -500, "") +RULE_INT(Faction, ThreateninglyFactionMinimum, -750, "") RULE_CATEGORY_END() #undef RULE_CATEGORY diff --git a/common/shareddb.cpp b/common/shareddb.cpp index e2d482cd7..7b7c88931 100644 --- a/common/shareddb.cpp +++ b/common/shareddb.cpp @@ -1481,12 +1481,7 @@ bool SharedDatabase::UpdateCommandSettings(const std::vector('(', ')'), - join_pair( - ",", - std::pair('\'', '\''), - std::pair('\'', '\''), - injected - ) + join_pair(",", std::pair('\'', '\''), injected) ) ); diff --git a/common/string_util.h b/common/string_util.h index b3301ab90..09da9088c 100644 --- a/common/string_util.h +++ b/common/string_util.h @@ -20,6 +20,7 @@ #include #include #include +#include #include "types.h" @@ -33,27 +34,27 @@ const std::string vStringFormat(const char* format, va_list args); std::string implode(std::string glue, std::vector src); template -std::string implode(std::string glue, std::pair encapsulation, std::vector src) +std::string implode(const std::string &glue, const std::pair &encapsulation, const std::vector &src) { if (src.empty()) { return {}; } - std::ostringstream output; + std::ostringstream oss; for (const T &src_iter : src) { - output << encapsulation.first << src_iter << encapsulation.second << glue; + oss << encapsulation.first << src_iter << encapsulation.second << glue; } - std::string final_output = output.str(); - final_output.resize(output.str().size() - glue.size()); - - return final_output; + std::string output(oss.str()); + output.resize(output.size() - glue.size()); + + return output; } -// this requires that #include be included in whatever file the invocation is made from +// this requires that #include be included in whatever code file the invocation is made from template -std::vector join_pair(std::string glue, std::pair first_encap, std::pair second_encap, std::vector> src) +std::vector join_pair(const std::string &glue, const std::pair &encapsulation, const std::vector> &src) { if (src.empty()) { return {}; @@ -65,17 +66,55 @@ std::vector join_pair(std::string glue, std::pair first output.push_back( // There are issues with including in a header file that result in compile // failure. I'm not sure if this applies only within the same project or across projects. - // Since templates act similar to macros in regards to initialization, this call should be - // safe so long as the '#include' rule above is observed. + // Since templates act similar to macros in regards to initialization, this definition + // should be safe so long as the '#include' rule above is observed. fmt::format( "{}{}{}{}{}{}{}", - first_encap.first, + encapsulation.first, src_iter.first, - first_encap.second, + encapsulation.second, glue, - second_encap.first, + encapsulation.first, src_iter.second, - second_encap.second + encapsulation.second + ) + ); + } + + return output; +} + +// this requires that #include be included in whatever code file the invocation is made from +template +std::vector join_tuple(const std::string &glue, const std::pair &encapsulation, const std::vector> &src) +{ + if (src.empty()) { + return {}; + } + + std::vector output; + + for (const std::tuple &src_iter : src) { + + output.push_back( + // note: see join_pair(...) + fmt::format( + "{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}", + encapsulation.first, + std::get<0>(src_iter), + encapsulation.second, + glue, + encapsulation.first, + std::get<1>(src_iter), + encapsulation.second, + glue, + encapsulation.first, + std::get<2>(src_iter), + encapsulation.second, + glue, + encapsulation.first, + std::get<3>(src_iter), + encapsulation.second ) ); } diff --git a/world/net.cpp b/world/net.cpp index 8278f9437..f85c1b387 100644 --- a/world/net.cpp +++ b/world/net.cpp @@ -332,16 +332,28 @@ int main(int argc, char** argv) { Log(Logs::General, Logs::World_Server, "Error: Could not load skill cap data. But ignoring"); Log(Logs::General, Logs::World_Server, "Loading guilds.."); guild_mgr.LoadGuilds(); + //rules: { + if (!RuleManager::Instance()->UpdateInjectedRules(&database, "default")) { + Log(Logs::General, Logs::World_Server, "Failed to process 'Injected Rules' for ruleset 'default' update operation."); + } + + if (!RuleManager::Instance()->UpdateOrphanedRules(&database)) { + Log(Logs::General, Logs::World_Server, "Failed to process 'Orphaned Rules' update operation."); + } + std::string tmp; if (database.GetVariable("RuleSet", tmp)) { + Log(Logs::General, Logs::World_Server, "Loading rule set '%s'", tmp.c_str()); + if (!RuleManager::Instance()->LoadRules(&database, tmp.c_str(), false)) { Log(Logs::General, Logs::World_Server, "Failed to load ruleset '%s', falling back to defaults.", tmp.c_str()); } } else { + if (!RuleManager::Instance()->LoadRules(&database, "default", false)) { Log(Logs::General, Logs::World_Server, "No rule set configured, using default rules"); } @@ -349,18 +361,16 @@ int main(int argc, char** argv) { Log(Logs::General, Logs::World_Server, "Loaded default rule set 'default'", tmp.c_str()); } } - - EQEmu::InitializeDynamicLookups(); - Log(Logs::General, Logs::World_Server, "Initialized dynamic dictionary entries"); } + EQEmu::InitializeDynamicLookups(); + Log(Logs::General, Logs::World_Server, "Initialized dynamic dictionary entries"); + if (RuleB(World, ClearTempMerchantlist)) { Log(Logs::General, Logs::World_Server, "Clearing temporary merchant lists.."); database.ClearMerchantTemp(); } - RuleManager::Instance()->SaveRules(&database); - Log(Logs::General, Logs::World_Server, "Loading EQ time of day.."); TimeOfDay_Struct eqTime; time_t realtime; diff --git a/zone/bot_database.cpp b/zone/bot_database.cpp index e5511776a..ad171c1fe 100644 --- a/zone/bot_database.cpp +++ b/zone/bot_database.cpp @@ -65,12 +65,7 @@ bool BotDatabase::UpdateBotCommandSettings(const std::vector('(', ')'), - join_pair( - ",", - std::pair('\'', '\''), - std::pair('\'', '\''), - injected - ) + join_pair(",", std::pair('\'', '\''), injected) ) ); From c1b48b9931b8d97d67b524099678d1e657494d0c Mon Sep 17 00:00:00 2001 From: Uleat Date: Wed, 4 Sep 2019 22:37:17 -0400 Subject: [PATCH 05/22] Updated the rule system to automatically restore rule notes (rule-based) --- changelog.txt | 6 ++ common/rulesys.cpp | 207 +++++++++++++++++++++------------------------ common/rulesys.h | 16 ++-- common/ruletypes.h | 1 + world/net.cpp | 12 ++- 5 files changed, 116 insertions(+), 126 deletions(-) diff --git a/changelog.txt b/changelog.txt index 716325c2d..324974969 100644 --- a/changelog.txt +++ b/changelog.txt @@ -1,5 +1,11 @@ EQEMu Changelog (Started on Sept 24, 2003 15:50) ------------------------------------------------------- +== 9/04/2019 == +Uleat: Added code to restore rule notes to their original values + - The code is inactive by default + - Change rule 'World:RestoreRuleNotes' to 'true' to enable this feature + - Rule will not exist until the server is run for the first time after updating + == 9/02/2019 == Uleat: Added code to inject new rules into the 'default' ruleset and remove orphaned rules from all rulesets - New rules are only added using the 'default' ruleset - Other rulesets will need to be added manually or through in-game updates diff --git a/common/rulesys.cpp b/common/rulesys.cpp index ecf8cf6cd..413755df8 100644 --- a/common/rulesys.cpp +++ b/common/rulesys.cpp @@ -215,15 +215,17 @@ bool RuleManager::_FindRule(const char *rule_name, RuleType &type_into, uint16 & //assumes index is valid! const char *RuleManager::_GetRuleName(RuleType type, uint16 index) { switch (type) { - case IntRule: - return(s_RuleInfo[index].name); - case RealRule: - return(s_RuleInfo[index + _IntRuleCount].name); - case BoolRule: - return(s_RuleInfo[index + _IntRuleCount + _RealRuleCount].name); + case IntRule: + return(s_RuleInfo[index].name); + case RealRule: + return(s_RuleInfo[index+_IntRuleCount].name); + case BoolRule: + return(s_RuleInfo[index+_IntRuleCount+_RealRuleCount].name); + default: + break; } //should never happen - return("InvalidRule??"); + return(s_RuleInfo[_IntRuleCount+_RealRuleCount+_BoolRuleCount].name); // no need to create a string when one already exists... } //assumes index is valid! @@ -232,12 +234,14 @@ const std::string &RuleManager::_GetRuleNotes(RuleType type, uint16 index) { case IntRule: return(s_RuleInfo[index].notes); case RealRule: - return(s_RuleInfo[index + _IntRuleCount].notes); + return(s_RuleInfo[index+_IntRuleCount].notes); case BoolRule: - return(s_RuleInfo[index + _IntRuleCount + _RealRuleCount].notes); + return(s_RuleInfo[index+_IntRuleCount+_RealRuleCount].notes); + default: + break; } //should never happen - return(std::string()); + return(s_RuleInfo[_IntRuleCount+_RealRuleCount+_BoolRuleCount].notes); } bool RuleManager::LoadRules(Database *database, const char *ruleset_name, bool reload) { @@ -304,12 +308,8 @@ bool RuleManager::LoadRules(Database *database, const char *ruleset_name, bool r return true; } -// convert this to a single REPLACE query (it can handle it - currently at 608 rules) void RuleManager::SaveRules(Database *database, const char *ruleset_name) { - // tbh, UpdateRules() can probably be called since it will handle deletions of - // orphaned entries of existing rulesets as well as adding the new ones - // (it already does it as a single REPLACE query) - + if (ruleset_name != nullptr) { //saving to a specific name if (m_activeName != ruleset_name) { @@ -328,10 +328,6 @@ void RuleManager::SaveRules(Database *database, const char *ruleset_name) { Log(Logs::Detail, Logs::Rules, "Saving running rules into running rule set %s", m_activeName.c_str(), m_activeRuleset); } - // this should be all that is needed..with the exception of handling expansion-based rules... - // (those really need to be put somewhere else - probably variables) - //UpdateRules(database, m_activeName.c_str(), m_activeRuleset, true); - int i; for (i = 0; i < _IntRuleCount; i++) { _SaveRule(database, IntRule, i); @@ -377,11 +373,6 @@ void RuleManager::_SaveRule(Database *database, RuleType type, uint16 index) { database->QueryDatabase(query); } -bool RuleManager::UpdateChangedRules(Database *db, const char *ruleset_name, bool quiet_update) -{ - return false; -} - bool RuleManager::UpdateInjectedRules(Database *db, const char *ruleset_name, bool quiet_update) { std::vector database_data; @@ -472,11 +463,33 @@ bool RuleManager::UpdateInjectedRules(Database *db, const char *ruleset_name, bo } if (injected_rule_entries.size()) { - return _UpdateRules(db, ruleset_name, ruleset_id, injected_rule_entries, std::vector()); - } - else { - return true; + + std::string query( + fmt::format( + "REPLACE INTO `rule_values`(`ruleset_id`, `rule_name`, `rule_value`, `notes`) VALUES {}", + implode( + ",", + std::pair('(', ')'), + join_tuple(",", std::pair('\'', '\''), injected_rule_entries) + ) + ) + ); + + if (!db->QueryDatabase(query).Success()) { + return false; + } + + Log(Logs::General, + Logs::Status, + "%u New Rule%s Added to ruleset '%s' (%i)", + injected_rule_entries.size(), + (injected_rule_entries.size() == 1 ? "" : "s"), + ruleset_name, + ruleset_id + ); } + + return true; } bool RuleManager::UpdateOrphanedRules(Database *db, bool quiet_update) @@ -524,113 +537,83 @@ bool RuleManager::UpdateOrphanedRules(Database *db, bool quiet_update) } if (orphaned_rule_entries.size()) { - return _UpdateRules( - db, - "All Rulesets", - -1, - std::vector>(), - orphaned_rule_entries + + std::string query ( + fmt::format( + "DELETE FROM `rule_values` WHERE `rule_name` IN ({})", + implode(",", std::pair('\'', '\''), orphaned_rule_entries) + ) + ); + + if (!db->QueryDatabase(query).Success()) { + return false; + } + + Log(Logs::General, + Logs::Status, + "%u Orphaned Rule%s Deleted from 'All Rulesets' (-1)", + orphaned_rule_entries.size(), + (orphaned_rule_entries.size() == 1 ? "" : "s") ); } - else { - return true; - } + + return true; } -bool RuleManager::_UpdateRules( - Database *db, - const char *ruleset_name, - const int ruleset_id, - const std::vector> &injected, - const std::vector &orphaned -) +bool RuleManager::RestoreRuleNotes(Database *db) { - bool return_value = true; - if (!db) { return false; } - if (ruleset_name == nullptr) { + std::string query("SELECT `ruleset_id`, `rule_name`, IFNULL(`notes`, '\\0')`notes` FROM `rule_values`"); + + auto results = db->QueryDatabase(query); + if (!results.Success()) { return false; } - if (injected.size()) { + int update_count = 0; + for (auto row = results.begin(); row != results.end(); ++row) { - if (ruleset_id >= 0 && strcasecmp(ruleset_name, "All Rulesets") != 0) { + const auto &rule = [&row]() { - std::string query( - fmt::format( - "REPLACE INTO `rule_values`(`ruleset_id`, `rule_name`, `rule_value`, `notes`) VALUES {}", - implode( - ",", - std::pair('(', ')'), - join_tuple(",", std::pair('\'', '\''), injected) - ) - ) - ); - - if (!db->QueryDatabase(query).Success()) { - return_value = false; - } - else { - Log(Logs::General, - Logs::Status, - "%u New Command%s Added to ruleset '%s' (%i)", - injected.size(), - (injected.size() == 1 ? "" : "s"), - ruleset_name, - ruleset_id - ); + for (const auto &rule_iter : s_RuleInfo) { + if (strcasecmp(rule_iter.name, row[1]) == 0) { + return rule_iter; + } } + + return s_RuleInfo[_IntRuleCount+_RealRuleCount+_BoolRuleCount]; + }(); + + if (strcasecmp(rule.name, row[1]) != 0) { + continue; } - else { - return_value = false; + + if (rule.notes.compare(row[2]) == 0) { + continue; } - } - if (orphaned.size()) { + std::string query( + StringFormat( + "UPDATE `rule_values` SET `notes` = '%s' WHERE `ruleset_id` = '%i' AND `rule_name` = '%s'", + rule.notes.c_str(), + atoi(row[0]), + row[1] + ) + ); - std::string query; - - if (ruleset_id < 0 && strcasecmp(ruleset_name, "All Rulesets") == 0) { - - query = fmt::format( - "DELETE FROM `rule_values` WHERE `rule_name` IN ({})", - implode(",", std::pair('\'', '\''), orphaned) - ); - } - else if (ruleset_id >= 0 && strcasecmp(ruleset_name, "All Rulesets") != 0) { - - query = fmt::format( - "DELETE FROM `rule_values` WHERE `ruleset_id` = '%i' AND `rule_name` IN ({})", - ruleset_id, - implode(",", std::pair('\'', '\''), orphaned) - ); + if (!db->QueryDatabase(query).Success()) { + continue; } - if (query.size() > 0) { - - if (!db->QueryDatabase(query).Success()) { - return_value = false; - } - else { - Log(Logs::General, - Logs::Status, - "%u Orphaned Command%s Deleted from ruleset '%s' (%i)", - orphaned.size(), - (orphaned.size() == 1 ? "" : "s"), - ruleset_name, - ruleset_id - ); - } - } - else { - return_value = false; - } + ++update_count; } - return return_value; + if (update_count > 0) { + Log(Logs::General, Logs::Status, "%u Rule Note%s Restored", update_count, (update_count == 1 ? "" : "s")); + } } int RuleManager::GetRulesetID(Database *database, const char *ruleset_name) { diff --git a/common/rulesys.h b/common/rulesys.h index 4ade97983..e9d3365fe 100644 --- a/common/rulesys.h +++ b/common/rulesys.h @@ -97,6 +97,9 @@ public: static const char *GetRuleName(IntType t) { return(s_RuleInfo[t].name); } static const char *GetRuleName(RealType t) { return(s_RuleInfo[t+_IntRuleCount].name); } static const char *GetRuleName(BoolType t) { return(s_RuleInfo[t+_IntRuleCount+_RealRuleCount].name); } + static const std::string &GetRuleNotes(IntType t) { return(s_RuleInfo[t].notes); } + static const std::string &GetRuleNotes(RealType t) { return(s_RuleInfo[t+_IntRuleCount].notes); } + static const std::string &GetRuleNotes(BoolType t) { return(s_RuleInfo[t+_IntRuleCount+_RealRuleCount].notes); } static uint32 CountRules() { return(_RulesCount); } static CategoryType FindCategory(const char *catname); bool ListRules(const char *catname, std::vector &into); @@ -113,9 +116,9 @@ public: void ResetRules(bool reload = false); bool LoadRules(Database *db, const char *ruleset = nullptr, bool reload = false); void SaveRules(Database *db, const char *ruleset = nullptr); - bool UpdateChangedRules(Database *db, const char *ruleset_name, bool quiet_update = false); bool UpdateInjectedRules(Database *db, const char *ruleset_name, bool quiet_update = false); bool UpdateOrphanedRules(Database *db, bool quiet_update = false); + bool RestoreRuleNotes(Database *db); private: RuleManager(); @@ -143,21 +146,14 @@ private: static const std::string &_GetRuleNotes(RuleType type, uint16 index); static int _FindOrCreateRuleset(Database *db, const char *ruleset); void _SaveRule(Database *db, RuleType type, uint16 index); - bool _UpdateRules( - Database *db, - const char *ruleset_name, - const int ruleset_id, - const std::vector> &injected, - const std::vector &orphaned - ); - + static const char *s_categoryNames[]; typedef struct { const char *name; CategoryType category; RuleType type; uint16 rule_index; //index into its 'type' array - std::string notes; + const std::string notes; } RuleInfo; static const RuleInfo s_RuleInfo[]; diff --git a/common/ruletypes.h b/common/ruletypes.h index b8581e9f4..0e3f3cdc5 100644 --- a/common/ruletypes.h +++ b/common/ruletypes.h @@ -241,6 +241,7 @@ RULE_BOOL(World, MaxClientsSimplifiedLogic, false, "New logic that only uses Exe RULE_INT (World, TellQueueSize, 20, "") RULE_BOOL(World, StartZoneSameAsBindOnCreation, true, "Should the start zone ALWAYS be the same location as your bind?") RULE_BOOL(World, EnforceCharacterLimitAtLogin, false, "") +RULE_BOOL(World, RestoreRuleNotes, false, "Restores all database rule entry notes to their original text") RULE_CATEGORY_END() RULE_CATEGORY(Zone) diff --git a/world/net.cpp b/world/net.cpp index f85c1b387..2a2a25d05 100644 --- a/world/net.cpp +++ b/world/net.cpp @@ -335,13 +335,13 @@ int main(int argc, char** argv) { //rules: { - if (!RuleManager::Instance()->UpdateInjectedRules(&database, "default")) { - Log(Logs::General, Logs::World_Server, "Failed to process 'Injected Rules' for ruleset 'default' update operation."); - } - if (!RuleManager::Instance()->UpdateOrphanedRules(&database)) { Log(Logs::General, Logs::World_Server, "Failed to process 'Orphaned Rules' update operation."); } + + if (!RuleManager::Instance()->UpdateInjectedRules(&database, "default")) { + Log(Logs::General, Logs::World_Server, "Failed to process 'Injected Rules' for ruleset 'default' update operation."); + } std::string tmp; if (database.GetVariable("RuleSet", tmp)) { @@ -361,6 +361,10 @@ int main(int argc, char** argv) { Log(Logs::General, Logs::World_Server, "Loaded default rule set 'default'", tmp.c_str()); } } + + if (RuleB(World, RestoreRuleNotes) && !RuleManager::Instance()->RestoreRuleNotes(&database)) { + Log(Logs::General, Logs::World_Server, "Failed to process 'Restore Rule Notes' update operation."); + } } EQEmu::InitializeDynamicLookups(); From 8e1b6a23eb6cbb388fae59fa0577d8d9e8d02941 Mon Sep 17 00:00:00 2001 From: kentai Date: Thu, 5 Sep 2019 14:12:56 +1000 Subject: [PATCH 06/22] Bot Naming - View/Delete Databuckets ^bottitle ^botsuffix ^botsurname #viewbuckets #deletebucket --- zone/bot.cpp | 17 +++++- zone/bot.h | 10 +++- zone/bot_command.cpp | 135 ++++++++++++++++++++++++++++++++++++++---- zone/bot_command.h | 3 + zone/bot_database.cpp | 36 ++++++++--- zone/bot_database.h | 2 +- zone/bot_structs.h | 2 + zone/command.cpp | 80 +++++++++++++++++++++++++ zone/command.h | 2 + 9 files changed, 262 insertions(+), 25 deletions(-) diff --git a/zone/bot.cpp b/zone/bot.cpp index 971c1d1b6..cf226c82d 100644 --- a/zone/bot.cpp +++ b/zone/bot.cpp @@ -255,6 +255,18 @@ void Bot::SetBotSpellID(uint32 newSpellID) { this->npc_spells_id = newSpellID; } +void Bot::SetSurname(std::string bot_surname) { + _surname = bot_surname.substr(0, 31); +} + +void Bot::SetTitle(std::string bot_title) { + _title = bot_title.substr(0, 31); +} + +void Bot::SetSuffix(std::string bot_suffix) { + _suffix = bot_suffix.substr(0, 31); +} + uint32 Bot::GetBotArcheryRange() { const EQEmu::ItemInstance *range_inst = GetBotItem(EQEmu::invslot::slotRange); const EQEmu::ItemInstance *ammo_inst = GetBotItem(EQEmu::invslot::slotAmmo); @@ -3260,7 +3272,7 @@ bool Bot::Spawn(Client* botCharacterOwner) { else this->GetBotOwner()->CastToClient()->Message(Chat::Red, "%s save failed!", this->GetCleanName()); - // Spawn the bot at the bow owner's loc + // Spawn the bot at the bot owner's loc this->m_Position.x = botCharacterOwner->GetX(); this->m_Position.y = botCharacterOwner->GetY(); this->m_Position.z = botCharacterOwner->GetZ(); @@ -3365,6 +3377,9 @@ void Bot::FillSpawnStruct(NewSpawn_Struct* ns, Mob* ForWho) { ns->spawn.helm = helmtexture; //(GetShowHelm() ? helmtexture : 0); //0xFF; ns->spawn.equip_chest2 = texture; //0xFF; ns->spawn.show_name = true; + strcpy(ns->spawn.lastName, GetSurname().c_str()); + strcpy(ns->spawn.title, GetTitle().c_str()); + strcpy(ns->spawn.suffix, GetSuffix().c_str()); const EQEmu::ItemData* item = nullptr; const EQEmu::ItemInstance* inst = nullptr; uint32 spawnedbotid = 0; diff --git a/zone/bot.h b/zone/bot.h index 3b363748a..20348181e 100644 --- a/zone/bot.h +++ b/zone/bot.h @@ -270,7 +270,12 @@ public: bool GetNeedsHateRedux(Mob *tar); bool HasOrMayGetAggro(); void SetDefaultBotStance(); - + void SetSurname(std::string bot_surname); + void SetTitle(std::string bot_title); + void SetSuffix(std::string bot_suffix); + std::string GetSurname() { return _surname; } + std::string GetTitle() { return _title; } + std::string GetSuffix() { return _suffix; } inline virtual int32 GetMaxStat(); inline virtual int32 GetMaxResist(); inline virtual int32 GetMaxSTR(); @@ -650,6 +655,9 @@ private: uint32 _guildId; uint8 _guildRank; std::string _guildName; + std::string _surname; + std::string _title; + std::string _suffix; uint32 _lastZoneId; bool _rangerAutoWeaponSelect; BotRoleType _botRole; diff --git a/zone/bot_command.cpp b/zone/bot_command.cpp index 31270cc0f..fb811dfb6 100644 --- a/zone/bot_command.cpp +++ b/zone/bot_command.cpp @@ -1351,10 +1351,13 @@ int bot_command_init(void) bot_command_add("botspawn", "Spawns a created bot", 0, bot_subcommand_bot_spawn) || bot_command_add("botstance", "Changes the stance of a bot", 0, bot_subcommand_bot_stance) || bot_command_add("botstopmeleelevel", "Sets the level a caster or spell-casting fighter bot will stop melee combat", 0, bot_subcommand_bot_stop_melee_level) || + bot_command_add("botsuffix", "Sets a bots suffix", 0, bot_subcommand_bot_suffix) || bot_command_add("botsummon", "Summons bot(s) to your location", 0, bot_subcommand_bot_summon) || + bot_command_add("botsurname", "Sets a bots surname (last name)", 0, bot_subcommand_bot_surname) || bot_command_add("bottattoo", "Changes the Drakkin tattoo of a bot", 0, bot_subcommand_bot_tattoo) || bot_command_add("bottogglearcher", "Toggles a archer bot between melee and ranged weapon use", 0, bot_subcommand_bot_toggle_archer) || bot_command_add("bottogglehelm", "Toggles the helm visibility of a bot between shown and hidden", 0, bot_subcommand_bot_toggle_helm) || + bot_command_add("bottitle", "Sets a bots title", 0, bot_subcommand_bot_title) || bot_command_add("botupdate", "Updates a bot to reflect any level changes that you have experienced", 0, bot_subcommand_bot_update) || bot_command_add("botwoad", "Changes the Barbarian woad of a bot", 0, bot_subcommand_bot_woad) || bot_command_add("charm", "Attempts to have a bot charm your target", 0, bot_command_charm) || @@ -4408,7 +4411,7 @@ void bot_subcommand_bot_create(Client *c, const Seperator *sep) return; } std::string bot_name = sep->arg[1]; - + bot_name = ucfirst(bot_name); if (sep->arg[2][0] == '\0' || !sep->IsNumber(2)) { c->Message(m_fail, "Invalid Class!"); return; @@ -4936,17 +4939,22 @@ void bot_subcommand_bot_list(Client *c, const Seperator *sep) if (helper_command_alias_fail(c, "bot_subcommand_bot_list", sep->arg[0], "botlist")) return; if (helper_is_help_or_usage(sep->arg[1])) { - c->Message(m_usage, "usage: %s ([class] [value]) ([race] [value]) ([name] [partial-full])", sep->arg[0]); + c->Message(m_usage, "usage: %s (account) ([class] [value]) ([race] [value]) ([name] [partial-full])", sep->arg[0]); c->Message(m_note, "note: filter criteria is orderless and optional"); return; } - + bool Account = false; + int seps = 1; uint32 filter_value[FilterCount]; int name_criteria_arg = 0; memset(&filter_value, 0, sizeof(uint32) * FilterCount); int filter_mask = 0; - for (int i = 1; i < (FilterCount * 2); i += 2) { + if (strcasecmp(sep->arg[1], "account") == 0) { + Account = true; + seps = 2; + } + for (int i = seps; i < (FilterCount * 2); i += 2) { if (sep->arg[i][0] == '\0') break; @@ -4971,7 +4979,7 @@ void bot_subcommand_bot_list(Client *c, const Seperator *sep) } std::list bots_list; - if (!database.botdb.LoadBotsList(c->CharacterID(), bots_list)) { + if (!database.botdb.LoadBotsList(c->CharacterID(), bots_list, Account)) { c->Message(m_fail, "%s", BotDatabase::fail::LoadBotsList()); return; } @@ -4981,6 +4989,7 @@ void bot_subcommand_bot_list(Client *c, const Seperator *sep) } int bot_count = 0; + int bots_owned = 0; for (auto bots_iter : bots_list) { if (filter_mask) { if ((filter_mask & MaskClass) && filter_value[FilterClass] != bots_iter.Class) @@ -4996,23 +5005,26 @@ void bot_subcommand_bot_list(Client *c, const Seperator *sep) continue; } } - - c->Message(m_message, "%s is a level %u %s %s %s", - bots_iter.Name, + Bot * botCheckNotOnline = entity_list.GetBotByBotName(bots_iter.Name); + std::string botspawn_saylink = StringFormat("^botspawn %s", bots_iter.Name); + c->Message(Chat::White, "%s is a level %u %s %s %s who is owned by %s", + ((c->CharacterID() == bots_iter.Owner_ID) && (!botCheckNotOnline) ? (EQEmu::SayLinkEngine::GenerateQuestSaylink(botspawn_saylink, false, bots_iter.Name).c_str()) : (bots_iter.Name)), bots_iter.Level, Bot::RaceIdToString(bots_iter.Race).c_str(), ((bots_iter.Gender == FEMALE) ? ("Female") : ((bots_iter.Gender == MALE) ? ("Male") : ("Neuter"))), - Bot::ClassIdToString(bots_iter.Class).c_str() + Bot::ClassIdToString(bots_iter.Class).c_str(), + bots_iter.Owner ); - + if (c->CharacterID() == bots_iter.Owner_ID) { ++bots_owned; } ++bot_count; } if (!bot_count) { - c->Message(m_fail, "You have no bots meeting this criteria"); + c->Message(Chat::Red, "You have no bots meeting this criteria"); } else { - c->Message(m_action, "%i of %i bot%s shown", bot_count, bots_list.size(), ((bot_count != 1) ? ("s") : (""))); - c->Message(m_message, "Your limit is %i bot%s", RuleI(Bots, CreationLimit), ((RuleI(Bots, CreationLimit) != 1) ? ("s") : (""))); + c->Message(Chat::Yellow, "%i of %i bot%s shown.", bot_count, bots_list.size(), ((bot_count != 1) ? ("s") : (""))); + c->Message(Chat::Yellow, "%i of %i bot%s are owned by you. (You may spawn any available by clicking name)", bots_owned, bot_count, ((bot_count != 1) ? ("s") : (""))); + c->Message(Chat::White, "Your limit is %i bot%s", RuleI(Bots, CreationLimit), ((RuleI(Bots, CreationLimit) != 1) ? ("s") : (""))); } } @@ -5058,6 +5070,103 @@ void bot_subcommand_bot_out_of_combat(Client *c, const Seperator *sep) } } +void bot_subcommand_bot_surname(Client *c, const Seperator *sep) +{ + if (sep->arg[1][0] == '\0' || sep->IsNumber(1)) { + c->Message(Chat::Red, "You must specify a [surname] to use this command (use _ to define spaces or -remove to clear.)"); + return; + } + auto my_bot = ActionableBots::AsTarget_ByBot(c); + if (!my_bot) { + c->Message(Chat::Red, "You must a bot that you own to use this command"); + return; + } + if (strlen(sep->arg[1]) > 31) { + c->Message(Chat::Red, "Surname must be 31 characters or less."); + return; + } + std::string bot_surname = sep->arg[1]; + bot_surname = (bot_surname == "-remove") ? "" : bot_surname; + std::replace(bot_surname.begin(), bot_surname.end(), '_', ' '); + my_bot->SetSurname(bot_surname); + if (!database.botdb.SaveBot(my_bot)) { + c->Message(Chat::Red, BotDatabase::fail::SaveBot()); + return; + } + else { + auto outapp = new EQApplicationPacket(OP_GMLastName, sizeof(GMLastName_Struct)); + GMLastName_Struct * gmn = (GMLastName_Struct*)outapp->pBuffer; + strcpy(gmn->name, my_bot->GetCleanName()); + strcpy(gmn->gmname, my_bot->GetCleanName()); + strcpy(gmn->lastname, my_bot->GetSurname().c_str()); + gmn->unknown[0] = 1; + gmn->unknown[1] = 1; + gmn->unknown[2] = 1; + gmn->unknown[3] = 1; + entity_list.QueueClients(my_bot->CastToClient(), outapp); + safe_delete(outapp); + c->Message(Chat::Yellow, "Bot Surname Saved."); + } +} + +void bot_subcommand_bot_title(Client *c, const Seperator *sep) +{ + if (sep->arg[1][0] == '\0' || sep->IsNumber(1)) { + c->Message(Chat::Red, "You must specify a [title] to use this command. (use _ to define spaces or -remove to clear.)"); + return; + } + auto my_bot = ActionableBots::AsTarget_ByBot(c); + if (!my_bot) { + c->Message(Chat::Red, "You must a bot that you own to use this command"); + return; + } + if (strlen(sep->arg[1]) > 31) { + c->Message(Chat::Red, "Title must be 31 characters or less."); + return; + } + std::string bot_title = sep->arg[1]; + bot_title = (bot_title == "-remove") ? "" : bot_title; + std::replace(bot_title.begin(), bot_title.end(), '_', ' '); + my_bot->SetTitle(bot_title); + if (!database.botdb.SaveBot(my_bot)) { + c->Message(Chat::Red, BotDatabase::fail::SaveBot()); + return; + } + else { + my_bot->CastToClient()->SetAATitle(my_bot->GetTitle().c_str()); + c->Message(Chat::Yellow, "Bot Title Saved."); + } +} + +void bot_subcommand_bot_suffix(Client *c, const Seperator *sep) +{ + if (sep->arg[1][0] == '\0' || sep->IsNumber(1)) { + c->Message(Chat::Red, "You must specify a [suffix] to use this command. (use _ to define spaces or -remove to clear.)"); + return; + } + auto my_bot = ActionableBots::AsTarget_ByBot(c); + if (!my_bot) { + c->Message(Chat::Red, "You must a bot that you own to use this command"); + return; + } + if (strlen(sep->arg[1]) > 31) { + c->Message(Chat::Red, "Suffix must be 31 characters or less."); + return; + } + std::string bot_suffix = sep->arg[1]; + bot_suffix = (bot_suffix == "-remove") ? "" : bot_suffix; + std::replace(bot_suffix.begin(), bot_suffix.end(), '_', ' '); + my_bot->SetSuffix(bot_suffix); + if (!database.botdb.SaveBot(my_bot)) { + c->Message(Chat::Red, BotDatabase::fail::SaveBot()); + return; + } + else { + my_bot->CastToClient()->SetTitleSuffix(my_bot->GetSuffix().c_str()); + c->Message(Chat::Yellow, "Bot Suffix Saved."); + } +} + void bot_subcommand_bot_report(Client *c, const Seperator *sep) { if (helper_command_alias_fail(c, "bot_subcommand_bot_report", sep->arg[0], "botreport")) diff --git a/zone/bot_command.h b/zone/bot_command.h index d60238f23..c8bad1e42 100644 --- a/zone/bot_command.h +++ b/zone/bot_command.h @@ -614,8 +614,11 @@ void bot_subcommand_bot_report(Client *c, const Seperator *sep); void bot_subcommand_bot_spawn(Client *c, const Seperator *sep); void bot_subcommand_bot_stance(Client *c, const Seperator *sep); void bot_subcommand_bot_stop_melee_level(Client *c, const Seperator *sep); +void bot_subcommand_bot_suffix(Client *c, const Seperator *sep); void bot_subcommand_bot_summon(Client *c, const Seperator *sep); +void bot_subcommand_bot_surname(Client *c, const Seperator *sep); void bot_subcommand_bot_tattoo(Client *c, const Seperator *sep); +void bot_subcommand_bot_title(Client *c, const Seperator *sep); void bot_subcommand_bot_toggle_archer(Client *c, const Seperator *sep); void bot_subcommand_bot_toggle_helm(Client *c, const Seperator *sep); void bot_subcommand_bot_update(Client *c, const Seperator *sep); diff --git a/zone/bot_database.cpp b/zone/bot_database.cpp index 29d0f37e9..e677848fd 100644 --- a/zone/bot_database.cpp +++ b/zone/bot_database.cpp @@ -163,12 +163,19 @@ bool BotDatabase::LoadQuestableSpawnCount(const uint32 owner_id, int& spawn_coun return true; } -bool BotDatabase::LoadBotsList(const uint32 owner_id, std::list& bots_list) +bool BotDatabase::LoadBotsList(const uint32 owner_id, std::list& bots_list, bool ByAccount) { if (!owner_id) return false; - query = StringFormat("SELECT `bot_id`, `name`, `class`, `level`, `race`, `gender` FROM `bot_data` WHERE `owner_id` = '%u'", owner_id); + if (ByAccount == true) + query = StringFormat("SELECT bot_id, bd.`name`, bd.class, bd.`level`, bd.race, bd.gender, cd.`name` as owner, bd.owner_id, cd.account_id, cd.id" + " FROM bot_data as bd inner join character_data as cd on bd.owner_id = cd.id" + " WHERE cd.account_id = (select account_id from bot_data bd inner join character_data as cd on bd.owner_id = cd.id where bd.owner_id = '%u' LIMIT 1)" + " ORDER BY bd.owner_id", owner_id); + else + query = StringFormat("SELECT `bot_id`, `name`, `class`, `level`, `race`, `gender`, 'You' as owner, owner_id FROM `bot_data` WHERE `owner_id` = '%u'", owner_id); + auto results = database.QueryDatabase(query); if (!results.Success()) return false; @@ -186,12 +193,17 @@ bool BotDatabase::LoadBotsList(const uint32 owner_id, std::list 63) + bot_owner = bot_owner.substr(0, 63); + if (!bot_owner.empty()) + strcpy(bot_entry.Owner, bot_owner.c_str()); bot_entry.Class = atoi(row[2]); bot_entry.Level = atoi(row[3]); bot_entry.Race = atoi(row[4]); bot_entry.Gender = atoi(row[5]); - + bot_entry.Owner_ID = atoi(row[7]); bots_list.push_back(bot_entry); } @@ -266,8 +278,8 @@ bool BotDatabase::LoadBot(const uint32 bot_id, Bot*& loaded_bot) " `spells_id`," " `name`," " `last_name`," - " `title`," /* planned use[4] */ - " `suffix`," /* planned use[5] */ + " `title`," + " `suffix`," " `zone_id`," " `gender`," " `race`," @@ -364,7 +376,9 @@ bool BotDatabase::LoadBot(const uint32 bot_id, Bot*& loaded_bot) loaded_bot = new Bot(bot_id, atoi(row[0]), atoi(row[1]), atof(row[14]), atoi(row[6]), tempNPCStruct); if (loaded_bot) { loaded_bot->SetShowHelm((atoi(row[43]) > 0 ? true : false)); - + loaded_bot->SetSurname(row[3]);//maintaining outside mob::lastname to cater to spaces + loaded_bot->SetTitle(row[4]); + loaded_bot->SetSuffix(row[5]); uint32 bfd = atoi(row[44]); if (bfd < 1) bfd = 1; @@ -573,12 +587,14 @@ bool BotDatabase::SaveBot(Bot* bot_inst) " `corruption` = '%i'," " `show_helm` = '%i'," " `follow_distance` = '%i'," - " `stop_melee_level` = '%u'" + " `stop_melee_level` = '%u'," + " `title` = '%s'," + " `suffix` = '%s'" " WHERE `bot_id` = '%u'", bot_inst->GetBotOwnerCharacterID(), bot_inst->GetBotSpellID(), bot_inst->GetCleanName(), - bot_inst->GetLastName(), + bot_inst->GetSurname().c_str(), bot_inst->GetLastZoneID(), bot_inst->GetBaseGender(), bot_inst->GetBaseRace(), @@ -616,6 +632,8 @@ bool BotDatabase::SaveBot(Bot* bot_inst) ((bot_inst->GetShowHelm()) ? (1) : (0)), bot_inst->GetFollowDistance(), bot_inst->GetStopMeleeLevel(), + bot_inst->GetTitle().c_str(), + bot_inst->GetSuffix().c_str(), bot_inst->GetBotID() ); auto results = database.QueryDatabase(query); diff --git a/zone/bot_database.h b/zone/bot_database.h index 0c18eade5..dd9055227 100644 --- a/zone/bot_database.h +++ b/zone/bot_database.h @@ -50,7 +50,7 @@ public: bool QueryNameAvailablity(const std::string& bot_name, bool& available_flag); bool QueryBotCount(const uint32 owner_id, uint32& bot_count); bool LoadQuestableSpawnCount(const uint32 owner_id, int& spawn_count); - bool LoadBotsList(const uint32 owner_id, std::list& bots_list); + bool LoadBotsList(const uint32 owner_id, std::list& bots_list, bool ByAccount = false); bool LoadOwnerID(const std::string& bot_name, uint32& owner_id); bool LoadOwnerID(const uint32 bot_id, uint32& owner_id); diff --git a/zone/bot_structs.h b/zone/bot_structs.h index d54c0c042..7ba32349b 100644 --- a/zone/bot_structs.h +++ b/zone/bot_structs.h @@ -32,6 +32,8 @@ struct BotsAvailableList { uint8 Level; uint16 Race; uint8 Gender; + char Owner[64]; + uint32 Owner_ID; }; struct BotGroup { diff --git a/zone/command.cpp b/zone/command.cpp index b979716c8..c6f3adb01 100755 --- a/zone/command.cpp +++ b/zone/command.cpp @@ -185,6 +185,7 @@ int command_init(void) command_add("date", "[yyyy] [mm] [dd] [HH] [MM] - Set EQ time", 90, command_date) || command_add("dbspawn2", "[spawngroup] [respawn] [variance] - Spawn an NPC from a predefined row in the spawn2 table", 100, command_dbspawn2) || command_add("delacct", "[accountname] - Delete an account", 150, command_delacct) || + command_add("deletebucket", "[key]- Deletes data bucket", 80, command_deletebucket) || command_add("deletegraveyard", "[zone name] - Deletes the graveyard for the specified zone.", 200, command_deletegraveyard) || command_add("delpetition", "[petition number] - Delete a petition", 20, command_delpetition) || command_add("depop", "- Depop your NPC target", 50, command_depop) || @@ -418,6 +419,7 @@ int command_init(void) command_add("untraindiscs", "- Untrains all disciplines from your target.", 180, command_untraindiscs) || command_add("uptime", "[zone server id] - Get uptime of worldserver, or zone server if argument provided", 10, command_uptime) || command_add("version", "- Display current version of EQEmu server", 0, command_version) || + command_add("viewbuckets", "[search string|limit]- View data buckets, limit 50 default", 80, command_viewbuckets) || command_add("viewnpctype", "[npctype id] - Show info about an npctype", 100, command_viewnpctype) || command_add("viewpetition", "[petition number] - View a petition", 20, command_viewpetition) || command_add("wc", "[wear slot] [material] - Sends an OP_WearChange for your target", 200, command_wc) || @@ -12574,6 +12576,84 @@ void command_scale(Client *c, const Seperator *sep) } } +void command_viewbuckets(Client *c, const Seperator *sep) + { + std::string key_filter; + uint8 limit = 50; + for (int i = 1; i < 3; i++) { + if (sep->arg[i][0] == '\0') + break; + if (strcasecmp(sep->arg[i], "limit") == 0) { + limit = (uint8)atoi(sep->arg[i + 1]); + continue; + } + } + if (sep->arg[1]) { + key_filter = str_tolower(sep->arg[1]); + } + std::string query = "SELECT `id`, `key`, `value`, `expires` FROM data_buckets"; + if (!key_filter.empty()) query += StringFormat(" WHERE `key` LIKE '%%%s%%'", key_filter.c_str()); + query += StringFormat(" LIMIT %u", limit); + auto results = database.QueryDatabase(query); + if (!results.Success()) + return; + if (results.RowCount() == 0) { + c->Message(Chat::Yellow, "No data_buckets found"); + return; + } + int _ctr = 0; + // put in window for easier readability in case want command line for something else + std::string window_title = "Data Buckets"; + std::string window_text = + "" + "" + "" + "" + "" + "" + ""; + for (auto row = results.begin(); row != results.end(); ++row) { + auto id = static_cast(atoi(row[0])); + std::string key = row[1]; + std::string value = row[2]; + std::string expires = row[3]; + window_text.append(StringFormat( + "" + "" + "" + "" + "" + "", + id, + expires.c_str(), + key.c_str(), + value.c_str() + )); + _ctr++; + std::string del_saylink = StringFormat("#deletebucket %s", key.c_str()); + c->Message(Chat::Blue, "%s : %s", + EQEmu::SayLinkEngine::GenerateQuestSaylink(del_saylink, false, "Delete").c_str(), key.c_str(), " Value: ", value.c_str()); + } + window_text.append("
IDExpiresKeyValue
%u%s%s%s
"); + c->SendPopupToClient(window_title.c_str(), window_text.c_str()); + std::string response = _ctr > 0 ? StringFormat("Found %i matching data buckets", _ctr).c_str() : "No Databuckets found."; + c->Message(Chat::Yellow, response.c_str()); + c->Message(Chat::Yellow, "Usage: #viewbuckets [partial_bucket_name] ['limit' value ] - both optional (default limit 50) "); +} + +void command_deletebucket(Client *c, const Seperator *sep) +{ + if (sep->arg[1][0] == 0) { + c->Message(Chat::Yellow, "Usage: #deletebucket (key) Type #viewbuckets for a list"); + return; + } + if (DataBucket::DeleteData(sep->argplus[1])) + c->Message(Chat::Yellow, "data bucket %s deleted.", sep->argplus[1]); + else + c->Message(Chat::Red, "An error occurred deleting data bucket %s", sep->argplus[1]); + return; +} + void command_who(Client *c, const Seperator *sep) { std::string query = diff --git a/zone/command.h b/zone/command.h index af92ec3f8..df83dd3df 100644 --- a/zone/command.h +++ b/zone/command.h @@ -80,6 +80,7 @@ void command_damage(Client *c, const Seperator *sep); void command_date(Client *c, const Seperator *sep); void command_dbspawn2(Client *c, const Seperator *sep); void command_delacct(Client *c, const Seperator *sep); +void command_deletebucket(Client *c, const Seperator *sep); void command_deletegraveyard(Client *c, const Seperator *sep); void command_delpetition(Client *c, const Seperator *sep); void command_depop(Client *c, const Seperator *sep); @@ -327,6 +328,7 @@ void command_untraindisc(Client *c, const Seperator *sep); void command_untraindiscs(Client *c, const Seperator *sep); void command_uptime(Client *c, const Seperator *sep); void command_version(Client *c, const Seperator *sep); +void command_viewbuckets(Client *c, const Seperator *sep); void command_viewnpctype(Client *c, const Seperator *sep); void command_viewpetition(Client *c, const Seperator *sep); void command_wc(Client *c, const Seperator *sep); From 512880e3165dc9c9949a6ccf2cd070e221e20ff9 Mon Sep 17 00:00:00 2001 From: kentai Date: Fri, 6 Sep 2019 10:04:37 +1000 Subject: [PATCH 07/22] Combined databucket view delete commands to #databuckets --- zone/command.cpp | 74 ++++++++++++++++++++++++------------------------ zone/command.h | 3 +- 2 files changed, 38 insertions(+), 39 deletions(-) diff --git a/zone/command.cpp b/zone/command.cpp index c6f3adb01..4a35ee3e1 100755 --- a/zone/command.cpp +++ b/zone/command.cpp @@ -182,10 +182,10 @@ int command_init(void) command_add("crashtest", "- Crash the zoneserver", 255, command_crashtest) || command_add("cvs", "- Summary of client versions currently online.", 200, command_cvs) || command_add("damage", "[amount] - Damage your target", 100, command_damage) || + command_add("databuckets", "View|Delete [key] [limit]- View data buckets, limit 50 default or Delete databucket by key", 80, command_databuckets) || command_add("date", "[yyyy] [mm] [dd] [HH] [MM] - Set EQ time", 90, command_date) || command_add("dbspawn2", "[spawngroup] [respawn] [variance] - Spawn an NPC from a predefined row in the spawn2 table", 100, command_dbspawn2) || command_add("delacct", "[accountname] - Delete an account", 150, command_delacct) || - command_add("deletebucket", "[key]- Deletes data bucket", 80, command_deletebucket) || command_add("deletegraveyard", "[zone name] - Deletes the graveyard for the specified zone.", 200, command_deletegraveyard) || command_add("delpetition", "[petition number] - Delete a petition", 20, command_delpetition) || command_add("depop", "- Depop your NPC target", 50, command_depop) || @@ -419,7 +419,6 @@ int command_init(void) command_add("untraindiscs", "- Untrains all disciplines from your target.", 180, command_untraindiscs) || command_add("uptime", "[zone server id] - Get uptime of worldserver, or zone server if argument provided", 10, command_uptime) || command_add("version", "- Display current version of EQEmu server", 0, command_version) || - command_add("viewbuckets", "[search string|limit]- View data buckets, limit 50 default", 80, command_viewbuckets) || command_add("viewnpctype", "[npctype id] - Show info about an npctype", 100, command_viewnpctype) || command_add("viewpetition", "[petition number] - View a petition", 20, command_viewpetition) || command_add("wc", "[wear slot] [material] - Sends an OP_WearChange for your target", 200, command_wc) || @@ -12576,20 +12575,26 @@ void command_scale(Client *c, const Seperator *sep) } } -void command_viewbuckets(Client *c, const Seperator *sep) +void command_databuckets(Client *c, const Seperator *sep) { - std::string key_filter; - uint8 limit = 50; - for (int i = 1; i < 3; i++) { + if (sep->arg[1][0] == 0) { + c->Message(Chat::Yellow, "Usage: #databuckets view (partial key)|(limit) OR #databuckets delete (key)"); + return; + } + if (strcasecmp(sep->arg[1], "view") == 0) { + + std::string key_filter; + uint8 limit = 50; + for (int i = 2; i < 4; i++) { if (sep->arg[i][0] == '\0') - break; + break; if (strcasecmp(sep->arg[i], "limit") == 0) { limit = (uint8)atoi(sep->arg[i + 1]); continue; } } - if (sep->arg[1]) { - key_filter = str_tolower(sep->arg[1]); + if (sep->arg[2]) { + key_filter = str_tolower(sep->arg[2]); } std::string query = "SELECT `id`, `key`, `value`, `expires` FROM data_buckets"; if (!key_filter.empty()) query += StringFormat(" WHERE `key` LIKE '%%%s%%'", key_filter.c_str()); @@ -12605,13 +12610,13 @@ void command_viewbuckets(Client *c, const Seperator *sep) // put in window for easier readability in case want command line for something else std::string window_title = "Data Buckets"; std::string window_text = - "" - "" - "" - "" - "" - "" - ""; + "
IDExpiresKeyValue
" + "" + "" + "" + "" + "" + ""; for (auto row = results.begin(); row != results.end(); ++row) { auto id = static_cast(atoi(row[0])); std::string key = row[1]; @@ -12619,39 +12624,34 @@ void command_viewbuckets(Client *c, const Seperator *sep) std::string expires = row[3]; window_text.append(StringFormat( "" - "" - "" - "" - "" - "", + "" + "" + "" + "" + "", id, expires.c_str(), key.c_str(), value.c_str() - )); + )); _ctr++; - std::string del_saylink = StringFormat("#deletebucket %s", key.c_str()); - c->Message(Chat::Blue, "%s : %s", - EQEmu::SayLinkEngine::GenerateQuestSaylink(del_saylink, false, "Delete").c_str(), key.c_str(), " Value: ", value.c_str()); + std::string del_saylink = StringFormat("#databuckets delete %s", key.c_str()); + c->Message(Chat::White, "%s : %s", + EQEmu::SayLinkEngine::GenerateQuestSaylink(del_saylink, false, "Delete").c_str(), key.c_str(), " Value: ", value.c_str()); } window_text.append("
IDExpiresKeyValue
%u%s%s%s
%u%s%s%s
"); c->SendPopupToClient(window_title.c_str(), window_text.c_str()); std::string response = _ctr > 0 ? StringFormat("Found %i matching data buckets", _ctr).c_str() : "No Databuckets found."; c->Message(Chat::Yellow, response.c_str()); - c->Message(Chat::Yellow, "Usage: #viewbuckets [partial_bucket_name] ['limit' value ] - both optional (default limit 50) "); -} - -void command_deletebucket(Client *c, const Seperator *sep) -{ - if (sep->arg[1][0] == 0) { - c->Message(Chat::Yellow, "Usage: #deletebucket (key) Type #viewbuckets for a list"); + } + else if (strcasecmp(sep->arg[1], "delete") == 0) + { + if (DataBucket::DeleteData(sep->argplus[2])) + c->Message(Chat::Yellow, "data bucket %s deleted.", sep->argplus[2]); + else + c->Message(Chat::Red, "An error occurred deleting data bucket %s", sep->argplus[2]); return; } - if (DataBucket::DeleteData(sep->argplus[1])) - c->Message(Chat::Yellow, "data bucket %s deleted.", sep->argplus[1]); - else - c->Message(Chat::Red, "An error occurred deleting data bucket %s", sep->argplus[1]); - return; } void command_who(Client *c, const Seperator *sep) diff --git a/zone/command.h b/zone/command.h index df83dd3df..b1b488d49 100644 --- a/zone/command.h +++ b/zone/command.h @@ -77,10 +77,10 @@ void command_crashtest(Client *c, const Seperator *sep); void command_cvs(Client *c, const Seperator *sep); void command_d1(Client *c, const Seperator *sep); void command_damage(Client *c, const Seperator *sep); +void command_databuckets(Client *c, const Seperator *sep); void command_date(Client *c, const Seperator *sep); void command_dbspawn2(Client *c, const Seperator *sep); void command_delacct(Client *c, const Seperator *sep); -void command_deletebucket(Client *c, const Seperator *sep); void command_deletegraveyard(Client *c, const Seperator *sep); void command_delpetition(Client *c, const Seperator *sep); void command_depop(Client *c, const Seperator *sep); @@ -328,7 +328,6 @@ void command_untraindisc(Client *c, const Seperator *sep); void command_untraindiscs(Client *c, const Seperator *sep); void command_uptime(Client *c, const Seperator *sep); void command_version(Client *c, const Seperator *sep); -void command_viewbuckets(Client *c, const Seperator *sep); void command_viewnpctype(Client *c, const Seperator *sep); void command_viewpetition(Client *c, const Seperator *sep); void command_wc(Client *c, const Seperator *sep); From 96103b09e0532b4096c547775139a7dd78e86609 Mon Sep 17 00:00:00 2001 From: Uleat Date: Thu, 5 Sep 2019 21:01:47 -0400 Subject: [PATCH 08/22] Fix for non-fmtlib related linux build failure --- common/rulesys.cpp | 4 ++-- zone/lua_general.cpp | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/common/rulesys.cpp b/common/rulesys.cpp index 413755df8..ac5405726 100644 --- a/common/rulesys.cpp +++ b/common/rulesys.cpp @@ -401,7 +401,7 @@ bool RuleManager::UpdateInjectedRules(Database *db, const char *ruleset_name, bo } // build database data entries - for (auto &row : results) { + for (auto row : results) { database_data.push_back(std::string(row[0])); } @@ -519,7 +519,7 @@ bool RuleManager::UpdateOrphanedRules(Database *db, bool quiet_update) } // build orphaned entries - for (auto &row : results) { + for (auto row : results) { const auto &rd_iter = std::find(rule_data.begin(), rule_data.end(), row[0]); if (rd_iter == rule_data.end()) { diff --git a/zone/lua_general.cpp b/zone/lua_general.cpp index 4dddd887d..99f3387d8 100644 --- a/zone/lua_general.cpp +++ b/zone/lua_general.cpp @@ -2327,17 +2327,17 @@ luabind::scope lua_register_rules_const() { return luabind::class_("Rule") .enum_("constants") [ -#define RULE_INT(cat, rule, default_value) \ +#define RULE_INT(cat, rule, default_value, notes) \ luabind::value(#rule, RuleManager::Int__##rule), #include "../common/ruletypes.h" luabind::value("_IntRuleCount", RuleManager::_IntRuleCount), #undef RULE_INT -#define RULE_REAL(cat, rule, default_value) \ +#define RULE_REAL(cat, rule, default_value, notes) \ luabind::value(#rule, RuleManager::Real__##rule), #include "../common/ruletypes.h" luabind::value("_RealRuleCount", RuleManager::_RealRuleCount), #undef RULE_REAL -#define RULE_BOOL(cat, rule, default_value) \ +#define RULE_BOOL(cat, rule, default_value, notes) \ luabind::value(#rule, RuleManager::Bool__##rule), #include "../common/ruletypes.h" luabind::value("_BoolRuleCount", RuleManager::_BoolRuleCount) From fcaa685e777e055c863711e5e6ec53db99068f2e Mon Sep 17 00:00:00 2001 From: Uleat Date: Thu, 5 Sep 2019 23:00:46 -0400 Subject: [PATCH 09/22] Hack fix for differences in Windows-Linux template generation techniques --- common/string_util.h | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/common/string_util.h b/common/string_util.h index 09da9088c..7936eaec5 100644 --- a/common/string_util.h +++ b/common/string_util.h @@ -22,6 +22,11 @@ #include #include +#ifndef _WIN32 +// this doesn't appear to affect linux-based systems..need feedback for _WIN64 +#include +#endif + #include "types.h" //std::string based @@ -52,7 +57,7 @@ std::string implode(const std::string &glue, const std::pair &encaps return output; } -// this requires that #include be included in whatever code file the invocation is made from +// _WIN32 builds require that #include be included in whatever code file the invocation is made from (no header files) template std::vector join_pair(const std::string &glue, const std::pair &encapsulation, const std::vector> &src) { @@ -64,10 +69,7 @@ std::vector join_pair(const std::string &glue, const std::pair &src_iter : src) { output.push_back( - // There are issues with including in a header file that result in compile - // failure. I'm not sure if this applies only within the same project or across projects. - // Since templates act similar to macros in regards to initialization, this definition - // should be safe so long as the '#include' rule above is observed. + fmt::format( "{}{}{}{}{}{}{}", encapsulation.first, @@ -84,7 +86,7 @@ std::vector join_pair(const std::string &glue, const std::pair be included in whatever code file the invocation is made from +// _WIN32 builds require that #include be included in whatever code file the invocation is made from (no header files) template std::vector join_tuple(const std::string &glue, const std::pair &encapsulation, const std::vector> &src) { @@ -97,7 +99,7 @@ std::vector join_tuple(const std::string &glue, const std::pair &src_iter : src) { output.push_back( - // note: see join_pair(...) + fmt::format( "{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}", encapsulation.first, From 8673aec9fd86d89480ff7732ba47c90b74966436 Mon Sep 17 00:00:00 2001 From: Uleat Date: Fri, 6 Sep 2019 20:04:08 -0400 Subject: [PATCH 10/22] Oops! StringFormat wasn't suppose to make into final --- common/rulesys.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/common/rulesys.cpp b/common/rulesys.cpp index ac5405726..8a765aee4 100644 --- a/common/rulesys.cpp +++ b/common/rulesys.cpp @@ -596,10 +596,10 @@ bool RuleManager::RestoreRuleNotes(Database *db) } std::string query( - StringFormat( - "UPDATE `rule_values` SET `notes` = '%s' WHERE `ruleset_id` = '%i' AND `rule_name` = '%s'", - rule.notes.c_str(), - atoi(row[0]), + fmt::format( + "UPDATE `rule_values` SET `notes` = '{}' WHERE `ruleset_id` = '{}' AND `rule_name` = '{}'", + EscapeString(rule.notes), + row[0], row[1] ) ); From 1515785adae60f60ada508f35dc600e3a53a317a Mon Sep 17 00:00:00 2001 From: Uleat Date: Fri, 6 Sep 2019 20:43:21 -0400 Subject: [PATCH 11/22] Added count reports to command injection/orphan code --- common/shareddb.cpp | 14 ++++++++++++++ zone/bot_database.cpp | 14 ++++++++++++++ 2 files changed, 28 insertions(+) diff --git a/common/shareddb.cpp b/common/shareddb.cpp index 7b7c88931..4cbfea652 100644 --- a/common/shareddb.cpp +++ b/common/shareddb.cpp @@ -1488,6 +1488,13 @@ bool SharedDatabase::UpdateCommandSettings(const std::vector Date: Sat, 7 Sep 2019 23:23:08 +0200 Subject: [PATCH 12/22] git submodule init/update must be executed from the top level working tree Build is failing as the submodules are not installed. --- utils/scripts/eqemu_server.pl | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/utils/scripts/eqemu_server.pl b/utils/scripts/eqemu_server.pl index 042c3d078..e3a051ef7 100644 --- a/utils/scripts/eqemu_server.pl +++ b/utils/scripts/eqemu_server.pl @@ -399,11 +399,13 @@ sub build_linux_source { print `git clone https://github.com/EQEmu/Server.git`; mkdir($source_dir . "/Server/build") if (!-e $source_dir . "/Server/build"); - chdir($source_dir . "/Server/build"); + chdir($source_dir . "/Server"); print `git submodule init`; print `git submodule update`; + chdir($source_dir . "/Server/build"); + print "Generating CMake build files...\n"; if ($os_flavor eq "fedora_core") { print `cmake $cmake_options -DEQEMU_BUILD_LOGIN=ON -DEQEMU_BUILD_LUA=ON -DLUA_INCLUDE_DIR=/usr/include/lua-5.1/ -G "Unix Makefiles" ..`; From f698571f35d5e6439d76ef3e06e21f60a90a6b84 Mon Sep 17 00:00:00 2001 From: MIchael Bastian <31563886+mibastian@users.noreply.github.com> Date: Sun, 8 Sep 2019 00:10:31 +0200 Subject: [PATCH 13/22] The RHEL/CentOS 6/7 cmake prerequisites RHEL/CentOS 6/7 are still on cmake version 2. Install cmake3 out of epel and set as primary alternative. Note: Might break with RHEL/CentOS 8 --- utils/scripts/linux_installer/install.sh | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/utils/scripts/linux_installer/install.sh b/utils/scripts/linux_installer/install.sh index 6af4a9df3..5cef4ab8b 100644 --- a/utils/scripts/linux_installer/install.sh +++ b/utils/scripts/linux_installer/install.sh @@ -153,7 +153,7 @@ elif [[ "$OS" == "red_hat" ]]; then yum -y install \ open-vm-tools \ vim \ - cmake \ + cmake3 \ boost-* \ zlib-devel \ mariadb \ @@ -178,6 +178,12 @@ elif [[ "$OS" == "red_hat" ]]; then "Development Tools" \ "Basic Web Server" \ "Compatibility Libraries" + # Deal with the cmake 3 prerequisite on RHEL/CentOS 6/7 Note: Might break with RHEL/CentOS 8 + alternatives --install /usr/local/bin/cmake cmake /usr/bin/cmake3 20 \ + --slave /usr/local/bin/ctest ctest /usr/bin/ctest3 \ + --slave /usr/local/bin/cpack cpack /usr/bin/cpack3 \ + --slave /usr/local/bin/ccmake ccmake /usr/bin/ccmake3 \ + --family cmake elif [[ "$OS" == "fedora_core" ]]; then # Do Fedora stuff From fec567c2f3011fe27d8ebef838279211b71fad30 Mon Sep 17 00:00:00 2001 From: Uleat Date: Sat, 7 Sep 2019 21:21:46 -0400 Subject: [PATCH 14/22] Updated Command Update code to report after each process handling rather than at the end --- common/shareddb.cpp | 15 +++++++++------ common/shareddb.h | 3 ++- zone/bot_command.cpp | 38 +++++++++++++++++++++++--------------- zone/bot_database.cpp | 15 +++++++++------ zone/bot_database.h | 3 ++- zone/command.cpp | 38 +++++++++++++++++++++++--------------- 6 files changed, 68 insertions(+), 44 deletions(-) diff --git a/common/shareddb.cpp b/common/shareddb.cpp index 4cbfea652..d24104a72 100644 --- a/common/shareddb.cpp +++ b/common/shareddb.cpp @@ -1470,10 +1470,8 @@ bool SharedDatabase::GetCommandSettings(std::map> &injected, const std::vector &orphaned) +bool SharedDatabase::UpdateInjectedCommandSettings(const std::vector> &injected) { - bool return_value = true; - if (injected.size()) { std::string query = fmt::format( @@ -1486,7 +1484,7 @@ bool SharedDatabase::UpdateCommandSettings(const std::vector &orphaned) +{ if (orphaned.size()) { std::string query = fmt::format( @@ -1505,7 +1508,7 @@ bool SharedDatabase::UpdateCommandSettings(const std::vector>> &command_settings); - bool UpdateCommandSettings(const std::vector> &injected, const std::vector &orphaned); + bool UpdateInjectedCommandSettings(const std::vector> &injected); + bool UpdateOrphanedCommandSettings(const std::vector &orphaned); uint32 GetTotalTimeEntitledOnAccount(uint32 AccountID); void SetMailKey(int CharID, int IPAddress, int MailKey); std::string GetMailKey(int CharID, bool key_only = false); diff --git a/zone/bot_command.cpp b/zone/bot_command.cpp index 656a1131a..391f55dd7 100644 --- a/zone/bot_command.cpp +++ b/zone/bot_command.cpp @@ -1429,6 +1429,26 @@ int bot_command_init(void) std::vector> injected_bot_command_settings; std::vector orphaned_bot_command_settings; + for (auto bcs_iter : bot_command_settings) { + + auto bcl_iter = bot_command_list.find(bcs_iter.first); + if (bcl_iter == bot_command_list.end()) { + + orphaned_bot_command_settings.push_back(bcs_iter.first); + Log(Logs::General, + Logs::Status, + "Bot Command '%s' no longer exists... Deleting orphaned entry from `bot_command_settings` table...", + bcs_iter.first.c_str() + ); + } + } + + if (orphaned_bot_command_settings.size()) { + if (!database.botdb.UpdateOrphanedBotCommandSettings(orphaned_bot_command_settings)) { + Log(Logs::General, Logs::Zone_Server, "Failed to process 'Orphaned Bot Commands' update operation."); + } + } + auto working_bcl = bot_command_list; for (auto working_bcl_iter : working_bcl) { @@ -1493,23 +1513,11 @@ int bot_command_init(void) } } - for (auto bcs_iter : bot_command_settings) { - - auto bcl_iter = bot_command_list.find(bcs_iter.first); - if (bcl_iter == bot_command_list.end()) { - - orphaned_bot_command_settings.push_back(bcs_iter.first); - Log(Logs::General, - Logs::Status, - "Bot Command '%s' no longer exists... Deleting orphaned entry from `bot_command_settings` table...", - bcs_iter.first.c_str() - ); + if (injected_bot_command_settings.size()) { + if (!database.botdb.UpdateInjectedBotCommandSettings(injected_bot_command_settings)) { + Log(Logs::General, Logs::Zone_Server, "Failed to process 'Injected Bot Commands' update operation."); } } - - if (injected_bot_command_settings.size() || orphaned_bot_command_settings.size()) { - database.botdb.UpdateBotCommandSettings(injected_bot_command_settings, orphaned_bot_command_settings); - } bot_command_dispatch = bot_command_real_dispatch; diff --git a/zone/bot_database.cpp b/zone/bot_database.cpp index 80c422c08..db2f2018b 100644 --- a/zone/bot_database.cpp +++ b/zone/bot_database.cpp @@ -54,10 +54,8 @@ bool BotDatabase::LoadBotCommandSettings(std::map> &injected, const std::vector &orphaned) +bool BotDatabase::UpdateInjectedBotCommandSettings(const std::vector> &injected) { - bool return_value = true; - if (injected.size()) { query = fmt::format( @@ -70,7 +68,7 @@ bool BotDatabase::UpdateBotCommandSettings(const std::vector &orphaned) +{ if (orphaned.size()) { query = fmt::format( @@ -89,7 +92,7 @@ bool BotDatabase::UpdateBotCommandSettings(const std::vector>> &bot_command_settings); - bool UpdateBotCommandSettings(const std::vector> &injected, const std::vector &orphaned); + bool UpdateInjectedBotCommandSettings(const std::vector> &injected); + bool UpdateOrphanedBotCommandSettings(const std::vector &orphaned); bool LoadBotSpellCastingChances(); diff --git a/zone/command.cpp b/zone/command.cpp index 2a0a07408..db9cd5524 100755 --- a/zone/command.cpp +++ b/zone/command.cpp @@ -456,6 +456,26 @@ int command_init(void) std::vector> injected_command_settings; std::vector orphaned_command_settings; + for (auto cs_iter : command_settings) { + + auto cl_iter = commandlist.find(cs_iter.first); + if (cl_iter == commandlist.end()) { + + orphaned_command_settings.push_back(cs_iter.first); + Log(Logs::General, + Logs::Status, + "Command '%s' no longer exists... Deleting orphaned entry from `command_settings` table...", + cs_iter.first.c_str() + ); + } + } + + if (orphaned_command_settings.size()) { + if (!database.UpdateOrphanedCommandSettings(orphaned_command_settings)) { + Log(Logs::General, Logs::Zone_Server, "Failed to process 'Orphaned Commands' update operation."); + } + } + auto working_cl = commandlist; for (auto working_cl_iter : working_cl) { @@ -520,24 +540,12 @@ int command_init(void) } } - for (auto cs_iter : command_settings) { - - auto cl_iter = commandlist.find(cs_iter.first); - if (cl_iter == commandlist.end()) { - - orphaned_command_settings.push_back(cs_iter.first); - Log(Logs::General, - Logs::Status, - "Command '%s' no longer exists... Deleting orphaned entry from `command_settings` table...", - cs_iter.first.c_str() - ); + if (injected_command_settings.size()) { + if (!database.UpdateInjectedCommandSettings(injected_command_settings)) { + Log(Logs::General, Logs::Zone_Server, "Failed to process 'Injected Commands' update operation."); } } - if (injected_command_settings.size() || orphaned_command_settings.size()) { - database.UpdateCommandSettings(injected_command_settings, orphaned_command_settings); - } - command_dispatch = command_realdispatch; return commandcount; From 0041d3e0da9325ea86aef8d39841589e3aa86176 Mon Sep 17 00:00:00 2001 From: Uleat Date: Sat, 7 Sep 2019 22:15:12 -0400 Subject: [PATCH 15/22] Manual revert of code from commit to fix clients not dropping group..this still needs to be addressed --- zone/client_packet.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/zone/client_packet.cpp b/zone/client_packet.cpp index d5dde9750..94b014243 100644 --- a/zone/client_packet.cpp +++ b/zone/client_packet.cpp @@ -3956,9 +3956,11 @@ void Client::Handle_OP_Camp(const EQApplicationPacket *app) #ifdef BOTS // This block is necessary to clean up any bot objects owned by a Client Bot::BotOrderCampAll(this); - auto group = GetGroup(); - if (group && group->GroupCount() < 2) - group->DisbandGroup(); + // Evidently, this is bad under certain conditions and causes crashes... + // Group and Raid code really needs to be overhauled to account for non-client types (mercs and bots) + //auto group = GetGroup(); + //if (group && group->GroupCount() < 2) + // group->DisbandGroup(); #endif if (IsLFP()) worldserver.StopLFP(CharacterID()); From 52069835130c93a9f3f88fdf7b687ec868075c43 Mon Sep 17 00:00:00 2001 From: Uleat Date: Sat, 7 Sep 2019 23:18:12 -0400 Subject: [PATCH 16/22] Removed rule-based check for rule note updates --- common/ruletypes.h | 1 - world/net.cpp | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/common/ruletypes.h b/common/ruletypes.h index 9085fafea..420322fac 100644 --- a/common/ruletypes.h +++ b/common/ruletypes.h @@ -241,7 +241,6 @@ RULE_BOOL(World, MaxClientsSimplifiedLogic, false, "New logic that only uses Exe RULE_INT (World, TellQueueSize, 20, "") RULE_BOOL(World, StartZoneSameAsBindOnCreation, true, "Should the start zone ALWAYS be the same location as your bind?") RULE_BOOL(World, EnforceCharacterLimitAtLogin, false, "") -RULE_BOOL(World, RestoreRuleNotes, false, "Restores all database rule entry notes to their original text") RULE_CATEGORY_END() RULE_CATEGORY(Zone) diff --git a/world/net.cpp b/world/net.cpp index fe8d2a593..b7bf2189f 100644 --- a/world/net.cpp +++ b/world/net.cpp @@ -362,7 +362,7 @@ int main(int argc, char** argv) { } } - if (RuleB(World, RestoreRuleNotes) && !RuleManager::Instance()->RestoreRuleNotes(&database)) { + if (!RuleManager::Instance()->RestoreRuleNotes(&database)) { Log(Logs::General, Logs::World_Server, "Failed to process 'Restore Rule Notes' update operation."); } } From 420667a35b7761078f87906fc042b4caf266c724 Mon Sep 17 00:00:00 2001 From: Uleat Date: Sun, 8 Sep 2019 17:02:49 -0400 Subject: [PATCH 17/22] Reworked LoadFactionData() to use minimal database queries --- zone/zonedb.cpp | 134 +++++++++++++++++++++++++++++++++++------------- 1 file changed, 98 insertions(+), 36 deletions(-) diff --git a/zone/zonedb.cpp b/zone/zonedb.cpp index 91f456768..2f0a3def2 100755 --- a/zone/zonedb.cpp +++ b/zone/zonedb.cpp @@ -15,6 +15,7 @@ #include #include +#include extern Zone* zone; @@ -4072,60 +4073,121 @@ bool ZoneDatabase::SetCharacterFactionLevel(uint32 char_id, int32 faction_id, in bool ZoneDatabase::LoadFactionData() { - std::string query = "SELECT MAX(id) FROM faction_list"; - auto results = QueryDatabase(query); - if (!results.Success()) { + std::string query("SELECT MAX(`id`) FROM `faction_list`"); + + auto faction_max_results = QueryDatabase(query); + if (!faction_max_results.Success() || faction_max_results.RowCount() == 0) { return false; } - if (results.RowCount() == 0) - return false; + auto fmr_row = faction_max_results.begin(); - auto row = results.begin(); + max_faction = atoul(fmr_row[0]); + faction_array = new Faction *[max_faction + 1]; - max_faction = row[0] ? atoi(row[0]) : 0; - faction_array = new Faction*[max_faction+1]; - for(unsigned int index=0; index faction_ids; + + // load factions + query = "SELECT `id`, `name`, `base` FROM `faction_list`"; - query = "SELECT id, name, base FROM faction_list"; - results = QueryDatabase(query); - if (!results.Success()) { + auto faction_results = QueryDatabase(query); + if (!faction_results.Success()) { return false; } - for (row = results.begin(); row != results.end(); ++row) { - uint32 index = atoi(row[0]); + for (auto fr_row : faction_results) { + + uint32 index = atoul(fr_row[0]); + if (index > max_faction) { + Log(Logs::General, Logs::Error, "Faction '%u' is out-of-bounds for faction array size!", index); + continue; + } + + // this should never hit since `id` is keyed..but, it alleviates any risk of lost pointers + if (faction_array[index] != nullptr) { + Log(Logs::General, Logs::Error, "Faction '%u' has already been assigned! (Duplicate Entry)", index); + continue; + } + faction_array[index] = new Faction; - strn0cpy(faction_array[index]->name, row[1], 50); - faction_array[index]->base = atoi(row[2]); + strn0cpy(faction_array[index]->name, fr_row[1], 50); + faction_array[index]->base = atoi(fr_row[2]); faction_array[index]->min = MIN_PERSONAL_FACTION; faction_array[index]->max = MAX_PERSONAL_FACTION; + + faction_ids.push_back(index); + } - // Load in the mimimum and maximum faction that can be earned for this faction - query = StringFormat("SELECT `min` , `max` FROM `faction_base_data` WHERE client_faction_id = %u", index); - auto baseResults = QueryDatabase(query); - if (!baseResults.Success() || baseResults.RowCount() == 0) { - Log(Logs::General, Logs::General, "Faction %d has no base data", (int)index); - } - else { - for (auto modRow = baseResults.begin(); modRow != baseResults.end(); ++modRow) { - faction_array[index]->min = atoi(modRow[0]); - faction_array[index]->max = atoi(modRow[1]); - Log(Logs::General, Logs::None, "Min(%d), Max(%d) for faction (%u)",faction_array[index]->min, faction_array[index]->max, index); + Log(Logs::General, Logs::Status, "%u Faction%s loaded...", faction_ids.size(), (faction_ids.size() == 1 ? "" : "s")); + + // this can be removed once the 'io_work' branch has been merged + std::vector faction_id_strings; + for (auto id : faction_ids) { + faction_id_strings.push_back(fmt::format("'{}'", id)); + } + const std::string faction_id_criteria(implode(",", faction_id_strings)); + + // code to activate (note above) + //const std::string faction_id_criteria(implode(",", std::pair('\'', '\''), faction_ids)); + + // load faction mins/maxes + query = fmt::format("SELECT `client_faction_id`, `min`, `max` FROM `faction_base_data` WHERE `client_faction_id` IN ({})", faction_id_criteria); + + auto base_results = QueryDatabase(query); + if (base_results.Success()) { + + for (auto br_row : base_results) { + + uint32 index = atoul(br_row[0]); + if (index > max_faction) { + Log(Logs::General, Logs::Error, "Faction '%u' is out-of-bounds for faction array size in Base adjustment!", index); + continue; } + + if (faction_array[index] == nullptr) { + Log(Logs::General, Logs::Error, "Faction '%u' does not exist for Base adjustment!", index); + continue; + } + + faction_array[index]->min = atoi(br_row[1]); + faction_array[index]->max = atoi(br_row[2]); } - // Load in modifiers to the faction based on characters race, class and diety. - query = StringFormat("SELECT `mod`, `mod_name` FROM `faction_list_mod` WHERE faction_id = %u", index); - auto modResults = QueryDatabase(query); - if (!modResults.Success()) - continue; + Log(Logs::General, Logs::Status, "%u Faction Base%s loaded...", base_results.RowCount(), (base_results.RowCount() == 1 ? "" : "s")); + } + else { + Log(Logs::General, Logs::Status, "Unable to load Faction Base data..."); + } + + // load race, class and diety modifiers + query = fmt::format("SELECT `faction_id`, `mod`, `mod_name` FROM `faction_list_mod` WHERE `faction_id` IN ({})", faction_id_criteria); - for (auto modRow = modResults.begin(); modRow != modResults.end(); ++modRow) { - faction_array[index]->mods[modRow[1]] = atoi(modRow[0]); + auto modifier_results = QueryDatabase(query); + if (modifier_results.Success()) { + + for (auto mr_row : modifier_results) { + + uint32 index = atoul(mr_row[0]); + if (index > max_faction) { + Log(Logs::General, Logs::Error, "Faction '%u' is out-of-bounds for faction array size in Modifier adjustment!", index); + continue; + } + + if (faction_array[index] == nullptr) { + Log(Logs::General, Logs::Error, "Faction '%u' does not exist for Modifier adjustment!", index); + continue; + } + + faction_array[index]->mods[mr_row[2]] = atoi(mr_row[1]); } - } + + Log(Logs::General, Logs::Status, "%u Faction Modifier%s loaded...", modifier_results.RowCount(), (modifier_results.RowCount() == 1 ? "" : "s")); + } + else { + Log(Logs::General, Logs::Status, "Unable to load Faction Modifier data..."); + } return true; } From a73df6aa096bf93c23a8d91b3a52cdfd2002da96 Mon Sep 17 00:00:00 2001 From: Uleat Date: Mon, 9 Sep 2019 19:52:41 -0400 Subject: [PATCH 18/22] Rework of Bot Owner Options --- common/version.h | 2 +- .../sql/git/bots/bots_db_update_manifest.txt | 1 + zone/bot.cpp | 6 +- zone/bot_command.cpp | 218 ++++++++++++++---- zone/bot_database.cpp | 171 +++++++------- zone/bot_database.h | 7 +- zone/client.cpp | 28 ++- zone/client.h | 43 ++-- 8 files changed, 295 insertions(+), 181 deletions(-) diff --git a/common/version.h b/common/version.h index 0c6dea2b5..5640a63fe 100644 --- a/common/version.h +++ b/common/version.h @@ -34,7 +34,7 @@ #define CURRENT_BINARY_DATABASE_VERSION 9142 #ifdef BOTS - #define CURRENT_BINARY_BOTS_DATABASE_VERSION 9025 + #define CURRENT_BINARY_BOTS_DATABASE_VERSION 9026 #else #define CURRENT_BINARY_BOTS_DATABASE_VERSION 0 // must be 0 #endif diff --git a/utils/sql/git/bots/bots_db_update_manifest.txt b/utils/sql/git/bots/bots_db_update_manifest.txt index 405cf3f5c..0a1e4466a 100644 --- a/utils/sql/git/bots/bots_db_update_manifest.txt +++ b/utils/sql/git/bots/bots_db_update_manifest.txt @@ -24,6 +24,7 @@ 9023|2019_06_22_bots_owner_option_stats_update.sql|SHOW COLUMNS FROM `bot_owner_options` LIKE 'stats_update'|empty| 9024|2019_06_27_bots_pet_get_lost.sql|SELECT `bot_command` FROM `bot_command_settings` WHERE `bot_command` LIKE 'petgetlost'|empty| 9025|2019_08_26_bots_owner_option_spawn_message.sql|SHOW COLUMNS FROM `bot_owner_options` LIKE 'spawn_message_enabled'|empty| +9026|2019_09_09_bots_owner_options_rework.sql|SHOW COLUMNS FROM `bot_owner_options` LIKE 'option_type'|empty| # Upgrade conditions: # This won't be needed after this system is implemented, but it is used database that are not diff --git a/zone/bot.cpp b/zone/bot.cpp index 971c1d1b6..d70c0ffe8 100644 --- a/zone/bot.cpp +++ b/zone/bot.cpp @@ -3499,7 +3499,7 @@ void Bot::LevelBotWithClient(Client* client, uint8 level, bool sendlvlapp) { Bot* bot = *biter; if(bot && (bot->GetLevel() != client->GetLevel())) { bot->SetPetChooser(false); // not sure what this does, but was in bot 'update' code - bot->CalcBotStats(client->GetBotOptionStatsUpdate()); + bot->CalcBotStats(client->GetBotOption(Client::booStatsUpdate)); if(sendlvlapp) bot->SendLevelAppearance(); // modified from Client::SetLevel() @@ -4178,7 +4178,7 @@ void Bot::PerformTradeWithClient(int16 beginSlotID, int16 endSlotID, Client* cli client->Message(Chat::Lime, "Trade with '%s' resulted in %i accepted item%s, %i returned item%s.", GetCleanName(), accepted_count, ((accepted_count == 1) ? "" : "s"), returned_count, ((returned_count == 1) ? "" : "s")); if (accepted_count) - CalcBotStats(client->GetBotOptionStatsUpdate()); + CalcBotStats(client->GetBotOption(Client::booStatsUpdate)); } bool Bot::Death(Mob *killerMob, int32 damage, uint16 spell_id, EQEmu::skills::SkillType attack_skill) { @@ -4188,7 +4188,7 @@ bool Bot::Death(Mob *killerMob, int32 damage, uint16 spell_id, EQEmu::skills::Sk Save(); Mob *my_owner = GetBotOwner(); - if (my_owner && my_owner->IsClient() && my_owner->CastToClient()->GetBotOptionDeathMarquee()) { + if (my_owner && my_owner->IsClient() && my_owner->CastToClient()->GetBotOption(Client::booDeathMarquee)) { if (killerMob) my_owner->CastToClient()->SendMarqueeMessage(Chat::Yellow, 510, 0, 1000, 3000, StringFormat("%s has been slain by %s", GetCleanName(), killerMob->GetCleanName())); else diff --git a/zone/bot_command.cpp b/zone/bot_command.cpp index 31270cc0f..661a902b3 100644 --- a/zone/bot_command.cpp +++ b/zone/bot_command.cpp @@ -3443,63 +3443,180 @@ void bot_command_movement_speed(Client *c, const Seperator *sep) void bot_command_owner_option(Client *c, const Seperator *sep) { if (helper_is_help_or_usage(sep->arg[1])) { - c->Message(m_usage, "usage: %s [deathmarquee | statsupdate] (argument: enable | disable | null (toggles))", sep->arg[0]); - c->Message(m_usage, "usage: %s [spawnmessage] [argument: say | tell | silent | class | default]", sep->arg[0]); + + c->Message(m_usage, "usage: %s [option] [argument | null]", sep->arg[0]); + + std::string window_title = "Bot Owner Options"; + std::string window_text = + "" + "" + "" + "" + "" + "" + "" + "" + "" + "" + "" + "" + "" + "" + "" + "" + "" + "" + "" + "" + "" + "" + "" + "" + "" + "" + "" + "" + "" + "" + "" + "" + "" + "" + "" + "" + "" + "" + "" + "" + "" + "" + "" + "" + "" + "" + "" + "" + "" + "" + "" + "" + "" + "" + "" + "" + "" + "" + "" + "" + "" + "
OptionArgumentNotes
deathmarqueeenable
disable
null(toggles)
statsupdateenable
disable
null(toggles)
spawnmessagesay
tell
silent
class
default
"; + + c->SendPopupToClient(window_title.c_str(), window_text.c_str()); + return; } - std::string owner_option = sep->arg[1]; - std::string argument = sep->arg[2]; + std::string owner_option(sep->arg[1]); + std::string argument(sep->arg[2]); if (!owner_option.compare("deathmarquee")) { - if (!argument.compare("enable")) - c->SetBotOptionDeathMarquee(true); - else if (!argument.compare("disable")) - c->SetBotOptionDeathMarquee(false); - else - c->SetBotOptionDeathMarquee(!c->GetBotOptionDeathMarquee()); - - database.botdb.SaveOwnerOptionDeathMarquee(c->CharacterID(), c->GetBotOptionDeathMarquee()); - c->Message(m_action, "Bot 'death marquee' is now %s.", (c->GetBotOptionDeathMarquee() == true ? "enabled" : "disabled")); - } - else if (!owner_option.compare("statsupdate")) { - if (!argument.compare("enable")) - c->SetBotOptionStatsUpdate(true); - else if (!argument.compare("disable")) - c->SetBotOptionStatsUpdate(false); - else - c->SetBotOptionStatsUpdate(!c->GetBotOptionStatsUpdate()); - database.botdb.SaveOwnerOptionStatsUpdate(c->CharacterID(), c->GetBotOptionStatsUpdate()); - c->Message(m_action, "Bot 'stats update' is now %s.", (c->GetBotOptionStatsUpdate() == true ? "enabled" : "disabled")); - } - else if (!owner_option.compare("spawnmessage")) { - if (!argument.compare("say")) { - c->SetBotOptionSpawnMessageSay(); + if (!argument.compare("enable")) { + c->SetBotOption(Client::booDeathMarquee, true); } - else if (!argument.compare("tell")) { - c->SetBotOptionSpawnMessageTell(); - } - else if (!argument.compare("silent")) { - c->SetBotOptionSpawnMessageSilent(); - } - else if (!argument.compare("class")) { - c->SetBotOptionSpawnMessageClassSpecific(true); - } - else if (!argument.compare("default")) { - c->SetBotOptionSpawnMessageClassSpecific(false); + else if (!argument.compare("disable")) { + c->SetBotOption(Client::booDeathMarquee, false); } else { + c->SetBotOption(Client::booDeathMarquee, !c->GetBotOption(Client::booDeathMarquee)); + } + + database.botdb.SaveOwnerOption(c->CharacterID(), Client::booDeathMarquee, c->GetBotOption(Client::booDeathMarquee)); + + c->Message(m_action, "Bot 'death marquee' is now %s.", (c->GetBotOption(Client::booDeathMarquee) == true ? "enabled" : "disabled")); + } + else if (!owner_option.compare("statsupdate")) { + + if (!argument.compare("enable")) { + c->SetBotOption(Client::booStatsUpdate, true); + } + else if (!argument.compare("disable")) { + c->SetBotOption(Client::booStatsUpdate, false); + } + else { + c->SetBotOption(Client::booStatsUpdate, !c->GetBotOption(Client::booStatsUpdate)); + } + + database.botdb.SaveOwnerOption(c->CharacterID(), Client::booStatsUpdate, c->GetBotOption(Client::booStatsUpdate)); + + c->Message(m_action, "Bot 'stats update' is now %s.", (c->GetBotOption(Client::booStatsUpdate) == true ? "enabled" : "disabled")); + } + else if (!owner_option.compare("spawnmessage")) { + + Client::BotOwnerOption boo = Client::_booCount; + + if (!argument.compare("say")) { + + boo = Client::booSpawnMessageSay; + c->SetBotOption(Client::booSpawnMessageSay, true); + c->SetBotOption(Client::booSpawnMessageTell, false); + } + else if (!argument.compare("tell")) { + + boo = Client::booSpawnMessageSay; + c->SetBotOption(Client::booSpawnMessageSay, false); + c->SetBotOption(Client::booSpawnMessageTell, true); + } + else if (!argument.compare("silent")) { + + boo = Client::booSpawnMessageSay; + c->SetBotOption(Client::booSpawnMessageSay, false); + c->SetBotOption(Client::booSpawnMessageTell, false); + } + else if (!argument.compare("class")) { + + boo = Client::booSpawnMessageClassSpecific; + c->SetBotOption(Client::booSpawnMessageClassSpecific, true); + } + else if (!argument.compare("default")) { + + boo = Client::booSpawnMessageClassSpecific; + c->SetBotOption(Client::booSpawnMessageClassSpecific, false); + } + else { + c->Message(m_fail, "Owner option '%s' argument '%s' is not recognized.", owner_option.c_str(), argument.c_str()); return; } - database.botdb.SaveOwnerOptionSpawnMessage( - c->CharacterID(), - c->GetBotOptionSpawnMessageSay(), - c->GetBotOptionSpawnMessageTell(), - c->GetBotOptionSpawnMessageClassSpecific() - ); + if (boo == Client::booSpawnMessageSay) { + + database.botdb.SaveOwnerOption( + c->CharacterID(), + std::pair( + Client::booSpawnMessageSay, + Client::booSpawnMessageTell + ), + std::pair( + c->GetBotOption(Client::booSpawnMessageSay), + c->GetBotOption(Client::booSpawnMessageTell) + ) + ); + } + else if (boo == Client::booSpawnMessageClassSpecific) { + + database.botdb.SaveOwnerOption( + c->CharacterID(), + Client::booSpawnMessageClassSpecific, + c->GetBotOption(Client::booSpawnMessageClassSpecific) + ); + } + else { + + c->Message(m_action, "Bot 'spawn message' is now ERROR."); + return; + } + c->Message(m_action, "Bot 'spawn message' is now %s.", argument.c_str()); } else { @@ -5221,13 +5338,16 @@ void bot_subcommand_bot_spawn(Client *c, const Seperator *sep) }; uint8 message_index = 0; - if (c->GetBotOptionSpawnMessageClassSpecific()) + if (c->GetBotOption(Client::booSpawnMessageClassSpecific)) { message_index = VALIDATECLASSID(my_bot->GetClass()); + } - if (c->GetBotOptionSpawnMessageSay()) + if (c->GetBotOption(Client::booSpawnMessageSay)) { Bot::BotGroupSay(my_bot, "%s", bot_spawn_message[message_index]); - else if (c->GetBotOptionSpawnMessageTell()) + } + else if (c->GetBotOption(Client::booSpawnMessageTell)) { c->Message(Chat::Tell, "%s tells you, \"%s\"", my_bot->GetCleanName(), bot_spawn_message[message_index]); + } } void bot_subcommand_bot_stance(Client *c, const Seperator *sep) @@ -5607,7 +5727,7 @@ void bot_subcommand_bot_update(Client *c, const Seperator *sep) continue; bot_iter->SetPetChooser(false); - bot_iter->CalcBotStats(c->GetBotOptionStatsUpdate()); + bot_iter->CalcBotStats(c->GetBotOption(Client::booStatsUpdate)); bot_iter->SendAppearancePacket(AT_WhoLevel, bot_iter->GetLevel(), true, true); ++bot_count; } @@ -7396,7 +7516,7 @@ void bot_subcommand_inventory_remove(Client *c, const Seperator *sep) } my_bot->BotRemoveEquipItem(slotId); - my_bot->CalcBotStats(c->GetBotOptionStatsUpdate()); + my_bot->CalcBotStats(c->GetBotOption(Client::booStatsUpdate)); } switch (slotId) { diff --git a/zone/bot_database.cpp b/zone/bot_database.cpp index 29d0f37e9..abf4fa44c 100644 --- a/zone/bot_database.cpp +++ b/zone/bot_database.cpp @@ -27,6 +27,8 @@ #include "bot.h" #include "client.h" +#include + bool BotDatabase::LoadBotCommandSettings(std::map>> &bot_command_settings) { @@ -2153,111 +2155,92 @@ bool BotDatabase::SaveStopMeleeLevel(const uint32 owner_id, const uint32 bot_id, bool BotDatabase::LoadOwnerOptions(Client *owner) { - if (!owner || !owner->CharacterID()) - return false; - - query = StringFormat( - "SELECT `death_marquee`, `stats_update`, `spawn_message_enabled`, `spawn_message_type` FROM `bot_owner_options`" - " WHERE `owner_id` = '%u'", - owner->CharacterID() - ); - auto results = database.QueryDatabase(query); - if (!results.Success()) - return false; - if (!results.RowCount()) { - query = StringFormat("REPLACE INTO `bot_owner_options` (`owner_id`) VALUES ('%u')", owner->CharacterID()); - results = database.QueryDatabase(query); - + if (!owner || !owner->CharacterID()) { return false; } - auto row = results.begin(); - owner->SetBotOptionDeathMarquee((atoi(row[0]) != 0)); - owner->SetBotOptionStatsUpdate((atoi(row[1]) != 0)); - switch (atoi(row[2])) { - case 2: - owner->SetBotOptionSpawnMessageSay(); - break; - case 1: - owner->SetBotOptionSpawnMessageTell(); - break; + query = fmt::format("SELECT `option_type`, `option_value` FROM `bot_owner_options` WHERE `owner_id` = '{}'", owner->CharacterID()); + + auto results = database.QueryDatabase(query); + if (!results.Success()) { + return false; + } + + for (auto row : results) { + + owner->SetBotOption(static_cast(atoul(row[0])), (atoul(row[1]) != 0)); + } + + return true; +} + +bool BotDatabase::SaveOwnerOption(const uint32 owner_id, size_t type, const bool flag) +{ + if (!owner_id) { + return false; + } + + switch (static_cast(type)) { + case Client::booDeathMarquee: + case Client::booStatsUpdate: + case Client::booSpawnMessageClassSpecific: { + + query = fmt::format( + "REPLACE INTO `bot_owner_options`(`owner_id`, `option_type`, `option_value`) VALUES ('{}', '{}', '{}')", + owner_id, + type, + (flag == true ? 1 : 0) + ); + + auto results = database.QueryDatabase(query); + if (!results.Success()) { + return false; + } + + return true; + } default: - owner->SetBotOptionSpawnMessageSilent(); - break; + return false; } - owner->SetBotOptionSpawnMessageClassSpecific((atoi(row[3]) != 0)); - - return true; } -bool BotDatabase::SaveOwnerOptionDeathMarquee(const uint32 owner_id, const bool flag) +bool BotDatabase::SaveOwnerOption(const uint32 owner_id, const std::pair type, const std::pair flag) { - if (!owner_id) + if (!owner_id) { return false; + } - query = StringFormat( - "UPDATE `bot_owner_options`" - " SET `death_marquee` = '%u'" - " WHERE `owner_id` = '%u'", - (flag == true ? 1 : 0), - owner_id - ); - auto results = database.QueryDatabase(query); - if (!results.Success()) + switch (static_cast(type.first)) { + case Client::booSpawnMessageSay: + case Client::booSpawnMessageTell: { + switch (static_cast(type.second)) { + case Client::booSpawnMessageSay: + case Client::booSpawnMessageTell: { + + query = fmt::format( + "REPLACE INTO `bot_owner_options`(`owner_id`, `option_type`, `option_value`) VALUES ('{}', '{}', '{}'), ('{}', '{}', '{}')", + owner_id, + type.first, + (flag.first == true ? 1 : 0), + owner_id, + type.second, + (flag.second == true ? 1 : 0) + ); + + auto results = database.QueryDatabase(query); + if (!results.Success()) { + return false; + } + + return true; + } + default: + return false; + } + } + default: return false; - - return true; -} - -bool BotDatabase::SaveOwnerOptionStatsUpdate(const uint32 owner_id, const bool flag) -{ - if (!owner_id) - return false; - - query = StringFormat( - "UPDATE `bot_owner_options`" - " SET `stats_update` = '%u'" - " WHERE `owner_id` = '%u'", - (flag == true ? 1 : 0), - owner_id - ); - auto results = database.QueryDatabase(query); - if (!results.Success()) - return false; - - return true; -} - -bool BotDatabase::SaveOwnerOptionSpawnMessage(const uint32 owner_id, const bool say, const bool tell, const bool class_specific) -{ - if (!owner_id) - return false; - - uint8 enabled_value = 0; - if (say) - enabled_value = 2; - else if (tell) - enabled_value = 1; - - uint8 type_value = 0; - if (class_specific) - type_value = 1; - - query = StringFormat( - "UPDATE `bot_owner_options`" - " SET" - " `spawn_message_enabled` = '%u'," - " `spawn_message_type` = '%u'" - " WHERE `owner_id` = '%u'", - enabled_value, - type_value, - owner_id - ); - auto results = database.QueryDatabase(query); - if (!results.Success()) - return false; - - return true; + } } diff --git a/zone/bot_database.h b/zone/bot_database.h index 0c18eade5..1c1a8b88d 100644 --- a/zone/bot_database.h +++ b/zone/bot_database.h @@ -139,10 +139,9 @@ public: bool SaveStopMeleeLevel(const uint32 owner_id, const uint32 bot_id, const uint8 sml_value); bool LoadOwnerOptions(Client *owner); - bool SaveOwnerOptionDeathMarquee(const uint32 owner_id, const bool flag); - bool SaveOwnerOptionStatsUpdate(const uint32 owner_id, const bool flag); - bool SaveOwnerOptionSpawnMessage(const uint32 owner_id, const bool say, const bool tell, const bool class_specific); - + bool SaveOwnerOption(const uint32 owner_id, size_t type, const bool flag); + bool SaveOwnerOption(const uint32 owner_id, const std::pair type, const std::pair flag); + /* Bot bot-group functions */ bool QueryBotGroupExistence(const std::string& botgroup_name, bool& extant_flag); diff --git a/zone/client.cpp b/zone/client.cpp index c1293be3f..ba65695c9 100644 --- a/zone/client.cpp +++ b/zone/client.cpp @@ -347,7 +347,11 @@ Client::Client(EQStreamInterface* ieqs) dev_tools_window_enabled = true; #ifdef BOTS - bot_owner_options = DefaultBotOwnerOptions; + bot_owner_options[booDeathMarquee] = false; + bot_owner_options[booStatsUpdate] = false; + bot_owner_options[booSpawnMessageSay] = false; + bot_owner_options[booSpawnMessageTell] = true; + bot_owner_options[booSpawnMessageClassSpecific] = true; #endif AI_Init(); @@ -9134,4 +9138,24 @@ glm::vec4 &Client::GetLastPositionBeforeBulkUpdate() void Client::SetLastPositionBeforeBulkUpdate(glm::vec4 in_last_position_before_bulk_update) { Client::last_position_before_bulk_update = in_last_position_before_bulk_update; -} \ No newline at end of file +} + +#ifdef BOTS + +bool Client::GetBotOption(BotOwnerOption boo) const { + + if (boo < _booCount) { + return bot_owner_options[boo]; + } + + return false; +} + +void Client::SetBotOption(BotOwnerOption boo, bool flag) { + + if (boo < _booCount) { + bot_owner_options[boo] = flag; + } +} + +#endif diff --git a/zone/client.h b/zone/client.h index 88bee0b03..54a1260ae 100644 --- a/zone/client.h +++ b/zone/client.h @@ -1626,39 +1626,26 @@ private: int client_max_level; #ifdef BOTS - struct BotOwnerOptions { - bool death_marquee; - bool stats_update; - bool spawn_message_say; - bool spawn_message_tell; - bool spawn_message_class_specific; - }; + - BotOwnerOptions bot_owner_options; - - const BotOwnerOptions DefaultBotOwnerOptions = { - false, // death_marquee - false, // stats_update - false, // spawn_message_say - true, // spawn_message_tell - true // spawn_message_class_specific - }; + public: - void SetBotOptionDeathMarquee(bool flag) { bot_owner_options.death_marquee = flag; } - void SetBotOptionStatsUpdate(bool flag) { bot_owner_options.stats_update = flag; } - void SetBotOptionSpawnMessageSay() { bot_owner_options.spawn_message_say = true; bot_owner_options.spawn_message_tell = false; } - void SetBotOptionSpawnMessageTell() { bot_owner_options.spawn_message_say = false; bot_owner_options.spawn_message_tell = true; } - void SetBotOptionSpawnMessageSilent() { bot_owner_options.spawn_message_say = false; bot_owner_options.spawn_message_tell = false; } - void SetBotOptionSpawnMessageClassSpecific(bool flag) { bot_owner_options.spawn_message_class_specific = flag; } + enum BotOwnerOption : size_t { + booDeathMarquee, + booStatsUpdate, + booSpawnMessageSay, + booSpawnMessageTell, + booSpawnMessageClassSpecific, + _booCount + }; - bool GetBotOptionDeathMarquee() const { return bot_owner_options.death_marquee; } - bool GetBotOptionStatsUpdate() const { return bot_owner_options.stats_update; } - bool GetBotOptionSpawnMessageSay() const { return bot_owner_options.spawn_message_say; } - bool GetBotOptionSpawnMessageTell() const { return bot_owner_options.spawn_message_tell; } - bool GetBotOptionSpawnMessageClassSpecific() const { return bot_owner_options.spawn_message_class_specific; } + bool GetBotOption(BotOwnerOption boo) const; + void SetBotOption(BotOwnerOption boo, bool flag = true); + +private: + bool bot_owner_options[_booCount]; -private: #endif }; From 8a26eaabf3d93c7eaba7502796ca785d2cae727a Mon Sep 17 00:00:00 2001 From: Uleat Date: Mon, 9 Sep 2019 19:53:34 -0400 Subject: [PATCH 19/22] Oops! Gotta have the sql too... [skip ci] --- .../required/2019_09_09_bots_owner_options_rework.sql | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 utils/sql/git/bots/required/2019_09_09_bots_owner_options_rework.sql diff --git a/utils/sql/git/bots/required/2019_09_09_bots_owner_options_rework.sql b/utils/sql/git/bots/required/2019_09_09_bots_owner_options_rework.sql new file mode 100644 index 000000000..6240e9366 --- /dev/null +++ b/utils/sql/git/bots/required/2019_09_09_bots_owner_options_rework.sql @@ -0,0 +1,10 @@ +DROP TABLE IF EXISTS `bot_owner_options`; + +CREATE TABLE `bot_owner_options` ( + `owner_id` INT(11) UNSIGNED NOT NULL, + `option_type` SMALLINT(3) UNSIGNED NOT NULL, + `option_value` SMALLINT(3) UNSIGNED NULL DEFAULT '0', + PRIMARY KEY (`owner_id`, `option_type`) +) +COLLATE='latin1_swedish_ci' +ENGINE=InnoDB; From 1990ae970a73a2dbb2d8cccfcbfddf7bec2be1de Mon Sep 17 00:00:00 2001 From: Uleat Date: Mon, 9 Sep 2019 23:28:55 -0400 Subject: [PATCH 20/22] Updated 'io_work' per pr page request --- common/rulesys.cpp | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/common/rulesys.cpp b/common/rulesys.cpp index 8a765aee4..4b3599113 100644 --- a/common/rulesys.cpp +++ b/common/rulesys.cpp @@ -379,10 +379,6 @@ bool RuleManager::UpdateInjectedRules(Database *db, const char *ruleset_name, bo std::map> rule_data; std::vector> injected_rule_entries; - if (!db) { - return false; - } - if (ruleset_name == nullptr) { return false; } @@ -497,10 +493,6 @@ bool RuleManager::UpdateOrphanedRules(Database *db, bool quiet_update) std::vector rule_data; std::vector orphaned_rule_entries; - if (!db) { - return false; - } - // load database rule names std::string query("SELECT `rule_name` FROM `rule_values` GROUP BY `rule_name`"); @@ -562,10 +554,6 @@ bool RuleManager::UpdateOrphanedRules(Database *db, bool quiet_update) bool RuleManager::RestoreRuleNotes(Database *db) { - if (!db) { - return false; - } - std::string query("SELECT `ruleset_id`, `rule_name`, IFNULL(`notes`, '\\0')`notes` FROM `rule_values`"); auto results = db->QueryDatabase(query); From 28d5c8f3018ac4b028e28d08e992bef7ab5c68fb Mon Sep 17 00:00:00 2001 From: Uleat Date: Tue, 10 Sep 2019 00:20:13 -0400 Subject: [PATCH 21/22] Fix-up after 'io_work' branch merger --- changelog.txt | 22 ---------------------- zone/zonedb.cpp | 10 +--------- 2 files changed, 1 insertion(+), 31 deletions(-) diff --git a/changelog.txt b/changelog.txt index 324974969..84d38df4a 100644 --- a/changelog.txt +++ b/changelog.txt @@ -1,27 +1,5 @@ EQEMu Changelog (Started on Sept 24, 2003 15:50) ------------------------------------------------------- -== 9/04/2019 == -Uleat: Added code to restore rule notes to their original values - - The code is inactive by default - - Change rule 'World:RestoreRuleNotes' to 'true' to enable this feature - - Rule will not exist until the server is run for the first time after updating - -== 9/02/2019 == -Uleat: Added code to inject new rules into the 'default' ruleset and remove orphaned rules from all rulesets - - New rules are only added using the 'default' ruleset - Other rulesets will need to be added manually or through in-game updates - -- Rule notes are now loaded into the system's hard-coded entries and will now propagate properly into database updates - - Defunct rules will have their orhpaned entries removed from the `rule_values` table for the all rulesets - -Note: If you would like to add these rules before starting your server so that you can modify them, start world.exe -manually and wait for the console messages to finish. It should take 5-10 seconds, or so. The world log should contain -a list of the added and removed entries, IF the `file` field of the 'Status' logging category is set to 1 or higher. -(Don't forget to manually stop the process after the update is complete.) - -== 8/30/2019 == -Uleat: Added code to inject new commands and remove orphaned commands from both command systems - - New commands are added with their status (`access`) set to the server default value - no aliases are defined - - Defunct commands will have their orhpaned entries removed from the command settings table for each system - == 8/16/2019 == Akkadius: Simplified the use of roamboxes and improved the AI for roambox pathing https://i.imgur.com/z33u7y9.gif Akkadius: Implemented command #roambox set [move_delay] diff --git a/zone/zonedb.cpp b/zone/zonedb.cpp index 2f0a3def2..fea89efbf 100755 --- a/zone/zonedb.cpp +++ b/zone/zonedb.cpp @@ -4122,15 +4122,7 @@ bool ZoneDatabase::LoadFactionData() Log(Logs::General, Logs::Status, "%u Faction%s loaded...", faction_ids.size(), (faction_ids.size() == 1 ? "" : "s")); - // this can be removed once the 'io_work' branch has been merged - std::vector faction_id_strings; - for (auto id : faction_ids) { - faction_id_strings.push_back(fmt::format("'{}'", id)); - } - const std::string faction_id_criteria(implode(",", faction_id_strings)); - - // code to activate (note above) - //const std::string faction_id_criteria(implode(",", std::pair('\'', '\''), faction_ids)); + const std::string faction_id_criteria(implode(",", std::pair('\'', '\''), faction_ids)); // load faction mins/maxes query = fmt::format("SELECT `client_faction_id`, `min`, `max` FROM `faction_base_data` WHERE `client_faction_id` IN ({})", faction_id_criteria); From 499c0fdca5ca668145d19b76f4092dcdd31ca3f5 Mon Sep 17 00:00:00 2001 From: Kinglykrab Date: Tue, 10 Sep 2019 21:48:15 -0400 Subject: [PATCH 22/22] Fixes multi-link Perl croaks, allowing the quest API reader to function properly. --- zone/embparser_api.cpp | 66 +++++++++++++------------------------- zone/perl_client.cpp | 45 +++++++++----------------- zone/perl_entity.cpp | 12 +++---- zone/perl_groups.cpp | 3 +- zone/perl_mob.cpp | 72 ++++++++++++++---------------------------- zone/perl_npc.cpp | 12 +++---- zone/perl_raids.cpp | 6 ++-- 7 files changed, 72 insertions(+), 144 deletions(-) diff --git a/zone/embparser_api.cpp b/zone/embparser_api.cpp index 5cb17ca50..98cca1910 100644 --- a/zone/embparser_api.cpp +++ b/zone/embparser_api.cpp @@ -226,8 +226,7 @@ XS(XS__spawn); XS(XS__spawn) { dXSARGS; if (items != 6) - Perl_croak(aTHX_ - "Usage: quest::spawn(int npc_type_id, int grid_id, int int_unused, float x, float y, float z)"); + Perl_croak(aTHX_ "Usage: quest::spawn(int npc_type_id, int grid_id, int int_unused, float x, float y, float z)"); uint16 RETVAL; dXSTARG; @@ -249,8 +248,7 @@ XS(XS__spawn2); XS(XS__spawn2) { dXSARGS; if (items != 7) - Perl_croak(aTHX_ - "Usage: quest::spawn2(int npc_type_id, int grid_id, int int_unused, float x, float y, float z, float heading)"); + Perl_croak(aTHX_ "Usage: quest::spawn2(int npc_type_id, int grid_id, int int_unused, float x, float y, float z, float heading)"); uint16 RETVAL; dXSTARG; @@ -272,8 +270,7 @@ XS(XS__unique_spawn); XS(XS__unique_spawn) { dXSARGS; if (items != 6 && items != 7) - Perl_croak(aTHX_ - "Usage: quest::unique_spawn(int npc_type_id, int grid_id, int int_unused, float x, float y, float z, [float heading])"); + Perl_croak(aTHX_ "Usage: quest::unique_spawn(int npc_type_id, int grid_id, int int_unused, float x, float y, float z, [float heading])"); uint16 RETVAL; dXSTARG; @@ -1315,8 +1312,7 @@ XS(XS__targlobal); XS(XS__targlobal) { dXSARGS; if (items != 6) - Perl_croak(aTHX_ - "Usage: quest::targlobal(stirng key, string value, string duration, int npc_id, int chararacter_id, int zone_id)"); + Perl_croak(aTHX_ "Usage: quest::targlobal(stirng key, string value, string duration, int npc_id, int chararacter_id, int zone_id)"); char *key = (char *) SvPV_nolen(ST(0)); char *str_value = (char *) SvPV_nolen(ST(1)); @@ -1411,8 +1407,7 @@ XS(XS__moveto); XS(XS__moveto) { dXSARGS; if (items != 3 && items != 4 && items != 5) - Perl_croak(aTHX_ - "Usage: quest::moveto(float x, float y, float z, [float heading], [bool save_guard_location])"); + Perl_croak(aTHX_ "Usage: quest::moveto(float x, float y, float z, [float heading], [bool save_guard_location])"); float x = (float) SvNV(ST(0)); float y = (float) SvNV(ST(1)); @@ -1561,8 +1556,7 @@ XS(XS__set_proximity); XS(XS__set_proximity) { dXSARGS; if (items != 4 && items != 6 && items != 7) - Perl_croak(aTHX_ - "Usage: quest::set_proximity(float min_x, float max_x, float min_y, float max_y, [float min_z], [float max_z], [say])"); + Perl_croak(aTHX_ "Usage: quest::set_proximity(float min_x, float max_x, float min_y, float max_y, [float min_z], [float max_z], [say])"); float min_x = (float) SvNV(ST(0)); float max_x = (float) SvNV(ST(1)); @@ -1643,8 +1637,7 @@ XS(XS__spawn_condition); XS(XS__spawn_condition) { dXSARGS; if (items < 3 || items > 4) - Perl_croak(aTHX_ - "Usage: quest::spawn_condition(string zone_short, [int instance_id], uint16 condition_id, int16 value)"); + Perl_croak(aTHX_ "Usage: quest::spawn_condition(string zone_short, [int instance_id], uint16 condition_id, int16 value)"); if (items == 3) { char *zone_short = (char *) SvPV_nolen(ST(0)); @@ -1701,8 +1694,7 @@ XS(XS__toggle_spawn_event); XS(XS__toggle_spawn_event) { dXSARGS; if (items != 4) - Perl_croak(aTHX_ - "Usage: quest::toggle_spawn_event(uint32 event_id, [bool is_enabled = false], [bool is_strict = false], [bool reset_base = false])"); + Perl_croak(aTHX_ "Usage: quest::toggle_spawn_event(uint32 event_id, [bool is_enabled = false], [bool is_strict = false], [bool reset_base = false])"); uint32 event_id = (int) SvIV(ST(0)); bool is_enabled = ((int) SvIV(ST(1))) == 0 ? false : true; @@ -1763,8 +1755,7 @@ XS(XS__summonburiedplayercorpse); XS(XS__summonburiedplayercorpse) { dXSARGS; if (items != 5) - Perl_croak(aTHX_ - "Usage: quest::summonburiedplayercorpse(uint32 char_id, float dest_x, float dest_y, float dest_z, float dest_heading)"); + Perl_croak(aTHX_ "Usage: quest::summonburiedplayercorpse(uint32 char_id, float dest_x, float dest_y, float dest_z, float dest_heading)"); bool RETVAL; uint32 char_id = (int) SvIV(ST(0)); @@ -1781,8 +1772,7 @@ XS(XS__summonallplayercorpses); XS(XS__summonallplayercorpses) { dXSARGS; if (items != 5) - Perl_croak(aTHX_ - "Usage: quest::summonallplayercorpses(int char_id, float dest_x, float dest_y, float dest_z, float dest_heading)"); + Perl_croak(aTHX_ "Usage: quest::summonallplayercorpses(int char_id, float dest_x, float dest_y, float dest_z, float dest_heading)"); bool RETVAL; uint32 char_id = (int) SvIV(ST(0)); @@ -2038,8 +2028,7 @@ XS(XS__playerfeature); XS(XS__playerfeature) { dXSARGS; if (items != 2) - Perl_croak(aTHX_ - "Usage: quest::playerfeature(string feature [race|gender|texture|helm|haircolor|beardcolor|eyecolor1|eyecolor2|hair|face|beard|heritage|tatoo|details|size], int setting)"); + Perl_croak(aTHX_ "Usage: quest::playerfeature(string feature [race|gender|texture|helm|haircolor|beardcolor|eyecolor1|eyecolor2|hair|face|beard|heritage|tatoo|details|size], int setting)"); char *str_value = (char *) SvPV_nolen(ST(0)); int int_value = (int) SvIV(ST(1)); @@ -2053,8 +2042,7 @@ XS(XS__npcfeature); XS(XS__npcfeature) { dXSARGS; if (items != 2) - Perl_croak(aTHX_ - "Usage: quest::npcfeature(string feature [race|gender|texture|helm|haircolor|beardcolor|eyecolor1|eyecolor2|hair|face|beard|heritage|tatoo|details|size], int value)"); + Perl_croak(aTHX_ "Usage: quest::npcfeature(string feature [race|gender|texture|helm|haircolor|beardcolor|eyecolor1|eyecolor2|hair|face|beard|heritage|tatoo|details|size], int value)"); char *str_value = (char *) SvPV_nolen(ST(0)); int int_value = (int) SvIV(ST(1)); @@ -2281,8 +2269,7 @@ XS(XS__updatetaskactivity) { } quest_manager.updatetaskactivity(task_id, activity_id, count, ignore_quest_update); } else { - Perl_croak(aTHX_ - "Usage: quest::updatetaskactivity(int task_id, int activity_id, [int count], [bool ignore_quest_update = false])"); + Perl_croak(aTHX_ "Usage: quest::updatetaskactivity(int task_id, int activity_id, [int count], [bool ignore_quest_update = false])"); } XSRETURN_EMPTY; @@ -2570,8 +2557,7 @@ XS(XS__popup) { int duration = 0; if ((items < 2) || (items > 5)) - Perl_croak(aTHX_ - "Usage: quest::popup(string window_title, string message, int popup_id, int buttons, int duration)"); + Perl_croak(aTHX_ "Usage: quest::popup(string window_title, string message, int popup_id, int buttons, int duration)"); if (items >= 3) popup_id = (int) SvIV(ST(2)); @@ -2652,8 +2638,7 @@ XS(XS__CreateGroundObject); XS(XS__CreateGroundObject) { dXSARGS; if (items != 5 && items != 6) - Perl_croak(aTHX_ - "Usage: quest::creategroundobject(int item_id, float x, float y, float z, float heading, [uint32 decay_time-ms = 300000])"); + Perl_croak(aTHX_ "Usage: quest::creategroundobject(int item_id, float x, float y, float z, float heading, [uint32 decay_time-ms = 300000])"); int item_id = (int) SvIV(ST(0)); float x = (float) SvNV(ST(1)); @@ -2676,8 +2661,7 @@ XS(XS__CreateGroundObjectFromModel); XS(XS__CreateGroundObjectFromModel) { dXSARGS; if (items < 5 || items > 7) - Perl_croak(aTHX_ - "Usage: quest::creategroundobjectfrommodel(string model_name, float x, float y, float z, float heading, [int object_type], [uint32 decay_time-ms = 300000])"); + Perl_croak(aTHX_ "Usage: quest::creategroundobjectfrommodel(string model_name, float x, float y, float z, float heading, [int object_type], [uint32 decay_time-ms = 300000])"); char *modelname = (char *) SvPV_nolen(ST(0)); float x = (float) SvNV(ST(1)); @@ -2702,8 +2686,7 @@ XS(XS__CreateDoor); XS(XS__CreateDoor) { dXSARGS; if (items < 5 || items > 7) - Perl_croak(aTHX_ - "Usage: quest::createdoor(string model_name, float x, float y, float z, float heading, [int object_type = 58], [int size = 100])"); + Perl_croak(aTHX_ "Usage: quest::createdoor(string model_name, float x, float y, float z, float heading, [int object_type = 58], [int size = 100])"); char *modelname = (char *) SvPV_nolen(ST(0)); float x = (float) SvNV(ST(1)); @@ -3032,8 +3015,7 @@ XS(XS__MovePCInstance); XS(XS__MovePCInstance) { dXSARGS; if (items != 5 && items != 6) - Perl_croak(aTHX_ - "Usage: quest::MovePCInstance(int zone_id, int instance_id, float x, float y, float z, [float heading])"); + Perl_croak(aTHX_ "Usage: quest::MovePCInstance(int zone_id, int instance_id, float x, float y, float z, [float heading])"); int zone_id = (int) SvIV(ST(0)); int instanceid = (int) SvIV(ST(1)); @@ -3286,8 +3268,7 @@ XS(XS__wearchange); XS(XS__wearchange) { dXSARGS; if (items < 2) - Perl_croak(aTHX_ - "Usage: quest::wearchange(uint8 slot, uint16 texture_id, [uint32 hero_forge_model_id = 0], [uint32 elite_material_id = 0])"); + Perl_croak(aTHX_ "Usage: quest::wearchange(uint8 slot, uint16 texture_id, [uint32 hero_forge_model_id = 0], [uint32 elite_material_id = 0])"); uint8 slot = (int) SvUV(ST(0)); uint16 texture_id = (int) SvUV(ST(1)); @@ -3535,8 +3516,7 @@ XS(XS__crosszonesetentityvariablebynpctypeid) { dXSARGS; if (items != 3) - Perl_croak(aTHX_ - "Usage: quest::crosszonesetentityvariablebynpctypeid(int npc_type_id, string key, string value)"); + Perl_croak(aTHX_ "Usage: quest::crosszonesetentityvariablebynpctypeid(int npc_type_id, string key, string value)"); if (items == 3) { uint32 npc_type_id = (uint32) SvIV(ST(0)); @@ -3553,8 +3533,7 @@ XS(XS__crosszonesetentityvariablebyclientname) { dXSARGS; if (items != 3) - Perl_croak(aTHX_ - "Usage: quest::crosszonesetentityvariablebyclientname(string client_name, string key, string value)"); + Perl_croak(aTHX_ "Usage: quest::crosszonesetentityvariablebyclientname(string client_name, string key, string value)"); if (items == 3) { const char *client_name = (const char *) SvPV_nolen(ST(0)); @@ -3586,8 +3565,7 @@ XS(XS__worldwidemarquee); XS(XS__worldwidemarquee) { dXSARGS; if (items != 6) - Perl_croak(aTHX_ - "Usage: quest::worldwidemarquee(uint32 color_id, uint32 priority, uint32 fade_in, uint32 fade_out, uint32 duration, string message)"); + Perl_croak(aTHX_ "Usage: quest::worldwidemarquee(uint32 color_id, uint32 priority, uint32 fade_in, uint32 fade_out, uint32 duration, string message)"); if (items == 6) { uint32 color_id = (uint32) SvIV(ST(0)); diff --git a/zone/perl_client.cpp b/zone/perl_client.cpp index 4aac33267..5bae19194 100644 --- a/zone/perl_client.cpp +++ b/zone/perl_client.cpp @@ -961,8 +961,7 @@ XS(XS_Client_SetEXP); /* prototype to pass -Wmissing-prototypes */ XS(XS_Client_SetEXP) { dXSARGS; if (items < 3 || items > 4) - Perl_croak(aTHX_ - "Usage: Client::SetEXP(THIS, uint32 experience_points, uint32 aa_experience_points, [bool resexp=false])"); + Perl_croak(aTHX_ "Usage: Client::SetEXP(THIS, uint32 experience_points, uint32 aa_experience_points, [bool resexp=false])"); { Client *THIS; uint32 set_exp = (uint32) SvUV(ST(1)); @@ -992,8 +991,7 @@ XS(XS_Client_SetBindPoint); /* prototype to pass -Wmissing-prototypes */ XS(XS_Client_SetBindPoint) { dXSARGS; if (items < 1 || items > 6) - Perl_croak(aTHX_ - "Usage: Client::SetBindPoint(THIS, int to_zone = -1, int to_instance = 0, float new_x = 0.0f, float new_y = 0.0f, float new_z = 0.0f)"); + Perl_croak(aTHX_ "Usage: Client::SetBindPoint(THIS, int to_zone = -1, int to_instance = 0, float new_x = 0.0f, float new_y = 0.0f, float new_z = 0.0f)"); { Client *THIS; int to_zone; @@ -1260,8 +1258,7 @@ XS(XS_Client_MovePCInstance); /* prototype to pass -Wmissing-prototypes */ XS(XS_Client_MovePCInstance) { dXSARGS; if (items != 7) - Perl_croak(aTHX_ - "Usage: Client::MovePCInstance(THIS, uint32 zone_id, uint32 instance_id, float x, float y, float z, float heading)"); + Perl_croak(aTHX_ "Usage: Client::MovePCInstance(THIS, uint32 zone_id, uint32 instance_id, float x, float y, float z, float heading)"); { Client *THIS; uint32 zoneID = (uint32) SvUV(ST(1)); @@ -1335,8 +1332,7 @@ XS(XS_Client_GetFactionLevel); /* prototype to pass -Wmissing-prototypes */ XS(XS_Client_GetFactionLevel) { dXSARGS; if (items != 8) - Perl_croak(aTHX_ - "Usage: Client::GetFactionLevel(THIS, uint32 character_id, uint32 npc_id, uint32 player_race_id, uint32 player_class_id, uint32 player_deity_id, uint32 player_faction_id, Mob*)"); + Perl_croak(aTHX_ "Usage: Client::GetFactionLevel(THIS, uint32 character_id, uint32 npc_id, uint32 player_race_id, uint32 player_class_id, uint32 player_deity_id, uint32 player_faction_id, Mob*)"); { Client *THIS; FACTION_VALUE RETVAL; @@ -1376,8 +1372,7 @@ XS(XS_Client_SetFactionLevel); /* prototype to pass -Wmissing-prototypes */ XS(XS_Client_SetFactionLevel) { dXSARGS; if (items != 6) - Perl_croak(aTHX_ - "Usage: Client::SetFactionLevel(THIS, uint32 character_id, uint32 npc_id, uint8 character_class, uint8 character_race, uint8 character_deity)"); + Perl_croak(aTHX_ "Usage: Client::SetFactionLevel(THIS, uint32 character_id, uint32 npc_id, uint8 character_class, uint8 character_race, uint8 character_deity)"); { Client *THIS; uint32 char_id = (uint32) SvUV(ST(1)); @@ -1403,8 +1398,7 @@ XS(XS_Client_SetFactionLevel2); /* prototype to pass -Wmissing-prototypes */ XS(XS_Client_SetFactionLevel2) { dXSARGS; if (items < 7 || items > 8) - Perl_croak(aTHX_ - "Usage: Client::SetFactionLevel2(THIS, uint32 character_id, int32 faction_id, uint8 character_class, uint8 character_race, uint8 character_deity, int32 value, uint8 temp)"); + Perl_croak(aTHX_ "Usage: Client::SetFactionLevel2(THIS, uint32 character_id, int32 faction_id, uint8 character_class, uint8 character_race, uint8 character_deity, int32 value, uint8 temp)"); { Client *THIS; uint32 char_id = (uint32) SvUV(ST(1)); @@ -1724,8 +1718,7 @@ XS(XS_Client_AddMoneyToPP); /* prototype to pass -Wmissing-prototypes */ XS(XS_Client_AddMoneyToPP) { dXSARGS; if (items != 6) - Perl_croak(aTHX_ - "Usage: Client::AddMoneyToPP(THIS, uint32 copper, uint32 silver, uint32 gold, uint32 platinum, bool update_client)"); + Perl_croak(aTHX_ "Usage: Client::AddMoneyToPP(THIS, uint32 copper, uint32 silver, uint32 gold, uint32 platinum, bool update_client)"); { Client *THIS; uint32 copper = (uint32) SvUV(ST(1)); @@ -3095,8 +3088,7 @@ XS(XS_Client_DeleteItemInInventory); /* prototype to pass -Wmissing-prototypes * XS(XS_Client_DeleteItemInInventory) { dXSARGS; if (items < 2 || items > 4) - Perl_croak(aTHX_ - "Usage: Client::DeleteItemInInventory(THIS, int16 slot_id, [int8 quantity = 0], [bool client_update = false])"); + Perl_croak(aTHX_ "Usage: Client::DeleteItemInInventory(THIS, int16 slot_id, [int8 quantity = 0], [bool client_update = false])"); { Client *THIS; int16 slot_id = (int16) SvIV(ST(1)); @@ -3132,8 +3124,7 @@ XS(XS_Client_SummonItem); /* prototype to pass -Wmissing-prototypes */ XS(XS_Client_SummonItem) { dXSARGS; if (items < 2 || items > 10) - Perl_croak(aTHX_ - "Usage: Client::SummonItem(THIS, uint32 item_id, [int16 charges = -1], [bool attune = false], [uint32 aug1 = 0], [uint32 aug2 = 0], [uint32 aug3 = 0], [uint32 aug4 = 0], [uint32 aug5 = 0], [uint16 slot_id = cursor])"); + Perl_croak(aTHX_ "Usage: Client::SummonItem(THIS, uint32 item_id, [int16 charges = -1], [bool attune = false], [uint32 aug1 = 0], [uint32 aug2 = 0], [uint32 aug3 = 0], [uint32 aug4 = 0], [uint32 aug5 = 0], [uint16 slot_id = cursor])"); { Client *THIS; uint32 item_id = (uint32) SvUV(ST(1)); @@ -4834,8 +4825,7 @@ XS(XS_Client_GrantAlternateAdvancementAbility); /* prototype to pass -Wmissing-p XS(XS_Client_GrantAlternateAdvancementAbility) { dXSARGS; if (items < 3 || items > 4) - Perl_croak(aTHX_ - "Usage: Client::GrantAlternateAdvancementAbility(THIS, int aa_id, int points, [bool ignore_cost = false])"); + Perl_croak(aTHX_ "Usage: Client::GrantAlternateAdvancementAbility(THIS, int aa_id, int points, [bool ignore_cost = false])"); { Client *THIS; bool RETVAL; @@ -4992,8 +4982,7 @@ XS(XS_Client_UpdateTaskActivity); /* prototype to pass -Wmissing-prototypes */ XS(XS_Client_UpdateTaskActivity) { dXSARGS; if (items < 4) - Perl_croak(aTHX_ - "Usage: Client::UpdateTaskActivity(THIS, int task_id, int activity_id, int count, [bool ignore_quest_update = false])"); + Perl_croak(aTHX_ "Usage: Client::UpdateTaskActivity(THIS, int task_id, int activity_id, int count, [bool ignore_quest_update = false])"); { bool ignore_quest_update = false; @@ -5052,8 +5041,7 @@ XS(XS_Client_AssignTask); /* prototype to pass -Wmissing-prototypes */ XS(XS_Client_AssignTask) { dXSARGS; if (items != 3 && items != 4) - Perl_croak(aTHX_ - "Usage: Client::AssignTask(THIS, int task_id, int npc_id, [bool enforce_level_requirement = false])"); + Perl_croak(aTHX_ "Usage: Client::AssignTask(THIS, int task_id, int npc_id, [bool enforce_level_requirement = false])"); { Client *THIS; int TaskID = (int) SvIV(ST(1)); @@ -5964,8 +5952,7 @@ XS(XS_Client_SendMarqueeMessage); /* prototype to pass -Wmissing-prototypes */ XS(XS_Client_SendMarqueeMessage) { dXSARGS; if (items != 7) - Perl_croak(aTHX_ - "Usage: Client::SendMarqueeMessage(THIS, uint32 type, uint32 priority, uint32 fade_in, uint32 fade_out, uint32 duration, string msg)"); + Perl_croak(aTHX_ "Usage: Client::SendMarqueeMessage(THIS, uint32 type, uint32 priority, uint32 fade_in, uint32 fade_out, uint32 duration, string msg)"); { Client *THIS; uint32 type = (uint32) SvUV(ST(1)); @@ -6144,8 +6131,7 @@ XS(XS_Client_QuestReward); /* prototype to pass -Wmissing-prototypes */ XS(XS_Client_QuestReward) { dXSARGS; if (items < 1 || items > 9) - Perl_croak(aTHX_ - "Usage: Client::QuestReward(THIS, int32 mob, int32 copper, int32 silver, int32 gold, int32 platinum, int32 item_id, int32 exp, [bool faction = false])"); + Perl_croak(aTHX_ "Usage: Client::QuestReward(THIS, int32 mob, int32 copper, int32 silver, int32 gold, int32 platinum, int32 item_id, int32 exp, [bool faction = false])"); { Client *THIS; Mob *mob = nullptr; @@ -6245,8 +6231,7 @@ XS(XS_Client_Popup2); /* prototype to pass -Wmissing-prototypes */ XS(XS_Client_Popup2) { dXSARGS; if (items < 3 || items > 10) - Perl_croak(aTHX_ - "Usage: Client::SendFullPopup(THIS, string title, string text, uint32 popup_id, uint32 negative_id, uint32 buttons, uint32 duration, string button_name_0, string button_name_1, uint32 sound_controls)"); + Perl_croak(aTHX_ "Usage: Client::SendFullPopup(THIS, string title, string text, uint32 popup_id, uint32 negative_id, uint32 buttons, uint32 duration, string button_name_0, string button_name_1, uint32 sound_controls)"); { Client *THIS; char *Title = (char *) SvPV_nolen(ST(1)); diff --git a/zone/perl_entity.cpp b/zone/perl_entity.cpp index 58e25b263..0f7fe21c7 100644 --- a/zone/perl_entity.cpp +++ b/zone/perl_entity.cpp @@ -1222,8 +1222,7 @@ XS(XS_EntityList_MessageStatus); /* prototype to pass -Wmissing-prototypes */ XS(XS_EntityList_MessageStatus) { dXSARGS; if (items < 5) - Perl_croak(aTHX_ - "Usage: EntityList::MessageStatus(THIS, uint32 guild_id, uint32 emote_color_type, string message)"); + Perl_croak(aTHX_ "Usage: EntityList::MessageStatus(THIS, uint32 guild_id, uint32 emote_color_type, string message)"); { EntityList *THIS; uint32 to_guilddbid = (uint32) SvUV(ST(1)); @@ -1248,8 +1247,7 @@ XS(XS_EntityList_MessageClose); /* prototype to pass -Wmissing-prototypes */ XS(XS_EntityList_MessageClose) { dXSARGS; if (items < 6) - Perl_croak(aTHX_ - "Usage: EntityList::MessageClose(THIS, Mob* sender, bool skip_sender, float distance, uint32 emote_color_type, string message)"); + Perl_croak(aTHX_ "Usage: EntityList::MessageClose(THIS, Mob* sender, bool skip_sender, float distance, uint32 emote_color_type, string message)"); { EntityList *THIS; Mob *sender; @@ -1682,8 +1680,7 @@ XS(XS_EntityList_MessageGroup); /* prototype to pass -Wmissing-prototypes */ XS(XS_EntityList_MessageGroup) { dXSARGS; if (items < 5) - Perl_croak(aTHX_ - "Usage: EntityList::MessageGroup(THIS, Mob* sender, bool skip_close, uint32 emote_color_type, string message)"); + Perl_croak(aTHX_ "Usage: EntityList::MessageGroup(THIS, Mob* sender, bool skip_close, uint32 emote_color_type, string message)"); { EntityList *THIS; Mob *sender; @@ -1716,8 +1713,7 @@ XS(XS_EntityList_GetRandomClient); /* prototype to pass -Wmissing-prototypes */ XS(XS_EntityList_GetRandomClient) { dXSARGS; if ((items < 5) || (items > 6)) - Perl_croak(aTHX_ - "Usage: EntityList::GetRandomClient(THIS, float x, float y, float z, float distance, [Client* exclude_client = nullptr])"); + Perl_croak(aTHX_ "Usage: EntityList::GetRandomClient(THIS, float x, float y, float z, float distance, [Client* exclude_client = nullptr])"); { EntityList *THIS; Client *RETVAL, *c = nullptr; diff --git a/zone/perl_groups.cpp b/zone/perl_groups.cpp index 33ed9689d..c23246b4a 100644 --- a/zone/perl_groups.cpp +++ b/zone/perl_groups.cpp @@ -486,8 +486,7 @@ XS(XS_Group_TeleportGroup); /* prototype to pass -Wmissing-prototypes */ XS(XS_Group_TeleportGroup) { dXSARGS; if (items != 7) - Perl_croak(aTHX_ - "Usage: Group::TeleportGroup(THIS, Mob* sender, uint32 zone_id, float x, float y, float z, float heading)"); + Perl_croak(aTHX_ "Usage: Group::TeleportGroup(THIS, Mob* sender, uint32 zone_id, float x, float y, float z, float heading)"); { Group *THIS; Mob *sender; diff --git a/zone/perl_mob.cpp b/zone/perl_mob.cpp index 9ad3a6e8b..ca72ca803 100644 --- a/zone/perl_mob.cpp +++ b/zone/perl_mob.cpp @@ -794,8 +794,7 @@ XS(XS_Mob_Attack); /* prototype to pass -Wmissing-prototypes */ XS(XS_Mob_Attack) { dXSARGS; if (items < 2 || items > 4) - Perl_croak(aTHX_ - "Usage: Mob::Attack(THIS, Mob* other, [int hand = 13 [prim|sec]], [bool from_riposte = false])"); + Perl_croak(aTHX_ "Usage: Mob::Attack(THIS, Mob* other, [int hand = 13 [prim|sec]], [bool from_riposte = false])"); { Mob *THIS; bool RETVAL; @@ -842,8 +841,7 @@ XS(XS_Mob_Damage); /* prototype to pass -Wmissing-prototypes */ XS(XS_Mob_Damage) { dXSARGS; if (items < 5 || items > 8) - Perl_croak(aTHX_ - "Usage: Mob::Damage(THIS, Mob* from, int32 damage, uint16 spell_id, int attack_skill, [bool avoidable = true], [int8 buffslot = -1], [bool buff_tic = false])"); + Perl_croak(aTHX_ "Usage: Mob::Damage(THIS, Mob* from, int32 damage, uint16 spell_id, int attack_skill, [bool avoidable = true], [int8 buffslot = -1], [bool buff_tic = false])"); { Mob *THIS; Mob *from; @@ -1447,8 +1445,7 @@ XS(XS_Mob_MakeTempPet); /* prototype to pass -Wmissing-prototypes */ XS(XS_Mob_MakeTempPet) { dXSARGS; if (items < 2 || items > 6) - Perl_croak(aTHX_ - "Usage: Mob::MakeTempPet(THIS, uint16 spell_id, [string name = nullptr], [uint32 duration = 0], [Mob* target = nullptr], [bool sticktarg = 0])"); + Perl_croak(aTHX_ "Usage: Mob::MakeTempPet(THIS, uint16 spell_id, [string name = nullptr], [uint32 duration = 0], [Mob* target = nullptr], [bool sticktarg = 0])"); { Mob *THIS; uint16 spell_id = (uint16) SvUV(ST(1)); @@ -1498,8 +1495,7 @@ XS(XS_Mob_TypesTempPet); /* prototype to pass -Wmissing-prototypes */ XS(XS_Mob_TypesTempPet) { dXSARGS; if (items < 2 || items > 7) - Perl_croak(aTHX_ - "Usage: Mob::TypesTempPet(THIS, uint32 type_id, [string name = nullptr], [uint32 duration = 0], [bool follow = 0], [Mob* target = nullptr], [bool stick_targ = 0])"); + Perl_croak(aTHX_ "Usage: Mob::TypesTempPet(THIS, uint32 type_id, [string name = nullptr], [uint32 duration = 0], [bool follow = 0], [Mob* target = nullptr], [bool stick_targ = 0])"); { Mob *THIS; uint32 typesid = (uint32) SvUV(ST(1)); @@ -3680,8 +3676,7 @@ XS(XS_Mob_Message_StringID); /* prototype to pass -Wmissing-prototypes */ XS(XS_Mob_Message_StringID) { dXSARGS; if (items < 3 || items > 4) - Perl_croak(aTHX_ - "Usage: Mob::Message_StringID(THIS, uint32 emote_color_type, uint32 string_id, [uint32 distance = 0])"); + Perl_croak(aTHX_ "Usage: Mob::Message_StringID(THIS, uint32 emote_color_type, uint32 string_id, [uint32 distance = 0])"); { Mob *THIS; uint32 type = (uint32) SvUV(ST(1)); @@ -3805,8 +3800,7 @@ XS(XS_Mob_CastSpell); /* prototype to pass -Wmissing-prototypes */ XS(XS_Mob_CastSpell) { dXSARGS; if (items < 3 || items > 7) - Perl_croak(aTHX_ - "Usage: Mob::CastSpell(THIS, uint16 spell_id, uint16 target_id, [int slot = 22], [int32 cast_time = -1], [int32 mana_cost = -1], [int16 resist_adjust = 0])"); + Perl_croak(aTHX_ "Usage: Mob::CastSpell(THIS, uint16 spell_id, uint16 target_id, [int slot = 22], [int32 cast_time = -1], [int32 mana_cost = -1], [int16 resist_adjust = 0])"); { Mob *THIS; uint16 spell_id = (uint16) SvUV(ST(1)); @@ -3862,8 +3856,7 @@ XS(XS_Mob_SpellFinished); /* prototype to pass -Wmissing-prototypes */ XS(XS_Mob_SpellFinished) { dXSARGS; if (items < 2 || items > 5) - Perl_croak(aTHX_ - "Usage: Mob::SpellFinished(uint16 spell_id, [Mob* spell_target = this], [uint16 mana_cost = 0], [uint16 resist_diff = 0])"); + Perl_croak(aTHX_ "Usage: Mob::SpellFinished(uint16 spell_id, [Mob* spell_target = this], [uint16 mana_cost = 0], [uint16 resist_diff = 0])"); { Mob *THIS; uint16 spell_id = (uint16) SvUV(ST(1)); @@ -4045,8 +4038,7 @@ XS(XS_Mob_CanBuffStack); /* prototype to pass -Wmissing-prototypes */ XS(XS_Mob_CanBuffStack) { dXSARGS; if (items < 3 || items > 4) - Perl_croak(aTHX_ - "Usage: Mob::CanBuffStack(THIS, uint16 spell_id, uint8 caster_level, [bool fail_if_overwritten = false])"); + Perl_croak(aTHX_ "Usage: Mob::CanBuffStack(THIS, uint16 spell_id, uint8 caster_level, [bool fail_if_overwritten = false])"); { Mob *THIS; int RETVAL; @@ -5044,8 +5036,7 @@ XS(XS_Mob_AddToHateList); /* prototype to pass -Wmissing-prototypes */ XS(XS_Mob_AddToHateList) { dXSARGS; if (items < 2 || items > 7) - Perl_croak(aTHX_ - "Usage: Mob::AddToHateList(THIS, Mob* other, [int32 hate = 0], [int32 damage = 0], [bool yell_for_help = true], [bool frenzy = false], [bool buff_tic = false])"); + Perl_croak(aTHX_ "Usage: Mob::AddToHateList(THIS, Mob* other, [int32 hate = 0], [int32 damage = 0], [bool yell_for_help = true], [bool frenzy = false], [bool buff_tic = false])"); { Mob *THIS; Mob *other; @@ -5609,8 +5600,7 @@ XS(XS_Mob_NavigateTo); /* prototype to pass -Wmissing-prototypes */ XS(XS_Mob_NavigateTo) { dXSARGS; if (items < 4 || items > 5) - Perl_croak(aTHX_ - "Usage: Mob::NavigateTo(THIS, float x, float y, float z)"); + Perl_croak(aTHX_ "Usage: Mob::NavigateTo(THIS, float x, float y, float z)"); { Mob *THIS; float x = (float) SvNV(ST(1)); @@ -5735,8 +5725,7 @@ XS(XS_Mob_NPCSpecialAttacks); /* prototype to pass -Wmissing-prototypes */ XS(XS_Mob_NPCSpecialAttacks) { dXSARGS; if (items < 3 || items > 5) - Perl_croak(aTHX_ - "Usage: Mob::NPCSpecialAttacks(THIS, string abilities_string, int perm_tag, [bool reset = true], [bool remove = true])"); + Perl_croak(aTHX_ "Usage: Mob::NPCSpecialAttacks(THIS, string abilities_string, int perm_tag, [bool reset = true], [bool remove = true])"); { Mob *THIS; char *parse = (char *) SvPV_nolen(ST(1)); @@ -6476,8 +6465,7 @@ XS(XS_Mob_DoSpecialAttackDamage); /* prototype to pass -Wmissing-prototypes */ XS(XS_Mob_DoSpecialAttackDamage) { dXSARGS; if (items < 4 || items > 6) - Perl_croak(aTHX_ - "Usage: Mob::DoSpecialAttackDamage(THIS, Mob* target, int skill, int32 max_damage, [int32 min_damage = 1], [int32 hate_override = -11])"); + Perl_croak(aTHX_ "Usage: Mob::DoSpecialAttackDamage(THIS, Mob* target, int skill, int32 max_damage, [int32 min_damage = 1], [int32 hate_override = -11])"); { Mob *THIS; Mob *target; @@ -6620,8 +6608,7 @@ XS(XS_Mob_ProjectileAnim); /* prototype to pass -Wmissing-prototypes */ XS(XS_Mob_ProjectileAnim) { dXSARGS; if (items < 3 || items > 9) - Perl_croak(aTHX_ - "Usage: Mob::ProjectileAnim(THIS, Mob* mob, int item_id, [bool is_arrow = false], [float speed = 0], [float angle = 0], [float tilt = 0], [float arc = 0])"); + Perl_croak(aTHX_ "Usage: Mob::ProjectileAnim(THIS, Mob* mob, int item_id, [bool is_arrow = false], [float speed = 0], [float angle = 0], [float tilt = 0], [float arc = 0])"); { Mob *THIS; @@ -6703,8 +6690,7 @@ XS(XS_Mob_SendAppearanceEffect); /* prototype to pass -Wmissing-prototypes */ XS(XS_Mob_SendAppearanceEffect) { dXSARGS; if (items < 2 || items > 7) - Perl_croak(aTHX_ - "Usage: Mob::SendAppearanceEffect(THIS, int32 param_1, [int32 param_2 = 0], [int32 param_3 = 0], [int32 param_4 = 0], [int32 param_5 = 0], [Client* single_client_to_send_to = null])"); + Perl_croak(aTHX_ "Usage: Mob::SendAppearanceEffect(THIS, int32 param_1, [int32 param_2 = 0], [int32 param_3 = 0], [int32 param_4 = 0], [int32 param_5 = 0], [Client* single_client_to_send_to = null])"); { Mob *THIS; int32 parm1 = (int32) SvIV(ST(1)); @@ -6833,8 +6819,7 @@ XS(XS_Mob_SendIllusion); /* prototype to pass -Wmissing-prototypes */ XS(XS_Mob_SendIllusion) { dXSARGS; if (items < 2 || items > 14) - Perl_croak(aTHX_ - "Usage: Mob::SendIllusion(THIS, uint16 race, [uint8 gender = 0xFF], [uint8 texture face = 0xFF], [uint8 hairstyle = 0xFF], [uint8 hair_color = 0xFF], [uint8 beard = 0xFF], [uint8 beard_color =FF], [uint32 drakkin_tattoo = 0xFFFFFFFF], [uint32 drakkin_details = 0xFFFFFFFF], [float size = -1])"); + Perl_croak(aTHX_ "Usage: Mob::SendIllusion(THIS, uint16 race, [uint8 gender = 0xFF], [uint8 texture face = 0xFF], [uint8 hairstyle = 0xFF], [uint8 hair_color = 0xFF], [uint8 beard = 0xFF], [uint8 beard_color =FF], [uint32 drakkin_tattoo = 0xFFFFFFFF], [uint32 drakkin_details = 0xFFFFFFFF], [float size = -1])"); { Mob *THIS; uint16 race = (uint16) SvIV(ST(1)); @@ -6882,8 +6867,7 @@ XS(XS_Mob_CameraEffect); /* prototype to pass -Wmissing-prototypes */ XS(XS_Mob_CameraEffect) { dXSARGS; if (items < 2 || items > 5) - Perl_croak(aTHX_ - "Usage: Mob::CameraEffect(THIS, uint32 duration, [uint32 intensity = 0], [Client* single_client = nullptr], [bool is_world_wide = false])"); + Perl_croak(aTHX_ "Usage: Mob::CameraEffect(THIS, uint32 duration, [uint32 intensity = 0], [Client* single_client = nullptr], [bool is_world_wide = false])"); { Mob *THIS; uint32 duration = (uint32) SvUV(ST(1)); @@ -6925,8 +6909,7 @@ XS(XS_Mob_SpellEffect); /* prototype to pass -Wmissing-prototypes */ XS(XS_Mob_SpellEffect) { dXSARGS; if (items < 2 || items > 8) - Perl_croak(aTHX_ - "Usage: Mob::SpellEffect(THIS, uint32 effect, [uint32 duration = 5000], [uint32 finish_delay = 0], [bool zone_wide = false], [uint32 unk20 = 3000], [bool perm_effect = false], [Client* single_client])"); + Perl_croak(aTHX_ "Usage: Mob::SpellEffect(THIS, uint32 effect, [uint32 duration = 5000], [uint32 finish_delay = 0], [bool zone_wide = false], [uint32 unk20 = 3000], [bool perm_effect = false], [Client* single_client])"); { Mob *THIS; uint32 effect = (uint32) SvUV(ST(1)); @@ -7054,8 +7037,7 @@ XS(XS_Mob_SetGlobal); XS(XS_Mob_SetGlobal) { dXSARGS; if (items < 5 || items > 6) - Perl_croak(aTHX_ - "Usage: SetGlobal(THIS, string var_name, string new_value, int options, string duration, [Mob* other = nullptr])"); + Perl_croak(aTHX_ "Usage: SetGlobal(THIS, string var_name, string new_value, int options, string duration, [Mob* other = nullptr])"); { Mob *THIS; char *varname = (char *) SvPV_nolen(ST(1)); @@ -7091,8 +7073,7 @@ XS(XS_Mob_TarGlobal); XS(XS_Mob_TarGlobal) { dXSARGS; if (items != 7) - Perl_croak(aTHX_ - "Usage: TarGlobal(THIS, string var_name, string value, string duration, int npc_id, int character_id, int zone_id)"); + Perl_croak(aTHX_ "Usage: TarGlobal(THIS, string var_name, string value, string duration, int npc_id, int character_id, int zone_id)"); { Mob *THIS; char *varname = (char *) SvPV_nolen(ST(1)); @@ -7141,8 +7122,7 @@ XS(XS_Mob_SetSlotTint); /* prototype to pass -Wmissing-prototypes */ XS(XS_Mob_SetSlotTint) { dXSARGS; if (items != 5) - Perl_croak(aTHX_ - "Usage: Mob::SetSlotTint(THIS, uint8 material_slot, uint8 red_tint, uint8 green_tint, uint8 blue_tint)"); + Perl_croak(aTHX_ "Usage: Mob::SetSlotTint(THIS, uint8 material_slot, uint8 red_tint, uint8 green_tint, uint8 blue_tint)"); { Mob *THIS; uint8 material_slot = (uint8) SvIV(ST(1)); @@ -7167,8 +7147,7 @@ XS(XS_Mob_WearChange); /* prototype to pass -Wmissing-prototypes */ XS(XS_Mob_WearChange) { dXSARGS; if (items < 3 || items > 4) - Perl_croak(aTHX_ - "Usage: Mob::WearChange(THIS, uint8 material_slot, uint16 texture, [uint32 color = 0, uint32 hero_forge_model = 0])"); + Perl_croak(aTHX_ "Usage: Mob::WearChange(THIS, uint8 material_slot, uint16 texture, [uint32 color = 0, uint32 hero_forge_model = 0])"); { Mob *THIS; uint8 material_slot = (uint8) SvIV(ST(1)); @@ -7598,8 +7577,7 @@ XS(XS_Mob_DoMeleeSkillAttackDmg); /* prototype to pass -Wmissing-prototypes */ XS(XS_Mob_DoMeleeSkillAttackDmg) { dXSARGS; if (items != 7) - Perl_croak(aTHX_ - "Usage: Mob::DoMeleeSkillAttackDmg(THIS, Mob* target, uint16 weapon_damage, int skill, int16 chance_mod, int16 focus, uint8 can_riposte)"); + Perl_croak(aTHX_ "Usage: Mob::DoMeleeSkillAttackDmg(THIS, Mob* target, uint16 weapon_damage, int skill, int16 chance_mod, int16 focus, uint8 can_riposte)"); { Mob *THIS; Mob *target; @@ -7634,8 +7612,7 @@ XS(XS_Mob_DoArcheryAttackDmg); /* prototype to pass -Wmissing-prototypes */ XS(XS_Mob_DoArcheryAttackDmg) { dXSARGS; if (items != 7) - Perl_croak(aTHX_ - "Usage: Mob::DoArcheryAttackDmg(THIS, Mob* target, [range_weapon_item_instance = nullptr], [ammo_item_instance = nullptr], uint16 weapon_damage, int16 chance_mod, int16 focus)"); + Perl_croak(aTHX_ "Usage: Mob::DoArcheryAttackDmg(THIS, Mob* target, [range_weapon_item_instance = nullptr], [ammo_item_instance = nullptr], uint16 weapon_damage, int16 chance_mod, int16 focus)"); { Mob *THIS; Mob *target; @@ -7670,8 +7647,7 @@ XS(XS_Mob_DoThrowingAttackDmg); /* prototype to pass -Wmissing-prototypes */ XS(XS_Mob_DoThrowingAttackDmg) { dXSARGS; if (items != 7) - Perl_croak(aTHX_ - "Usage: Mob::DoThrowingAttackDmg(THIS, Mob* target, [range_weapon_item_instance = nullptr], [ammo_item_instance = nullptr], uint16 weapon_damage, int16 chance_mod, int16 focus)"); + Perl_croak(aTHX_ "Usage: Mob::DoThrowingAttackDmg(THIS, Mob* target, [range_weapon_item_instance = nullptr], [ammo_item_instance = nullptr], uint16 weapon_damage, int16 chance_mod, int16 focus)"); { Mob *THIS; Mob *target; diff --git a/zone/perl_npc.cpp b/zone/perl_npc.cpp index 366aad2ec..97dc889e1 100644 --- a/zone/perl_npc.cpp +++ b/zone/perl_npc.cpp @@ -97,8 +97,7 @@ XS(XS_NPC_AddItem); /* prototype to pass -Wmissing-prototypes */ XS(XS_NPC_AddItem) { dXSARGS; if (items < 2 || items > 10) - Perl_croak(aTHX_ - "Usage: NPC::AddItem(THIS, uint32 item_id, [uint16 charges = 0], [bool equip_item = true], [uint32 aug1 = 0], [uint32 aug2 = 0], [uint32 aug3 = 0], [uint32 aug4 = 0], [uint32 aug5 = 0], [uint32 aug6 = 0])"); + Perl_croak(aTHX_ "Usage: NPC::AddItem(THIS, uint32 item_id, [uint16 charges = 0], [bool equip_item = true], [uint32 aug1 = 0], [uint32 aug2 = 0], [uint32 aug3 = 0], [uint32 aug4 = 0], [uint32 aug5 = 0], [uint32 aug6 = 0])"); { NPC *THIS; uint32 itemid = (uint32) SvUV(ST(1)); @@ -1283,8 +1282,7 @@ XS(XS_NPC_MoveTo); /* prototype to pass -Wmissing-prototypes */ XS(XS_NPC_MoveTo) { dXSARGS; if (items != 4 && items != 5 && items != 6) - Perl_croak(aTHX_ - "Usage: NPC::MoveTo(THIS, float x, float y, float z, [float heading], [bool save_guard_location = false])"); + Perl_croak(aTHX_ "Usage: NPC::MoveTo(THIS, float x, float y, float z, [float heading], [bool save_guard_location = false])"); { NPC *THIS; float mtx = (float) SvNV(ST(1)); @@ -1391,8 +1389,7 @@ XS(XS_NPC_AI_SetRoambox); /* prototype to pass -Wmissing-prototypes */ XS(XS_NPC_AI_SetRoambox) { dXSARGS; if (items < 6 || items > 8) - Perl_croak(aTHX_ - "Usage: NPC::AI_SetRoambox(THIS, float distance, float max_x, float min_x, float max_y, float min_y, [uint32 max_delay = 2500], [uint32 min_delay = 2500])"); + Perl_croak(aTHX_ "Usage: NPC::AI_SetRoambox(THIS, float distance, float max_x, float min_x, float max_y, float min_y, [uint32 max_delay = 2500], [uint32 min_delay = 2500])"); { NPC *THIS; float iDist = (float) SvNV(ST(1)); @@ -1852,8 +1849,7 @@ XS(XS_NPC_AddSpellToNPCList); /* prototype to pass -Wmissing-prototypes */ XS(XS_NPC_AddSpellToNPCList) { dXSARGS; if (items != 7) - Perl_croak(aTHX_ - "Usage: NPC::AddAISpell(THIS, int priority, int spell_id, int type, int mana_cost, int recast_delay, int resist_adjust)"); + Perl_croak(aTHX_ "Usage: NPC::AddAISpell(THIS, int priority, int spell_id, int type, int mana_cost, int recast_delay, int resist_adjust)"); { NPC *THIS; int priority = (int) SvIV(ST(1)); diff --git a/zone/perl_raids.cpp b/zone/perl_raids.cpp index f5b91448e..72672de4e 100644 --- a/zone/perl_raids.cpp +++ b/zone/perl_raids.cpp @@ -420,8 +420,7 @@ XS(XS_Raid_TeleportGroup); /* prototype to pass -Wmissing-prototypes */ XS(XS_Raid_TeleportGroup) { dXSARGS; if (items != 8) - Perl_croak(aTHX_ - "Usage: Raid::TeleportGroup(THIS, Mob* sender, uint32 zone_id, float x, float y, float z, float heading, uint32 group_id)"); + Perl_croak(aTHX_ "Usage: Raid::TeleportGroup(THIS, Mob* sender, uint32 zone_id, float x, float y, float z, float heading, uint32 group_id)"); { Raid *THIS; Mob *sender; @@ -457,8 +456,7 @@ XS(XS_Raid_TeleportRaid); /* prototype to pass -Wmissing-prototypes */ XS(XS_Raid_TeleportRaid) { dXSARGS; if (items != 7) - Perl_croak(aTHX_ - "Usage: Raid::TeleportRaid(THIS, Mob* sender, uint32 zone_id, float x, float y, float z, float heading)"); + Perl_croak(aTHX_ "Usage: Raid::TeleportRaid(THIS, Mob* sender, uint32 zone_id, float x, float y, float z, float heading)"); { Raid *THIS; Mob *sender;