}
public void run()
{
int npcId;
SocialAction sa = null;
if(_socialTask != null)
{
_socialTask.cancel(false);
_socialTask = null;
}
switch(_taskId)
{
case 1: // spawn.
if(_antharas != null)
{
return;
}
// Strength of Antharas is decided by the number of players that invaded the lair.
if(_players.size() <= FWA_LIMITOFWEAK)
{
npcId = 29066; // weak
}
else if(_players.size() >= FWA_LIMITOFNORMAL)
{
npcId = 29068; // strong
}
else
{
npcId = 29067;
} // normal
Dying = false;
// do spawn.
_antharas = new L2BossInstance(IdFactory.getInstance().getNextId(), NpcTable.getTemplate(npcId));
_antharas.setSpawnedLoc(_antharasLocation);
_antharas.onSpawn();
_antharas.spawnMe(_antharas.getSpawnedLoc());
_antharas.setImobilised(true);
_state.setRespawnDate(Rnd.get(FWA_FIXINTERVALOFANTHARAS, FWA_FIXINTERVALOFANTHARAS + FWA_RANDOMINTERVALOFANTHARAS));
_state.setState(EpicBossState.State.ALIVE);
_state.update();
// setting 1st time of minions spawn task.
int intervalOfBehemoth;
int intervalOfBomber;
// Interval of minions is decided by the number of players
// that invaded the lair.
if(_players.size() <= FWA_LIMITOFWEAK) // weak
{
intervalOfBehemoth = FWA_INTERVALOFBEHEMOTHONWEAK;
intervalOfBomber = FWA_INTERVALOFBOMBERONWEAK;
}
else if(_players.size() >= FWA_LIMITOFNORMAL) // strong
{
intervalOfBehemoth = FWA_INTERVALOFBEHEMOTHONSTRONG;
intervalOfBomber = FWA_INTERVALOFBOMBERONSTRONG;
}
else
// normal
{
intervalOfBehemoth = FWA_INTERVALOFBEHEMOTHONNORMAL;
intervalOfBomber = FWA_INTERVALOFBOMBERONNORMAL;
}
// spawn Behemoth.
_behemothSpawnTask = ThreadPoolManager.getInstance().scheduleGeneral(new BehemothSpawn(intervalOfBehemoth), 30000);
// spawn Bomber.
_bomberSpawnTask = ThreadPoolManager.getInstance().scheduleGeneral(new BomberSpawn(intervalOfBomber), 30000);
_socialTask = ThreadPoolManager.getInstance().scheduleGeneral(new AntharasSpawn(2), 16);
break;
case 2:
// set camera.
for(L2Player pc : _players)
{
if(pc.getDistance(_antharas) <= _distance)
{
pc.enterMovieMode();
pc.specialCamera(_antharas, 700, 13, -19, 0, 10000);
}
else
{
pc.leaveMovieMode();
}
}
_socialTask = ThreadPoolManager.getInstance().scheduleGeneral(new AntharasSpawn(3), 3000);
break;
case 3:
// do social.
sa = new SocialAction(_antharas.getObjectId(), 1);
_antharas.broadcastPacket(sa);
// set camera.
for(L2Player pc : _players)
{
if(pc.getDistance(_antharas) <= _distance)
{
pc.enterMovieMode();
pc.specialCamera(_antharas, 700, 13, 0, 6000, 10000);
}
else
{
pc.leaveMovieMode();
}
}
_socialTask = ThreadPoolManager.getInstance().scheduleGeneral(new AntharasSpawn(4), 10000);
break;
case 4:
// set camera.
for(L2Player pc : _players)
{
if(pc.getDistance(_antharas) <= _distance)
{
pc.enterMovieMode();
pc.specialCamera(_antharas, 3800, 0, -3, 0, 10000);
}
else
{
pc.leaveMovieMode();
}
}
_socialTask = ThreadPoolManager.getInstance().scheduleGeneral(new AntharasSpawn(5), 200);
break;
case 5:
// do social.
sa = new SocialAction(_antharas.getObjectId(), 2);
_antharas.broadcastPacket(sa);
// set camera.
for(L2Player pc : _players)
{
if(pc.getDistance(_antharas) <= _distance)