Magnifying Glass Fix for 1 line potential

Results 1 to 13 of 13
  1. #1
    I'm The God pauljeki is offline
    MemberRank
    Oct 2011 Join Date
    IsraelLocation
    736Posts

    Magnifying Glass Fix for 1 line potential

    REPLACE ALL MagnifyingGlassHandler

    Code:
    /* 
     * To change this template, choose Tools | Templates 
     * and open the template in the editor. 
     */ 
    
    package net.channel.handler; 
    
    import client.IEquip; 
    import client.IItem; 
    import client.MapleClient; 
    import client.MapleInventoryType; 
    //import client.anticheat.CheatingOffense; 
    import net.AbstractMaplePacketHandler; 
    import server.MapleInventoryManipulator; 
    import tools.MaplePacketCreator; 
    import tools.Randomizer; 
    import tools.data.input.SeekableLittleEndianAccessor; 
    
    /** 
     * 
     * @author iPoopMagic 
     */ 
    
    public class MagnifyingGlassHandler extends AbstractMaplePacketHandler { 
        public final void handlePacket(SeekableLittleEndianAccessor slea, MapleClient c) { 
            slea.readInt(); // Timestamp 
            byte type = (byte) slea.readShort();  
            byte slot = (byte) slea.readShort();  
            IEquip item = (IEquip) c.getPlayer().getInventory(MapleInventoryType.EQUIP).getItem(slot); 
            IItem toUse = c.getPlayer().getInventory(MapleInventoryType.USE).getItem(type); 
    
            // Need to check to make sure magnifying glass, and it will work on the item. 
    
            if(toUse.getItemId() != 2460000 && toUse.getItemId() != 2460001 && toUse.getItemId() != 2460002 && toUse.getItemId() != 2460003) { 
              //  c.getPlayer().getCheatTracker().registerOffense(CheatingOffense.PACKET_EDITING, "M-1: " + Integer.toString(toUse.getItemId())); 
                c.getSession().write(MaplePacketCreator.enableActions()); 
                return; 
            } 
    
            if (toUse.getQuantity() < 1) { //If they don't have magnifying glass             
    //c.getPlayer().getCheatTracker().registerOffense(CheatingOffense.PACKET_EDITING, "M-2: " + toUse.getItemId()); 
                c.getSession().write(MaplePacketCreator.enableActions()); 
                return; 
            } 
            if (item.getPotential() < 1 || item.getPotential() > 3) { // Its not a hidden potential. 
            //    c.getPlayer().getCheatTracker().registerOffense(CheatingOffense.PACKET_EDITING, "M-3: Not hidden potent"); 
                c.getSession().write(MaplePacketCreator.enableActions()); 
                return; 
            } 
            int rand = Randomizer.nextInt(100); 
            if (rand >= 95 || item.getPotential() == 3) { // 5% chance for Unique Item 
                item.setPotential((byte) 7); 
                item.setPotent1(getRandomPotentialStat()); 
                item.setPotent2(getRandomPotentialStat()); 
                item.setPotent3(getRandomPotentialStat()); 
            } else if (rand >= 85 || item.getPotential() == 2) { // 25% chance for Epic Equip 
                rand = Randomizer.nextInt(100); 
                 
                item.setPotential((byte) 6); 
                item.setPotent1(getRandomPotentialStat()); 
                item.setPotent2(getRandomPotentialStat()); 
                if(rand > 80) { 
     	  item.setPotent2(getRandomPotentialStat()); 
                    item.setPotent3(getRandomPotentialStat()); 
                } 
            } else { // 70% chance for Rare Equip 
                rand = Randomizer.nextInt(100); 
    
                item.setPotential((byte) 5); 
                item.setPotent1(getRandomPotentialStat());
                item.setPotent2(getRandomPotentialStat()); 
                if(rand > 95) { 
                    item.setPotent1(getRandomPotentialStat());
                    item.setPotent2(getRandomPotentialStat()); 
                    item.setPotent3(getRandomPotentialStat());
                } else if(rand > 80) { 
                     item.setPotent2(getRandomPotentialStat()); 
                     item.setPotent3(getRandomPotentialStat()); 
                } 
            } 
            c.getPlayer().equipChanged(); 
            c.getPlayer().dropMessage("Potential Reaveled");
            MapleInventoryManipulator.removeFromSlot(c, MapleInventoryType.USE, type, (short) 1, false); 
            c.getSession().write(MaplePacketCreator.showMagnifyingEffect(1, slot));
            c.getSession().write(MaplePacketCreator.updateEquipSlot(item)); 
            c.getSession().write(MaplePacketCreator.enableActions()); 
        } 
    
        private short getRandomPotentialStat() { 
            short[] potentials = {1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10, 10, 11, 11, 12, 12, 13, 13, 14, 14, 10001, 10002, 10003, 10004, 10005, 10006, 10007, 10008, 10009, 10010, 10011, 10012, 10013, 10014, 10041, 10042, 10043, 10044, 10045, 10046, 10047, 10048, 10041, 10052, 10053, 10054, 10055, 10070, 10081, 10201, 10206, 10221, 10226, 10231, 10236, 10241, 10246, 10291, 20041, 20042, 20043, 20044,  20045, 20046, 20047, 20048, 20051, 20052, 20053, 20054, 20055, 20070, 20086, 20201, 20206, 20291, 20351, 20352, 20353, 20366, 20396, 20401, 20406, 20656, 30041, 30042, 30044, 30045, 30046, 30047, 30048, 30051, 30053, 30054, 30055, 30070, 30086, 30356, 30357, 30366, 30371, 30551, 30601, 30602, 31001, 31002, 31003, 31004}; 
            int rand = Randomizer.nextInt(potentials.length); 
            return potentials[rand]; 
        } 
    }
    Thx to CheckPoint.
    Last edited by pauljeki; 14-02-12 at 01:21 PM.


  2. #2
    Account Upgraded | Title Enabled! lolwutwat is offline
    MemberRank
    Aug 2011 Join Date
    307Posts

    Re: Magnifying Glass Fix for 1 line potential

    Code:
    package net.channel.handler; 
    
    import client.IEquip;
    import client.IItem;
    import client.MapleClient;
    import client.MapleInventoryType;
    import net.AbstractMaplePacketHandler;
    import server.MapleInventoryManipulator;
    import tools.MaplePacketCreator;
    import tools.Randomizer;
    import tools.data.input.SeekableLittleEndianAccessor;
    
    public class MagnifyingGlassHandler extends AbstractMaplePacketHandler { 
        
        @Override
        public final void handlePacket(SeekableLittleEndianAccessor slea, MapleClient c) { 
            slea.readInt(); 
            byte type = (byte) slea.readShort();  
            byte slot = (byte) slea.readShort();  
            IEquip item = (IEquip) c.getPlayer().getInventory(MapleInventoryType.EQUIP).getItem(slot); 
            IItem toUse = c.getPlayer().getInventory(MapleInventoryType.USE).getItem(type); 
            if (toUse.getItemId() != 2460000 && toUse.getItemId() != 2460001 && toUse.getItemId() != 2460002 && toUse.getItemId() != 2460003 || toUse.getQuantity() < 1 || item.getPotential() < 1 || item.getPotential() > 3) { 
                c.getSession().write(MaplePacketCreator.enableActions()); 
                return; 
            } 
            int rand = Randomizer.nextInt(100); 
            if (rand >= 95 || item.getPotential() == 3) { // 5% chance for Unique
                item.setPotential((byte) 7); 
                item.setPotent1(getRandomPotentialStat()); 
                item.setPotent2(getRandomPotentialStat()); 
                item.setPotent3(getRandomPotentialStat()); 
            } else if (rand >= 85 || item.getPotential() == 2) { // 15% chance for Epic
                rand = Randomizer.nextInt(100);
                item.setPotential((byte) 6); 
                item.setPotent1(getRandomPotentialStat()); 
                item.setPotent2(getRandomPotentialStat()); 
                if(rand >= 80) { // 20% to get 3rd line
                    item.setPotent3(getRandomPotentialStat()); 
                } 
            } else { // 80% chance for Rare
                rand = Randomizer.nextInt(100);
                item.setPotential((byte) 5); 
                item.setPotent1(getRandomPotentialStat());
                item.setPotent2(getRandomPotentialStat()); 
                if(rand >= 95) { // 5% to get 3rd line
                    item.setPotent3(getRandomPotentialStat());
                } 
            } 
            c.getPlayer().equipChanged(); 
            MapleInventoryManipulator.removeFromSlot(c, MapleInventoryType.USE, type, (short) 1, false); 
            c.getSession().write(MaplePacketCreator.showMagnifyingEffect(1, slot));
            c.getSession().write(MaplePacketCreator.updateEquipSlot(item)); 
            c.getSession().write(MaplePacketCreator.enableActions()); 
        } 
    
            private short getRandomPotentialStat() { 
            short[] potentials = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 10001, 10002, 10003, 10004, 10005, 10006, 10007, 10008, 10009, 10010, 10011, 10012, 10013, 10014, 10041, 10042, 10043, 10044, 10045, 10046, 10047, 10048, 10041, 10052, 10053, 10054, 10055, 10070, 10081, 10201, 10206, 10221, 10226, 10231, 10236, 10241, 10246, 10291, 20041, 20042, 20043, 20044,  20045, 20046, 20047, 20048, 20051, 20052, 20053, 20054, 20055, 20070, 20086, 20201, 20206, 20291, 20351, 20352, 20353, 20366, 20396, 20401, 20406, 20656, 30041, 30042, 30044, 30045, 30046, 30047, 30048, 30051, 30053, 30054, 30055, 30070, 30086, 30356, 30357, 30366, 30371, 30551, 30601, 30602, 31001, 31002, 31003, 31004}; 
            int rand = Randomizer.nextInt(potentials.length); 
            return potentials[rand]; 
        } 
    }

    pauljeki's code is messy and weird, use ^ if something.
    Last edited by lolwutwat; 14-02-12 at 02:10 PM.

  3. #3
    Account Upgraded | Title Enabled! lolwutwat is offline
    MemberRank
    Aug 2011 Join Date
    307Posts

    Re: Magnifying Glass Fix for 1 line potential

    Quote Originally Posted by ItsMeTheBoss View Post
    lol its from LotusMS...
    haha... and its not fix..
    mine fixes 1 liners.

  4. #4
    Developer gausho is offline
    MemberRank
    Apr 2009 Join Date
    298Posts

    Re: Magnifying Glass Fix for 1 line potential

    Quote Originally Posted by lolwutwat View Post
    mine fixes 1 liners.
    His one working to ..
    i tested

  5. #5
    Account Upgraded | Title Enabled! lolwutwat is offline
    MemberRank
    Aug 2011 Join Date
    307Posts

    Re: Magnifying Glass Fix for 1 line potential

    Quote Originally Posted by gausho View Post
    His one working to ..
    i tested
    yeah but there's no point to randomize the 1 and 2 twice like he does lol

  6. #6
    Member CEO is offline
    MemberRank
    Feb 2012 Join Date
    94Posts

    Re: Magnifying Glass Fix for 1 line potential

    Rare 1 line
    Epic 2 lines
    Unique 3 Lines

    Work for me without this fix.

  7. #7
    Account Upgraded | Title Enabled! lolwutwat is offline
    MemberRank
    Aug 2011 Join Date
    307Posts

    Re: Magnifying Glass Fix for 1 line potential

    Quote Originally Posted by CEO View Post
    Rare 1 line
    Epic 2 lines
    Unique 3 Lines

    Work for me without this fix.
    Rare are 2/3 line in North America MS! (not 1) (yes it's real name is NAMS instead of GMS / GLOBAL MS)

  8. #8
    Account Upgraded | Title Enabled! SuperLol is offline
    MemberRank
    Jun 2010 Join Date
    801Posts

    Re: Magnifying Glass Fix for 1 line potential

    lolol this thread.
    A few problems with this release.
    1. This isn't how potential system is supposed to work. I'll use my example from before: you can get jump bonuses on weapons. Two line items are supposed to stay two lines and three line items are supposed to stay three as well.
    2. Why are potential stats being set multiple times per if statement? Code works but it is messy and possibly misleading.
    3. Best part of thread
    Quote Originally Posted by pauljeki View Post
    shut up bitch

  9. #9
    Member LilSkidd is offline
    MemberRank
    Nov 2009 Join Date
    83Posts

    Re: Magnifying Glass Fix for 1 line potential

    Just a question why is it that unique is ALWAYS 3Lined? why not make the 3rd line a random chance aswell? 0.o even though its not gms like its closer to it lol and i was working on a way to keep the lines throughout cubing but im a scrub at coding so its taking more time than i thought lol

  10. #10
    Gamma Sparrow is offline
    MemberRank
    Mar 2009 Join Date
    SydneyLocation
    2,960Posts

    Re: Magnifying Glass Fix for 1 line potential

    Quote Originally Posted by LilSkidd View Post
    Just a question why is it that unique is ALWAYS 3Lined? why not make the 3rd line a random chance aswell? 0.o even though its not gms like its closer to it lol and i was working on a way to keep the lines throughout cubing but im a scrub at coding so its taking more time than i thought lol
    It shouldn't be hard? Just make a variable to store the amount of lines the item had before cube, and then set the new lines to that variable? I haven't fully explored how the potential system is coded so I could be wrong.

  11. #11
    Member LilSkidd is offline
    MemberRank
    Nov 2009 Join Date
    83Posts

    Re: Magnifying Glass Fix for 1 line potential

    Quote Originally Posted by Sparrow View Post
    It shouldn't be hard? Just make a variable to store the amount of lines the item had before cube, and then set the new lines to that variable? I haven't fully explored how the potential system is coded so I could be wrong.
    Thats how I was going to fix it but as i stated before, im a total scrub at java and i just learn by trial and error and by looking through sources so xP

  12. #12
    ♥Fatal|Error♥ JungleByte is offline
    MemberRank
    Oct 2009 Join Date
    Singapore, SingLocation
    1,096Posts

    Re: Magnifying Glass Fix for 1 line potential

    What do you mean by first 1 line ? I don get it ?
    Posted via Mobile Device

  13. #13
    Account Upgraded | Title Enabled! Xerdox is offline
    MemberRank
    Oct 2011 Join Date
    PolandLocation
    312Posts
    Next stupid topic about fix something in xeon source... Seriously, its so hard for you to fix it? If it is, you shouldnt use xeon source >_>
    @to author of topic
    Learn java, please... dont use xeon...

    Sent from my E15i using Tapatalk



Advertisement