&& (temp > (Config.VALAKAS_DESPAWN_TIME*60000))) //15 mins by default
{
npc.getAI().setIntention(CtrlIntention.AI_INTENTION_IDLE);
//delete the actual boss
L2GrandBossInstance _boss_instance = GrandBossManager.getInstance().deleteBoss(VALAKAS);
_boss_instance.decayMe();
GrandBossManager.getInstance().setBossStatus(VALAKAS, DORMANT);
//npc.setCurrentHpMp(npc.getMaxHp(), npc.getMaxMp());
_Zone.oustAllPlayers();
cancelQuestTimer("check_activity_and_do_actions", npc, null);
i_quest2 = 0;
i_quest3 = 0;
i_quest4 = 0;
}
else if (npc.getCurrentHp() > ((npc.getMaxHp() * 1) / 4))
{
if (sk_4691 == 0 || (sk_4691 == 1 && lvl != 4))
{
npc.setTarget(npc);
npc.doCast(SkillTable.getInstance().getInfo(4691, 4));
}
}
else if (npc.getCurrentHp() > ((npc.getMaxHp() * 2) / 4.0))
{
if (sk_4691 == 0 || (sk_4691 == 1 && lvl != 3))
{
npc.setTarget(npc);
npc.doCast(SkillTable.getInstance().getInfo(4691, 3));
}
}
else if (npc.getCurrentHp() > ((npc.getMaxHp() * 3) / 4.0))
{
if (sk_4691 == 0 || (sk_4691 == 1 && lvl != 2))
{
npc.setTarget(npc);
npc.doCast(SkillTable.getInstance().getInfo(4691, 2));
}
}
else if (sk_4691 == 0 || (sk_4691 == 1 && lvl != 1))
{
npc.setTarget(npc);
npc.doCast(SkillTable.getInstance().getInfo(4691, 1));
}
}
else if (event.equalsIgnoreCase("launch_random_skill"))
{
if (!npc.isInvul())
getRandomSkill(npc);
else
npc.getAI().setIntention(CtrlIntention.AI_INTENTION_IDLE);
}
else if (event.equalsIgnoreCase("1004"))
{
startQuestTimer("1102", 1500, npc, null);
npc.broadcastPacket(new SpecialCamera(npc.getObjectId(),1300,180,-5,3000,15000));
}
else if (event.equalsIgnoreCase("1102"))
{
startQuestTimer("1103", 3300, npc, null);
npc.broadcastPacket(new SpecialCamera(npc.getObjectId(),500,180,-8,600,15000));
}
else if (event.equalsIgnoreCase("1103"))
{
startQuestTimer("1104", 2900, npc, null);
npc.broadcastPacket(new SpecialCamera(npc.getObjectId(),800,180,-8,2700,15000));
}
else if (event.equalsIgnoreCase("1104"))
{
startQuestTimer("1105", 2700, npc, null);
npc.broadcastPacket(new SpecialCamera(npc.getObjectId(),200,250,70,0,15000));
}
else if (event.equalsIgnoreCase("1105"))
{
startQuestTimer("1106", 1, npc, null);
npc.broadcastPacket(new SpecialCamera(npc.getObjectId(),1100,250,70,2500,15000));
}
else if (event.equalsIgnoreCase("1106"))
{
startQuestTimer("1107", 3200, npc, null);
npc.broadcastPacket(new SpecialCamera(npc.getObjectId(),700,150,30,0,15000));
}
else if (event.equalsIgnoreCase("1107"))
{
startQuestTimer("1108", 1400, npc, null);
npc.broadcastPacket(new SpecialCamera(npc.getObjectId(),1200,150,20,2900,15000));
}
else if (event.equalsIgnoreCase("1108"))
{
startQuestTimer("1109", 6700, npc, null);
npc.broadcastPacket(new SpecialCamera(npc.getObjectId(),750,170,15,3400,15000));
}
else if (event.equalsIgnoreCase("1109"))
{
startQuestTimer("1110", 5700, npc, null);
npc.broadcastPacket(new SpecialCamera(npc.getObjectId(),750,170,-10,3400,15000));
}
else if (event.equalsIgnoreCase("1110"))
{
GrandBossManager.getInstance().setBossStatus(VALAKAS,FIGHTING);
startQuestTimer("check_activity_and_do_actions", 60000, npc, null, true);
npc.setIsInvul(false);
getRandomSkill(npc);
}
else if (event.equalsIgnoreCase("1111"))
{
startQuestTimer("1112", 3500, npc, null);
npc.broadcastPacket(new SpecialCamera(npc.getObjectId(),1100,210,-5,3000,10000));
}
else if (event.equalsIgnoreCase("1112"))
{
startQuestTimer("1113", 4500, npc, null);
npc.broadcastPacket(new SpecialCamera(npc.getObjectId(),1300,200,-8,3000,10000));
}
else if (event.equalsIgnoreCase("1113"))
{
startQuestTimer("1114", 500, npc, null);
npc.broadcastPacket(new SpecialCamera(npc.getObjectId(),1000,190,0,3000,10000));
}
else if (event.equalsIgnoreCase("1114"))
{
startQuestTimer("1115", 4600, npc, null);
npc.broadcastPacket(new SpecialCamera(npc.getObjectId(),1700,120,0,2500,10000));
}
else if (event.equalsIgnoreCase("1115"))
{
startQuestTimer("1116", 750, npc, null);
npc.broadcastPacket(new SpecialCamera(npc.getObjectId(),1700,20,0,3000,10000));
}
else if (event.equalsIgnoreCase("1116"))
{
startQuestTimer("1117", 2500, npc, null);
npc.broadcastPacket(new SpecialCamera(npc.getObjectId(),1700,10,0,3000,10000));
}
else if (event.equalsIgnoreCase("1117"))
{
npc.broadcastPacket(new SpecialCamera(npc.getObjectId(),1700,10,0,3000,250));
if(!npc.getSpawn().is_customBossInstance()){
addSpawn(31759, 212852, -114842, -1632, 0, false, 900000);
int radius = 1500;
for (int i = 0; i < 20; i++)
{
int x = (int) (radius * Math.cos(i * .331)); //.331~2pi/19
int y = (int) (radius * Math.sin(i * .331));
addSpawn(31759, 212852 + x, -114842 + y, -1632, 0, false, 900000);
}
startQuestTimer("remove_players", 900000, null, null);
}
cancelQuestTimer("check_activity_and_do_actions", npc, null);
}
}
else
{
if (event.equalsIgnoreCase("lock_entry_and_spawn_valakas"))
{
int loc_x = 213004;
int loc_y = -114890;
int loc_z = -1595;
int heading = 0;
L2GrandBossInstance valakas = (L2GrandBossInstance) addSpawn(VALAKAS, loc_x, loc_y, loc_z, heading, false, 0);
GrandBossManager.getInstance().addBoss(valakas);
lastAttackTime = System.currentTimeMillis();
final L2NpcInstance _valakas = valakas;
ThreadPoolManager.getInstance().scheduleGeneral(new Runnable()