Thread: Adding Skin Colours and Requirements

Results 1 to 1 of 1
  1. #1 Adding Skin Colours and Requirements 
    Registered Member Sheddy's Avatar
    Join Date
    Jul 2009
    Age
    29
    Posts
    1,053
    Thanks given
    56
    Thanks received
    89
    Discord
    View profile
    Rep Power
    69
    So I just got back into programming servers again and I'm taking things one step at a time, easing back into things.

    The first thing I wanted to accomplish was adding more skin colours and having it so you have to be a donator to choose from the more off-the-wall colours.

    I came across this post
    https://www.rune-server.ee/runescape...-improved.html

    Upon swapping out my method with the one posted I noticed that some colours repeated and to be honest I had no clue what I was replacing so I decided to break it down and analyze it compared to the code originally coded in my server.

    So let's break it down.
    Code:
    public static int[][] appearanceColors = {
    			{ 6798, 107, 10283, 16, 4797, 7744, 5799, 4634, -31839, 22433, 2983, -11343, 8, 5281, 10438, 3650, -27322,
    					-21845, 200, 571, 908, 21830, 28946, -15701, -14010 }, //HAIR
    			{ 8741, 12, -1506, -22374, 7735, 8404, 1701, -27106, 24094, 10153, -8915, 4783, 1341, 16578, -30533, 25239,
    					8, 5281, 10438, 3650, -27322, -21845, 200, 571, 908, 21830, 28946, -15701, -14010 }, //TORSO
    			{ 25238, 8742, 12, -1506, -22374, 7735, 8404, 1701, -27106, 24094, 10153, -8915, 4783, 1341, 16578, -30533,
    					8, 5281, 10438, 3650, -27322, -21845, 200, 571, 908, 21830, 28946, -15701, -14010 }, //LEGS
    			{ 4626, 11146, 6439, 12, 4758, 10270 }, //FEET
    			{ 4550, 4537, 5681, 5673, 5790, 6806, 8076, 4574, 0, 12821, 100 , 20165,
    					43678, 16895 ,28416 ,12231 ,947 ,60359, 32433} // SKIN
    	};
    Okay so each index in this array is for a different piece to colour.

    Code:
    [0] = HAIR
    [1] = TORSO
    [2] = LEGS
    [3] = FEET
    [4] = SKIN
    So basically just add the colours you want into the index of your choice.

    Now once you do so, you also have to change the max amount of colours per index or else it will display the colour in the appearance changer but it won't apply it to your character.
    To do this visit your server sided code and look for your change Appearance packet. For me it was ChangeAppearance.java

    Code:
    	private static final int[][] ALLOWED_COLORS = { 
    			{ 0, 24 }, // hair color
    			{ 0, 28 }, // torso color
    			{ 0, 28 }, // legs color
    			{ 0, 5 }, // feet color
    			{ 0, 18 } // skin color
    	};
    Change the 2nd number in the index to the number of entries you have per index. Remember to start counting at 0 and not 1.

    Now to make it so you need donator or something to choose certain colours in the same ChangeAppearance file search for some like
    Code:
    c.playerAppearance[12] = colors[4]
    change this to something similar to this
    Code:
    if (colors[4] >= 8) {
    				if (c.amDonated < 10) {
    					c.sendMessage("You must be a donator to use these skin colors.");
    					return;
    				} else {
    					c.playerAppearance[12] = colors[4]; // skin colour
    				}
    			} else {
    				c.playerAppearance[12] = colors[4]; // skin colour
    			}
    If you want to do it for a specific colour you can use
    Code:
    colors[4] == 8 || colors[4] == 9
    or if you're like me all your new colours will be donator only.

    You can use other things such as playerRights to make colours specific too.

    I'm sorry if the wording for this is weird. Like I said I'm just coming back to this after 5/6 years. So bare with me. I will improve the format of this as I figure out more. I will also be adding how to know what colours you're adding once I figure that out.
    Reply With Quote  
     

  2. Thankful user:



Thread Information
Users Browsing this Thread

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


User Tag List

Similar Threads

  1. z525 skin colour and long beard 100% coded?
    By i Leo i in forum Requests
    Replies: 0
    Last Post: 11-23-2009, 07:55 AM
  2. Adding Decorated JFrame and JMenu
    By Harvey in forum Tutorials
    Replies: 177
    Last Post: 08-05-2009, 06:44 AM
  3. Adding REAL skillcapes and hoods
    By Yarnova in forum Tutorials
    Replies: 23
    Last Post: 12-03-2007, 02:03 AM
  4. Adding Item Bonuses And Prices
    By Jazz in forum Tutorials
    Replies: 5
    Last Post: 09-25-2007, 07:49 PM
  5. Adding Full Fishing And cooking
    By sarah101 in forum Tutorials
    Replies: 10
    Last Post: 05-04-2007, 01:08 AM
Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •