Fix for Mini Games + Password for Mini Game

Page 1 of 3 123 LastLast
Results 1 to 25 of 54
  1. #1
    Account Upgraded | Title Enabled! flav is offline
    MemberRank
    Jul 2008 Join Date
    655Posts

    Fix for Mini Games + Password for Mini Game

    I noticed that Mini Games are not working in all the released sources (reason for that is that the noobs copied it from each other). This fixes the creation of a game (it doesn't fix Match Card and Omok itself, do this on your own ). I also added the password protection, a step closer to GMS - yay?

    PlayerInteractionHandler.java
    Change
    Code:
    IPlayerInteractionManager game = new MapleMiniGame(c.getPlayer(), type, desc);
    to
    Code:
    IPlayerInteractionManager game = new MapleMiniGame(c.getPlayer(), type, desc, pass);
    Add
    Code:
    else if (ips.getShopType() == 3 || ips.getShopType() == 4) { //mini game
                            String pass = null;
                            if (slea.readByte() == 1) { //a password has been entered
                                pass = slea.readMapleAsciiString();
                            }
    
                            if (pass != null && !pass.equals(ips.getPassword())) {
                                c.getPlayer().dropMessage(1, "The password is not correct.");
                                return;
                            }
                        }
    after
    Code:
    else if (ips.getShopType() == 2) {
                            if (((MaplePlayerShop) ips).isBanned(c.getPlayer().getName())) {
                                c.getPlayer().dropMessage(1, "You have been banned from this store.");
                                return;
                            }
                        }
    HiredMerchant.java
    Change
    Code:
    super(owner, itemId % 10, desc, 3);
    to
    Code:
    super(owner, itemId % 10, desc, null, 3);
    IPlayerInteractionManager.java
    Add
    Code:
    public String getPassword();
    MapleMiniGame.java
    Change
    Code:
    public MapleMiniGame(MapleCharacter owner, int type, String desc) {
            super(owner, type, desc, 1);
    to
    Code:
    public MapleMiniGame(MapleCharacter owner, int type, String desc, String pass) {
            super(owner, type, desc, pass, 1);
    MaplePlayerShop.java
    Change
    Code:
    public MaplePlayerShop(MapleCharacter owner, int itemId, String desc) {
            super(owner, itemId % 10, desc, 3);
    to
    Code:
    public MaplePlayerShop(MapleCharacter owner, int itemId, String desc) {
            super(owner, itemId % 10, desc, null, 3);
    PlayerInteractionManager.java
    Add
    Code:
    private String password = "";
    Change
    Code:
    public PlayerInteractionManager(MapleCharacter owner, int type, String desc, int capacity) {
            this.setPosition(owner.getPosition());
            this.ownerName = owner.getName();
            this.ownerId = owner.getId();
            this.type = (byte) type;
            this.capacity = (short) capacity;
            this.description = desc;
    to
    Code:
    public PlayerInteractionManager(MapleCharacter owner, int type, String desc, String pass, int capacity) {
            this.setPosition(owner.getPosition());
            this.ownerName = owner.getName();
            this.ownerId = owner.getId();
            this.type = (byte) type;
            this.capacity = (short) capacity;
            this.description = desc;
            this.password = pass;
    Add
    Code:
    @Override
        public String getPassword() {
            return password;
        }
    MaplePacketCreator.java
    Change your addAnnounceBox() function to
    Code:
    private static void addAnnounceBox(MaplePacketLittleEndianWriter mplew, IPlayerInteractionManager interaction) {
            if (interaction.getShopType() == 2) {
                mplew.write(4); //Shop
                mplew.writeInt(((MaplePlayerShop) interaction).getObjectId());
            } else if (interaction.getShopType() == 3) {
                mplew.write(2); //Match Card
                mplew.writeInt(((MapleMiniGame) interaction).getObjectId());
            } else if (interaction.getShopType() == 4) {
                mplew.write(1); //Omok
                mplew.writeInt(((MapleMiniGame) interaction).getObjectId());
            }
            mplew.writeMapleAsciiString(interaction.getDescription()); // desc
            if (interaction.getPassword() != null)
                mplew.write(1); //private
            else
                mplew.write(0); //public
            mplew.write(interaction.getItemType());
            mplew.write(1);
            if (interaction.getShopType() == 2) {
                mplew.write(interaction.getFreeSlot() > -1 ? 4 : 1);
                mplew.write(0);
            } else {
                mplew.write(interaction.getFreeSlot() > -1 ? 2 : 1); //4 slots, but only 2 can enter
                mplew.write(((MapleMiniGame) interaction).getStarted() ? 1 : 0);
            }
        }
    MapleMiniGame.java
    Replace
    Code:
    public void setOwnerPoints() {
            ownerpoints++;
            if (ownerpoints + visitorpoints == matchestowin) {
                if (ownerpoints == visitorpoints) {
                    broadcast(MaplePacketCreator.getMiniGameTie(this), true);
                } else if (ownerpoints > visitorpoints) {
                    broadcast(MaplePacketCreator.getMiniGameWin(this, 0), true);
                } else if (visitorpoints > ownerpoints) {
                    broadcast(MaplePacketCreator.getMiniGameWin(this, 1), true);
                }
            }
            ownerpoints = 0;
            visitorpoints = 0;
        }
    
        public void setVisitorPoints() {
            visitorpoints++;
            if ((ownerpoints + visitorpoints) == matchestowin) {
                if (ownerpoints > visitorpoints) {
                    broadcast(MaplePacketCreator.getMiniGameWin(this, 0), true);
                } else if (visitorpoints > ownerpoints) {
                    broadcast(MaplePacketCreator.getMiniGameWin(this, 1), true);
                } else if (ownerpoints == visitorpoints) {
                    broadcast(MaplePacketCreator.getMiniGameTie(this), true);
                }
            }
            ownerpoints = 0;
            visitorpoints = 0;
        }
    with
    Code:
    public void setOwnerPoints() {
            ownerpoints++;
            if (ownerpoints + visitorpoints == matchestowin) {
                if (ownerpoints == visitorpoints) {
                    broadcast(MaplePacketCreator.getMiniGameTie(this), true);
                } else if (ownerpoints > visitorpoints) {
                    broadcast(MaplePacketCreator.getMiniGameWin(this, 0), true);
                } else if (visitorpoints > ownerpoints) {
                    broadcast(MaplePacketCreator.getMiniGameWin(this, 1), true);
                }
                ownerpoints = 0;
                visitorpoints = 0;
            }
        }
    
        public void setVisitorPoints() {
            visitorpoints++;
            if ((ownerpoints + visitorpoints) == matchestowin) {
                if (ownerpoints > visitorpoints) {
                    broadcast(MaplePacketCreator.getMiniGameWin(this, 0), true);
                } else if (visitorpoints > ownerpoints) {
                    broadcast(MaplePacketCreator.getMiniGameWin(this, 1), true);
                } else if (ownerpoints == visitorpoints) {
                    broadcast(MaplePacketCreator.getMiniGameTie(this), true);
                }
                ownerpoints = 0;
                visitorpoints = 0;
            }
        }
    Finish the rest on your own...

    By the way...
    Code:
    EXPEL_PLAYER(0x36), //Game Expel
    Last edited by flav; 03-05-09 at 01:48 PM.


  2. #2
    Xephizion Development Ehab is offline
    MemberRank
    Apr 2008 Join Date
    Somewhere I BelLocation
    1,935Posts

    Re: Fix for Mini Games + Password for Mini Game

    niiiiiiiiiiiice

  3. #3
    Member mysterio123 is offline
    MemberRank
    Apr 2008 Join Date
    63Posts

    Re: Fix for Mini Games + Password for Mini Game

    mother fucking gay fish ftw

  4. #4
    Account Upgraded | Title Enabled! flav is offline
    MemberRank
    Jul 2008 Join Date
    655Posts

    Re: Fix for Mini Games + Password for Mini Game

    Quote Originally Posted by mysterio123 View Post
    mother fucking gay fish ftw
    http://www.youtube.com/watch?v=pwFaFlVXg_c

  5. #5
    Valued Member Quаlitys is offline
    MemberRank
    Apr 2009 Join Date
    103Posts

    Re: Fix for Mini Games + Password for Mini Game

    Nice release dude.

  6. #6
    Account Upgraded | Title Enabled! lzylzy is offline
    MemberRank
    Sep 2008 Join Date
    351Posts

    Re: Fix for Mini Games + Password for Mini Game

    I had this a long time,I though it was public release already lol.

  7. #7
    Account Upgraded | Title Enabled! flav is offline
    MemberRank
    Jul 2008 Join Date
    655Posts

    Re: Fix for Mini Games + Password for Mini Game

    Quote Originally Posted by lzylzy View Post
    I had this a long time,I though it was public release already lol.
    Wondering why you tell me/us that?

  8. #8
    Gamma Xerixe is offline
    MemberRank
    Apr 2008 Join Date
    MalaysiaLocation
    3,605Posts

    Re: Fix for Mini Games + Password for Mini Game

    Woot. Pro.

  9. #9
    Account Upgraded | Title Enabled! PinkGatsby is offline
    MemberRank
    Mar 2009 Join Date
    AmericaLocation
    434Posts

    Re: Fix for Mini Games + Password for Mini Game

    Quote Originally Posted by lzylzy View Post
    i had this a long time,i though it was public release already lol.
    i smell bullshitz

  10. #10
    Gamma Xerixe is offline
    MemberRank
    Apr 2008 Join Date
    MalaysiaLocation
    3,605Posts

    Re: Fix for Mini Games + Password for Mini Game

    Quote Originally Posted by PinkGatsby View Post
    i smell bullshitz
    I smell a pro :)

  11. #11
    Valued Member Quаlitys is offline
    MemberRank
    Apr 2009 Join Date
    103Posts

    Re: Fix for Mini Games + Password for Mini Game

    Quote Originally Posted by PinkGatsby View Post
    Qualitys is sexy and he makes me wet.:
    I totally agree with you.

  12. #12
    Gamma Xerixe is offline
    MemberRank
    Apr 2008 Join Date
    MalaysiaLocation
    3,605Posts

    Re: Fix for Mini Games + Password for Mini Game

    Quote Originally Posted by Quаlitys View Post
    I think Xerixe is smexier makes me wet.
    Quoted For Truth :D

  13. #13
    Proficient Member nubspacecake is offline
    MemberRank
    Apr 2009 Join Date
    185Posts

    Re: Fix for Mini Games + Password for Mini Game

    Quote Originally Posted by Xerixe View Post
    I think people who edit quotes are fag
    hmm i do agree with you.

  14. #14
    Valued Member Shogi is offline
    MemberRank
    Apr 2008 Join Date
    134Posts

    Re: Fix for Mini Games + Password for Mini Game

    i like your release :), good job man, and thanks alot!

    i have problem when entering PlayerInteractionHandler.java
    i cant find both lines u added there to change, i'm using BubblesDev revision 17

  15. #15
    Account Upgraded | Title Enabled! PinkGatsby is offline
    MemberRank
    Mar 2009 Join Date
    AmericaLocation
    434Posts

    Re: Fix for Mini Games + Password for Mini Game

    Quote Originally Posted by nubspacecake View Post
    hmm i do agree with you.

    PS; PinkGatsby is awesome
    Yeah ! >=/ I hate those jerks

  16. #16
    Proficient Member nubspacecake is offline
    MemberRank
    Apr 2009 Join Date
    185Posts

    Re: Fix for Mini Games + Password for Mini Game

    Quote Originally Posted by PinkGatsby View Post
    Yeah ! >=/ I hate those jerks
    let's all give bassoe a blowjob
    i totally agree.
    you are just fag if you do that

    btw blowjob?!?!

  17. #17
    Account Upgraded | Title Enabled! johnlth93 is offline
    MemberRank
    Jul 2008 Join Date
    1,346Posts

    Re: Fix for Mini Games + Password for Mini Game

    dint } properly -.-''

  18. #18
    Account Upgraded | Title Enabled! flav is offline
    MemberRank
    Jul 2008 Join Date
    655Posts

    Re: Fix for Mini Games + Password for Mini Game

    Quote Originally Posted by johnlth93 View Post
    dint } properly -.-''
    When I say replace public X() { X with public X() { Y it doesn't mean to replace public X() { X } with public X() { Y, does it?

  19. #19
    Account Upgraded | Title Enabled! xJvlaplex is offline
    MemberRank
    Mar 2009 Join Date
    478Posts

    Re: Fix for Mini Games + Password for Mini Game

    I get an error : NullPointerException

  20. #20
    Account Upgraded | Title Enabled! <XENON> is offline
    MemberRank
    Feb 2009 Join Date
    Titti TownLocation
    223Posts

    Re: Fix for Mini Games + Password for Mini Game

    nice , ill may add this O.o

    Stop editing quotes O.o

  21. #21
    Account Upgraded | Title Enabled! XiuzSu is offline
    MemberRank
    Mar 2009 Join Date
    c.getXiuzSu.posLocation
    826Posts

    Re: Fix for Mini Games + Password for Mini Game

    Nice work man. ^_^

  22. #22
    Proficient Member nubspacecake is offline
    MemberRank
    Apr 2009 Join Date
    185Posts

    Re: Fix for Mini Games + Password for Mini Game

    Quote Originally Posted by <XENON> View Post
    Yea finally give bassoe his blowjob
    kk go ahead

  23. #23
    Account Upgraded | Title Enabled! lzylzy is offline
    MemberRank
    Sep 2008 Join Date
    351Posts

    Re: Fix for Mini Games + Password for Mini Game

    I'm not bullshitting,I really do have it.

  24. #24
    Account Upgraded | Title Enabled! KnightStoryTeam is offline
    MemberRank
    Nov 2008 Join Date
    SOMEWHERE ....WLocation
    239Posts

    Re: Fix for Mini Games + Password for Mini Game

    http://youfail.org/

    Joking

    good realse

  25. #25
    Gamma Xerixe is offline
    MemberRank
    Apr 2008 Join Date
    MalaysiaLocation
    3,605Posts

    Re: Fix for Mini Games + Password for Mini Game

    Moogra. Could you enable Private Messaging for a while pweash.
    I needa tell you something o.0



Page 1 of 3 123 LastLast

Advertisement