• Unfortunately, we have experienced significant hard drive damage that requires urgent maintenance and rebuilding. The forum will be a state of read only until we install our new drives and rebuild all the configurations needed. Please follow our Facebook page for updates, we will be back up shortly! (The forum could go offline at any given time due to the nature of the failed drives whilst awaiting the upgrades.) When you see an Incapsula error, you know we are in the process of migration.

How to add marriage/engagement to your v83 server.

Newbie Spellweaver
Joined
Sep 7, 2013
Messages
79
Reaction score
22
Made this because my friend (Landerssssssss) needed to know to do it. Here you go big boi:


First go to MapleCharacter ​and add

PHP:
private boolean askingOut = false;
private MapleCharacter askingMeOut;
private MapleCharacter couple;
private boolean engaged;

public void setCouple(MapleCharacter couple) {
     this.couple = couple;
}

public MapleCharacter getCouple() {
    return couple;
}

public void setEngaged(boolean engaged) {
    this.engaged = engaged;
}

public boolean isEngaged() {
    return engaged;
}

public void setAskingOut(boolean askingOut) {
    this.askingOut = askingOut;
}

public boolean getAskingOut() {
    return askingOut;
}

public void setAskingMeOut(MapleCharacter jerk) {
    askingMeOut = jerk;
}

public MapleCharacter getAskingMeOut() {
    return askingMeOut;
}

Then go into your PlayerCommands and add these commands:

Propose - Proposes to the player

PHP:
    if (splitted[0].equals("propose")) {
    if (splitted.length() == 2) {
        if (player.getAskingOut()) {
            player.dropMessage(5, "You're currently asking someone else... Jerk.");
            return;
        }
        MapleCharacter partner = c.getChannelServer().getPlayerStorage().getCharacterByName(splitted[1]);
        if (partner == null) {
            player.dropMessage(5, "Your loved one seems to be offline.");
        } else if (partner.getAskingMeOut() != null) {
            player.dropMessage(5, "Your partner is currently being asked out by someone else. Ouch...");
        } else if (partner.isEngaged()) {
            player.dropMessage(5, "Your partner is already married.");
        } else {
            player.setAskingOut(true);
            partner.setAskingMeOut(player);
            partner.dropMessage(5, player.getName() + " is asking for your hand in marriage");
        }
    } else {
        player.dropMessage(5, "Wring Command Syntax: @propose <LoversName>");
    }
}

Decline - Gives the player the option to decline

PHP:
    else if (splitted[0].equals("decline")) {
    if (player.isEngaged()) {
        player.dropMessage(5, "You can't use this because you are already married.");
    } else if (player.getAskingMeOut() != null) {
        player.dropMessage(5, "You have declined the proposal invitation.");
        if (MapleCharacter partner = c.getChannelServer().getPlayerStorage().getCharacterByName(player.getAskingMeOut()) != null) {
            player.getAskingMeOut().dropMessage(5, "You have been rejected, be more cute next time.");
            player.getAskingMeOut().setAskingOut(false);
            player.setAskingMeOut(null);
        } else {
            player.setAskingMeOut(null);
        }
    } else {
        player.dropMessage(5, "You're currently forever alone.");
    }
}

Accept - Gives the player the option to accept
PHP:
    else if (splitted[1].equals("accept")) {
    if (player.isEngaged()) {
        player.dropMessage(5, "You can't use this because you are already married.");
    } else if (player.getAskingMeOut() != null) {
        if (c.getChannelServer().getPlayerStorage().getCharacterByName(player.getAskingMeOut()) != null) {
            player.setCouple(player.getAskingMeOut());
            player.getAskingMeOut().setCouple(player);
            player.dropMessage(5, "You have accepted your proposal invitation. Congratulations.");
            player.getAskingMeOut().dropMessage(5, "Congratulations you are now married!");
            player.getAskingMeOut().setAskingOut(false);
            player.setAskingMeOut(null);
        } else {
            player.dropMessage(5, "Your proposal inviter is a coward. He/She just ran away.");
            player.setAskingMeOut(null);
        }
    } else {
        player.dropMessage(5, "You're currently forever alone.");
    }
}

Divorce - Self explanitory
PHP:
    else if (splitted[0].equals("divorce")) {
    if (player.isEngaged()) {
        MapleCharacter poorPartner = player.getCouple();
        player.setCouple(null);
        player.setEngaged(false);
        player.dropMessage("You have left your partner... ");
        if (poorPartner != null) {
            poorPartner.setCouple(null);
            poorPartner.setEngaged(false);
            poorPartner.dropMessage(5, "Your soul mate has left you out in the open.");
        } else {
            //Database poop to break up.
        }
    } else {
        player.dropMessage(5, "You cannot use this command because you're not married.");
    }
}

Credits:
Veda
Me
 
Newbie Spellweaver
Joined
Jun 7, 2011
Messages
12
Reaction score
0
There are lots of errors!

Where the heck do people get the idea of 'developing' a private server without knowing the language..
Anyway the jerk part is funny, I only hoped a real marriage for the rings etc. That would have saved me some work..:p


-
 
Newbie Spellweaver
Joined
Oct 30, 2013
Messages
11
Reaction score
0
Name(player.getAskingMeOut()) != null) {
player.getAskingMeOut().dropMessage(5, "You have been rejected, be more cute next time.");
player.getAskingMeOut().setAskingOut(false);
player.setAskingMeOut(null);
} else {
player.setAskingMeOut(null);
}
} else {
player.dropMessage(5, "You're currently forever alone.");
}
}

haha this part!!

By the way does this work for tiredstory source ? #yeah i am newbie :3














-Flame me plz
 
Junior Spellweaver
Joined
Jul 4, 2011
Messages
197
Reaction score
11

haha this part!!

By the way does this work for tiredstory source ? #yeah i am newbie :3














-Flame me plz

Yes, all of this will work for any source, but just fix it up to make it work on your source.
 
Newbie Spellweaver
Joined
Nov 4, 2013
Messages
35
Reaction score
1
Isn't this..a relationship command thats in KhazeMS source?
And i thought someone actually released a fully functional wedding TT
 
Back
Top