public ushort CloseCellWithoutEntitiesPositions(ushort cellId) { var cells = CloseCells(cellId); if (cells.Count() == 0) { return(0); } else { return(cells.FirstOrDefault(x => !Instance.GetEntities().ToList().ConvertAll <ushort>(w => w.CellId).Contains(x))); } }
public void RemoveGroup(AbstractMapInstance instance, MonsterRecord[] monsterRecords) { foreach (var group in instance.GetEntities <MonsterGroup>()) { if (group.GetMonsters().All(x => monsterRecords.Contains(x.Template))) { instance.RemoveEntity(group); break; } } }
public bool GroupExist(AbstractMapInstance instance, MonsterRecord[] monsterRecords) { foreach (var group in instance.GetEntities <MonsterGroup>()) { if (group.GetMonsters().All(x => monsterRecords.Contains(x.Template))) { return(true); } } return(false); }