Advertisement
Guest User

Untitled

a guest
Nov 20th, 2019
159
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 8.05 KB | None | 0 0
  1. public ItemDefinition() {
  2. cursor2op = -1;
  3. womanwearzoff = 0;
  4. femaleEquipModel1 = -1;
  5. getNotedItem = -1;
  6. femaleEquipModel2 = -1;
  7. icursor2 = -1;
  8. cursor2 = -1;
  9. manwearyoff = 0;
  10. itemIsStackable = 0;
  11. isMembersItem = false;
  12. womanwearxoff = 0;
  13. cursor1 = -1;
  14. certtemplate = -1;
  15. maleEquipModel3 = -1;
  16. contrast = 0;
  17. manwearxoff = 0;
  18. femaleHeadModel2 = -1;
  19. name = "null";
  20. scaleX = 128;
  21. maleHeadModel2 = -1;
  22. manwearzoff = 0;
  23. getItemValue = 1;
  24. scaleZ = 128;
  25. lenttemplate = -1;
  26. stockmarket = false;
  27. ambient = 0;
  28. icursor1 = -1;
  29. maleEquipModel1 = -1;
  30. modelOffsetY = 0;
  31. lentlink = -1;
  32. modelRotationY = 0;
  33. femaleEquipModel3 = -1;
  34. z_angle_2d = 0;
  35. scaleY = 128;
  36. cursor1op = -1;
  37. femaleHeadModel = -1;
  38. dummyObject = 0;
  39. maleEquipModel2 = -1;
  40. maleHeadModel = -1;
  41. modelZoom = 2000;
  42. womanwearyoff = 0;
  43. modelRotationX = 0;
  44. team = 0;
  45. cursor2iop = -1;
  46. modelOffsetX = 0;
  47. }
  48.  
  49. final void decode(Packet stream) {
  50. anInt2617++;
  51. for (;;) {
  52. int opcode = stream.readUnsignedByte();
  53. if (opcode == 0)
  54. break;
  55. decode(2, stream, opcode);
  56. }
  57. }
  58.  
  59. private final void decode(int i, Packet stream, int opcode) {
  60. if (opcode == 1) {
  61. this.invModelId = stream.readBigSmart();
  62. } else if (opcode == 2) {
  63. this.name = stream.readString();
  64. } else if (opcode == 4) {
  65. this.modelZoom = stream.readUShort();
  66. } else if (opcode == 5) {
  67. this.modelRotationX = stream.readUShort();
  68. } else if (opcode == 6) {
  69. this.modelRotationY = stream.readUShort();
  70. } else if (opcode == 7) {
  71. this.modelOffsetX = stream.readUShort();
  72. if (this.modelOffsetX > 32767) {
  73. this.modelOffsetX -= 65536;
  74. }
  75. } else if (opcode == 8) {
  76. this.modelOffsetY = stream.readUShort();
  77. if (this.modelOffsetY > 32767) {
  78. this.modelOffsetY -= 65536;
  79. }
  80. } else if (opcode == 11) {
  81. this.itemIsStackable = 1;
  82. } else if (opcode == 12) {
  83. this.getItemValue = stream.readInt();
  84. } else if (opcode == 16) {
  85. this.isMembersItem = true;
  86. } else if (opcode == 23) {
  87. this.maleEquipModel1 = stream.readBigSmart();
  88. } else if (opcode == 24) {
  89. maleEquipModel2 = stream.readBigSmart();
  90. } else if (opcode == 25) {
  91. this.femaleEquipModel1 = stream.readBigSmart();
  92. } else if (opcode == 26) {
  93. femaleEquipModel2 = stream.readBigSmart();
  94. } else if (opcode >= 30 && opcode < 35) {
  95. itemGroundOption[opcode - 30] = stream.readString();
  96. } else if (opcode >= 35 && opcode < 40) {
  97. inventoryOptions[opcode - 35] = stream.readString();
  98. } else if (opcode == 40) {
  99. int i_81_ = stream.readUnsignedByte();
  100. recolorOriginal = new short[i_81_];
  101. recolorModified = new short[i_81_];
  102. for (int i_82_ = 0; i_82_ < i_81_; i_82_++) {
  103. recolorModified[i_82_] = (short) (stream.readUShort());
  104. recolorOriginal[i_82_] = (short) (stream.readUShort());
  105. }
  106. } else if (opcode == 41) {
  107. int length = stream.readUnsignedByte();
  108. retextureOriginal = new short[length];
  109. retextureModified = new short[length];
  110. for (int i_80_ = 0; i_80_ < length; i_80_++) {
  111. retextureOriginal[i_80_] = (short) (stream.readUShort());
  112. retextureModified[i_80_] = (short) (stream.readUShort());
  113. }
  114. } else if (opcode == 42) {
  115. int recolourLen = stream.readUnsignedByte();
  116. recolorPalette = (new byte[recolourLen]);
  117. for (int id = 0; id < recolourLen; id++) {
  118. recolorPalette[id] = stream.readByte();
  119. }
  120. } else if (opcode == 65) {
  121. this.stockmarket = true;
  122. } else if (opcode == 78) {
  123. maleEquipModel3 = stream.readBigSmart();
  124. } else if (opcode == 79) {
  125. femaleEquipModel3 = stream.readBigSmart();
  126. } else if (opcode == 90) {
  127. maleHeadModel = stream.readUShort();
  128. } else if (opcode == 91) {
  129. femaleHeadModel = stream.readUShort();
  130. } else if (opcode == 92) {
  131. maleHeadModel2 = stream.readUShort();
  132. } else if (opcode == 93) {
  133. femaleHeadModel2 = stream.readUShort();
  134. } else if (opcode == 95) {
  135. this.z_angle_2d = stream.readUShort();
  136. } else if (opcode == 96) {
  137. this.dummyObject = stream.readUnsignedByte();
  138. } else if (opcode == 97) {
  139. this.getNotedItem = stream.readUShort();
  140. } else if (opcode == 98) {
  141. this.certtemplate = stream.readUShort();
  142. } else if (opcode >= 100 && opcode < 110) {
  143. if (countobjs == null) {
  144. countcounts = new int[10];
  145. countobjs = new int[10];
  146. }
  147. countobjs[opcode - 100] = stream.readUShort();
  148. countcounts[opcode - 100] = stream.readUShort();
  149. } else if (opcode == 110) {
  150. scaleX = stream.readUShort();
  151. } else if (opcode == 111) {
  152. scaleY = stream.readUShort();
  153. } else if (opcode == 112) {
  154. scaleZ = stream.readUShort();
  155. } else if (opcode == 113) {
  156. ambient = stream.readByte();
  157. } else if (opcode == 114) {
  158. contrast = 5 * stream.readByte();
  159. } else if (opcode == 115) {
  160. this.team = stream.readUnsignedByte();
  161. } else if (opcode == 121) {
  162. this.lentlink = stream.readUShort();
  163. } else if (opcode == 122) {
  164. this.lenttemplate = stream.readUShort();
  165. } else if (opcode == 125) {
  166. manwearxoff = stream.readByte() << 2;
  167. manwearyoff = stream.readByte() << 2;
  168. manwearzoff = stream.readByte() << 2;
  169. } else if (opcode == 126) {
  170. womanwearxoff = stream.readByte() << 2;
  171. womanwearyoff = stream.readByte() << 2;
  172. womanwearzoff = stream.readByte() << 2;
  173. } else if (opcode == 127) {
  174. this.cursor1op = stream.readUnsignedByte();
  175. this.cursor1 = stream.readUShort();
  176. } else if (opcode == 128) {
  177. this.cursor2op = stream.readUnsignedByte();
  178. this.cursor2 = stream.readUShort();
  179. } else if (opcode == 129) {
  180. this.cursor1iop = stream.readUnsignedByte();
  181. this.icursor1 = stream.readUShort();
  182. } else if (opcode == 130) {
  183. this.cursor2iop = stream.readUnsignedByte();
  184. this.icursor2 = stream.readUShort();
  185. } else if (opcode == 132) {
  186. int i_71_ = stream.readUnsignedByte();
  187. campaigns = new int[i_71_];
  188. for (int i_72_ = 0; i_71_ > i_72_; i_72_++)
  189. campaigns[i_72_] = stream.readUShort();
  190. } else if (opcode == 249) {
  191. int length = stream.readUnsignedByte();
  192. if (this.params == null) {
  193. int size = Class7.find_next_greater_pwr2(length);
  194. this.params = new HashTable(size);
  195. }
  196. for (int index = 0; index < length; index++) {
  197. boolean stringInstance = stream.readUnsignedByte() == 1;
  198. int key = stream.read24BitInt();
  199. Node node;
  200. if (stringInstance)
  201. node = new StringNode(stream.readString());
  202. else
  203. node = new IntegerNode(stream.readInt());
  204. this.params.put((long) key, i - 1, node);
  205. }
  206. }
  207. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement