Thread: Decanting

Page 1 of 2 12 LastLast
Results 1 to 10 of 20
  1. #1 Decanting 
    Banned
    Join Date
    Sep 2017
    Posts
    159
    Thanks given
    13
    Thanks received
    11
    Rep Power
    0
    Hello guys im having trouble with this


    when i have a restore(3) and have a restore 1 and if i use the sip 1 on the the sip 3 it will make the sip 3 (2)

    https://gyazo.com/0853a00b5415f0b552a8fb9f5ea2f8cc
    Reply With Quote  
     

  2. #2  
    Registered Member
    Join Date
    Nov 2017
    Posts
    304
    Thanks given
    36
    Thanks received
    75
    Rep Power
    3
    Just go onto useitemonitem and modify the items.
    Reply With Quote  
     

  3. #3  
    Banned
    Join Date
    Sep 2017
    Posts
    159
    Thanks given
    13
    Thanks received
    11
    Rep Power
    0
    Quote Originally Posted by Faaith View Post
    Just go onto useitemonitem and modify the items.
    I have took a look maybe you can guide me somewhere?

    https://pastebin.com/RzHS4GGj //UseItemPackectListener
    Reply With Quote  
     

  4. #4  
    Learning...

    Mathy's Avatar
    Join Date
    Jul 2013
    Posts
    231
    Thanks given
    31
    Thanks received
    12
    Rep Power
    82
    Check your item on item method, see what happens when you use a super restore (2) with another one, see what item is supposed to be added to the inventory.
    Spoiler for Vouches:
    Quote Originally Posted by StrayDog View Post
    Thanks Mathy for helping me with my server
    Quote Originally Posted by triscool1987 View Post
    Great Help, thanks Mathy_!
    Reply With Quote  
     

  5. #5  
    Registered Member
    Join Date
    Nov 2017
    Posts
    304
    Thanks given
    36
    Thanks received
    75
    Rep Power
    3
    Not the correct one.

    There's "ITEM_ON_ITEM".
    Reply With Quote  
     

  6. #6  
    Banned
    Join Date
    Sep 2017
    Posts
    159
    Thanks given
    13
    Thanks received
    11
    Rep Power
    0
    Quote Originally Posted by Faaith View Post
    Not the correct one.

    There's "ITEM_ON_ITEM".
    http://prntscr.com/jfu88o

    https://pastebin.com/rvfeJfA0 // ItemOnItemEvent

    https://pastebin.com/r06mt5Cv ItemOnItemInteractionEvent
    Reply With Quote  
     

  7. #7  
    Registered Member
    excl150's Avatar
    Join Date
    Jul 2014
    Posts
    123
    Thanks given
    46
    Thanks received
    30
    Rep Power
    97
    Try right clicking on the ItemOnItemEvent constructor and select "Open call hierarchy" and see where its called.
    Reply With Quote  
     

  8. #8  
    Registered Member

    Join Date
    Jul 2009
    Posts
    499
    Thanks given
    159
    Thanks received
    143
    Rep Power
    619
    Quote Originally Posted by Amenity View Post
    Lol are you joking? Post the class that actually handles this
    Reply With Quote  
     

  9. #9  
    Extreme Donator


    Join Date
    Aug 2016
    Posts
    597
    Thanks given
    109
    Thanks received
    96
    Rep Power
    254
    Code:
    if (EventDispatcher.execute(player, new ItemOnItemInteractionEvent(used, with, usedWithSlot, itemUsedSlot))) {
           return;
    }
    if (ItemActionRepository.itemOnItem(player, used, with)) {
           return;
    }
    Another class handles your item on item interactions. Your potion values are probably just set to the wrong item id in one of your herblore classes. Not much to look at in that class, but heres my potion combination method if you want to make your own or revise yours

    Code:
    public static void combinePotion(Player p, int firstPotID, int secondPotID) {
    		CombiningDoses potion = CombiningDoses.getPotionByID(firstPotID);
    		if (potion == null || !p.getInventory().contains(firstPotID) || !p.getInventory().contains(secondPotID))
    			return;
    		if (potion.getDoseForID(secondPotID) > 0) {
    			int firstPotAmount = potion.getDoseForID(firstPotID);
    			int secondPotAmount = potion.getDoseForID(secondPotID);
    			if (firstPotAmount + secondPotAmount <= 4) {
    				p.getInventory().delete(firstPotID, 1);
    				p.getInventory().delete(secondPotID, 1);
    				p.getInventory().add(potion.getIDForDose(firstPotAmount + secondPotAmount), 1);
    				p.getInventory().add(EMPTY_VIAL, 1);
    			} else {
    				int overflow = (firstPotAmount + secondPotAmount) - 4;
    				p.getInventory().delete(firstPotID, 1);
    				p.getInventory().delete(secondPotID, 1);
    				p.getInventory().add(potion.getIDForDose(4), 1);
    				p.getInventory().add(potion.getIDForDose(overflow), 1);
    			}
    		}
    	}
    Reply With Quote  
     

  10. #10  
    Banned
    Join Date
    Sep 2017
    Posts
    159
    Thanks given
    13
    Thanks received
    11
    Rep Power
    0
    Quote Originally Posted by excl150 View Post
    Try right clicking on the ItemOnItemEvent constructor and select "Open call hierarchy" and see where its called.
    nothing

    Quote Originally Posted by Goody View Post
    Code:
    if (EventDispatcher.execute(player, new ItemOnItemInteractionEvent(used, with, usedWithSlot, itemUsedSlot))) {
           return;
    }
    if (ItemActionRepository.itemOnItem(player, used, with)) {
           return;
    }
    where would i paste this?
    Reply With Quote  
     

Page 1 of 2 12 LastLast

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. 718 Full NPC Bob Barter Decanting
    By Justin T in forum Tutorials
    Replies: 18
    Last Post: 06-29-2013, 07:09 AM
  2. Sevador #718 - Decantation
    By Tyluur in forum Show-off
    Replies: 2
    Last Post: 07-31-2012, 05:53 PM
  3. Decanting [508]
    By J2dao2dae in forum Snippets
    Replies: 0
    Last Post: 02-26-2012, 02:15 PM
  4. Arcane-Arena Decanting
    By MerzA in forum Show-off
    Replies: 13
    Last Post: 11-08-2011, 07:00 AM
  5. Decanting base code
    By MerzA in forum Snippets
    Replies: 6
    Last Post: 11-04-2011, 10:04 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
  •