Thread: [Galkon's Refactored] 420+ Equipment Tab

Page 1 of 4 123 ... LastLast
Results 1 to 10 of 38
  1. #1 [Galkon's Refactored] 420+ Equipment Tab 
    Registered Member

    Join Date
    Sep 2008
    Posts
    2,219
    Thanks given
    148
    Thanks received
    204
    Rep Power
    1570
    Credits:
    100% to Primadude as I converted it from his client.

    First off I don't know the revision, but 377 is close enough, so I put that.

    What you're adding:


    Note:
    I've edited a lot of methods to my liking, you will either have to replace or edit your methods in order for this to work.

    Step 1:
    Add the two equipment tab methods.
    Code:
    	/**
    	 * Shows an interface with your character's current attributes.
    	 */
    	public static void equipmentInterface(TextDrawingArea[] wid) {
    		RSInterface rsi = RSInterface.addTabInterface(15106);
    		rsi.addSprite(15107, 15107, "Custom", "Equipment");
    		rsi.addActionButton(15108, 15108, 15108, 21, 21, "Close", "equipment");
    		rsi.addText(15109, "Equip Your Character...", wid, 2, 0xe4a146);
    		rsi.addText(15110, "Attack bonus", wid, 2, 0xe4a146);
    		rsi.addText(15111, "Defence bonus", wid, 2, 0xe4a146);
    		rsi.addText(15112, "Other bonuses", wid, 2, 0xe4a146);
    		rsi.addText(15113, "Stab: +120", wid, 1, 0xe4a146);
    		rsi.addText(15114, "Slash: +120", wid, 1, 0xe4a146);
    		rsi.addText(15115, "Crush: +120", wid, 1, 0xe4a146);
    		rsi.addText(15116, "Magic: +120", wid, 1, 0xe4a146);
    		rsi.addText(15117, "Range: +120", wid, 1, 0xe4a146);
    		rsi.addText(15118, "Stab: +120", wid, 1, 0xe4a146);
    		rsi.addText(15119, "Slash: +120", wid, 1, 0xe4a146);
    		rsi.addText(15120, "Crush: +120", wid, 1, 0xe4a146);
    		rsi.addText(15121, "Magic: +120", wid, 1, 0xe4a146);
    		rsi.addText(15122, "Range: +120", wid, 1, 0xe4a146);
    		rsi.addText(15123, "", wid, 1, 0xe4a146);
    		rsi.addText(15124, "Strength: +120", wid, 1, 0xe4a146);
    		rsi.addChar(15125);
    		rsi.scrollMax = 0;
    		rsi.isMouseOverTriggered = false;
    		rsi.children = new int[43];
    		rsi.childX = new int[43];
    		rsi.childY = new int[43];
    		rsi.children[0] = 15107;//window
    		rsi.childX[0] = 4;
    		rsi.childY[0] = 20;
    		rsi.children[1] = 15108;//close
    		rsi.childX[1] = 476;
    		rsi.childY[1] = 21-5+13;
    		rsi.children[2] = 15109;//equip your character...
    		rsi.childX[2] = 3 + 11;
    		rsi.childY[2] = 22-5+13;	
    		rsi.children[3] = 15110;//attack bonus
    		rsi.childX[3] = 3+13;
    		rsi.childY[3] = 70-15;
    		rsi.children[4] = 15111;//defence bonus
    		rsi.childX[4] = 3+13;
    		rsi.childY[4] = 150-3;
    		rsi.children[5] = 15112;//other bonuses
    		rsi.childX[5] = 3+13;
    		rsi.childY[5] = 232+16;
    		rsi.children[6] = 15113;//attack stab
    		rsi.childX[6] = 5+15;
    		rsi.childY[6] = 84-15;
    		rsi.children[7] = 15114;//attack slash
    		rsi.childX[7] = 5+15;
    		rsi.childY[7] = 97-14;
    		rsi.children[8] = 15115;//attack crush
    		rsi.childX[8] = 5+15;
    		rsi.childY[8] = 109-12;
    		rsi.children[9] = 15116;//attack mage
    		rsi.childX[9] = 5+15;
    		rsi.childY[9] = 121-10;
    		rsi.children[10] = 15117;//attack range
    		rsi.childX[10] = 5+15;
    		rsi.childY[10] = 133-8;
    		rsi.children[11] = 15118;//defence stab
    		rsi.childX[11] = 5+15;
    		rsi.childY[11] = 164-3;
    		rsi.children[12] = 15119;//defence slash
    		rsi.childX[12] = 5+15;
    		rsi.childY[12] = 177;
    		rsi.children[13] = 15120;//defence crush
    		rsi.childX[13] = 5+15;
    		rsi.childY[13] = 190+2;
    		rsi.children[14] = 15121;//defence mage
    		rsi.childX[14] = 5+15;
    		rsi.childY[14] = 203+4;
    		rsi.children[15] = 15122;//defence range
    		rsi.childX[15] = 5+15;
    		rsi.childY[15] = 216+5;
    		rsi.children[16] = 15123;//other strength
    		rsi.childX[16] = 5+15;
    		rsi.childY[16] = 246+16;
    		rsi.children[17] = 15124;// Strength
    		rsi.childX[17] = 5+15;
    		rsi.childY[17] = 246+16;
    		rsi.children[18] = 15125;//character
    		rsi.childX[18] = 170;
    		rsi.childY[18] = 150;
    		rsi.children[19] = 1645;
    		rsi.childX[19] = 50 + 78 - 24 + 297 - 2;
    		rsi.childY[19] = 110 + 39 - 44 - 13 + 5;
    		rsi.children[20] = 1646;
    		rsi.childX[20] = 50 - 24 + 78 + 297 - 2;
    		rsi.childY[20] = 110 - 44 + 68 - 13 + 5;
    		rsi.children[21] = 1647;
    		rsi.childX[21] = 50 - 24 + 78 + 297 - 2;
    		rsi.childY[21] = 110 - 44 + 105 - 13 + 5;
    		rsi.children[22] = 1648;
    		rsi.childX[22] = 50 - 24 + 78 + 297 - 2;
    		rsi.childY[22] = 110 - 44 + 146 - 13 + 5;
    		rsi.children[23] = 1649;
    		rsi.childX[23] = 50 - 24 + 22 + 297 - 2;
    		rsi.childY[23] = 110 - 44 + 118 - 13 + 5;
    		rsi.children[24] = 1650;
    		rsi.childX[24] = 50 - 24 + 22 + 297 - 2;
    		rsi.childY[24] = 110 - 44 + 154 - 13 + 5;
    		rsi.children[25] = 1651;
    		rsi.childX[25] = 50 - 24 + 134 + 297 - 2;
    		rsi.childY[25] = 110 - 44 + 118 - 13 + 5;
    		rsi.children[26] = 1652;
    		rsi.childX[26] = 50 - 24 + 134 + 297 - 2;
    		rsi.childY[26] = 110 - 44 + 154 - 13 + 5;
    		rsi.children[27] = 1653;
    		rsi.childX[27] = 50 - 24 + 48 + 297 - 2;
    		rsi.childY[27] = 110 - 44 + 81 - 13 + 5;
    		rsi.children[28] = 1654;
    		rsi.childX[28] = 50 - 24 + 107 + 297 - 2;
    		rsi.childY[28] = 110 - 44 + 81 - 13 + 5;
    		rsi.children[29] = 1655;
    		rsi.childX[29] = 50 - 24 + 58 + 297 - 2;
    		rsi.childY[29] = 110 - 44 + 42 - 13 + 5;
    		rsi.children[30] = 1656;
    		rsi.childX[30] = 50 - 24 + 112 + 297 - 2;
    		rsi.childY[30] = 110 - 44 + 41 - 13 + 5;
    		rsi.children[31] = 1657;
    		rsi.childX[31] = 50 - 24 + 78 + 297 - 2;
    		rsi.childY[31] = 110 - 44 + 4 - 13 + 5;
    		rsi.children[32] = 1658;
    		rsi.childX[32] = 50 - 24 + 37 + 297 - 2;
    		rsi.childY[32] = 110 - 44 + 43 - 13 + 5;
    		rsi.children[33] = 1659;
    		rsi.childX[33] = 50 - 24 + 78 + 297 - 2;
    		rsi.childY[33] = 110 - 44 + 43 - 13 + 5;
    		rsi.children[34] = 1660;
    		rsi.childX[34] = 50 - 24 + 119 + 297 - 2;
    		rsi.childY[34] = 110 - 44 + 43 - 13 + 5;
    		rsi.children[35] = 1661;
    		rsi.childX[35] = 50 - 24 + 22 + 297 - 2;
    		rsi.childY[35] = 110 - 44 + 82 - 13 + 5;
    		rsi.children[36] = 1662;
    		rsi.childX[36] = 50 - 24 + 78 + 297 - 2;
    		rsi.childY[36] = 110 - 44 + 82 - 13 + 5;
    		rsi.children[37] = 1663;
    		rsi.childX[37] = 50 - 24 + 134 + 297 - 2;
    		rsi.childY[37] = 110 - 44 + 82 - 13 + 5;
    		rsi.children[38] = 1664;
    		rsi.childX[38] = 50 - 24 + 78 + 297 - 2;
    		rsi.childY[38] = 110 - 44 + 122 - 13 + 5;
    		rsi.children[39] = 1665;
    		rsi.childX[39] = 50 - 24 + 78 + 297 - 2;
    		rsi.childY[39] = 110 - 44 + 162 - 13 + 5;
    		rsi.children[40] = 1666;
    		rsi.childX[40] = 50 - 24 + 22 + 297 - 2;
    		rsi.childY[40] = 110 - 44 + 162 - 13 + 5;
    		rsi.children[41] = 1667;
    		rsi.childX[41] = 50 - 24 + 134 + 297 - 2;
    		rsi.childY[41] = 110 - 44 + 162 - 13 + 5;
    		rsi.children[42] = 1688;
    		rsi.childX[42] = 50 + 297 - 2;
    		rsi.childY[42] = 110 - 13 + 5;
    	}
    
    	/**
    	 * Adds an action button to the bottom of the equipment interface and
    	 * removes the bonus text.
    	 */
    	public static void equipmentTab(TextDrawingArea tda[]) {
    		RSInterface rsi = interfaceCache[1644];
    		rsi.addActionButton(15101, 15101, 15101, 150, 40, "Show Equipment Screen", "equipment");
    		rsi.addClick(15102, 15102, 15102, "", 1, 1);
    		rsi.removeSomething(15103);
    		rsi.removeSomething(15104);
    		rsi.children[23] = 15101;
    		rsi.childX[23] = 21;
    		rsi.childY[23] = 210;
    		rsi.children[24] = 15102;
    		rsi.childX[24] = 1;
    		rsi.childY[24] = 1;
    		rsi.children[25] = 15103;
    		rsi.childX[25] = 41;
    		rsi.childY[25] = 212;
    		rsi.children[26] = 15104;
    		rsi.childX[26] = 41+39+30;
    		rsi.childY[26] = 212;
    	}
    And the method which adds your character to an interface:
    Code:
    	/**
    	 * Adds your current character to an interface.
    	 */
    	public void addChar(int ID) { 
    		RSInterface rsi = interfaceCache[ID] = new RSInterface(); 
    		rsi.id = id; 
    		rsi.parentID = ID; 
    		rsi.type = 6;
    		rsi.atActionType = 0; 
    		rsi.contentType = 328; 
    		rsi.width = 136; 
    		rsi.height = 168; 
    		rsi.aByte254 = 0;
    		rsi.mOverInterToTrigger = 0;
    		rsi.modelZoom = 650;
    		rsi.modelRotation1 = 150;
    		rsi.modelRotation2 = 0; 
    		rsi.anInt257 = -1; 
    		rsi.anInt258 = -1; 
    	}
    If you do not wish to add your sprites into sub folders, then you will have to remove this: rsi.addActionButton(15101, 15101, 15101, 150, 40, "Show Equipment Screen", "equipment");

    Here are my methods and what I've edited, I've also changed the location variable in the Sprite class to:
    Code:
    public String location = "./cache/sprites/";
    I suggest you do so unless you want to edit the path to the sprites.

    Code:
    	public static void addSprite(int id, int spriteId, String spriteName, String file) {
    		RSInterface rsi = interfaceCache[id] = new RSInterface();
    		rsi.id = id;
    		rsi.parentID = id;
    		rsi.type = 5;
    		rsi.atActionType = 0;
    		rsi.contentType = 0;
    		rsi.aByte254 = (byte) 0;
    		rsi.mOverInterToTrigger = 52;
    		rsi.sprite1 = imageLoader("" + file + "", spriteId, spriteName);
    		rsi.sprite2 = imageLoader("" + file + "", spriteId, spriteName);
    		rsi.width = 512;
    		rsi.height = 334;
    	}
    
    	public static void addClick(int id, int spriteOnId, int spriteOffId, String castText, int h, int w) {
    		RSInterface rsi = interfaceCache[id] = new RSInterface();
    		rsi.id = id;
    		rsi.parentID = id;
    		rsi.type = 5;
    		rsi.atActionType = 1;
    		rsi.contentType = 0;
    		rsi.width = h;
    		rsi.height = w;
    		rsi.aByte254 = (byte)0;
    		rsi.mOverInterToTrigger = 52;
    		rsi.selectedActionName = "Cast On";
    		rsi.spellName = castText;
    		rsi.sprite1 = imageLoader("equipment", spriteOnId, "interface");
    		rsi.sprite2 = imageLoader("equipment", spriteOffId, "interface");
    		rsi.tooltip = castText;
    	}
    
    	public static void removeSomething(int id) {
    		@SuppressWarnings("unused")
    		RSInterface rsi = interfaceCache[id] = new RSInterface();
    	}
    
    	public static void addActionButton(int id, int sprite, int sprite2, int width, int height, String s, String folder) {
    		RSInterface rsi = interfaceCache[id] = new RSInterface();
    		if (folder.equalsIgnoreCase("equipment")) {
    			rsi.sprite1 = imageLoader("equipment", sprite, "CUSTOM");
    		} else if (folder.equalsIgnoreCase("attack")) {
    			rsi.sprite1 = imageLoader("attack", sprite, "");
    		} else {
    			rsi.sprite1 = imageLoader("misc", sprite, "");
    		}
    		if (sprite2 == sprite) {
    			rsi.sprite2 = imageLoader("attack", sprite, "a");
    		} else {
    			rsi.sprite2 = imageLoader("attack", sprite2, "");
    		}
    		rsi.tooltip = s;
    		rsi.contentType = 0;
    		rsi.atActionType = 1;
    		rsi.width = width;
    		rsi.mOverInterToTrigger = 52;
    		rsi.parentID = id;
    		rsi.id = id;
    		rsi.type = 5;
    		rsi.height = height;
    	}
    
    	private static Sprite imageLoader(String folder, int i, String s) {
    		long l = (TextClass.method585(s) << 8) + (long) i;
    		Sprite sprite = (Sprite) aMRUNodes_238.insertFromCache(l);
    		if (sprite != null)
    			return sprite;
    		try {
    			if (folder.equals("attack")) {
    				sprite = new Sprite("" + folder + "/" + i + "" + s + "");
    			} else {
    				sprite = new Sprite("" + folder + "/" + s + " " + i + "");
    			}
    			aMRUNodes_238.removeFromCache(sprite, l);
    		} catch (Exception exception) {
    			return null;
    		}
    		return sprite;
    	}
    
    	public static void addText(int id, String text, TextDrawingArea tda[], int idx, int color) {
    		RSInterface rsi = addTabInterface(id);
    		rsi.id = id;
    		rsi.parentID = id;
    		rsi.type = 4;
    		rsi.atActionType = 0;
    		rsi.width = 174;
    		rsi.height = 11;
    		rsi.contentType = 0;
    		rsi.aByte254 = 0;
    		rsi.mOverInterToTrigger = -1;
    		rsi.centerText = false;
    		rsi.textShadow = true;
    		rsi.textDrawingAreas = tda[idx];
    		rsi.message = text;
    		rsi.aString228 = "";
    		rsi.textColor = color;
    		rsi.anInt219 = 0;
    		rsi.anInt216 = 0;
    		rsi.anInt239 = 0;	
    	}
    Alternatively, you can just put your sprites into the sprites folder and you won't need to replace any methods.

    Now you can either execute the button server or client sided, I prefer client sided, so that's the way I'll show you. Open your client class and find 'if (l == 315) {'Below the switch, add these(I can't figure out a way to close the interface with the tabs showing back up):
    Code:
    					/*
    					 * Equipment interface.
    					 */
    					case 15101:
    						sendFrame248(15106, 3213);
    						method60(15106);
    						inputTaken = true;
    						break;
    					/*
    					 * Equipment interface close button.
    					 */
    					case 15108:
    						sendFrame248(-1, 3213);
    						drawTabArea();
    						break;
    Here's the text IDs for them if you feel like doing it server sided:
    Code:
    public void updateEquipment() {
    	sendQuest(15110, "Attack:");
    	sendQuest(15111, "Defense");
    	sendQuest(15112, "Other bonuses");
    	sendQuest(15113, "Stab:");
    	sendQuest(15114, "Slash:");
    	sendQuest(15115, "Crush:");
    	sendQuest(15116, "Magic:");
    	sendQuest(15117, "Range:");
    	sendQuest(15118, "Stab:");
    	sendQuest(15119, "Slash:");
    	sendQuest(15120, "Crush:");
    	sendQuest(15121, "Magic:");
    	sendQuest(15122, "Range:");
    	sendQuest(15124, "Strength:");
    }
    Finally, here are the sprites: [Only registered and activated users can see links. ]

    I'm pretty sure that's it..I don't think I left any methods out, if I did let me know.

    Spoiler for Permission:
    Quote Originally Posted by Primadude
    Quote Originally Posted by Aeterna
    Quote Originally Posted by Galkon
    Quote Originally Posted by Aeterna
    Hi, I was wondering if I was allowed to release something I got from the iClarity client and converted to your base (his equipment tab) if I gave him credits and removed upon his request, or do I need permission from him first?
    You would need his permission.
    Could I release it? I'm sick of all these new-era equipment tabs with custom buttons.
    Sure.

    [Only registered and activated users can see links. ]

    Reply With Quote  
     

  2. #2  
    Donator

    Ecstasy's Avatar
    Join Date
    Sep 2008
    Age
    26
    Posts
    5,032
    Thanks given
    324
    Thanks received
    596
    Rep Power
    843
    Thanks bro, I wanted this bad.

    Reply With Quote  
     

  3. #3  
    Extreme Donator


    Join Date
    Mar 2009
    Age
    26
    Posts
    954
    Thanks given
    25
    Thanks received
    15
    Rep Power
    213
    Why didn't you use the correct lines for the equipment stats?? At least help the dumb people who can't get it right...

    Can I make this shorter for you and fix the lines? This is really bugging me as it's for Galkon's Refactored and his client is supposed to have shorter codes.
    Quote Originally Posted by Note
    Why do you quote yourself?
    Reply With Quote  
     

  4. #4  
    Registered Member 2pro's Avatar
    Join Date
    Aug 2009
    Posts
    774
    Thanks given
    15
    Thanks received
    15
    Rep Power
    66
    need the imageloader method >.<
    Quote Originally Posted by Gator God View Post
    The use of small code like this is what makes a server great.
    Quote Originally Posted by Shoes View Post
    First of all, that's my code. Second of all it is more efficient in many ways, they may not be big but it's the little things that count.
    Quote Originally Posted by Luke132 View Post
    A thread's age doesn't mean anything if the information in the topic is still relevant.
    Why is gravedigging disallowed then?
    Reply With Quote  
     

  5. #5  
    Registered Member

    Join Date
    Sep 2008
    Posts
    2,219
    Thanks given
    148
    Thanks received
    204
    Rep Power
    1570
    Quote Originally Posted by Jamiz View Post
    Why didn't you use the correct lines for the equipment stats?? At least help the dumb people who can't get it right...

    Can I make this shorter for you and fix the lines? This is really bugging me as it's for Galkon's Refactored and his client is supposed to have shorter codes.
    Go for it lol, I'll just add it to the topic, and I added it to the topic 2pro.

    Quote Originally Posted by King Ecstasy' View Post
    Thanks bro, I wanted this bad.
    No problem

    [Only registered and activated users can see links. ]

    Reply With Quote  
     

  6. #6  
    Banned

    Join Date
    Oct 2009
    Posts
    1,621
    Thanks given
    15
    Thanks received
    67
    Rep Power
    0
    Good job. Might not use, but thanks
    Reply With Quote  
     

  7. #7  
    Registered Member DestriX's Avatar
    Join Date
    Nov 2008
    Posts
    1,329
    Thanks given
    490
    Thanks received
    152
    Rep Power
    257
    Zomg finally I've been waiting Ty
    [Only registered and activated users can see links. ]
    Reply With Quote  
     

  8. #8  
    Registered Member 2pro's Avatar
    Join Date
    Aug 2009
    Posts
    774
    Thanks given
    15
    Thanks received
    15
    Rep Power
    66
    addText method please.
    Quote Originally Posted by Gator God View Post
    The use of small code like this is what makes a server great.
    Quote Originally Posted by Shoes View Post
    First of all, that's my code. Second of all it is more efficient in many ways, they may not be big but it's the little things that count.
    Quote Originally Posted by Luke132 View Post
    A thread's age doesn't mean anything if the information in the topic is still relevant.
    Why is gravedigging disallowed then?
    Reply With Quote  
     

  9. #9  
    Fuckin PRO

    Tyler's Avatar
    Join Date
    Jan 2008
    Age
    30
    Posts
    6,023
    Thanks given
    46
    Thanks received
    507
    Rep Power
    3330
    This is like 420?
    Free Filehost Premium Accounts
    [Only registered and activated users can see links. ]
    Reply With Quote  
     

  10. #10  
    Donator

    Ecstasy's Avatar
    Join Date
    Sep 2008
    Age
    26
    Posts
    5,032
    Thanks given
    324
    Thanks received
    596
    Rep Power
    843
    Do you have ultimates weapon interface converted for galkons refactored?

    Reply With Quote  
     

Page 1 of 4 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
  •