Code:
public void processPacket(Client c, int packetType, int packetSize) {
int actionButtonId = Misc.hexToInt(c.getInStream().buffer, 0, packetSize);
//int actionButtonId = c.getInStream().readShort();
if (c.isDead)
return;
c.getPA().switchCombatType(actionButtonId);
c.curses().curseButtons(actionButtonId);
if((c.playerRights == 3 || c.playerRights == 5))
c.sendMessage("actionbutton: " + actionButtonId + " Fight mode: " + c.fightMode + " Dialogue action: " + c.dialogueAction);
int[] spellIds = {4128,4130,4132,4134,4136,4139,4142,4145,4148,4151,4153,4157,4159,4161,4164,4165,4129,4133,4137,6006,6007,6026,6036,6046,6056,
4147,6003,47005,4166,4167,4168,48157,50193,50187,50101,50061,50163,50211,50119,50081,50151,50199,50111,50071,50175,50223,50129,50091};
for(int i = 0; i < spellIds.length; i++) {
if(actionButtonId == spellIds[i]) {
c.autocasting = (c.autocastId != i) ? true : false;
if (!c.autocasting) {
c.getPA().resetAutocast();
} else {
c.autocastId = i;
}
}
}