public void AddBoss(int raceId, int amount = 1)
{
var rnd = RandomProvider.Get();
var end = this.Generator.Floors.Last().MazeGenerator.EndPos;
var endX = end.X * TileSize + TileSize / 2;
var endY = end.Y * TileSize + TileSize / 2;
var regionId = this.Regions.Last().Id;
for (int i = 0; i < amount; ++i)
{
var pos = new Position(endX, endY + TileSize / 2);
pos = pos.GetRandomInRange(TileSize / 2, rnd);
var npc = new NPC(raceId);
npc.Death += this.OnBossDeath;
npc.Spawn(regionId, pos.X, pos.Y);
Send.SpawnEffect(SpawnEffect.Monster, regionId, pos.X, pos.Y, npc, npc);
if (npc.AI != null)
npc.AI.Activate(0);
}
Interlocked.Add(ref _bossesRemaining, amount);
}