Guest User

Untitled

a guest
May 24th, 2018
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 2.99 KB | None | 0 0
  1. private void readValues(Stream buffer) {
  2.         do {
  3.             int configId = buffer.getUnsignedByte();
  4.             if (configId == 0) {
  5.                 return;
  6.             }
  7.             if (configId == 1) {
  8.                 int total = buffer.getUnsignedByte();
  9.                 models = new int[total];
  10.                 for (int i = 0; i < total; i++) {
  11.                     models[i] = buffer.getUnsignedShort();
  12.                 }
  13.             } else if (configId == 2) {
  14.                 name = buffer.getString();
  15.             } else if (configId == 3) {
  16.                 description = buffer.getStringBytes();
  17.             } else if (configId == 12) {
  18.                 size = buffer.getByte();
  19.             } else if (configId == 13) {
  20.                 idleAnim = buffer.getUnsignedShort();
  21.             } else if (configId == 14) {
  22.                 walkAnim = buffer.getUnsignedShort();
  23.             } else if (configId == 17) {
  24.                 walkAnim = buffer.getUnsignedShort();
  25.                 retreatAnim = buffer.getUnsignedShort();
  26.                 turnRightAnim = buffer.getUnsignedShort();
  27.                 turnLeftAnim = buffer.getUnsignedShort();
  28.             } else if (configId >= 30 && configId < 40) {
  29.                 if (actions == null) {
  30.                     actions = new String[5];
  31.                 }
  32.                 actions[configId - 30] = buffer.getString();
  33.                 if (actions[configId - 30].equalsIgnoreCase("hidden")) {
  34.                     actions[configId - 30] = null;
  35.                 }
  36.             } else if (configId == 40) {
  37.                 int total = buffer.getUnsignedByte();
  38.                 srcColors = new int[total];
  39.                 destColors = new int[total];
  40.                 for (int i = 0; i < total; i++) {
  41.                     srcColors[i] = buffer.getUnsignedShort();
  42.                     destColors[i] = buffer.getUnsignedShort();
  43.                 }
  44.             } else if (configId == 60) {
  45.                 int total = buffer.getUnsignedByte();
  46.                 dialogueModels = new int[total];
  47.                 for (int i = 0; i < total; i++) {
  48.                     dialogueModels[i] = buffer.getUnsignedShort();
  49.                 }
  50.             } else if (configId == 90) {
  51.                 buffer.getUnsignedShort();
  52.             } else if (configId == 91) {
  53.                 buffer.getUnsignedShort();
  54.             } else if (configId == 92) {
  55.                 buffer.getUnsignedShort();
  56.             } else if (configId == 93) {
  57.                 visibleOnMinimap = false;
  58.             } else if (configId == 95) {
  59.                 combatLevel = buffer.getUnsignedShort();
  60.             } else if (configId == 97) {
  61.                 scaleXY = buffer.getUnsignedShort();
  62.             } else if (configId == 98) {
  63.                 scaleZ = buffer.getUnsignedShort();
  64.             } else if (configId == 99) {
  65.                 members = true;
  66.             } else if (configId == 100) {
  67.                 lightness = buffer.getByte();
  68.             } else if (configId == 101) {
  69.                 shading = buffer.getByte() * 5;
  70.             } else if (configId == 102) {
  71.                 headIcon = buffer.getUnsignedShort();
  72.             } else if (configId == 103) {
  73.                 turnAmount = buffer.getUnsignedShort();
  74.             } else if (configId == 106) {
  75.                 varbitId = buffer.getUnsignedShort();
  76.                 if (varbitId == 65535) {
  77.                     varbitId = -1;
  78.                 }
  79.                 actionId = buffer.getUnsignedShort();
  80.                 if (actionId == 65535) {
  81.                     actionId = -1;
  82.                 }
  83.                 int id = buffer.getUnsignedByte();
  84.                 childIds = new int[id + 1];
  85.                 for (int i = 0; i <= id; i++) {
  86.                     childIds[i] = buffer.getUnsignedShort();
  87.                     if (childIds[i] == 65535) {
  88.                         childIds[i] = -1;
  89.                     }
  90.                 }
  91.             } else if (configId == 107) {
  92.                 clickable = false;
  93.             }
  94.         } while (true);
  95.     }
Add Comment
Please, Sign In to add comment