Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Add this method
- [code] public void hitmarkDraw(int hitLength, int type, int icon, int damage, int move, int opacity) {
- if (damage > 0) {
- Sprite end1 = null, middle = null, end2 = null;
- int x = 0;
- switch (hitLength) {
- case 1: x = 8; break;
- case 2: x = 4; break;
- case 3: x = 1; break;
- }
- switch (type) {
- case 0:
- end1 = hitMark[0];
- middle = hitMark[1];
- end2 = hitMark[2];
- break;
- case 1:
- end1 = hitMark[3];
- middle = hitMark[4];
- end2 = hitMark[5];
- break;
- case 2:
- end1 = hitMark[6];
- middle = hitMark[7];
- end2 = hitMark[8];
- break;
- }
- if (type <= 1 || icon != -1)
- hitIcon[icon].drawTransparentSprite(spriteDrawX - 34 + x, spriteDrawY - 14 + move, opacity);
- end1.drawTransparentSprite(spriteDrawX - 12 + x, spriteDrawY - 12 + move, opacity);
- x += 4;
- for (int i = 0; i < hitLength * 2; i++) {
- middle.drawTransparentSprite(spriteDrawX - 12 + x, spriteDrawY - 12 + move, opacity);
- x += 4;
- }
- end2.drawTransparentSprite(spriteDrawX - 12 + x, spriteDrawY - 12 + move, opacity);
- if (opacity > 100)
- (type == 1 ? bigHit : smallHit).drawText(0xffffff, String.valueOf(damage), spriteDrawY + (type == 1 ? 2 : 32) + move, spriteDrawX + 4);
- } else {
- Sprite block = new Sprite("/Hits/block");
- block.drawTransparentSprite(spriteDrawX - 12, spriteDrawY - 14 + move, opacity);
- }
- }[/code]
- search for
- [code] if(((Entity) (obj)).loopCycleStatus > loopCycle)
- {
- try{
- npcScreenPos(((Entity) (obj)), ((Entity) (obj)).height + 15);
- if(spriteDrawX > -1)
- {
- int i1 = (((Entity) (obj)).currentHealth * 30) / ((Entity) (obj)).maxHealth;
- if(i1 > 30)
- i1 = 30;
- DrawingArea.drawPixels(5, spriteDrawY - 3, spriteDrawX - 15, 65280, i1);
- DrawingArea.drawPixels(5, spriteDrawY - 3, (spriteDrawX - 15) + i1, 0xff0000, 30 - i1);
- }
- }catch(Exception e){ }
- }[/code]
- Replace it with
- [code]
- if(((Entity) (obj)).loopCycleStatus > loopCycle)
- {
- try{
- npcScreenPos(((Entity) (obj)), ((Entity) (obj)).height + 15);
- if(spriteDrawX > -1)
- {
- int i1 = (((Entity) (obj)).currentHealth * 30) / ((Entity) (obj)).maxHealth;
- if(i1 > 30)
- i1 = 30;
- int HpPercent = (((Entity) (obj)).currentHealth * 56) / ((Entity) (obj)).maxHealth;
- if (HpPercent > 56)
- HpPercent = 56;
- HPBarEmpty.drawSprite(spriteDrawX - 28, spriteDrawY - 5);
- HPBarFull = new Sprite("./Sprites/Player/HP 0.png", HpPercent, 7);
- HPBarFull.drawSprite(spriteDrawX - 28, spriteDrawY - 5);
- }
- }catch(Exception e){ }
- }[/code]
- Find this
- [code] for(int j1 = 0; j1 < 4; j1++)
- if(((Entity) (obj)).hitsLoopCycle[j1] > loopCycle)
- {
- npcScreenPos(((Entity) (obj)), ((Entity) (obj)).height / 2);
- if(spriteDrawX > -1)
- {
- if(j1 == 1)
- spriteDrawY -= 20;
- if(j1 == 2)
- {
- spriteDrawX -= 15;
- spriteDrawY -= 10;
- }
- if(j1 == 3)
- {
- spriteDrawX += 15;
- spriteDrawY -= 10;
- }
- hitMarks[((Entity) (obj)).hitMarkTypes[j1]].drawSprite(spriteDrawX - 12, spriteDrawY - 12);
- smallText.drawText(0, String.valueOf(((Entity) (obj)).hitArray[j1]), spriteDrawY + 4, spriteDrawX);
- smallText.drawText(0xffffff, String.valueOf(((Entity) (obj)).hitArray[j1]), spriteDrawY + 3, spriteDrawX - 1);
- }
- }[/code]
- Replace it with:
- [code]
- for(int j1 = 0; j1 < 4; j1++)
- if(((Entity) (obj)).hitsLoopCycle[j1] > loopCycle)
- {
- npcScreenPos(((Entity) (obj)), ((Entity) (obj)).height / 2);
- if(spriteDrawX > -1)
- {
- switch (j1) {
- case 1:
- spriteDrawY += 20;
- break;
- case 2:
- spriteDrawY += 40;
- break;
- case 3:
- spriteDrawY += 60;
- break;
- case 4:
- spriteDrawY += 80;
- break;
- case 5:
- spriteDrawY += 100;
- break;
- case 6:
- spriteDrawY += 120;
- break;
- }
- Entity e = ((Entity) (obj));
- if (e.hitmarkMove[j1] > -30)
- e.hitmarkMove[j1]--;
- if (e.hitmarkMove[j1] < -26)
- e.hitmarkTrans[j1] -= 5;
- hitmarkDraw(String.valueOf(e.hitArray[j1]).length(), e.hitMarkTypes[j1], e.hitIcon[j1], e.hitArray[j1], e.hitmarkMove[j1], e.hitmarkTrans[j1]);
- }
- }[/code]
- Search
- [code]
- mapBack = null;[/code]
- Under it add
- [code]
- HPBarFull = null;
- HPBarEmpty = null;
- [/code]
- Search for
- [code]
- if((l & 8) != 0)
- {
- int j1 = stream.method426();
- int j2 = stream.method427();
- npc.updateHitData(j2, j1, loopCycle);
- npc.loopCycleStatus = loopCycle + 300;
- npc.currentHealth = stream.method426();
- npc.maxHealth = stream.readUnsignedByte();
- }[/code]
- Replace with
- [code] if((l & 8) != 0)
- {
- int j1 = stream.method426();
- int j2 = stream.method427();
- int icon = stream.readUnsignedByte();
- npc.updateHitData(j2, j1, loopCycle, icon);
- npc.loopCycleStatus = loopCycle + 300;
- npc.currentHealth = stream.method426();
- npc.maxHealth = stream.readUnsignedByte();
- }[/code]
- Search for
- [code]
- if((l & 0x40) != 0)
- {
- int l1 = stream.method427();
- int k2 = stream.method428();
- npc.updateHitData(k2, l1, loopCycle);
- npc.loopCycleStatus = loopCycle + 300;
- npc.currentHealth = stream.method428();
- npc.maxHealth = stream.method427();
- }[/code]
- Replace with
- [code]
- if((l & 0x40) != 0)
- {
- int l1 = stream.method427();
- int k2 = stream.method428();
- int icon = stream.readUnsignedByte();
- npc.updateHitData(k2, l1, loopCycle, icon);
- npc.loopCycleStatus = loopCycle + 300;
- npc.currentHealth = stream.method428();
- npc.maxHealth = stream.method427();
- }
- [/code]
- Search in starting up method for
- [code]
- smallText = new TextDrawingArea(false, "p11_full", titleStreamLoader);[/code]
- [/code]
- Under it add:
- [code]
- smallHit = new TextDrawingArea(false, "hit_full", titleStreamLoader);
- bigHit = new TextDrawingArea(true, "critical_full", titleStreamLoader);
- [/code]
- Search for
- [code]
- for(int r1 = 0; r1 < 5; r1++)
- redStones[r1] = new Sprite("redstones " + r1);
- [/code]
- Under it add
- [code]
- for(int i4 = 0; i4 < 20; i4++)
- hitMark[i4] = new Sprite("/Hits/hit " + i4);
- for(int i4 = 0; i4 < 5; i4++)
- hitIcon[i4] = new Sprite("/Hits/icon " + i4);
- [/code]
- Search for
- [code]
- if((i & 0x20) != 0)
- {
- int k1 = stream.readUnsignedByte();
- int k2 = stream.method426();
- player.updateHitData(k2, k1, loopCycle);
- player.loopCycleStatus = loopCycle + 300;
- player.currentHealth = stream.method427();
- player.maxHealth = stream.readUnsignedByte();
- }
- [/code]
- Replace with
- [code]
- if((i & 0x20) != 0)
- {
- int k1 = stream.readUnsignedByte();
- int k2 = stream.method426();
- int icon = stream.readUnsignedByte();
- player.updateHitData(k2, k1, loopCycle, icon);
- player.loopCycleStatus = loopCycle + 300;
- player.currentHealth = stream.method427();
- player.maxHealth = stream.readUnsignedByte();
- }
- [/code]
- Search for:
- [code]
- if((i & 0x200) != 0)
- {
- int l1 = stream.readUnsignedByte();
- int l2 = stream.method428();
- player.updateHitData(l2, l1, loopCycle);
- player.loopCycleStatus = loopCycle + 300;
- player.currentHealth = stream.readUnsignedByte();
- player.maxHealth = stream.method427();
- }
- [/code]
- Replace it with
- [code]
- if((i & 0x200) != 0)
- {
- int l1 = stream.readUnsignedByte();
- int l2 = stream.method428();
- int icon = stream.readUnsignedByte();
- player.updateHitData(l2, l1, loopCycle, icon);
- player.loopCycleStatus = loopCycle + 300;
- player.currentHealth = stream.readUnsignedByte();
- player.maxHealth = stream.method427();
- }
- [/code]
- Search for
- [code]
- hitMarks = new Sprite[20];
- [/code]
- Under it add:
- [code]
- hitMark = new Sprite[20];
- hitIcon = new Sprite[20];
- [/code]
- Search for:
- [code]
- private Sprite[] hitMarks;
- [/code]
- Under it add:
- [code]
- private Sprite[] hitMark;
- private Sprite[] hitIcon;
- private Sprite HPBarFull, HPBarEmpty;
- [/code]
- Search for
- [code]
- private TextDrawingArea smallText;
- [/code]
- Under it add
- [code]
- private TextDrawingArea smallHit;
- private TextDrawingArea bigHit;
- [/code]
- Finished in client.java
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement