Thread: Fresh 317 client (no new items) not sure if i added ints correct or in the proper loc

Results 1 to 4 of 4
  1. #1 Fresh 317 client (no new items) not sure if i added ints correct or in the proper loc 
    Registered Member
    Join Date
    May 2015
    Posts
    41
    Thanks given
    0
    Thanks received
    0
    Discord
    View profile
    Rep Power
    11
    Code:
    public static ItemDef forID(int i) {
    		for (int j = 0; j < 10; j++)
    			if (cache[j].ID == i)
    				return cache[j];
    		cacheIndex = (cacheIndex + 1) % 10;
    		ItemDef itemDef = cache[cacheIndex];
    		stream.currentOffset = streamIndices[i];
    		itemDef.ID = i;
    		itemDef.setDefaults();
    		itemDef.readValues(stream);
    		if (itemDef.certTemplateID != -1)
    			itemDef.toNote();
    		if (itemDef.lentItemID != -1)
    			itemDef.toLend();
    		if (!isMembers && itemDef.membersObject) {
    			itemDef.name = "Members Object";
    			itemDef.description = "Login to a members' server to use this object.";
    			itemDef.groundActions = null;
    			itemDef.actions = null;
    			itemDef.team = 0;
    		}
    		if (itemDef.editedModelColor != null) {
    			for (int i2 = 0; i2 < itemDef.editedModelColor.length; i2++) {
    				if (itemDef.newModelColor[i2] == 0) {
    					itemDef.newModelColor[i2] = 1;
    				}
    			}
    		}
    		return itemDef;
    	
    	//**Custom items**\\
    		case 20290:	
    	itemDef.ID = 20290;
    	itemDef.actions = new String[] { null, "Wear", "Revert", null, "Drop" };
    	itemDef.modelID = 42724;
    	itemDef.maleEquip1 = 42734;
    	itemDef.femaleEquip1 = 42737;
    	itemDef.modelZoom = 750;
    	itemDef.modelRotation1 = 1743;
    	itemDef.modelRotation2 = 69;
    	itemDef.modelOffset1 = -4;
    	itemDef.modelOffset2 = -3;
    	break;
    i do beleive its suppose to be an if itemDef or something, because
    Code:
    case 20290:
    case 20290: is an error code
    Reply With Quote  
     

  2. #2  
    Contributor
    Women's Avatar
    Join Date
    Mar 2010
    Posts
    1,857
    Thanks given
    696
    Thanks received
    1,113
    Discord
    View profile
    Rep Power
    4264
    u want to add them under a switch statement

    https://docs.oracle.com/javase/tutor...ts/switch.html
    Reply With Quote  
     

  3. #3  
    Registered Member
    Join Date
    May 2015
    Posts
    41
    Thanks given
    0
    Thanks received
    0
    Discord
    View profile
    Rep Power
    11
    yeah i unfortunately dont even have any switch statements in my itemdef

    public static ItemDef itemDef(int i, ItemDef itemDef) {
    if(i == 20290) {
    itemDef.ID = 20290;
    itemDef.actions = new String[] { null, "Wear", "Revert", null, "Drop" };
    itemDef.modelID = 42724;
    itemDef.maleEquip1 = 42734;
    itemDef.femaleEquip1 = 42737;
    itemDef.modelZoom = 750;
    itemDef.modelRotation1 = 1743;
    itemDef.modelRotation2 = 69;
    itemDef.modelOffset1 = -4;
    itemDef.modelOffset2 = -3;
    }
    figured it out, wrote that one it works
    Reply With Quote  
     

  4. #4  
    Registered Member TheTameer400's Avatar
    Join Date
    Aug 2014
    Posts
    164
    Thanks given
    30
    Thanks received
    8
    Discord
    View profile
    Rep Power
    36
    Quote Originally Posted by Our Future View Post
    yeah i unfortunately dont even have any switch statements in my itemdef

    figured it out, wrote that one it works
    you can open a switch statement and add items in it like this:

    Code:
    
           switch (i) {
    
           case 1234: //number is the (i) which is meant to be the item id.      
           //your code here for the item's definitions.      
           break; // to end the case
           }
    yours should look something like this just make sure the switch statement is inside the forID method:

    Code:
    
    public static ItemDef forID(int i) {
    		for (int j = 0; j < 10; j++)
    			if (cache[j].ID == i)
    				return cache[j];
    		cacheIndex = (cacheIndex + 1) % 10;
    		ItemDef itemDef = cache[cacheIndex];
    		stream.currentOffset = streamIndices[i];
    		itemDef.ID = i;
    		itemDef.setDefaults();
    		itemDef.readValues(stream);
    		if (itemDef.certTemplateID != -1)
    			itemDef.toNote();
    		if (itemDef.lentItemID != -1)
    			itemDef.toLend();
    		if (!isMembers && itemDef.membersObject) {
    			itemDef.name = "Members Object";
    			itemDef.description = "Login to a members' server to use this object.";
    			itemDef.groundActions = null;
    			itemDef.actions = null;
    			itemDef.team = 0;
    		}
    		if (itemDef.editedModelColor != null) {
    			for (int i2 = 0; i2 < itemDef.editedModelColor.length; i2++) {
    				if (itemDef.newModelColor[i2] == 0) {
    					itemDef.newModelColor[i2] = 1;
    				}
    			}
    		}
    
                    switch(i){
    
                   		case 20290:	
    	itemDef.ID = 20290;
    	itemDef.actions = new String[] { null, "Wear", "Revert", null, "Drop" };
    	itemDef.modelID = 42724;
    	itemDef.maleEquip1 = 42734;
    	itemDef.femaleEquip1 = 42737;
    	itemDef.modelZoom = 750;
    	itemDef.modelRotation1 = 1743;
    	itemDef.modelRotation2 = 69;
    	itemDef.modelOffset1 = -4;
    	itemDef.modelOffset2 = -3;
    	break;
            
           }
            return itemDef;
          }
    try to add it in yourself and not to copy and paste
    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. Not sure if this is a client problem! 317 [pi]
    By Bluntarifick in forum Buying
    Replies: 1
    Last Post: 01-04-2013, 12:14 PM
  2. Not sure if this is a complaint or a suggestion...
    By Debugger in forum Complaints
    Replies: 15
    Last Post: 07-24-2010, 07:13 PM
  3. Replies: 4
    Last Post: 06-25-2010, 05:11 AM
  4. Replies: 1
    Last Post: 06-20-2010, 05:24 AM
  5. Replies: 3
    Last Post: 12-22-2007, 10:13 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
  •