Thread: Pking skulls (must have your own client)

Page 1 of 8 123 ... LastLast
Results 1 to 10 of 72
  1. #1 Pking skulls (must have your own client) 
    Xx nub xx
    Guest
    Purpose: To learn how to have almost 100% skulls on your server (cba to make you not get skulled for retaliating)

    Difficulty: 1/10

    Assumed Knowledge: none... im here to teach you right?

    Server Base: pimpscape

    Classes Modified: client.java (server), client.java (client)

    Procedure:

    *NOTE* If you want your client to have prayer icons leave now because you can not have skulls and prayer icons at the same time (to my knowledge)

    Step 1: This is the only part I will not be explaining, because it is too confusing to do so to you and most of you probably don't give a **** anyway. Anyway... the first thing you want to do is get your client compatible with the skull head-icons. Search your client.java for this:

    Code:
                try {
                    for(int i4 = 0; i4 < 20; i4++)
                        aClass30_Sub2_Sub1_Sub1Array987[i4] = new Class30_Sub2_Sub1_Sub1(class44_2, "hitmarks", i4);
    
                } catch(Exception _ex) { }
    and somewhere above or under that you will need to add a statement that looks a little something like this:

    Code:
                try {
                    for(int j4 = 0; j4 < 8; j4++)
                        aClass30_Sub2_Sub1_Sub1Array1095[j4] = new Class30_Sub2_Sub1_Sub1(class44_2, "headicons_pk", j4);
    
                } catch(Exception _ex) { }
    And congratulations! Your client will now show skulls for head icons!

    On to the server side part.

    Step 2: Open your client.java (server) and go into case 73 (pvp case). Yours should look something like mine:

    Code:
    case 73: //PVP
    				if(PkingDelay <= 1) {
    				try {
    				AttackingOn = inStream.readSignedWordBigEndian();
    				client plz = (client) server.playerHandler.players[AttackingOn];
    if(playerEquipment[playerWeapon] == 861 || playerEquipment[playerWeapon] == 841 || playerEquipment[playerWeapon] == 843 || playerEquipment[playerWeapon] == 849 || playerEquipment[playerWeapon] == 853 || playerEquipment[playerWeapon] == 857 || playerEquipment[playerWeapon] == 4214 || playerEquipment[playerWeapon] == 4734 || playerEquipment[playerWeapon] == 6724 || playerEquipment[playerWeapon] == 11785 || playerEquipment[playerWeapon] == 7648) {
    UseBow = true;
    CheckArrows();
    teleportToX = absX;
    teleportToY = absY;
    } else {
    UseBow = false;
    }
    if(UseBow) {
    if(HasArrows && bowLevel && !nonWild() && !plz.nonWild() && plz != null && UseBow) {
      IsAttacking = true;
      inCombat();
    } else if(!nonWild() || !plz.nonWild() || plz != null) {
      sendMessage("You can't attack this player!");
      IsAttacking = false;
      ResetAttack();
      resetAnimation();
    } else if(!HasArrows) {
      sendMessage("You don't have any arrows in your quiver!");
      IsAttacking = false;
      ResetAttack();
    } else if(!bowLevel) {
      sendMessage("You need a higher level bow to shoot this arrow!");
      IsAttacking = false;
      ResetAttack();
    }
    } else if(!UseBow) {
    if(!nonWild() && !plz.nonWild() && plz != null && !UseBow) {
    IsAttacking = true;
    inCombat();
    }
                                    if(server.playerHandler.players[AttackingOn] != null) {
                                    if(server.playerHandler.players[AttackingOn].absX != absX && server.playerHandler.players[AttackingOn].absY != absY)
                                    faceNPC = 32768+AttackingOn;
                                    faceNPCupdate = true;
                                    }
    else if(!nonWild() || !plz.nonWild() || plz != null) {
    resetAnimation();
    ResetAttack();
    sendMessage("You can't attack this player!");
    }
    }
    } catch(Exception E) {
    }
    }
    
    				break;
    Now, what you will have to do, is add a timer for the skulls. You can call this anything you want, but for the purposes of this tutorial we will call it "skullTimer".

    Now, in the part of your case that successfully attacks, you will add:

    Code:
    skullTimer = 2400;
    which is 20 minutes (i think) and you can edit that to be whatever you want (10 min... 30 min... whatever).

    The part of the case that actually attacks should look like this:

    Code:
    if(!nonWild() && !plz.nonWild() && plz != null && !UseBow) {
    IsAttacking = true;
    inCombat();
    }
    but you probably won't have that since i made my case 73 from scratch... so just add the timer under anything that says "inCombat();"

    Now to add the skullTimer int and the head-icons themselves.

    Step 3: Now search for void process (or boolean) and inside it you should see something like this:

    Code:
    	public void process() {		// is being called regularily every 500ms
    		if (actionAmount < 0) {
    			actionAmount = 0;
    		}
    		if (actionTimer > 0) {
    			actionTimer -= 1;
    		}
    		if (actionAmount > 25) {
    			sendMessage("Kicked for acting too fast!");
    			misc.println("Client acts too fast - disconnecting it");
    			disconnected = true;
    		}
    		if (theifTimer > 0) {
    			theifTimer -= 1;
    		}
    		if (AgilityTimer > 0) {
    			AgilityTimer -= 1;
    		}
    		if (WCTimer > 0) {
    			WCTimer -= 1;
    		}
    		if (fishTimer > 0) {
    			fishTimer -= 1;
    		}
    		if (fishTimer2 > 0) {
    			fishTimer2 -= 1;
    		}
    		if (RCTimer > 0) {
    			RCTimer -= 1;
    		}
    		if (healTimer > 0) {
    			healTimer -= 1;
    		}
    		if (messageTimer > 0) {
    			messageTimer -= 1;
    		}
    		if (messageTimer2 > 0) {
    			messageTimer2 -= 1;
    		}
    		if (attackTimer > 0) {
    			attackTimer -= 1;
    		}
    		if (rangedTeleportTimer > 0) {
    			rangedTeleportTimer -= 1;
    		}
    		if (darkBowTimer > 0) {
    			darkBowTimer -= 1;
    		}
    		if (ddsSpecTimer > 0) {
    			ddsSpecTimer -= 1;
    		}
    Now, you will need to add an if statement to have the timer actually count down.

    This is very easy to do, you must start by declaring the if statement like this:

    Code:
    		if (skullTimer > 0) {
    		}
    This basically states that if the skullTimer is greater then 0, then something will happen.

    Now we must add a function to count the timer down each tick. We can do this by adding a line of code that looks like this:

    Code:
    			skullTimer -= 1;
    This means that every time the void ticks, the skullTimer will decrease by one each time (note the -= 1)

    and your if statement should look like this:

    Code:
    if(skullTimer > 0) {
    skullTimer -= 1;
    }
    Now we must make the client show the head-icon. We can do this by adding this:

    Code:
    headIcon = 1;
    appearanceUpdateRequired = true;
    This means that if the skullTimer is greater then 0, the client will show headIcon 1, and then update your appearance so that the headicon will show without you having to move or start an action. You can change this to show a red skull instead of the usual white skull by changing the ID of the headIcon (i believe the red skull is 4.. just guess and check).

    Your if statement should now look like this:

    Code:
    if(skullTimer > 0) {
    skullTimer -= 1;
    headIcon = 1;
    appearanceUpdateRequired = true;
    }
    Now, we have to add a piece of code to remove the skull when the timer decreases to 0. All you have to do, is add an else statement. You must start the else statement after the closing bracket of the if statement. Start the else statement like this:

    Code:
    else if(skullTimer <= 0) {
    }
    Now, inside of the else statment, you will have to add something similar to the if statement, but it sets the headIcon to 0 (no headIcon) instead of 1 (skull). You can do this by adding this inside the else statement:

    Code:
    headIcon = 0;
    appearanceUpdateRequired = true;
    Now, when the timer reaches zero, the headIcon will disappear.

    Your final statement should look like this:

    Code:
    		if (skullTimer > 0) {
    			skullTimer -= 1;
    			headIcon = 1;
    			appearanceUpdateRequired = true;
    		} else if(skullTimer <= 0) {
    			headIcon = 0;
    			appearanceUpdateRequired = true;
    		}
    And finally, we need to declare the int skullTimer. Do this by adding:

    Code:
    public int skullTimer = 0;
    above void process or wherever you feel like adding your ints (really makes no difference)

    Step 4: Now, you must make it so if you die (lets hope you don't) the skull will go away. There is really no need to explain this part, just add

    Code:
    skullTimer = 0;
    to your boolean applydead (or whatever your death boolean is).

    Now, you have pking skulls! One more thing for people who want it, you can make the timer save, so logging out won't lose you your skull. To do this, you must find this in your client.java:

    Code:
    } else if (token.equals("
    and under that whole statement add this statement:

    Code:
    						} else if (token.equals("character-skullTimer")) {
    						    skullTimer = Integer.parseInt(token2);
                                                    }
    *NOTE* Don't add this under the line I told you to find, you must add it under the entire statement, which will look something like this:

    Code:
     } else if (token.equals("character-pkpoints")) {
          pkpoints = Integer.parseInt(token2);
     }
    and search for this:

    Code:
    			characterfile.write("
    and under that whole statement add this:

    Code:
    			characterfile.write("character-skullTimer = ", 0, 23);
    			characterfile.write(Integer.toString(skullTimer), 0, Integer.toString(skullTimer).length());
    			characterfile.newLine();

    *NOTE* Don't add this under the line I told you to find, you must add it under the entire statement, which will look something like this:

    Code:
    			characterfile.write("character-pkpoints = ", 0, 21);
    			characterfile.write(Integer.toString(pkpoints), 0, Integer.toString(pkpoints).length());
    			characterfile.newLine();
    And congratulations! You now have 99% pking skulls in your server. If you get any errors you added something wrong so post it and I can tell you what is wrong. Have fun pking

    Heres a pic:

     

  2. #2  
    Ex Administrator

    Numbers's Avatar
    Join Date
    Jun 2006
    Age
    30
    Posts
    5,691
    Thanks given
    0
    Thanks received
    2,158
    Rep Power
    5000
    Awesome Tut if it works, Ill check this out. again, thanks much!
     

  3. #3  
    Hippy
    Guest
    nice release, i ahve the transparent skull if you need.
     

  4. #4  
    JavaNerd
    Guest
    Nice Ill try this out later
     

  5. #5  
    Registered Member
    Your Name's Avatar
    Join Date
    Oct 2007
    Age
    31
    Posts
    1,442
    Thanks given
    0
    Thanks received
    4
    Rep Power
    172
    nice
    now i just want the skull in corner of my screen lol
    Find Chuck Norris



    MoparScape name = Doodooss
     

  6. #6  
    Xx nub xx
    Guest
    Quote Originally Posted by Hippy View Post
    nice release, i ahve the transparent skull if you need.
    the skulls are already transparent for me so it should work for you too (if you mean the background anyway)

    Quote Originally Posted by Im So Hood! View Post
    nice
    now i just want the skull in corner of my screen lol
    here ya go

    Code:
    outStream.createFrame(208);
    outStream.writeWordBigEndian_dup(197);
    sendQuest("text here", 199);
    Added a picture
     

  7. #7  
    yankee
    Guest
    Nice(message To Short)
     

  8. #8  
    Registered Member
    Lommeka's Avatar
    Join Date
    Oct 2006
    Posts
    719
    Thanks given
    3
    Thanks received
    3
    Rep Power
    147
    omg, man if this works
     

  9. #9  
    Community Veteran

    Llama's Avatar
    Join Date
    Oct 2006
    Age
    33
    Posts
    510
    Thanks given
    0
    Thanks received
    0
    Rep Power
    106
    this is like a fake version for idiots.. you could have just loaded your headicons_pk sprites into your headicons_prayer in blank spots and called them like normal prayer icons.
    Would have saved you all this trouble, or you could have just loaded your own .png files as headicons when a player puts on a headicon...

    whatever's easiest for leachers i suppose... -_-



     

  10. #10  
    Xx nub xx
    Guest
    Quote Originally Posted by W I C K E D View Post
    this is like a fake version for idiots.. you could have just loaded your headicons_pk sprites into your headicons_prayer in blank spots and called them like normal prayer icons.
    Would have saved you all this trouble, or you could have just loaded your own .png files as headicons when a player puts on a headicon...

    whatever's easiest for leachers i suppose... -_-
    well....

    1. i suck at clients
    2. im too lazy to make my own sprites

    if you dont like it you dont have to post
     

Page 1 of 8 123 ... LastLast

Thread Information
Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)


User Tag List

Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •