Sveiki, gal galetumet padeti perasyti koda jog bomberius spawintu y butent paskirta vieta o ne random aplink anthara ?
// Do spawn Behemoth or Bomber.
private class MobsSpawn implements Runnable
{
public MobsSpawn()
{
}
@Override
public void run()
{
L2NpcTemplate template1;
L2Spawn tempSpawn;
final boolean isBehemoth = Rnd.get(100) < FWA_PERCENTOFBEHEMOTH;
try
{
final int mobNumber = (isBehemoth ? 2 : 3);
// Set spawn.
for (int i = 0; i < mobNumber; i++)
{
if (_monsters.size() >= FWA_MAXMOBS)
break;
int npcId;
if (isBehemoth)
npcId = 29069;
else
npcId = Rnd.get(29070, 29076);
template1 = NpcTable.getInstance().getTemplate(npcId);
tempSpawn = new L2Spawn(template1);
// allocates it at random in the lair of Antharas.
int tried = 0;
boolean notFound = true;
int x = 175000;
int y = 112400;
int dt = (_antharas.getX() - x) * (_antharas.getX() - x) + (_antharas.getY() - y) * (_antharas.getY() - y);
while (tried++ < 25 && notFound)
{
final int rx = Rnd.get(175000, 179900);
final int ry = Rnd.get(112400, 116000);
final int rdt = (_antharas.getX() - rx) * (_antharas.getX() - rx) + (_antharas.getY() - ry) * (_antharas.getY() - ry);
if (GeoData.getInstance().canSeeTarget(_antharas.getX(), _antharas.getY(), -7704, rx, ry, -7704))
if (rdt < dt)
{
x = rx;
y = ry;
dt = rdt;
if (rdt <= 900000)
notFound = false;
}
}
tempSpawn.setLocx(x);
tempSpawn.setLocy(y);
tempSpawn.setLocz(-7704);
tempSpawn.setHeading(0);
tempSpawn.setAmount(1);
tempSpawn.setRespawnDelay(FWA_ACTIVITYTIMEOFANTHARAS * 2);
SpawnTable.getInstance().addNewSpawn(tempSpawn, false);
// Do spawn.
_monsters.add(tempSpawn.doSpawn());
}
}
catch (final Exception e)
{
LOGGER.warn(e.getMessage());
}
}
}