Thread: [718] Pouch Infusion - Summoning

Results 1 to 10 of 10
  1. #1 [718] Pouch Infusion - Summoning 
    Banned

    Join Date
    Sep 2009
    Posts
    1,878
    Thanks given
    411
    Thanks received
    1,637
    Rep Power
    0
    Thought I would share this with you all since it was simple

    Code:
           private static final Animation POUCH_INFUSION_ANIMATION = new Animation(725);
           private static final Graphics POUCH_INFUSION_GRAPHICS = new Graphics(1207);
    
           public static void handlePouchInfusion(Player player, int slotId, int creationCount) {
    		int slotValue = (slotId - 2) / 5;
    		Pouch pouch = Pouch.values()[slotValue];
    		if (pouch == null)
    			return;
    		boolean infusingScroll = (boolean) player.getTemporaryAttributtes().remove("infusing_scroll"), hasRequirements = false;
    		ItemDefinitions def = ItemDefinitions.getItemDefinitions(pouch.getRealPouchId());
    		List<Item> itemReq = def.getCreateItemRequirements();
    		if (itemReq != null) {
    			itemCount : for (int i = 0; i < creationCount; i++) {
    				if (!player.getInventory().containsItems(itemReq))
    					break itemCount;
    				hasRequirements = true;
    				player.getInventory().removeItems(itemReq);
    				player.getInventory().addItem(new Item(infusingScroll ? pouch.getRealScrollId() : pouch.getRealPouchId(), infusingScroll ? 10 : 1));
    				player.getSkills().addXp(Skills.SUMMONING, infusingScroll ? pouch.getMinorExperience() : pouch.getExperience());
    			}
    		}
    		if (!hasRequirements) {
    			player.getTemporaryAttributtes().put("infusing_scroll", infusingScroll);
    			return;
    		}
    		player.closeInterfaces();
    		player.setNextAnimation(POUCH_INFUSION_ANIMATION);
    		player.setNextGraphics(POUCH_INFUSION_GRAPHICS);
    	}
    Reply With Quote  
     

  2. Thankful users:


  3. #2  
    Developer


    Join Date
    Aug 2012
    Age
    22
    Posts
    2,491
    Thanks given
    179
    Thanks received
    1,703
    Rep Power
    2470
    Thanks, it's clean and nice.
    Reply With Quote  
     

  4. #3  
    touched like seafood
    Tyluur's Avatar
    Join Date
    Jun 2010
    Age
    23
    Posts
    4,838
    Thanks given
    1,676
    Thanks received
    1,567
    Discord
    View profile
    Rep Power
    1390
    Better than mine. gj
    [Only registered and activated users can see links. ] | [Only registered and activated users can see links. ] | [Only registered and activated users can see links. ] (official dog of rune-server)
    Quote Originally Posted by blakeman8192 View Post
    Keep trying. Quitting is the only true failure.
    Reply With Quote  
     

  5. #4  
    Registered Member

    Join Date
    Jan 2013
    Posts
    795
    Thanks given
    257
    Thanks received
    191
    Rep Power
    197
    Thanks had it but yours is better
    Reply With Quote  
     

  6. #5  
    Donator

    Old Oak's Avatar
    Join Date
    May 2011
    Age
    26
    Posts
    1,552
    Thanks given
    544
    Thanks received
    435
    Rep Power
    189
    i was in the middle of working on one, this saves me time. thanks.
    [Only registered and activated users can see links. ]
    Reply With Quote  
     

  7. #6  
    Registered Member

    Join Date
    Oct 2008
    Posts
    2,342
    Thanks given
    132
    Thanks received
    1,019
    Rep Power
    828
    cjay i see a stupid thing on ur code. you can just do break since theres only 1 loop. no need to declare the loop you want to break.
    Reply With Quote  
     

  8. #7  
    Banned

    Join Date
    Sep 2009
    Posts
    1,878
    Thanks given
    411
    Thanks received
    1,637
    Rep Power
    0
    Quote Originally Posted by dragonkk View Post
    cjay i see a stupid thing on ur code. you can just do break since theres only 1 loop. no need to declare the loop you want to break.
    It looks pretty alex, shutup
    Reply With Quote  
     

  9. Thankful user:


  10. #8  
    Registered Member

    Join Date
    Jan 2013
    Age
    23
    Posts
    783
    Thanks given
    159
    Thanks received
    170
    Rep Power
    360
    Pretty nice, gj
    Reply With Quote  
     

  11. #9  
    The Enigma
    Cαleb's Avatar
    Join Date
    Nov 2012
    Posts
    333
    Thanks given
    87
    Thanks received
    33
    Rep Power
    15
    This is so nice thanks Cjay
    Reply With Quote  
     

  12. #10  
    Registered Member

    Join Date
    Oct 2008
    Posts
    2,342
    Thanks given
    132
    Thanks received
    1,019
    Rep Power
    828
    Quote Originally Posted by Cjay0091 View Post
    It looks pretty alex, shutup
    do you even know when to use somethinguringloop?

    its only used when you want to break a certain loop and you have two or more loops occuring. when you do break it will break the current looping and since you only have one theres no need for break itemcount;. break; would do same.
    Reply With Quote  
     

  13. Thankful users:



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. 667 & 718 Summoning Pouch Creation.
    By kingcobra805 in forum Snippets
    Replies: 34
    Last Post: 01-01-2013, 12:01 AM
  2. Summoning pouch creation
    By TheLife in forum Show-off
    Replies: 5
    Last Post: 06-18-2011, 07:04 PM
  3. [pi]Summoning pouch wielding[pi]
    By Usaclub in forum Help
    Replies: 9
    Last Post: 05-04-2011, 04:23 AM
  4. 614 | Summoning Pouch Configs?
    By chaflie in forum Requests
    Replies: 6
    Last Post: 08-24-2010, 04:46 PM
  5. Summoning Pouch System
    By X Mercy X in forum Show-off
    Replies: 32
    Last Post: 02-13-2010, 09:16 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
  •