Thread: What stepts to take to add new items [530]

Results 1 to 4 of 4
  1. #1 What stepts to take to add new items [530] 
    Hi :)


    Join Date
    Apr 2016
    Posts
    622
    Thanks given
    84
    Thanks received
    161
    Rep Power
    93
    I'm looking into the more client/cache side of things at the moment and I'm not sure what modifications I need to make in order to add custom items correctly. I can pack them into the cache, spawn the item in game but the item is not weildable, as it doesnt show the correct item when its equipped. I understand it has something to do with render emotes? I'm using XenoRune as a trial. Some help would be appreciated.
    Check out my remake here:
    Incite
    Reply With Quote  
     

  2. #2  
    Banned
    Join Date
    Dec 2016
    Posts
    26
    Thanks given
    6
    Thanks received
    3
    Rep Power
    0
    Quote Originally Posted by public void View Post
    I'm looking into the more client/cache side of things at the moment and I'm not sure what modifications I need to make in order to add custom items correctly. I can pack them into the cache, spawn the item in game but the item is not weildable, as it doesnt show the correct item when its equipped. I understand it has something to do with render emotes? I'm using XenoRune as a trial. Some help would be appreciated.
    After you packed them did you add them into the itemdefinitions in the server?
    Reply With Quote  
     

  3. #3  
    Hi :)


    Join Date
    Apr 2016
    Posts
    622
    Thanks given
    84
    Thanks received
    161
    Rep Power
    93
    Quote Originally Posted by Smash Smash View Post
    After you packed them did you add them into the itemdefinitions in the server?
    Yep I can see the item, I can drop the item and they both have the correct models. When I equip the item I can see it on my equipment tab but on the player, the render isnt working.
    Check out my remake here:
    Incite
    Reply With Quote  
     

  4. #4  
    Donator


    Join Date
    Jul 2011
    Posts
    570
    Thanks given
    135
    Thanks received
    142
    Rep Power
    291
    Quote Originally Posted by public void View Post
    Yep I can see the item, I can drop the item and they both have the correct models. When I equip the item I can see it on my equipment tab but on the player, the render isnt working.
    When you packed the items did you set the maleModelIds? Render animation shouldn't stop you from seeing the item unless it's something obscure from like 718 revision.

    However if you wanna pack a new render animation, there's a class in the client I think called RenderAnimationDefinition. Emperor's Arios 530 cache editor uses this to pack new NPCs and their render animations. All a render animation is runAnimId, standAnimId, turnAnimId, etc., all packed into one object. So just find all those ids and pack a new render animation definition. Here's the class from 530 revision:

    Code:
    package emperor;
    
    import java.nio.ByteBuffer;
    
    import com.alex.store.Store;
    
    /**
     * Holds definitions for render animations.
     * @author Jagex
     * @author Emperor
     *
     */
    public class RenderAnimationDefinition {
    
    	public int turn180Animation;
    	public int anInt951 = -1;
    	public int anInt952;
    	public int turnCWAnimation = -1;
    	public int anInt954;
    	public int anInt955;
    	public int anInt956;
    	public int anInt957;
    	public int anInt958;
    	public int[] anIntArray959 = null;
    	public int anInt960;
    	public int anInt961 = 0;
    	public int anInt962;
    	public int walkAnimationId;
    	public int anInt964;
    	public int anInt965;
    	public int anInt966;
    	public int anInt969;
    	public int[] anIntArray971;
    	public int standAnimationId;
    	public int anInt973;
    	public int anInt974;
    	public int anInt975;
    	public int runAnimationId;
    	public int anInt977;
    	public boolean aBoolean978;
    	public int[][] anIntArrayArray979;
    	public int anInt980;
    	public int turnCCWAnimation;
    	public int anInt983;
    	public int anInt985;
    	public int anInt986;
    	public int anInt987;
    	public int anInt988;
    	public int anInt989;
    	public int anInt990;
    	public int anInt992;
    	public int anInt993;
    	public int anInt994;
    	public int anInt999 = -1;
    
    	/**
    	 * Gets the render animation definitions for the given id.
    	 * @param animId The render animation id.
    	 * @return The render animation definitions.
    	 */
    	public static RenderAnimationDefinition forId(Store store, int animId) {
    		RenderAnimationDefinition defs = new RenderAnimationDefinition();
    		if (animId == -1) {
    			return null;
    		}
    		byte[] data = store.getIndexes()[2].getFile(32, animId);
    		defs = new RenderAnimationDefinition();
    		if (data != null) {
    			defs.parse(ByteBuffer.wrap(data));
    		} else {
    			System.err.println("No definitions found for render animation " + animId + ", size=" + store.getIndexes()[2].getValidFilesCount(32) + "!");
    		}
    		return defs;
    	}
    	
    
    	private void parse(ByteBuffer buffer) {
    		for (;;) {
    			int opcode = buffer.get() & 0xFF;
    			if (opcode == 0) {
    				break;
    			}
    			parseOpcode(buffer, opcode);
    		}
    	}
    
    	public byte[] pack() {
    		ByteBuffer buffer = ByteBuffer.allocate(888888);
    		if (standAnimationId > -1 || walkAnimationId > -1) {
    			buffer.put((byte) 1);
    			buffer.putShort((short) standAnimationId);
    			buffer.putShort((short) walkAnimationId);
    		}
    		if (anInt974 != -1) {
    			buffer.put((byte) 2);
    			buffer.putShort((short) anInt974);
    		}
    		if (anInt987 != -1) {
    			buffer.put((byte) 3);
    			buffer.putShort((short) anInt987);
    		}
    		if (anInt986 != -1) {
    			buffer.put((byte) 4);
    			buffer.putShort((short) anInt986);
    		}
    		if (anInt977 != -1) {
    			buffer.put((byte) 5);
    			buffer.putShort((short) anInt977);
    		}
    		if (runAnimationId != -1) {
    			buffer.put((byte) 6);
    			buffer.putShort((short) runAnimationId);
    		}
    		if (anInt960 != -1) {
    			buffer.put((byte) 7);
    			buffer.putShort((short) anInt960);
    		}
    		if (anInt985 != -1) {
    			buffer.put((byte) 8);
    			buffer.putShort((short) anInt985);
    		}
    		if (anInt957 != -1) {
    			buffer.put((byte) 9);
    			buffer.putShort((short) anInt957);
    		}
    		if (anInt973 != 0 || anInt975 != 0) {
    			buffer.put((byte) 26);
    			buffer.put((byte) (anInt973 / 4));
    			buffer.put((byte) (anInt975 / 4));
    		}
    		if (anIntArrayArray979 != null) {
    			for (int i = 0; i < anIntArrayArray979.length; i++) {
    				if (anIntArrayArray979[i] != null && anIntArrayArray979[i].length > 0) {
    					buffer.put((byte) 27);
    					buffer.put((byte) i);
    					for (int j : anIntArrayArray979[i]) {
    						buffer.putShort((short) j);
    					}
    				}
    			}
    		}
    		if (anIntArray971 != null) {
    			buffer.put((byte) 28);
    			for (int i = 0; i < 12; i++) {
    				buffer.put((byte) anIntArray971[i]);
    			}
    		}
    		if (anInt992 != 0) {
    			buffer.put((byte) 29);
    			buffer.put((byte) anInt992);
    		}
    		if (anInt980 != 0) {
    			buffer.put((byte) 30);
    			buffer.putShort((short) anInt980);
    		}
    		if (anInt988 != 0) {
    			buffer.put((byte) 31);
    			buffer.put((byte) anInt988);
    		}
    		if (anInt961 != 0) {
    			buffer.put((byte) 32);
    			buffer.putShort((short) anInt961);
    		}
    		if (anInt956 != 0) {
    			buffer.put((byte) 33);
    			buffer.putShort((short) anInt956);
    		}
    		if (anInt993 != 0) {
    			buffer.put((byte) 34);
    			buffer.put((byte) anInt993);
    		}
    		if (anInt969 != 0) {
    			buffer.put((byte) 35);
    			buffer.putShort((short) anInt969);
    		}
    		if (anInt965 != 0) {
    			buffer.put((byte) 36);
    			buffer.putShort((short) anInt965);
    		}
    		if (anInt951 != -1) {
    			buffer.put((byte) 37);
    			buffer.put((byte) anInt951);
    		}
    		if (anInt958 != -1) {
    			buffer.put((byte) 38);
    			buffer.putShort((short) anInt958);
    		}
    		if (anInt954 != -1) {
    			buffer.put((byte) 39);
    			buffer.putShort((short) anInt954);
    		}
    		if (turn180Animation != -1) {
    			buffer.put((byte) 40);
    			buffer.putShort((short) turn180Animation);
    		}
    		if (turnCWAnimation != -1) {
    			buffer.put((byte) 41);
    			buffer.putShort((short) turnCWAnimation);
    		}
    		if (turnCCWAnimation != -1) {
    			buffer.put((byte) 42);
    			buffer.putShort((short) turnCCWAnimation);
    		}
    		if (anInt999 != -1) {
    			buffer.put((byte) 43);
    			buffer.putShort((short) anInt999);
    		}
    		if (anInt955 != -1) {
    			buffer.put((byte) 44);
    			buffer.putShort((short) anInt955);
    		}
    		if (anInt964 != -1) {
    			buffer.put((byte) 45);
    			buffer.putShort((short) anInt964);
    		}
    		buffer.put((byte) 0);
    		buffer.flip();
    		byte[] bs = new byte[buffer.remaining()];
    		buffer.get(bs);
    		return bs;
    	}
    
    	private void parseOpcode(ByteBuffer buffer, int opcode) {
    		switch (opcode) {
    		case 1:
    			standAnimationId = buffer.getShort() & 0xFFFF;
    			walkAnimationId = buffer.getShort() & 0xFFFF;
    			if ((standAnimationId ^ 0xffffffff) == -65536) {
    				standAnimationId = -1;
    			}
    			if ((walkAnimationId ^ 0xffffffff) == -65536) {
    				walkAnimationId = -1;
    			}
    			break;
    		case 2:
    			anInt974 = buffer.getShort() & 0xFFFF;
    			break;
    		case 3:
    			anInt987 = buffer.getShort() & 0xFFFF;
    			break;
    		case 4:
    			anInt986 = buffer.getShort() & 0xFFFF;
    			break;
    		case 5:
    			anInt977 = buffer.getShort() & 0xFFFF;
    			break;
    		case 6:
    			runAnimationId = buffer.getShort() & 0xFFFF;
    			break;
    		case 7:
    			anInt960 = buffer.getShort() & 0xFFFF;
    			break;
    		case 8:
    			anInt985 = buffer.getShort() & 0xFFFF;
    			break;
    		case 9:
    			anInt957 = buffer.getShort() & 0xFFFF;
    			break;
    		case 26:
    			anInt973 = (short) (buffer.get() & 0xFF * 4);
    			anInt975 = (short) (buffer.get() & 0xFF * 4);
    			break;
    		case 27:
    			if (anIntArrayArray979 == null) {
    				anIntArrayArray979 = new int[12][];
    			}
    			int i = buffer.get() & 0xFF;
    			anIntArrayArray979[i] = new int[6];
    			for (int i_1_ = 0; (i_1_ ^ 0xffffffff) > -7; i_1_++) {
    				anIntArrayArray979[i][i_1_] = buffer.getShort();
    			}
    			break;
    		case 28:
    			anIntArray971 = new int[12];
    			for (i = 0; i < 12; i++) {
    				anIntArray971[i] = buffer.get() & 0xFF;
    				if (anIntArray971[i] == 255) {
    					anIntArray971[i] = -1;
    				}
    			}
    			break;
    		case 29:
    			anInt992 = buffer.get() & 0xFF;
    			break;
    		case 30:
    			anInt980 = buffer.getShort() & 0xFFFF;
    			break;
    		case 31:
    			anInt988 = buffer.get() & 0xFF;
    			break;
    		case 32:
    			anInt961 = buffer.getShort() & 0xFFFF;
    			break;
    		case 33:
    			anInt956 = (buffer.getShort());
    			break;
    		case 34:
    			anInt993 = buffer.get() & 0xFF;
    			break;
    		case 35:
    			anInt969 = (buffer.getShort() & 0xFFFF);
    			break;
    		case 36:
    			anInt965 = (buffer.getShort());
    			break;
    		case 37:
    			anInt951 = (buffer.get() & 0xFF);
    			break;
    		case 38:
    			anInt958 = (buffer.getShort() & 0xFFFF);
    			break;
    		case 39:
    			anInt954 = buffer.getShort() & 0xFFFF;
    			break;
    		case 40:
    			turn180Animation = buffer.getShort() & 0xFFFF;
    			break;
    		case 41:
    			turnCWAnimation = buffer.getShort() & 0xFFFF;
    			break;
    		case 42:
    			turnCCWAnimation = buffer.getShort() & 0xFFFF;
    			break;
    		case 43:
    			anInt999 = buffer.getShort() & 0xFFFF;
    			break;
    		case 44:
    			anInt955 = buffer.getShort() & 0xFFFF;
    			break;
    		case 45:
    			anInt964 = buffer.getShort() & 0xFFFF;
    			break;
    		}
    	}
    
    	public RenderAnimationDefinition() {
    		anInt957 = -1;
    		anInt954 = -1;
    		anInt960 = -1;
    		anInt958 = -1;
    		anInt965 = 0;
    		anInt973 = 0;
    		turn180Animation = -1;
    		anInt956 = 0;
    		standAnimationId = -1;
    		anInt952 = -1;
    		anInt983 = -1;
    		anInt985 = -1;
    		anInt962 = -1;
    		anInt966 = -1;
    		anInt977 = -1;
    		anInt975 = 0;
    		runAnimationId = -1;
    		anInt988 = 0;
    		turnCCWAnimation = -1;
    		anInt987 = -1;
    		anInt980 = 0;
    		anInt964 = -1;
    		walkAnimationId = -1;
    		anInt986 = -1;
    		aBoolean978 = true;
    		anInt992 = 0;
    		anInt955 = -1;
    		anInt989 = -1;
    		anInt974 = -1;
    		anInt969 = 0;
    		anInt994 = 0;
    		anInt990 = -1;
    		anInt993 = 0;
    	}
    }
    Reply With Quote  
     


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. How to add new items :)?
    By Tha King in forum Help
    Replies: 3
    Last Post: 11-18-2012, 03:11 AM
  2. How to add new items into your client
    By Magic in forum Tutorials
    Replies: 24
    Last Post: 10-20-2012, 04:39 AM
  3. Replies: 1
    Last Post: 12-08-2011, 04:18 PM
  4. How To Add New Items?
    By Hidden Gamer in forum Help
    Replies: 12
    Last Post: 10-05-2011, 05:11 AM
  5. [508] Better way to add new items
    By Dragonking in forum Configuration
    Replies: 18
    Last Post: 06-20-2009, 07:01 PM
Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •