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
Then go into your PlayerCommands and add these commands:
Propose - Proposes to the player
Decline - Gives the player the option to decline
Accept - Gives the player the option to accept
Divorce - Self explanitory
Credits:
Veda
Me
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