Disable spawns: base checking entry, additionally - guid
Set `flags` to 1 and `data` to guid. If flags not set, all spawns of the entry are disabled.
This commit is contained in:
parent
ae88c9cdcf
commit
93abbf4c72
@ -1062,7 +1062,7 @@ void ObjectMgr::LoadCreatures()
|
|||||||
uint32 guid = fields[ 0].GetUInt32();
|
uint32 guid = fields[ 0].GetUInt32();
|
||||||
uint32 entry = fields[ 1].GetUInt32();
|
uint32 entry = fields[ 1].GetUInt32();
|
||||||
|
|
||||||
if (DisableMgr::IsDisabledFor(DISABLE_TYPE_CREATURE_SPAWN, guid))
|
if (DisableMgr::IsDisabledFor(DISABLE_TYPE_CREATURE_SPAWN, entry, NULL, 0, guid))
|
||||||
{
|
{
|
||||||
sLog.outDebug("Creature guid %u (entry %u) spawning is disabled.", guid, entry);
|
sLog.outDebug("Creature guid %u (entry %u) spawning is disabled.", guid, entry);
|
||||||
continue;
|
continue;
|
||||||
@ -1236,7 +1236,7 @@ void ObjectMgr::LoadGameObjects()
|
|||||||
uint32 guid = fields[ 0].GetUInt32();
|
uint32 guid = fields[ 0].GetUInt32();
|
||||||
uint32 entry = fields[ 1].GetUInt32();
|
uint32 entry = fields[ 1].GetUInt32();
|
||||||
|
|
||||||
if (DisableMgr::IsDisabledFor(DISABLE_TYPE_GAMEOBJECT_SPAWN, guid))
|
if (DisableMgr::IsDisabledFor(DISABLE_TYPE_GAMEOBJECT_SPAWN, entry, NULL, 0, guid))
|
||||||
{
|
{
|
||||||
sLog.outDebug("Gameobject guid %u (entry %u) spawning is disabled.", guid, entry);
|
sLog.outDebug("Gameobject guid %u (entry %u) spawning is disabled.", guid, entry);
|
||||||
continue;
|
continue;
|
||||||
|
@ -237,6 +237,17 @@ void LoadDisables()
|
|||||||
}
|
}
|
||||||
case DISABLE_TYPE_CREATURE_SPAWN:
|
case DISABLE_TYPE_CREATURE_SPAWN:
|
||||||
case DISABLE_TYPE_GAMEOBJECT_SPAWN:
|
case DISABLE_TYPE_GAMEOBJECT_SPAWN:
|
||||||
|
if ((flags & SPAWN_DISABLE_CHECK_GUID) != 0)
|
||||||
|
{
|
||||||
|
if (data0)
|
||||||
|
data->params[0].insert(data0);
|
||||||
|
else
|
||||||
|
{
|
||||||
|
ERROR_DB_STRICT_LOG("Disables type %u: required GUID is missing for entry %u, ignoring disable entry.", type, entry);
|
||||||
|
delete data;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
@ -278,7 +289,7 @@ void CheckQuestDisables()
|
|||||||
sLog.outString(">> Checked %u quest disables", count);
|
sLog.outString(">> Checked %u quest disables", count);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool IsDisabledFor(DisableType type, uint32 entry, Unit const* unit, uint8 flags)
|
bool IsDisabledFor(DisableType type, uint32 entry, Unit const* unit, uint8 flags, uint32 adData)
|
||||||
{
|
{
|
||||||
MANGOS_ASSERT(type < MAX_DISABLE_TYPES);
|
MANGOS_ASSERT(type < MAX_DISABLE_TYPES);
|
||||||
if (m_DisableMap[type].empty())
|
if (m_DisableMap[type].empty())
|
||||||
@ -366,11 +377,12 @@ bool IsDisabledFor(DisableType type, uint32 entry, Unit const* unit, uint8 flags
|
|||||||
case DISABLE_TYPE_OUTDOORPVP:
|
case DISABLE_TYPE_OUTDOORPVP:
|
||||||
case DISABLE_TYPE_ACHIEVEMENT_CRITERIA:
|
case DISABLE_TYPE_ACHIEVEMENT_CRITERIA:
|
||||||
case DISABLE_TYPE_MMAP:
|
case DISABLE_TYPE_MMAP:
|
||||||
case DISABLE_TYPE_CREATURE_SPAWN:
|
|
||||||
case DISABLE_TYPE_GAMEOBJECT_SPAWN:
|
|
||||||
return true;
|
return true;
|
||||||
case DISABLE_TYPE_VMAP:
|
case DISABLE_TYPE_VMAP:
|
||||||
return (flags & itr->second.flags) != 0;
|
return (flags & itr->second.flags) != 0;
|
||||||
|
case DISABLE_TYPE_CREATURE_SPAWN:
|
||||||
|
case DISABLE_TYPE_GAMEOBJECT_SPAWN:
|
||||||
|
return (itr->second.flags & SPAWN_DISABLE_CHECK_GUID) == 0 || itr->second.params[0].count(adData) > 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
|
@ -55,14 +55,13 @@ enum SpellDisableTypes
|
|||||||
|
|
||||||
enum SpawnDisableTypes
|
enum SpawnDisableTypes
|
||||||
{
|
{
|
||||||
SPAWN_DISABLE_FOR_ENTRY = 0,
|
SPAWN_DISABLE_CHECK_GUID = 0x1
|
||||||
SPAWN_DISABLE_FOR_GUID = 1
|
|
||||||
};
|
};
|
||||||
|
|
||||||
namespace DisableMgr
|
namespace DisableMgr
|
||||||
{
|
{
|
||||||
void LoadDisables();
|
void LoadDisables();
|
||||||
bool IsDisabledFor(DisableType type, uint32 entry, Unit const* unit = NULL, uint8 flags = 0);
|
bool IsDisabledFor(DisableType type, uint32 entry, Unit const* unit = NULL, uint8 flags = 0, uint32 data = 0);
|
||||||
void CheckQuestDisables();
|
void CheckQuestDisables();
|
||||||
bool IsVMAPDisabledFor(uint32 entry, uint8 flags);
|
bool IsVMAPDisabledFor(uint32 entry, uint8 flags);
|
||||||
bool IsPathfindingEnabled(uint32 mapId);
|
bool IsPathfindingEnabled(uint32 mapId);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user