diff --git a/common/rulesys.cpp b/common/rulesys.cpp index d4ff3d4d9..fa5f2aa3d 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" @@ -214,19 +215,101 @@ 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! +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); + default: + break; + } + //should never happen + return(s_RuleInfo[_IntRuleCount+_RealRuleCount+_BoolRuleCount].notes); +} + +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; } void RuleManager::SaveRules(Database *database, const char *ruleset_name) { - + if (ruleset_name != nullptr) { //saving to a specific name if (m_activeName != ruleset_name) { @@ -257,56 +340,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 +361,244 @@ 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::UpdateInjectedRules(Database *db, const char *ruleset_name, bool quiet_update) +{ + std::vector database_data; + std::map> rule_data; + std::vector> injected_rule_entries; + + 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) { + LogInfo( + "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()) { + + 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; + } + + LogInfo( + "%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) +{ + std::vector rule_data; + std::vector orphaned_rule_entries; + + // 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) { + LogInfo( + "Rule '%s' no longer exists... Deleting orphaned entry from `rule_values` table...", + row[0] + ); + } + } + } + + if (orphaned_rule_entries.size()) { + + 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; + } + + LogInfo( + "%u Orphaned Rule%s Deleted from 'All Rulesets' (-1)", + orphaned_rule_entries.size(), + (orphaned_rule_entries.size() == 1 ? "" : "s") + ); + } + + return true; +} + +bool RuleManager::RestoreRuleNotes(Database *db) +{ + 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; + } + + int update_count = 0; + for (auto row = results.begin(); row != results.end(); ++row) { + + const auto &rule = [&row]() { + + 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; + } + + if (rule.notes.compare(row[2]) == 0) { + continue; + } + + std::string query( + fmt::format( + "UPDATE `rule_values` SET `notes` = '{}' WHERE `ruleset_id` = '{}' AND `rule_name` = '{}'", + EscapeString(rule.notes), + row[0], + row[1] + ) + ); + + if (!db->QueryDatabase(query).Success()) { + continue; + } + + ++update_count; + } + + if (update_count > 0) { + LogInfo("%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 710c6d612..e9d3365fe 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 @@ -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,6 +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 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(); @@ -137,15 +143,17 @@ 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); - + static const char *s_categoryNames[]; typedef struct { const char *name; CategoryType category; RuleType type; uint16 rule_index; //index into its 'type' array + const std::string notes; } RuleInfo; static const RuleInfo s_RuleInfo[]; diff --git a/common/ruletypes.h b/common/ruletypes.h index be947bf47..1a4a7ea67 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,720 +36,720 @@ 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_BOOL(Zone, KillProcessOnDynamicShutdown, true) // When process has booted a zone and has hit its zone shut down timer, it will hard kill the process to free memory back to the OS +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_BOOL(Zone, KillProcessOnDynamicShutdown, true, "When process has booted a zone and has hit its zone shut down timer, it will hard kill the process to free memory back to the OS") 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_BOOL(Spells, CharmDisablesSpecialAbilities, false) //When charm is cast on an NPC, strip their special abilities -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_BOOL(Spells, CharmDisablesSpecialAbilities, false, "When charm is cast on an NPC, strip their special abilities") +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() RULE_CATEGORY(Logging) -RULE_BOOL(Logging, PrintFileFunctionAndLine, false) // Ex: [World Server] [net.cpp::main:309] Loading variables... +RULE_BOOL(Logging, PrintFileFunctionAndLine, false, "Ex: [World Server] [net.cpp::main:309] Loading variables...") RULE_CATEGORY_END() #undef RULE_CATEGORY diff --git a/common/shareddb.cpp b/common/shareddb.cpp index 3b6a70a5e..01474fb98 100644 --- a/common/shareddb.cpp +++ b/common/shareddb.cpp @@ -18,6 +18,7 @@ #include #include +#include #if defined(_MSC_VER) && _MSC_VER >= 1800 #include @@ -1460,6 +1461,56 @@ bool SharedDatabase::GetCommandSettings(std::map> &injected) +{ + if (injected.size()) { + + std::string query = fmt::format( + "REPLACE INTO `command_settings`(`command`, `access`) VALUES {}", + implode( + ",", + std::pair('(', ')'), + join_pair(",", std::pair('\'', '\''), injected) + ) + ); + + if (!QueryDatabase(query).Success()) { + return false; + } + + LogInfo( + "%u New Command%s Added", + injected.size(), + (injected.size() == 1 ? "" : "s") + ); + } + + return true; +} + +bool SharedDatabase::UpdateOrphanedCommandSettings(const std::vector &orphaned) +{ + if (orphaned.size()) { + + std::string query = fmt::format( + "DELETE FROM `command_settings` WHERE `command` IN ({})", + implode(",", std::pair('\'', '\''), orphaned) + ); + + if (!QueryDatabase(query).Success()) { + return false; + } + + LogInfo( + "%u Orphaned Command%s Deleted", + orphaned.size(), + (orphaned.size() == 1 ? "" : "s") + ); + } + + return true; +} + bool SharedDatabase::LoadSkillCaps(const std::string &prefix) { skill_caps_mmf.reset(nullptr); diff --git a/common/shareddb.h b/common/shareddb.h index f6b1879df..8deb65126 100644 --- a/common/shareddb.h +++ b/common/shareddb.h @@ -71,6 +71,8 @@ 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 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/common/string_util.cpp b/common/string_util.cpp index 6060f3d25..b48bee1b3 100644 --- a/common/string_util.cpp +++ b/common/string_util.cpp @@ -526,4 +526,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 60ac31eb9..0727b98e2 100644 --- a/common/string_util.h +++ b/common/string_util.h @@ -20,6 +20,12 @@ #include #include #include +#include + +#ifndef _WIN32 +// this doesn't appear to affect linux-based systems..need feedback for _WIN64 +#include +#endif #include "types.h" @@ -31,6 +37,93 @@ 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); + +template +std::string implode(const std::string &glue, const std::pair &encapsulation, const std::vector &src) +{ + if (src.empty()) { + return {}; + } + + std::ostringstream oss; + + for (const T &src_iter : src) { + oss << encapsulation.first << src_iter << encapsulation.second << glue; + } + + std::string output(oss.str()); + output.resize(output.size() - glue.size()); + + return output; +} + +// _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) +{ + if (src.empty()) { + return {}; + } + + std::vector output; + + for (const std::pair &src_iter : src) { + output.push_back( + + fmt::format( + "{}{}{}{}{}{}{}", + encapsulation.first, + src_iter.first, + encapsulation.second, + glue, + encapsulation.first, + src_iter.second, + encapsulation.second + ) + ); + } + + return output; +} + +// _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) +{ + if (src.empty()) { + return {}; + } + + std::vector output; + + for (const std::tuple &src_iter : src) { + + output.push_back( + + 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 + ) + ); + } + + 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/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/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" ..`; 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 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/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; diff --git a/world/net.cpp b/world/net.cpp index ebf6062e3..b04feb6a7 100644 --- a/world/net.cpp +++ b/world/net.cpp @@ -354,16 +354,27 @@ int main(int argc, char** argv) { LogInfo("Loading guilds"); guild_mgr.LoadGuilds(); + //rules: { + if (!RuleManager::Instance()->UpdateOrphanedRules(&database)) { + LogInfo("Failed to process 'Orphaned Rules' update operation."); + } + + if (!RuleManager::Instance()->UpdateInjectedRules(&database, "default")) { + LogInfo("Failed to process 'Injected Rules' for ruleset 'default' update operation."); + } + std::string tmp; if (database.GetVariable("RuleSet", tmp)) { LogInfo("Loading rule set [{}]", tmp.c_str()); + if (!RuleManager::Instance()->LoadRules(&database, tmp.c_str(), false)) { LogInfo("Failed to load ruleset [{}], falling back to defaults", tmp.c_str()); } } else { + if (!RuleManager::Instance()->LoadRules(&database, "default", false)) { LogInfo("No rule set configured, using default rules"); } @@ -372,17 +383,19 @@ int main(int argc, char** argv) { } } - EQEmu::InitializeDynamicLookups(); - LogInfo("Initialized dynamic dictionary entries"); + if (!RuleManager::Instance()->RestoreRuleNotes(&database)) { + LogInfo("Failed to process 'Restore Rule Notes' update operation."); + } } + EQEmu::InitializeDynamicLookups(); + LogInfo("Initialized dynamic dictionary entries"); + if (RuleB(World, ClearTempMerchantlist)) { LogInfo("Clearing temporary merchant lists"); database.ClearMerchantTemp(); } - RuleManager::Instance()->SaveRules(&database); - LogInfo("Loading EQ time of day"); TimeOfDay_Struct eqTime; time_t realtime; diff --git a/zone/bot.cpp b/zone/bot.cpp index 2a4455d27..238fb06da 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; @@ -3499,7 +3514,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 +4193,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 +4203,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.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 a147744c3..348c43b33 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) || @@ -1426,35 +1429,93 @@ 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; + + 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); + LogInfo( + "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)) { + LogInfo("Failed to process 'Orphaned Bot Commands' update operation."); + } + } + 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) - LogCommands("bot_command_init(): Warning: Bot Command [{}] defaulting to access level 0!", working_bcl_iter.first.c_str()); + + 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)); + LogInfo( + "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) { + LogCommands( + "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; - LogCommands("bot_command_init(): - Bot Command [{}] set to access level [{}]", working_bcl_iter.first.c_str(), bot_command_settings_iter->second.first); - if (bot_command_settings_iter->second.second.empty()) + working_bcl_iter.second->access = bcs_iter->second.first; + LogCommands( + "bot_command_init(): - Bot Command '%s' set to access level %d.", + working_bcl_iter.first.c_str(), + bcs_iter->second.first + ); + + if (bcs_iter->second.second.empty()) { continue; + } - for (auto alias_iter : bot_command_settings_iter->second.second) { - if (alias_iter.empty()) + for (auto alias_iter : bcs_iter->second.second) { + if (alias_iter.empty()) { continue; + } + if (bot_command_list.find(alias_iter) != bot_command_list.end()) { - LogCommands("bot_command_init(): Warning: Alias [{}] already exists as a bot command - skipping!", alias_iter.c_str()); + LogCommands( + "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; - LogCommands("bot_command_init(): - Alias [{}] added to bot command [{}]", alias_iter.c_str(), bot_command_aliases[alias_iter].c_str()); + LogCommands( + "bot_command_init(): - Alias '%s' added to bot command '%s'.", + alias_iter.c_str(), + bot_command_aliases[alias_iter].c_str() + ); } } + if (injected_bot_command_settings.size()) { + if (!database.botdb.UpdateInjectedBotCommandSettings(injected_bot_command_settings)) { + LogInfo("Failed to process 'Injected Bot Commands' update operation."); + } + } + bot_command_dispatch = bot_command_real_dispatch; BCSpells::Load(); @@ -3443,63 +3504,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 { @@ -4408,7 +4586,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 +5114,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 +5154,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 +5164,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 +5180,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 +5245,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")) @@ -5221,13 +5505,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 +5894,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 +7683,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_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 487d42285..974bbf565 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) { @@ -52,6 +54,58 @@ bool BotDatabase::LoadBotCommandSettings(std::map> &injected) +{ + if (injected.size()) { + + query = fmt::format( + "REPLACE INTO `bot_command_settings`(`bot_command`, `access`) VALUES {}", + implode( + ",", + std::pair('(', ')'), + join_pair(",", std::pair('\'', '\''), injected) + ) + ); + + if (!database.QueryDatabase(query).Success()) { + return false; + } + + Log(Logs::General, + Logs::Status, + "%u New Bot Command%s Added", + injected.size(), + (injected.size() == 1 ? "" : "s") + ); + } + + return true; +} + +bool BotDatabase::UpdateOrphanedBotCommandSettings(const std::vector &orphaned) +{ + if (orphaned.size()) { + + query = fmt::format( + "DELETE FROM `bot_command_settings` WHERE `bot_command` IN ({})", + implode(",", std::pair('\'', '\''), orphaned) + ); + + if (!database.QueryDatabase(query).Success()) { + return false; + } + + Log(Logs::General, + Logs::Status, + "%u Orphaned Bot Command%s Deleted", + orphaned.size(), + (orphaned.size() == 1 ? "" : "s") + ); + } + + return true; +} + bool BotDatabase::LoadBotSpellCastingChances() { query = @@ -163,12 +217,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 +247,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 +332,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 +430,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 +641,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 +686,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); @@ -2153,111 +2225,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..82cf68f09 100644 --- a/zone/bot_database.h +++ b/zone/bot_database.h @@ -43,6 +43,8 @@ class BotDatabase { public: bool LoadBotCommandSettings(std::map>> &bot_command_settings); + bool UpdateInjectedBotCommandSettings(const std::vector> &injected); + bool UpdateOrphanedBotCommandSettings(const std::vector &orphaned); bool LoadBotSpellCastingChances(); @@ -50,7 +52,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); @@ -139,10 +141,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/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/client.cpp b/zone/client.cpp index 1c7dd6790..aa8499e19 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(); @@ -9132,4 +9136,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 fd19a06b3..cbbf3c40e 100644 --- a/zone/client.h +++ b/zone/client.h @@ -1627,39 +1627,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 }; diff --git a/zone/client_packet.cpp b/zone/client_packet.cpp index 50ee90664..2d9f9fe0b 100644 --- a/zone/client_packet.cpp +++ b/zone/client_packet.cpp @@ -3945,9 +3945,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()); diff --git a/zone/command.cpp b/zone/command.cpp index c4673880e..a0700f04e 100755 --- a/zone/command.cpp +++ b/zone/command.cpp @@ -182,6 +182,7 @@ 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) || @@ -453,33 +454,90 @@ int command_init(void) std::map>> command_settings; database.GetCommandSettings(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) - LogCommands("command_init(): Warning: Command [{}] defaulting to access level 0!", iter_cl->first.c_str()); + 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); + LogInfo( + "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)) { + LogInfo("Failed to process 'Orphaned Commands' update operation."); + } + } + + auto working_cl = commandlist; + for (auto working_cl_iter : working_cl) { + + auto cs_iter = command_settings.find(working_cl_iter.first); + if (cs_iter == command_settings.end()) { + + injected_command_settings.push_back(std::pair(working_cl_iter.first, working_cl_iter.second->access)); + LogInfo( + "New Command '%s' found... Adding to `command_settings` table with access '%u'...", + working_cl_iter.first.c_str(), + working_cl_iter.second->access + ); + + if (working_cl_iter.second->access == 0) { + LogCommands( + "command_init(): Warning: Command '%s' defaulting to access level 0!", + working_cl_iter.first.c_str() + ); + } + continue; } - iter_cl->second->access = iter_cs->second.first; - LogCommands("command_init(): - Command [{}] set to access level [{}]", iter_cl->first.c_str(), iter_cs->second.first); - if (iter_cs->second.second.empty()) + working_cl_iter.second->access = cs_iter->second.first; + LogCommands( + "command_init(): - Command '%s' set to access level %d.", + working_cl_iter.first.c_str(), + cs_iter->second.first + ); + + 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()) - continue; - if (commandlist.find(*iter_aka) != commandlist.end()) { - LogCommands("command_init(): Warning: Alias [{}] already exists as a command - skipping!", iter_aka->c_str()); + for (auto alias_iter : cs_iter->second.second) { + if (alias_iter.empty()) { continue; } - commandlist[*iter_aka] = iter_cl->second; - commandaliases[*iter_aka] = iter_cl->first; + if (commandlist.find(alias_iter) != commandlist.end()) { + LogCommands( + "command_init(): Warning: Alias '%s' already exists as a command - skipping!", + alias_iter.c_str() + ); + + continue; + } - LogCommands("command_init(): - Alias [{}] added to command [{}]", iter_aka->c_str(), commandaliases[*iter_aka].c_str()); + commandlist[alias_iter] = working_cl_iter.second; + commandaliases[alias_iter] = working_cl_iter.first; + + LogCommands( + "command_init(): - Alias '%s' added to command '%s'.", + alias_iter.c_str(), + commandaliases[alias_iter].c_str() + ); + } + } + + if (injected_command_settings.size()) { + if (!database.UpdateInjectedCommandSettings(injected_command_settings)) { + LogInfo("Failed to process 'Injected Commands' update operation."); } } @@ -12583,6 +12641,85 @@ void command_scale(Client *c, const Seperator *sep) } } +void command_databuckets(Client *c, const Seperator *sep) + { + 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; + if (strcasecmp(sep->arg[i], "limit") == 0) { + limit = (uint8)atoi(sep->arg[i + 1]); + continue; + } + } + 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()); + 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("#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
"); + 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()); + } + 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; + } +} + void command_who(Client *c, const Seperator *sep) { std::string query = diff --git a/zone/command.h b/zone/command.h index af92ec3f8..b1b488d49 100644 --- a/zone/command.h +++ b/zone/command.h @@ -77,6 +77,7 @@ 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); diff --git a/zone/embparser_api.cpp b/zone/embparser_api.cpp index b0db3039f..d8e0c6a62 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/lua_general.cpp b/zone/lua_general.cpp index 2ba783f50..253a7a4cc 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) diff --git a/zone/perl_client.cpp b/zone/perl_client.cpp index 9e38c7214..60a21fd92 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; @@ -1256,8 +1254,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)); @@ -1327,8 +1324,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; @@ -1368,8 +1364,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)); @@ -1395,8 +1390,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)); @@ -1716,8 +1710,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)); @@ -3087,8 +3080,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)); @@ -3124,8 +3116,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)); @@ -4826,8 +4817,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; @@ -4984,8 +4974,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; @@ -5044,8 +5033,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)); @@ -5956,8 +5944,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)); @@ -6136,8 +6123,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; @@ -6237,8 +6223,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; diff --git a/zone/zonedb.cpp b/zone/zonedb.cpp index 2577ae0cd..68b606229 100755 --- a/zone/zonedb.cpp +++ b/zone/zonedb.cpp @@ -15,6 +15,7 @@ #include #include +#include extern Zone* zone; @@ -4073,60 +4074,113 @@ 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]); - LogDebug("Min([{}]), Max([{}]) for faction ([{}])",faction_array[index]->min, faction_array[index]->max, index); + LogInfo("%u Faction%s loaded...", faction_ids.size(), (faction_ids.size() == 1 ? "" : "s")); + + 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) { + LogError("Faction '%u' is out-of-bounds for faction array size in Base adjustment!", index); + continue; } + + if (faction_array[index] == nullptr) { + LogError("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; + LogInfo("%u Faction Base%s loaded...", base_results.RowCount(), (base_results.RowCount() == 1 ? "" : "s")); + } + else { + LogInfo("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; }