public void DespawnMonster(int monsterVnum) { Parallel.ForEach(_monsters.Where(s => s.MonsterVNum == monsterVnum), monster => { monster.SetDeathStatement(); Broadcast(StaticPacketHelper.Out(UserType.Monster, monster.MapMonsterId)); }); }
public void DespawnMonster(int monsterVnum) { Parallel.ForEach(_monsters.Where(s => s.MonsterVNum == monsterVnum), monster => { monster.IsAlive = false; monster.LastMove = DateTime.Now; monster.CurrentHp = 0; monster.CurrentMp = 0; monster.Death = DateTime.Now; Broadcast(StaticPacketHelper.Out(UserType.Monster, monster.MapMonsterId)); }); }
public List <MapNpc> GetListNpcInRange(short mapX, short mapY, byte distance, bool attackGreaterDistance = false) => _npcs.Where(s => s.CurrentHp > 0 && (!attackGreaterDistance ? s.IsInRange(mapX, mapY, distance) : !s.IsInRange(mapX, mapY, distance))).ToList();