Thread: ItemOperate help?

Results 1 to 2 of 2
  1. #1 ItemOperate help? 
    Registered Member
    Join Date
    Apr 2007
    Posts
    200
    Thanks given
    0
    Thanks received
    0
    Rep Power
    53
    Right, so I'm trying to write something for item operating for Emulous. Right now, I got this:

    Code:
    package server.model.players;
    
    public class ItemOperate
    {
    	private Client c; //-Calls Client.class. Easier than using server.model.players.Client;, ect..
    	public int[] items = {1706,1708,1710,1712,2552,2554,2556,2558,2560,2562,2564,2566}; //-This might waste space, but put all your items you put in itemOperate here.
    	/*
    	 * @author Jorell
    	 * We call this for shortcut in Client.class
    	 */
    	public ItemOperate(Client Client) {
    		this.c = Client;
    	}
    	/*
    	 * @author Jorell
    	 * This is where you can put your items and what they do.
    	 */
    	public void itemOperate(int itemType)
    	{
    		switch (itemType)
    		{
    			case 1712:
    				c.sendMessage("Test.");
    				break;
    			case 1706:
    				c.sendMessage("Ownage.");
    				break;
    			case 1708:
    				c.sendMessage("Leet.");
    				break;
    			case 1710:
    				c.sendMessage("Winner.");
    				break;
    			case 2552:
    				c.sendMessage("Haha.");
    				break;
    			case 2554:
    				c.sendMessage("Pwnage.");
    				break;
    			case 2556:
    				c.sendMessage("Lol.");
    				break;
    			case 2558:
    				c.sendMessage("Rofl.");
    				break;
    			case 2560:
    				c.sendMessage("Pwned.");
    				break;
    			case 2562:
    				c.sendMessage("xD.");
    				break;
    			case 2564:
    				c.sendMessage("(=.");
    				break;
    			case 2566:
    				c.sendMessage("Rotflmaoqzx.");
    				break;
    		}
    	}
    //-We can end the class here, duh.
    }
    Then in Bank10.class, I added this:
    Code:
    			case 1688:
    				for(int i = 0; i < c.getOperate().items.length; i++) {
    					if(c.playerEquipment.length == i) {
    						c.getOperate().itemOperate(i);
    					} else {
    						c.sendMessage("There's no way operating this item!");
    						break;
    					}
    				}
    			break;
    Then in Client.class, I added this:
    Code:
    	private ItemOperate itemOperate = new ItemOperate(this);
    	public ItemOperate getOperate() {
    		return itemOperate;
    	}
    But for some reason, it just doesn't seem to work. It compiles fine, but it doesn't work. Any reason why?
    Did you know?
    You cant die from a chicken, unless its toonie tuesdays on the 13th day of the year 2010 at exactly 2:32:37 am pacific time.
     

  2. #2  
    Registered Member
    Join Date
    Apr 2007
    Posts
    200
    Thanks given
    0
    Thanks received
    0
    Rep Power
    53
    C'mon, someone help .
    Did you know?
    You cant die from a chicken, unless its toonie tuesdays on the 13th day of the year 2010 at exactly 2:32:37 am pacific time.
     


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
  •