Integer status = GrandBossManager.getInstance().getBossStatus(ANTHARASOLDID);
if (FWA_OLDANTHARAS || status == WAITING)
{
StatsSet info = GrandBossManager.getInstance().getStatsSet(ANTHARASOLDID);
Long respawnTime = info.getLong("respawn_time");
if (status == DEAD && respawnTime <= System.currentTimeMillis())
{
// the time has already expired while the server was offline. Immediately spawn antharas in his cave.
// also, the status needs to be changed to DORMANT
GrandBossManager.getInstance().setBossStatus(ANTHARASOLDID,DORMANT);
status = DORMANT;
}
else if (status == FIGHTING)
{
int loc_x = info.getInteger("loc_x");
int loc_y = info.getInteger("loc_y");
int loc_z = info.getInteger("loc_z");
int heading = info.getInteger("heading");
int hp = info.getInteger("currentHP");
int mp = info.getInteger("currentMP");
_antharas = (L2GrandBossInstance) addSpawn(ANTHARASOLDID,loc_x,loc_y,loc_z,heading,false,0);
GrandBossManager.getInstance().addBoss(_antharas);
_antharas.setCurrentHpMp(hp,mp);
_LastAction = System.currentTimeMillis();
// Start repeating timer to check for inactivity
_activityCheckTask = ThreadPoolManager.getInstance().scheduleGeneralAtFixedRate(new CheckActivity(), 60000, 60000);
}
else if (status == DEAD)
{
ThreadPoolManager.getInstance().scheduleGeneral(new UnlockAntharas(ANTHARASOLDID), respawnTime - System.currentTimeMillis());
}
else
{
setAntharasSpawnTask();
}
}
else
{
Integer statusWeak = GrandBossManager.getInstance().getBossStatus(ANTHARASWEAKID);
Integer statusNormal = GrandBossManager.getInstance().getBossStatus(ANTHARASNORMALID);
Integer statusStrong = GrandBossManager.getInstance().getBossStatus(ANTHARASSTRONGID);
int antharasId = 0;
if (statusWeak == FIGHTING || statusWeak == DEAD)
{
antharasId = ANTHARASWEAKID;
status = statusWeak;
}
else if (statusNormal == FIGHTING || statusNormal == DEAD)
{
antharasId = ANTHARASNORMALID;
status = statusNormal;
}
else if (statusStrong == FIGHTING || statusStrong == DEAD)
{
antharasId = ANTHARASSTRONGID;
status = statusStrong;
}
if (antharasId != 0 && status == FIGHTING)
{
StatsSet info = GrandBossManager.getInstance().getStatsSet(antharasId);
int loc_x = info.getInteger("loc_x");
int loc_y = info.getInteger("loc_y");
int loc_z = info.getInteger("loc_z");
int heading = info.getInteger("heading");
int hp = info.getInteger("currentHP");
int mp = info.getInteger("currentMP");
_antharas = (L2GrandBossInstance) addSpawn(antharasId,loc_x,loc_y,loc_z,heading,false,0);
GrandBossManager.getInstance().addBoss(_antharas);
_antharas.setCurrentHpMp(hp,mp);
_LastAction = System.currentTimeMillis();
// Start repeating timer to check for inactivity
_activityCheckTask = ThreadPoolManager.getInstance().scheduleGeneralAtFixedRate(new CheckActivity(), 60000, 60000);
}
else if (antharasId != 0 && status == DEAD)
{
StatsSet info = GrandBossManager.getInstance().getStatsSet(antharasId);
Long respawnTime = info.getLong("respawn_time");
if (respawnTime <= System.currentTimeMillis())
{
// the time has already expired while the server was offline. Immediately spawn antharas in his cave.
// also, the status needs to be changed to DORMANT
GrandBossManager.getInstance().setBossStatus(antharasId,DORMANT);