feat(Core/Conf): handle custom creatures IDs and exclude them from checks (#10367)
This commit is contained in:
@@ -22,6 +22,7 @@
|
|||||||
#include "CharacterCache.h"
|
#include "CharacterCache.h"
|
||||||
#include "Chat.h"
|
#include "Chat.h"
|
||||||
#include "Common.h"
|
#include "Common.h"
|
||||||
|
#include "Config.h"
|
||||||
#include "DatabaseEnv.h"
|
#include "DatabaseEnv.h"
|
||||||
#include "DisableMgr.h"
|
#include "DisableMgr.h"
|
||||||
#include "GameEventMgr.h"
|
#include "GameEventMgr.h"
|
||||||
@@ -1173,11 +1174,20 @@ void ObjectMgr::CheckCreatureTemplate(CreatureTemplate const* cInfo)
|
|||||||
const_cast<CreatureTemplate*>(cInfo)->DamageModifier *= Creature::_GetDamageMod(cInfo->rank);
|
const_cast<CreatureTemplate*>(cInfo)->DamageModifier *= Creature::_GetDamageMod(cInfo->rank);
|
||||||
|
|
||||||
// Hack for modules
|
// Hack for modules
|
||||||
switch (cInfo->Entry)
|
std::vector<uint32> CustomCreatures;
|
||||||
|
std::string stringCreatureIds(sConfigMgr->GetOption<std::string>("Creatures.CustomIDs", ""));
|
||||||
|
for (std::string_view id : Acore::Tokenize(stringCreatureIds, ',', false))
|
||||||
{
|
{
|
||||||
case 190010: // Transmog Module
|
uint32 entry = Acore::StringTo<uint32>(id).value_or(0);
|
||||||
return;
|
CustomCreatures.emplace_back(entry);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
for (auto const& itr : CustomCreatures)
|
||||||
|
{
|
||||||
|
if (cInfo->Entry == itr)
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (cInfo->GossipMenuId && !(cInfo->npcflag & UNIT_NPC_FLAG_GOSSIP))
|
if (cInfo->GossipMenuId && !(cInfo->npcflag & UNIT_NPC_FLAG_GOSSIP))
|
||||||
{
|
{
|
||||||
LOG_ERROR("sql.sql", "Creature (Entry: {}) has assigned gossip menu {}, but npcflag does not include UNIT_NPC_FLAG_GOSSIP (1).", cInfo->Entry, cInfo->GossipMenuId);
|
LOG_ERROR("sql.sql", "Creature (Entry: {}) has assigned gossip menu {}, but npcflag does not include UNIT_NPC_FLAG_GOSSIP (1).", cInfo->Entry, cInfo->GossipMenuId);
|
||||||
|
|||||||
@@ -1796,6 +1796,16 @@ NpcRegenHPIfTargetIsUnreachable = 1
|
|||||||
|
|
||||||
NpcRegenHPTimeIfTargetIsUnreachable = 10
|
NpcRegenHPTimeIfTargetIsUnreachable = 10
|
||||||
|
|
||||||
|
# Creatures.CustomIDs
|
||||||
|
# Description: The list of custom creatures with gossip dialogues hardcoded in core,
|
||||||
|
# divided by "," without spaces.
|
||||||
|
# It is implied that you do not use for these NPC dialogs data from "gossip_menu" table.
|
||||||
|
# Server will skip these IDs during the definitions validation process.
|
||||||
|
# Example: Creatures.CustomIDs = "190010,55005,999991" - Npc for Transmog, Guild-zone and 1v1-arena modules
|
||||||
|
# Default: ""
|
||||||
|
|
||||||
|
Creatures.CustomIDs = "190010"
|
||||||
|
|
||||||
#
|
#
|
||||||
###################################################################################################
|
###################################################################################################
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user