public bool IsValidMAP(uint mapid, bool startUp) { MapEntry mEntry = DBCStorage.MapStorage.LookupByKey(mapid); if (startUp) { return(mEntry != null ? true : false); } else { return(mEntry != null && (!mEntry.IsDungeon() || Cypher.ObjMgr.GetInstanceTemplate(mapid) != null)); } // TODO: add check for battleground template }