Thread: matrix simple decanting

Page 1 of 2 12 LastLast
Results 1 to 10 of 11
  1. #1 matrix simple decanting 
    Christ is King

    Makar's Avatar
    Join Date
    Jul 2011
    Age
    29
    Posts
    2,004
    Thanks given
    545
    Thanks received
    965
    Rep Power
    427
    i saw some people requesting decanting and thought I'd help out lol. merry christmas u guys

    Code:
    // saradomin brew 1 dose on 2 dose
    if (used == 6691 && usedOn == 6689) {
    // check for item in inventory for make people to not cheat
    if (player.getInventory().containsItem(used, 1) && player.getInventory().containsItem(usedOn, 1)) {
    player.getInventory().deleteItem(6691, 1);
    player.getInventory().deleteItem(6689, 1);
    player.getInventory().addItem(6687);
    }
    }
    // saradomin brew 1 dose on 2 dose other way used
    if (used == 6689 && usedOn == 6691) {
    // check for item in inventory for make people to not cheat
    if (player.getInventory().containsItem(used, 1) && player.getInventory().containsItem(usedOn, 1)) {
    player.getInventory().deleteItem(6691, 1);
    player.getInventory().deleteItem(6689, 1);
    player.getInventory().addItem(6687);
    }
    }
    // saradomin brew 1 dose on 3 dose
    if (used == 6691 && usedOn == 6687) {
    // check for item in inventory for make people to not cheat
    if (player.getInventory().containsItem(used, 1) && player.getInventory().containsItem(usedOn, 1)) {
    player.getInventory().deleteItem(6691, 1);
    player.getInventory().deleteItem(6687, 1);
    player.getInventory().addItem(6685);
    }
    }
    // saradomin brew 1 dose on 3 dose other way used
    if (used == 6687 && usedOn == 6691) {
    // check for item in inventory for make people to not cheat
    if (player.getInventory().containsItem(used, 1) && player.getInventory().containsItem(usedOn, 1)) {
    player.getInventory().deleteItem(6691, 1);
    player.getInventory().deleteItem(6687, 1);
    player.getInventory().addItem(6685);
    }
    }
    // saradomin brew 2 dose on 2 dose
    if (used == 6689 && usedOn == 6689) {
    // check for item in inventory for make people to not cheat
    if (player.getInventory().containsItem(used, 1) && player.getInventory().containsItem(usedOn, 1)) {
    player.getInventory().deleteItem(6689, 1);
    player.getInventory().deleteItem(6689, 1);
    player.getInventory().addItem(6685);
    }
    }
    // saradomin brew 2 dose on 2 dose other way used
    if (used == 6689 && usedOn == 6689) {
    // check for item in inventory for make people to not cheat
    if (player.getInventory().containsItem(used, 1) && player.getInventory().containsItem(usedOn, 1)) {
    player.getInventory().deleteItem(6689, 1);
    player.getInventory().deleteItem(6689, 1);
    player.getInventory().addItem(6685);
    }
    }
    Attached image
    The best open-source pre-eoc remake project that isn't in its early stages for once
    Darkan Client (727 Client Refactor)
    Darkan World Server
    “It would not be impossible to prove with sufficient repetition and a psychological understanding of the people concerned that a square is in fact a circle. They are mere words, and words can be molded until they clothe ideas and disguise.”
    Reply With Quote  
     

  2. Thankful users:


  3. #2  
    Respected Member


    Kris's Avatar
    Join Date
    Jun 2016
    Age
    26
    Posts
    3,638
    Thanks given
    820
    Thanks received
    2,642
    Rep Power
    5000
    Thx now my matrix v2 is finally complete.
    Attached image
    Reply With Quote  
     

  4. Thankful users:


  5. #3  
    Banned

    Join Date
    Jun 2019
    Posts
    203
    Thanks given
    99
    Thanks received
    44
    Rep Power
    0
    There is better ways to do this, by checking doses (1), (2), (3), (4) etc
    Reply With Quote  
     

  6. #4  
    Respected Member


    Kris's Avatar
    Join Date
    Jun 2016
    Age
    26
    Posts
    3,638
    Thanks given
    820
    Thanks received
    2,642
    Rep Power
    5000
    Quote Originally Posted by Zerikoth View Post
    There is better ways to do this, by checking doses (1), (2), (3), (4) etc
    You're wrong.
    Attached image
    Reply With Quote  
     

  7. #5  
    Banned

    Join Date
    Jun 2019
    Posts
    203
    Thanks given
    99
    Thanks received
    44
    Rep Power
    0
    Quote Originally Posted by Kris View Post
    You're wrong.
    Okay boss
    Reply With Quote  
     

  8. #6  
    Christ is King

    Makar's Avatar
    Join Date
    Jul 2011
    Age
    29
    Posts
    2,004
    Thanks given
    545
    Thanks received
    965
    Rep Power
    427
    Quote Originally Posted by Zerikoth View Post
    There is better ways to do this, by checking doses (1), (2), (3), (4) etc
    I already am checking the doses though if you read the code. I know it is a little hard for beginners to understand but it's alright, I'm willing to help if you have questions.
    Attached image
    The best open-source pre-eoc remake project that isn't in its early stages for once
    Darkan Client (727 Client Refactor)
    Darkan World Server
    “It would not be impossible to prove with sufficient repetition and a psychological understanding of the people concerned that a square is in fact a circle. They are mere words, and words can be molded until they clothe ideas and disguise.”
    Reply With Quote  
     

  9. #7  
    Banned

    Join Date
    Jun 2019
    Posts
    203
    Thanks given
    99
    Thanks received
    44
    Rep Power
    0
    Quote Originally Posted by Makar View Post
    I already am checking the doses though if you read the code. I know it is a little hard for beginners to understand but it's alright, I'm willing to help if you have questions.
    I miss read, I mean you're doing it for each potion. While I'm sure there is some sort of structure where you have all the ids.
    In an enum or some storage. Where you can simply do.

    Code:
    int doses = getDoses(used.getId()) + getDoses(with.getId());
            int remainder = doses > 4 ? doses % 4 : 0;
            doses -= remainder;
    
            player.inventory().replace(used.getId(), first.getIdForDose(doses), withSlot, false);
    
            if (remainder > 0) {
                player.inventory().replace(with.getId(), first.getIdForDose(remainder), usedSlot, false);
            } else {
                player.inventory().replace(with.getId(), 229, usedSlot, false);
            }
    I just miss read .
    Reply With Quote  
     

  10. #8  
    Christ is King

    Makar's Avatar
    Join Date
    Jul 2011
    Age
    29
    Posts
    2,004
    Thanks given
    545
    Thanks received
    965
    Rep Power
    427
    Quote Originally Posted by Zerikoth View Post
    I miss read, I mean you're doing it for each potion. While I'm sure there is some sort of structure where you have all the ids.
    In an enum or some storage. Where you can simply do.

    Code:
    int doses = getDoses(used.getId()) + getDoses(with.getId());
            int remainder = doses > 4 ? doses % 4 : 0;
            doses -= remainder;
    
            player.inventory().replace(used.getId(), first.getIdForDose(doses), withSlot, false);
    
            if (remainder > 0) {
                player.inventory().replace(with.getId(), first.getIdForDose(remainder), usedSlot, false);
            } else {
                player.inventory().replace(with.getId(), 229, usedSlot, false);
            }
    I just miss read .
    I think storing all of them would be a little too tedious and way too much data storage for my liking as there are quite a few potions. You also wouldn't want to compare strings since that is relatively expensive computation-wise compared to simple integer comparisons.
    Attached image
    The best open-source pre-eoc remake project that isn't in its early stages for once
    Darkan Client (727 Client Refactor)
    Darkan World Server
    “It would not be impossible to prove with sufficient repetition and a psychological understanding of the people concerned that a square is in fact a circle. They are mere words, and words can be molded until they clothe ideas and disguise.”
    Reply With Quote  
     

  11. #9  
    *breaks walking*

    Cody_'s Avatar
    Join Date
    Dec 2010
    Posts
    732
    Thanks given
    219
    Thanks received
    203
    Rep Power
    286
    Attached image
    Reply With Quote  
     

  12. Thankful user:


  13. #10  
    WVWVWVWVWVWVWVW

    _jordan's Avatar
    Join Date
    Nov 2012
    Posts
    3,046
    Thanks given
    111
    Thanks received
    1,848
    Rep Power
    5000
    Looks good keep it up
    Attached image
    Attached image
    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. Replies: 11
    Last Post: 10-16-2015, 09:06 PM
  2. [718+ Matrix] Simple Rug Merchant
    By xRokku_Ri in forum Tutorials
    Replies: 5
    Last Post: 05-06-2015, 06:26 PM
  3. [Matrix 718] Need some very simple help.
    By GrahamFocker in forum Help
    Replies: 10
    Last Post: 09-07-2014, 02:49 PM
  4. [MATRIX] Simple IF Statement
    By leviathan recovery in forum Help
    Replies: 4
    Last Post: 11-04-2013, 12:42 AM
  5. Matrix 718 Simple Farming (herb seeds only)
    By Cαleb in forum Snippets
    Replies: 16
    Last Post: 03-12-2013, 10:34 AM
Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •