public void openSkillCape() {
int capes = get99Count();
if (capes > 1)
capes = 1;
else
capes = 0;
c.myShopId = 14;
setupSkillCapes(capes, get99Count());
}
//public int[] skillCapes = {9747,9753,9750,9768,9756,9759,9762,9801,9807,9783 ,9798,9804,9780,9795,9792,9774,9771,9777,9786,9810 ,9765,9948,12169};
public int[] skillCapes = {9747,9753,9750,9768,9756,9759,9762,9801,9807,9783 ,9798,9804,9780,9795,9792,9774,9771,9777,9786,9810 ,9765,9948,12169,18508};
public int get99Count() {
int count = 0;
for (int j = 0; j < skillCapes.length; j++) {
if (c.getLevelForXP(c.playerXP[j]) >= 99) {
count++;
}
}
return count;
}
public void setupSkillCapes(int capes, int capes2) {
synchronized(c) {
c.getItems().resetItems(3823);
c.isShopping = true;
c.myShopId = 14;
c.getPA().sendFrame248(3824, 3822);
c.getPA().sendFrame126("Skillcape Shop", 3901);
int TotalItems = 0;
TotalItems = capes2;
if (TotalItems > Server.shopHandler.MaxShopItems) {
TotalItems = Server.shopHandler.MaxShopItems;
}
c.getOutStream().createFrameVarSizeWord(53);
c.getOutStream().writeWord(3900);
c.getOutStream().writeWord(TotalItems);
int TotalCount = 0;
int off = (capes > 1 ? 2 : 0);
for (int i = 0; i < skillCapes.length; i++) {
if (c.getLevelForXP(c.playerXP[i]) < 99)
continue;
c.getOutStream().writeByte(1);
c.getOutStream().writeWordBigEndianA(skillCapes[i] + off); // why the +2? uhh this is just from the original nrpk? i think
TotalCount++;
}
c.getOutStream().endFrameVarSizeWord();
c.flushOutStream();
}
}