Code:
public static void enterFightCaves() {
c.getPA().movePlayer(2413, 5117, c.playerId * 4);
}
public static void exitFightCaves() {
c.getPA().movePlayer(2438, 5168, 0);
}
private boolean waveCountStarted = false;
public void startFightCaves() {
if (!waveCountStarted) {
waveCountStarted = true;
Server.getTaskScheduler().schedule(new Task(1, true) {
int count = 0, timeUntilRound = 10;
@Override
protected void execute() {
count++;
c.getPA().walkableInterface(4535);
c.getPA().sendFrame126("" + timeUntilRound, 4536);
if (count == 2) {
timeUntilRound--;
count = 0;
}
if (timeUntilRound == 0) {
Server.npcHandler.spawnNpc(c, 2745, 2402, 5088, c.playerId * 4, 0, 15, 90, 6000, 300, true, false);
stop();
waveCountStarted = false;
}
}
});
}
}
public static boolean isInFightCaves() {
if(c.absX > 2358 && c.absX < 2433 && c.absY > 5042 && c.absY < 5121) {
return true;
}
return false;
}
public static void sendFightCaveRespawn() {
c.getPA().movePlayer(2438, 5168, 0);
}
public static void giveFightCaveRewards() {
sendFightCaveRespawn();
c.getItems().addItem(6570, 1);
c.sendMessage("Congratulations on conquering the Fight Caves! Enjoy your Fire Cape!");
c.getCombat().resetPrayers();
for (int i = 0; i < 20; i++) {
c.playerLevel[i] = c.getPA().getLevelForXP(c.playerXP[i]);
c.getPA().refreshSkill(i);
}
}