Advertisement
Guest User

Untitled

a guest
Sep 16th, 2011
1,876
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 8.37 KB | None | 0 0
  1. Add this method
  2. [code] public void hitmarkDraw(int hitLength, int type, int icon, int damage, int move, int opacity) {
  3. if (damage > 0) {
  4. Sprite end1 = null, middle = null, end2 = null;
  5. int x = 0;
  6. switch (hitLength) {
  7. case 1: x = 8; break;
  8. case 2: x = 4; break;
  9. case 3: x = 1; break;
  10. }
  11. switch (type) {
  12. case 0:
  13. end1 = hitMark[0];
  14. middle = hitMark[1];
  15. end2 = hitMark[2];
  16. break;
  17. case 1:
  18. end1 = hitMark[3];
  19. middle = hitMark[4];
  20. end2 = hitMark[5];
  21. break;
  22. case 2:
  23. end1 = hitMark[6];
  24. middle = hitMark[7];
  25. end2 = hitMark[8];
  26. break;
  27. }
  28. if (type <= 1 || icon != -1)
  29. hitIcon[icon].drawTransparentSprite(spriteDrawX - 34 + x, spriteDrawY - 14 + move, opacity);
  30. end1.drawTransparentSprite(spriteDrawX - 12 + x, spriteDrawY - 12 + move, opacity);
  31. x += 4;
  32. for (int i = 0; i < hitLength * 2; i++) {
  33. middle.drawTransparentSprite(spriteDrawX - 12 + x, spriteDrawY - 12 + move, opacity);
  34. x += 4;
  35. }
  36. end2.drawTransparentSprite(spriteDrawX - 12 + x, spriteDrawY - 12 + move, opacity);
  37. if (opacity > 100)
  38. (type == 1 ? bigHit : smallHit).drawText(0xffffff, String.valueOf(damage), spriteDrawY + (type == 1 ? 2 : 32) + move, spriteDrawX + 4);
  39. } else {
  40. Sprite block = new Sprite("/Hits/block");
  41. block.drawTransparentSprite(spriteDrawX - 12, spriteDrawY - 14 + move, opacity);
  42. }
  43. }[/code]
  44.  
  45. search for
  46. [code] if(((Entity) (obj)).loopCycleStatus > loopCycle)
  47. {
  48. try{
  49. npcScreenPos(((Entity) (obj)), ((Entity) (obj)).height + 15);
  50. if(spriteDrawX > -1)
  51. {
  52. int i1 = (((Entity) (obj)).currentHealth * 30) / ((Entity) (obj)).maxHealth;
  53. if(i1 > 30)
  54. i1 = 30;
  55. DrawingArea.drawPixels(5, spriteDrawY - 3, spriteDrawX - 15, 65280, i1);
  56. DrawingArea.drawPixels(5, spriteDrawY - 3, (spriteDrawX - 15) + i1, 0xff0000, 30 - i1);
  57. }
  58. }catch(Exception e){ }
  59. }[/code]
  60. Replace it with
  61. [code]
  62. if(((Entity) (obj)).loopCycleStatus > loopCycle)
  63. {
  64. try{
  65. npcScreenPos(((Entity) (obj)), ((Entity) (obj)).height + 15);
  66. if(spriteDrawX > -1)
  67. {
  68. int i1 = (((Entity) (obj)).currentHealth * 30) / ((Entity) (obj)).maxHealth;
  69. if(i1 > 30)
  70. i1 = 30;
  71. int HpPercent = (((Entity) (obj)).currentHealth * 56) / ((Entity) (obj)).maxHealth;
  72. if (HpPercent > 56)
  73. HpPercent = 56;
  74. HPBarEmpty.drawSprite(spriteDrawX - 28, spriteDrawY - 5);
  75. HPBarFull = new Sprite("./Sprites/Player/HP 0.png", HpPercent, 7);
  76. HPBarFull.drawSprite(spriteDrawX - 28, spriteDrawY - 5);
  77. }
  78. }catch(Exception e){ }
  79. }[/code]
  80.  
  81. Find this
  82. [code] for(int j1 = 0; j1 < 4; j1++)
  83. if(((Entity) (obj)).hitsLoopCycle[j1] > loopCycle)
  84. {
  85. npcScreenPos(((Entity) (obj)), ((Entity) (obj)).height / 2);
  86. if(spriteDrawX > -1)
  87. {
  88. if(j1 == 1)
  89. spriteDrawY -= 20;
  90. if(j1 == 2)
  91. {
  92. spriteDrawX -= 15;
  93. spriteDrawY -= 10;
  94. }
  95. if(j1 == 3)
  96. {
  97. spriteDrawX += 15;
  98. spriteDrawY -= 10;
  99. }
  100. hitMarks[((Entity) (obj)).hitMarkTypes[j1]].drawSprite(spriteDrawX - 12, spriteDrawY - 12);
  101. smallText.drawText(0, String.valueOf(((Entity) (obj)).hitArray[j1]), spriteDrawY + 4, spriteDrawX);
  102. smallText.drawText(0xffffff, String.valueOf(((Entity) (obj)).hitArray[j1]), spriteDrawY + 3, spriteDrawX - 1);
  103. }
  104. }[/code]
  105. Replace it with:
  106. [code]
  107. for(int j1 = 0; j1 < 4; j1++)
  108. if(((Entity) (obj)).hitsLoopCycle[j1] > loopCycle)
  109. {
  110. npcScreenPos(((Entity) (obj)), ((Entity) (obj)).height / 2);
  111. if(spriteDrawX > -1)
  112. {
  113. switch (j1) {
  114. case 1:
  115. spriteDrawY += 20;
  116. break;
  117. case 2:
  118. spriteDrawY += 40;
  119. break;
  120. case 3:
  121. spriteDrawY += 60;
  122. break;
  123. case 4:
  124. spriteDrawY += 80;
  125. break;
  126. case 5:
  127. spriteDrawY += 100;
  128. break;
  129. case 6:
  130. spriteDrawY += 120;
  131. break;
  132. }
  133. Entity e = ((Entity) (obj));
  134. if (e.hitmarkMove[j1] > -30)
  135. e.hitmarkMove[j1]--;
  136. if (e.hitmarkMove[j1] < -26)
  137. e.hitmarkTrans[j1] -= 5;
  138. hitmarkDraw(String.valueOf(e.hitArray[j1]).length(), e.hitMarkTypes[j1], e.hitIcon[j1], e.hitArray[j1], e.hitmarkMove[j1], e.hitmarkTrans[j1]);
  139. }
  140. }[/code]
  141.  
  142. Search
  143. [code]
  144. mapBack = null;[/code]
  145.  
  146. Under it add
  147. [code]
  148. HPBarFull = null;
  149. HPBarEmpty = null;
  150. [/code]
  151.  
  152. Search for
  153. [code]
  154. if((l & 8) != 0)
  155. {
  156. int j1 = stream.method426();
  157. int j2 = stream.method427();
  158. npc.updateHitData(j2, j1, loopCycle);
  159. npc.loopCycleStatus = loopCycle + 300;
  160. npc.currentHealth = stream.method426();
  161. npc.maxHealth = stream.readUnsignedByte();
  162. }[/code]
  163.  
  164. Replace with
  165. [code] if((l & 8) != 0)
  166. {
  167. int j1 = stream.method426();
  168. int j2 = stream.method427();
  169. int icon = stream.readUnsignedByte();
  170. npc.updateHitData(j2, j1, loopCycle, icon);
  171. npc.loopCycleStatus = loopCycle + 300;
  172. npc.currentHealth = stream.method426();
  173. npc.maxHealth = stream.readUnsignedByte();
  174. }[/code]
  175.  
  176. Search for
  177. [code]
  178. if((l & 0x40) != 0)
  179. {
  180. int l1 = stream.method427();
  181. int k2 = stream.method428();
  182. npc.updateHitData(k2, l1, loopCycle);
  183. npc.loopCycleStatus = loopCycle + 300;
  184. npc.currentHealth = stream.method428();
  185. npc.maxHealth = stream.method427();
  186. }[/code]
  187.  
  188. Replace with
  189. [code]
  190. if((l & 0x40) != 0)
  191. {
  192. int l1 = stream.method427();
  193. int k2 = stream.method428();
  194. int icon = stream.readUnsignedByte();
  195. npc.updateHitData(k2, l1, loopCycle, icon);
  196. npc.loopCycleStatus = loopCycle + 300;
  197. npc.currentHealth = stream.method428();
  198. npc.maxHealth = stream.method427();
  199. }
  200. [/code]
  201.  
  202. Search in starting up method for
  203.  
  204. [code]
  205. smallText = new TextDrawingArea(false, "p11_full", titleStreamLoader);[/code]
  206. [/code]
  207.  
  208. Under it add:
  209.  
  210. [code]
  211. smallHit = new TextDrawingArea(false, "hit_full", titleStreamLoader);
  212. bigHit = new TextDrawingArea(true, "critical_full", titleStreamLoader);
  213. [/code]
  214.  
  215. Search for
  216.  
  217. [code]
  218. for(int r1 = 0; r1 < 5; r1++)
  219. redStones[r1] = new Sprite("redstones " + r1);
  220. [/code]
  221.  
  222. Under it add
  223.  
  224. [code]
  225. for(int i4 = 0; i4 < 20; i4++)
  226. hitMark[i4] = new Sprite("/Hits/hit " + i4);
  227. for(int i4 = 0; i4 < 5; i4++)
  228. hitIcon[i4] = new Sprite("/Hits/icon " + i4);
  229. [/code]
  230.  
  231.  
  232. Search for
  233. [code]
  234. if((i & 0x20) != 0)
  235. {
  236. int k1 = stream.readUnsignedByte();
  237. int k2 = stream.method426();
  238. player.updateHitData(k2, k1, loopCycle);
  239. player.loopCycleStatus = loopCycle + 300;
  240. player.currentHealth = stream.method427();
  241. player.maxHealth = stream.readUnsignedByte();
  242. }
  243. [/code]
  244.  
  245. Replace with
  246.  
  247. [code]
  248. if((i & 0x20) != 0)
  249. {
  250. int k1 = stream.readUnsignedByte();
  251. int k2 = stream.method426();
  252. int icon = stream.readUnsignedByte();
  253. player.updateHitData(k2, k1, loopCycle, icon);
  254. player.loopCycleStatus = loopCycle + 300;
  255. player.currentHealth = stream.method427();
  256. player.maxHealth = stream.readUnsignedByte();
  257. }
  258. [/code]
  259.  
  260. Search for:
  261. [code]
  262. if((i & 0x200) != 0)
  263. {
  264. int l1 = stream.readUnsignedByte();
  265. int l2 = stream.method428();
  266. player.updateHitData(l2, l1, loopCycle);
  267. player.loopCycleStatus = loopCycle + 300;
  268. player.currentHealth = stream.readUnsignedByte();
  269. player.maxHealth = stream.method427();
  270. }
  271. [/code]
  272.  
  273. Replace it with
  274.  
  275. [code]
  276. if((i & 0x200) != 0)
  277. {
  278. int l1 = stream.readUnsignedByte();
  279. int l2 = stream.method428();
  280. int icon = stream.readUnsignedByte();
  281. player.updateHitData(l2, l1, loopCycle, icon);
  282. player.loopCycleStatus = loopCycle + 300;
  283. player.currentHealth = stream.readUnsignedByte();
  284. player.maxHealth = stream.method427();
  285. }
  286. [/code]
  287.  
  288.  
  289. Search for
  290. [code]
  291. hitMarks = new Sprite[20];
  292. [/code]
  293.  
  294. Under it add:
  295. [code]
  296. hitMark = new Sprite[20];
  297. hitIcon = new Sprite[20];
  298. [/code]
  299.  
  300. Search for:
  301.  
  302. [code]
  303. private Sprite[] hitMarks;
  304. [/code]
  305. Under it add:
  306. [code]
  307. private Sprite[] hitMark;
  308. private Sprite[] hitIcon;
  309. private Sprite HPBarFull, HPBarEmpty;
  310. [/code]
  311.  
  312. Search for
  313. [code]
  314. private TextDrawingArea smallText;
  315. [/code]
  316.  
  317. Under it add
  318. [code]
  319. private TextDrawingArea smallHit;
  320. private TextDrawingArea bigHit;
  321. [/code]
  322.  
  323. Finished in client.java
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement