Added rule 'NPC:UseClassAsLastName' to allow certain npcs' class names to be hidden

This commit is contained in:
Uleat 2016-07-03 19:44:45 -04:00
parent dcd276a5ce
commit 3d61df253d
5 changed files with 6 additions and 2 deletions

View File

@ -502,6 +502,7 @@ RULE_BOOL(NPC, LiveLikeEnrage, false) // If set to true then only player control
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_CATEGORY_END()
RULE_CATEGORY(Aggro)

View File

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

View File

@ -350,6 +350,7 @@
9094|2015_12_29_quest_zone_events.sql|SELECT * FROM perl_event_export_settings WHERE event_description = 'EVENT_SPAWN_ZONE'|empty|
9095|2016_01_08_command_find_aliases.sql|SELECT * FROM `command_settings` WHERE `command` LIKE 'findaliases'|empty|
9096|2016_03_05_secondary_recall.sql|SHOW COLUMNS FROM `character_bind` LIKE 'slot'|empty|
9097|2016_07_03_npc_class_as_last_name.sql|SELECT `rule_name` FROM `rule_values` WHERE `rule_name` LIKE 'NPC:UseClassAsLastName'|empty|
# Upgrade conditions:
# This won't be needed after this system is implemented, but it is used database that are not

View File

@ -0,0 +1,2 @@
INSERT INTO `rule_values` (`ruleset_id`, `rule_name`, `rule_value`, `notes`) VALUES
(1, 'NPC:UseClassAsLastName', 'true', 'Uses class archetype as LastName for npcs with none');

View File

@ -909,7 +909,7 @@ void Mob::CreateSpawnPacket(EQApplicationPacket* app, Mob* ForWho) {
NewSpawn_Struct* ns = (NewSpawn_Struct*)app->pBuffer;
FillSpawnStruct(ns, ForWho);
if(strlen(ns->spawn.lastName) == 0)
if(RuleB(NPC, UseClassAsLastName) && strlen(ns->spawn.lastName) == 0)
{
switch(ns->spawn.class_)
{