diff --git a/src/game/DBCEnums.h b/src/game/DBCEnums.h index 8d28b555a..d56cb7e14 100644 --- a/src/game/DBCEnums.h +++ b/src/game/DBCEnums.h @@ -247,6 +247,25 @@ enum Difficulty #define MAX_RAID_DIFFICULTY 4 #define MAX_DIFFICULTY 4 +enum SpawnMask +{ + SPAWNMASK_CONTINENT = 1, // any any maps without spawn modes + + SPAWNMASK_DUNGEON_NORMAL = (1 << DUNGEON_DIFFICULTY_NORMAL), + SPAWNMASK_DUNGEON_HEROIC = (1 << DUNGEON_DIFFICULTY_HEROIC), + SPAWNMASK_DUNGEON_ALL = (SPAWNMASK_DUNGEON_NORMAL | SPAWNMASK_DUNGEON_HEROIC), + + SPAWNMASK_RAID_10MAN_NORMAL = (1 << RAID_DIFFICULTY_10MAN_NORMAL), + SPAWNMASK_RAID_25MAN_NORMAL = (1 << RAID_DIFFICULTY_25MAN_NORMAL), + SPAWNMASK_RAID_NORMAL_ALL = (SPAWNMASK_RAID_10MAN_NORMAL | SPAWNMASK_RAID_25MAN_NORMAL), + + SPAWNMASK_RAID_10MAN_HEROIC = (1 << RAID_DIFFICULTY_10MAN_HEROIC), + SPAWNMASK_RAID_25MAN_HEROIC = (1 << RAID_DIFFICULTY_25MAN_HEROIC), + SPAWNMASK_RAID_HEROIC_ALL = (SPAWNMASK_RAID_10MAN_HEROIC | SPAWNMASK_RAID_25MAN_HEROIC), + + SPAWNMASK_RAID_ALL = (SPAWNMASK_RAID_NORMAL_ALL | SPAWNMASK_RAID_HEROIC_ALL), +}; + enum FactionTemplateFlags { FACTION_TEMPLATE_FLAG_CONTESTED_GUARD = 0x00001000, // faction will attack players that were involved in PvP combats diff --git a/src/game/ObjectMgr.cpp b/src/game/ObjectMgr.cpp index 22a46ae1f..dca6aa441 100644 --- a/src/game/ObjectMgr.cpp +++ b/src/game/ObjectMgr.cpp @@ -1080,6 +1080,29 @@ void ObjectMgr::LoadCreatures() int16 gameEvent = fields[18].GetInt16(); int16 PoolId = fields[19].GetInt16(); + MapEntry const* mapEntry = sMapStore.LookupEntry(data.mapid); + if(!mapEntry) + { + sLog.outErrorDb("Table `creature` have creature (GUID: %u) that spawned at not existed map (Id: %u), skipped.",guid, data.mapid ); + continue; + } + + if(mapEntry->IsNonRaidDungeon()) + { + if(data.spawnMask & ~SPAWNMASK_DUNGEON_ALL) + sLog.outErrorDb("Table `creature` have creature (GUID: %u) that have wrong spawn mask %u for non-raid dungeon map (Id: %u).",guid, data.spawnMask, data.mapid ); + } + else if(mapEntry->IsRaid()) + { + if(data.spawnMask & ~SPAWNMASK_RAID_ALL) + sLog.outErrorDb("Table `creature` have creature (GUID: %u) that have wrong spawn mask %u for raid dungeon map (Id: %u).",guid, data.spawnMask, data.mapid ); + } + else + { + if(data.spawnMask & ~SPAWNMASK_CONTINENT) + sLog.outErrorDb("Table `creature` have creature (GUID: %u) that have wrong spawn mask %u for non-dungeon map (Id: %u).",guid, data.spawnMask, data.mapid ); + } + if(heroicCreatures.find(data.id)!=heroicCreatures.end()) { sLog.outErrorDb("Table `creature` have creature (GUID: %u) that listed as heroic template (entry: %u) in `creature_template`, skipped.",guid, data.id ); @@ -1103,8 +1126,7 @@ void ObjectMgr::LoadCreatures() if(cInfo->flags_extra & CREATURE_FLAG_EXTRA_INSTANCE_BIND) { - MapEntry const* map = sMapStore.LookupEntry(data.mapid); - if(!map || !map->IsDungeon()) + if(!mapEntry || !mapEntry->IsDungeon()) sLog.outErrorDb("Table `creature` have creature (GUID: %u Entry: %u) with `creature_template`.`flags_extra` including CREATURE_FLAG_EXTRA_INSTANCE_BIND but creature are not in instance.",guid,data.id); } @@ -1259,6 +1281,29 @@ void ObjectMgr::LoadGameobjects() data.rotation3 = fields[10].GetFloat(); data.spawntimesecs = fields[11].GetInt32(); + MapEntry const* mapEntry = sMapStore.LookupEntry(data.mapid); + if(!mapEntry) + { + sLog.outErrorDb("Table `gameobject` have gameobject (GUID: %u Entry: %u) that spawned at not existed map (Id: %u), skip", guid, data.id, data.mapid); + continue; + } + + if(mapEntry->IsNonRaidDungeon()) + { + if(data.spawnMask & ~SPAWNMASK_DUNGEON_ALL) + sLog.outErrorDb("Table `gameobject` have gameobject (GUID: %u Entry: %u) that have wrong spawn mask %u for non-raid dungeon map (Id: %u), skip", guid, data.id, data.spawnMask, data.mapid); + } + else if(mapEntry->IsRaid()) + { + if(data.spawnMask & ~SPAWNMASK_RAID_ALL) + sLog.outErrorDb("Table `gameobject` have gameobject (GUID: %u Entry: %u) that have wrong spawn mask %u for raid dungeon map (Id: %u), skip", guid, data.id, data.spawnMask, data.mapid); + } + else + { + if(data.spawnMask & ~SPAWNMASK_CONTINENT) + sLog.outErrorDb("Table `gameobject` have gameobject (GUID: %u Entry: %u) that have wrong spawn mask %u for non-dungeon map (Id: %u), skip", guid, data.id, data.spawnMask, data.mapid); + } + if (data.spawntimesecs == 0 && gInfo->IsDespawnAtAction()) { sLog.outErrorDb("Table `gameobject` have gameobject (GUID: %u Entry: %u) with `spawntimesecs` (0) value, but gameobejct marked as despawnable at action.", guid, data.id); diff --git a/src/shared/revision_nr.h b/src/shared/revision_nr.h index 9792c806a..7a1fd1a9a 100644 --- a/src/shared/revision_nr.h +++ b/src/shared/revision_nr.h @@ -1,4 +1,4 @@ #ifndef __REVISION_NR_H__ #define __REVISION_NR_H__ - #define REVISION_NR "8696" + #define REVISION_NR "8697" #endif // __REVISION_NR_H__