Hello,
I've been trying to pass a prestige int through the SendSkill packet but I have been receiving errors as you can probably tell.
Here is what I have tried so far:
Code:
public PacketSender sendSkill(Skill skill) {
PacketBuilder out = new PacketBuilder(134);
out.put(skill.ordinal());
out.putInt(player.getSkillManager().getExperience(skill), ByteOrder.MIDDLE);
out.putShort(player.getSkillManager().getCurrentLevel(skill));
out.putShort(player.getSkillManager().getMaxLevel(skill));
out.putShort(player.getSkillManager().getPrestigeLevel(skill));
player.getSession().queueMessage(out);
return this;
}
Client sided:
Code:
case 134:
// needDrawTabArea = true;
int skillId = getInputBuffer().getUnsignedByte();
int exp = getInputBuffer().method439();
int level = getInputBuffer().getUnsignedShort();
int maxLevel = getInputBuffer().getUnsignedShort();
int prestigeLvl = getInputBuffer().getUnsignedShort();
int gainedExperience = exp - currentExp[skillId];
currentExp[skillId] = exp;
currentStats[skillId] = level;
maxStats[skillId] = maxLevel;
prestigeLevel[skillId] = prestigeLvl;
if(gainedExperience > 0)
PlayerHandler.addXP(skillId, gainedExperience);
if(skillId == 23) {
setInterfaceText(""+maxLevel+"", 28171);
}
pktType = -1;
return true;
I've also been messing around with packet sizes but I cannot seem to get it correct. (Not sure if this is what is causing the issue).
This is where I'm at right now, if anyone out there is able to give me some guidance on packet sending I would be very grateful.
Thank you in advance for anyone who may be able to help me