v83 buy ring handler

Page 1 of 2 12 LastLast
Results 1 to 15 of 29
  1. #1
    Account Upgraded | Title Enabled! hindie is offline
    MemberRank
    Jun 2010 Join Date
    253Posts

    v83 buy ring handler

    Well had some issues with my current host and my server is going for a fucking reformat ..So i've decided to release some useful codes while waiting :D Heres the buy ring :

    This goes into buycsitemhandler

    Code:
    case 0x1D: {
                 if (checkBirthday(c, slea.readInt())) { //friendship
    		System.out.println("BIRTHDAY CORRECT");
    		int i = 1;
                    int toCharge = slea.readInt();
                    int SN = slea.readInt();
                    String recipient = slea.readMapleAsciiString();
                    String text = slea.readMapleAsciiString();
    		System.out.println(i); i++;
                    CashItemInfo ring = CashItemFactory.getInstance().getItem(SN);
    		System.out.println(i); i++;
                    MapleCharacter partnerChar = c.getChannelServer().getPlayerStorage().getCharacterByName(recipient);
    		System.out.println(i); i++;
                    if (partnerChar == null) {
    		System.out.println("PARTNER IS GAY");
                        c.getPlayer().getClient().getSession().write(MaplePacketCreator.serverNotice(1, "The partner you specified cannot be found.\r\nPlease make sure your partner is online and in the same channel."));
                    } else {
                        if (partnerChar.getGender() == c.getPlayer().getGender()) {
    			System.out.println("SAME GENDER FAILURE");
                            c.getPlayer().dropMessage("You and your partner are the same gender, please buy a friendship ring.");
                            return;
                        }
    		    System.out.println("NOW GOING TO SEND BOUGHTCSITEM PACKET");
                        c.getSession().write(MaplePacketCreator.showBoughtCSItem(c, ring));
    		    System.out.println("Done; NOW GOING TO MODIFY CS POINTS");
                        c.getPlayer().modifyCSPoints(toCharge, -ring.getPrice());
    		    System.out.println("DONE; OK NOW CREATING RING!");
                        MapleRing.createRing(ring.getId(), c.getPlayer(), partnerChar, text);
    		    System.out.println("Done lulz");
                        c.getPlayer().getClient().getSession().write(MaplePacketCreator.serverNotice(1, "Successfully created a ring for both you and your partner!"));
                    }
                } else {
                    c.getPlayer().dropMessage("The birthday you entered was incorrect.");
                }
                showCS(c);
                break;
                }
    Code:
    case 0x23: { // crush ring
                 if (checkBirthday(c, slea.readInt())) {
    		System.out.println("BIRTHDAY CORRECT");
    		int i = 1;
                    int toCharge = slea.readInt();
                    int SN = slea.readInt();
                    String recipient = slea.readMapleAsciiString();
                    String text = slea.readMapleAsciiString();
    		System.out.println(i); i++;
                    CashItemInfo ring = CashItemFactory.getInstance().getItem(SN);
    		System.out.println(i); i++;
                    MapleCharacter partnerChar = c.getChannelServer().getPlayerStorage().getCharacterByName(recipient);
    		System.out.println(i); i++;
                    if (partnerChar == null) {
    		System.out.println("PARTNER IS GAY");
                        c.getPlayer().getClient().getSession().write(MaplePacketCreator.serverNotice(1, "The partner you specified cannot be found.\r\nPlease make sure your partner is online and in the same channel."));
                    } else {
    		    System.out.println("NOW GOING TO SEND BOUGHTCSITEM PACKET");
                        c.getSession().write(MaplePacketCreator.showBoughtCSItem(c, ring));
    		    System.out.println("Done; NOW GOING TO MODIFY CS POINTS");
                        c.getPlayer().modifyCSPoints(toCharge, -ring.getPrice());
    		    System.out.println("DONE; OK NOW CREATING RING!");
                        MapleRing.createRing(ring.getId(), c.getPlayer(), partnerChar, text);
    		    System.out.println("Done lulz");
                        c.getPlayer().getClient().getSession().write(MaplePacketCreator.serverNotice(1, "Successfully created a ring for both you and your partner!"));
                    }
                } else {
                    c.getPlayer().dropMessage("The birthday you entered was incorrect.");
                }
                showCS(c);
                break;
                }
    Partial Credits to both kevins :D ( kevintjuh for println to check whats wrong) , (expedia for giving me the correct headers)
    Other than that i take credit for this
    Last edited by hindie; 02-11-10 at 03:47 AM.


  2. #2
    Account Upgraded | Title Enabled! AzuS is offline
    MemberRank
    Jul 2008 Join Date
    871Posts

    Re: v83 buy ring handler

    *claps*
    Too pro!

  3. #3
    Account Upgraded | Title Enabled! Expedia is offline
    MemberRank
    Nov 2009 Join Date
    884Posts

    Re: v83 buy ring handler

    Yeaahah me got a shoutout :d and wat u mean correct headers? o-o

  4. #4
    Account Upgraded | Title Enabled! HorrorChix89 is offline
    MemberRank
    May 2010 Join Date
    ArkansasLocation
    1,279Posts

    Re: v83 buy ring handler

    Great, this will come in handy for sure once I get my relationship add-on working

  5. #5
    Ooo, shiny! FateJiki is offline
    MemberRank
    Feb 2008 Join Date
    1,057Posts

    Re: v83 buy ring handler

    Thanks! Great code release you released there.

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

    Re: v83 buy ring handler

    Thankyou :) Was looking for this.

  7. #7
    Account Upgraded | Title Enabled! hindie is offline
    MemberRank
    Jun 2010 Join Date
    253Posts

    Re: v83 buy ring handler

    you might need to convert this to your server needs :D

  8. #8
    Account Upgraded | Title Enabled! .:LastBreath:. is offline
    MemberRank
    Oct 2009 Join Date
    Under your bedLocation
    1,315Posts

    Re: v83 buy ring handler

    Good Job Sir.

  9. #9
    while(true) spam(); kevintjuh93 is offline
    MemberRank
    Jun 2008 Join Date
    The NetherlandsLocation
    4,119Posts

    Re: v83 buy ring handler

    Quote Originally Posted by AzuS View Post
    *claps*
    Too pro!
    There is nothing pro in this. This has been released several times, just needed to fix something for v83.

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

    Re: v83 buy ring handler

    Quote Originally Posted by kevintjuh93 View Post
    There is nothing pro in this. This has been released several times, just needed to fix something for v83.
    Oh really? Would you happen to have a link?

  11. #11
    while(true) spam(); kevintjuh93 is offline
    MemberRank
    Jun 2008 Join Date
    The NetherlandsLocation
    4,119Posts

    Re: v83 buy ring handler

    Quote Originally Posted by -Daniel- View Post
    Oh really? Would you happen to have a link?
    How many sources do not have buying rings? Well almost every source have at least a beginning of it. So not hard. And I've seen this before...
    Xuan this is that shit where I helped you with right? Maybe that is why it looks so familiar :P

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

    Re: v83 buy ring handler

    Why using dropMessage here? Sucks and wastes bandwidth (not a lot but meh).

  13. #13
    Account Upgraded | Title Enabled! hindie is offline
    MemberRank
    Jun 2010 Join Date
    253Posts

    Re: v83 buy ring handler

    Quote Originally Posted by kevintjuh93 View Post
    How many sources do not have buying rings? Well almost every source have at least a beginning of it. So not hard. And I've seen this before...
    Xuan this is that shit where I helped you with right? Maybe that is why it looks so familiar :P
    @kevin i gave you my handler before, you added prntln so i know where it stopped working..
    @flav because i have 10tb to play with ^^
    Last edited by hindie; 03-11-10 at 01:40 AM.

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

    Re: v83 buy ring handler

    It's not even about the bandwidth but what you did there is just stupid. Why would you send a whole string instead of a single byte?

  15. #15
    Account Upgraded | Title Enabled! hindie is offline
    MemberRank
    Jun 2010 Join Date
    253Posts

    Re: v83 buy ring handler

    this was taken from my old source before i updated it tbh.. Ragezoners lurker wont take it to heart :D
    Last edited by hindie; 03-11-10 at 07:32 PM.



Page 1 of 2 12 LastLast

Advertisement