Quote fromAdam on April 24, 2022, 3:36 pm
I haven't seen this released yet, but probably has, though I haven't seen many RSPS with this. I've been running through enum params list for Matrix 592, and added this into my server. Thought I'd share with you guys, if anyone is interested.
Appearence.java
Add the following:
Code:public static final int HAIR_WITH_HAT_PARAM = 790; public static final int HAIR_WITH_FACE_MASK_PARAM = 791; public static final int MALE_HAIR_STRUCT_LOOKUP = 2338; public static final int MALE_HAIR_SLOT_LOOKUP = 2339; public static final int FEMALE_HAIR_STRUCT_LOOKUP = 2341; public static final int FEMALE_HAIR_SLOT_LOOKUP = 2342;
Code:public int getHairParam(int baseStyle) { int hairLookup = ClientScriptMap.getMap(male ? MALE_HAIR_SLOT_LOOKUP : FEMALE_HAIR_SLOT_LOOKUP).getIntValue(baseStyle); return GeneralRequirementMap.getMap(ClientScriptMap.getMap(male ? MALE_HAIR_STRUCT_LOOKUP : FEMALE_HAIR_STRUCT_LOOKUP).getIntValue(hairLookup)).getIntValue(HAIR_WITH_HAT_PARAM); }
Under generateAppearenceData() {
You need to replace the entire code for item = player.getEquipment().getItems().get(Equipment.SLO T_HAT);
Code:item = player.getEquipment().getItems().get(Equipment.SLOT_HAT); if (styles[0] != -1 && (item == null || !Equipment.hideHair(item))) { if(item == null) { stream.writeShort(0x100 + styles[0]); } else { int hatHairStyle = getHairParam(styles[0]); if(hatHairStyle != -1) { stream.writeShort(0x100 + hatHairStyle); } else { stream.writeByte(0); } } } else { stream.writeByte(0); }
I haven't seen this released yet, but probably has, though I haven't seen many RSPS with this. I've been running through enum params list for Matrix 592, and added this into my server. Thought I'd share with you guys, if anyone is interested.
Appearence.java
Add the following:
Code:public static final int HAIR_WITH_HAT_PARAM = 790; public static final int HAIR_WITH_FACE_MASK_PARAM = 791; public static final int MALE_HAIR_STRUCT_LOOKUP = 2338; public static final int MALE_HAIR_SLOT_LOOKUP = 2339; public static final int FEMALE_HAIR_STRUCT_LOOKUP = 2341; public static final int FEMALE_HAIR_SLOT_LOOKUP = 2342;
Code:public int getHairParam(int baseStyle) { int hairLookup = ClientScriptMap.getMap(male ? MALE_HAIR_SLOT_LOOKUP : FEMALE_HAIR_SLOT_LOOKUP).getIntValue(baseStyle); return GeneralRequirementMap.getMap(ClientScriptMap.getMap(male ? MALE_HAIR_STRUCT_LOOKUP : FEMALE_HAIR_STRUCT_LOOKUP).getIntValue(hairLookup)).getIntValue(HAIR_WITH_HAT_PARAM); }
Under generateAppearenceData() {
You need to replace the entire code for item = player.getEquipment().getItems().get(Equipment.SLO T_HAT);
Code:item = player.getEquipment().getItems().get(Equipment.SLOT_HAT); if (styles[0] != -1 && (item == null || !Equipment.hideHair(item))) { if(item == null) { stream.writeShort(0x100 + styles[0]); } else { int hatHairStyle = getHairParam(styles[0]); if(hatHairStyle != -1) { stream.writeShort(0x100 + hatHairStyle); } else { stream.writeByte(0); } } } else { stream.writeByte(0); }