Thread: Effigy help

Results 1 to 6 of 6
  1. #1 Effigy help 
    Registered Member
    Join Date
    Apr 2014
    Posts
    80
    Thanks given
    4
    Thanks received
    1
    Rep Power
    11
    Ok so when you Use the effigy it doesn't Disappear and give you then next stage it just Removes the effigy completely

    http://puu.sh/8Xx5Z.jpg
    http://puu.sh/8Xx6n.jpg

    Code:
    public static void effigyInvestigation(Player player, int id) {
    	Inventory inv = player.getInventory();
    	inv.deleteItem(id, 1);
    	if (inv.containsOneItem(STARVED_ANCIENT_EFFIGY))
    	    inv.addItem(NOURISHED_ANCIENT_EFFIGY, 1);
    	else if (inv.containsOneItem(NOURISHED_ANCIENT_EFFIGY))
    	    inv.addItem(SATED_ANCIENT_EFFIGY, 1);
    	else if (inv.containsOneItem(SATED_ANCIENT_EFFIGY))
    	    inv.addItem(GORGED_ANCIENT_EFFIGY, 1);
    	else if (inv.containsOneItem(GORGED_ANCIENT_EFFIGY))
    	    inv.addItem(DRAGONKIN_LAMP, 1);
        }
    Reply With Quote  
     

  2. #2  
    Registered Member

    Join Date
    Feb 2013
    Posts
    4,409
    Thanks given
    59
    Thanks received
    478
    Rep Power
    138
    Quote Originally Posted by joshuav1 View Post
    Ok so when you Use the effigy it doesn't Disappear and give you then next stage it just Removes the effigy completely

    http://puu.sh/8Xx5Z.jpg
    http://puu.sh/8Xx6n.jpg

    Code:
    public static void effigyInvestigation(Player player, int id) {
    	Inventory inv = player.getInventory();
    	inv.deleteItem(id, 1);
    	if (inv.containsOneItem(STARVED_ANCIENT_EFFIGY))
    	    inv.addItem(NOURISHED_ANCIENT_EFFIGY, 1);
    	else if (inv.containsOneItem(NOURISHED_ANCIENT_EFFIGY))
    	    inv.addItem(SATED_ANCIENT_EFFIGY, 1);
    	else if (inv.containsOneItem(SATED_ANCIENT_EFFIGY))
    	    inv.addItem(GORGED_ANCIENT_EFFIGY, 1);
    	else if (inv.containsOneItem(GORGED_ANCIENT_EFFIGY))
    	    inv.addItem(DRAGONKIN_LAMP, 1);
        }

    Deleting before adding
    Reply With Quote  
     

  3. #3  
    Registered Member
    Join Date
    Apr 2014
    Posts
    80
    Thanks given
    4
    Thanks received
    1
    Rep Power
    11
    Alright fixed that Cheers deaths, But when i use it, it moves across a inventory slot Now ?
    Reply With Quote  
     

  4. #4  
    Registered Member
    Join Date
    Apr 2014
    Posts
    80
    Thanks given
    4
    Thanks received
    1
    Rep Power
    11
    For a better outlook of what actually Happens, it shifts slots and honestly don't know why
    http://puu.sh/8XG49
    http://puu.sh/8XG5v
    Reply With Quote  
     

  5. #5  
    Registered Member

    Join Date
    Feb 2013
    Posts
    4,409
    Thanks given
    59
    Thanks received
    478
    Rep Power
    138
    Quote Originally Posted by joshuav1 View Post
    For a better outlook of what actually Happens, it shifts slots and honestly don't know why
    http://puu.sh/8XG49
    http://puu.sh/8XG5v
    Odd, pretty sure there is a method to replace the item and add it to the current slot
    Reply With Quote  
     

  6. #6  
    Registered Member Sjonsen's Avatar
    Join Date
    May 2012
    Posts
    321
    Thanks given
    15
    Thanks received
    44
    Rep Power
    20
    I actually fixed this yesterday, use this instead:

    Code:
    Inventory inv = player.getInventory();
    switch(id){
    		case STARVED_ANCIENT_EFFIGY:
    			inv.deleteItem(id, 1);
    			inv.addItem(NOURISHED_ANCIENT_EFFIGY, 1);
    			break;
    		case NOURISHED_ANCIENT_EFFIGY:
    			inv.deleteItem(id, 1);
    			inv.addItem(SATED_ANCIENT_EFFIGY, 1);
    			break;
    		case SATED_ANCIENT_EFFIGY:
    			inv.deleteItem(id, 1);
    			inv.addItem(GORGED_ANCIENT_EFFIGY, 1);
    			break;
    		case GORGED_ANCIENT_EFFIGY:
    			inv.deleteItem(id, 1);
    			inv.addItem(DRAGONKIN_LAMP, 1);
    			break;
    		default:
    			player.closeInterfaces();
    			break;
    		}
    You're welcome.

    Edit: The reason your code doesn't work is; it deletes the item first, THEN checks if the inventory still contains the item (which it obviously doesn't anymore as it deleted it first), then do code. There's no code to run as the inventory doesn't contain any of the item cases.
    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. Need Help With Effigys
    By Thanks in forum Help
    Replies: 0
    Last Post: 02-29-2012, 02:55 PM
  2. Need gfx help?
    By Beh3moth2 in forum General
    Replies: 1
    Last Post: 04-03-2007, 11:50 AM
  3. GIMP brush help
    By man777 in forum Tutorials
    Replies: 0
    Last Post: 04-03-2007, 03:11 AM
  4. Need help again
    By Zane in forum Showcase
    Replies: 4
    Last Post: 04-02-2007, 09:11 PM
  5. Need help choosing sig
    By Zane in forum Showcase
    Replies: 7
    Last Post: 04-02-2007, 03:14 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
  •