Welcome!

Join our community of MMO enthusiasts and game developers! By registering, you'll gain access to discussions on the latest developments in MMO server files and collaborate with like-minded individuals. Join us today and unlock the potential of MMO server development!

Join Today!

Engagements and Marriages/Weddings

Status
Not open for further replies.
🎀 Moderator 🎀
Staff member
Moderator
Joined
Jan 18, 2010
Messages
3,109
Reaction score
1,136
Just because it seems a lot of people are curious about this, I thought I'd just post my portions of weddings that I had done and you can use whatever you want from them. These were re-done for my source so some things are a little different but because I based my source off Lithium, it will use a lot of those methods.

Here's my Wedding file, I hold all the classes, enums, and packets here.
PHP:
/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package tools.packets;

import client.IItem;
import client.MapleCharacter;
import client.inventory.GW_ItemSlotBase;
import java.util.ArrayList;
import java.util.List;
import net.MaplePacket;
import tools.MaplePacketCreator;
import tools.Utilities;
import tools.data.output.MaplePacketLittleEndianWriter;

/**
 * CField_Wedding, CField_WeddingPhoto, CWeddingMan, OnMarriageResult, and all Wedding/Marriage enum/structs.
 * 
 * @author Eric
 */
public class Wedding extends MaplePacketCreator {
    private static final short MARRIAGE_REQUEST = 0x48;
    private static final short MARRIAGE_RESULT = 0x49;
    private static final short WEDDING_GIFT_RESULT = 0x4A;
    private static final short NOTIFY_MARRIED_PARTNER_MAP_TRANSFER = 0x4B;
    private static final short WEDDING_PHOTO = 0x2B;
    private static final short WEDDING_PROGRESS = 0x140;
    private static final short WEDDING_CEREMONY_END = 0x141;
    
    /*
        00000000 CWeddingMan     struc ; (sizeof=0x104)
        00000000 vfptr           dd ?                    ; offset
        00000004 ___u1           $01CBC6800BD386B8A8FD818EAD990BEC ?
        0000000C m_mCharIDToMarriageNo ZMap<unsigned long,unsigned long,unsigned long> ?
        00000024 m_mReservationPending ZMap<unsigned long,ZRef<GW_WeddingReservation>,unsigned long> ?
        0000003C m_mReservationPendingGroom ZMap<unsigned long,ZRef<CUser>,unsigned long> ?
        00000054 m_mReservationPendingBride ZMap<unsigned long,ZRef<CUser>,unsigned long> ?
        0000006C m_mReservationStartUser ZMap<unsigned long,unsigned long,unsigned long> ?
        00000084 m_mReservationCompleted ZMap<unsigned long,ZRef<GW_WeddingReservation>,unsigned long> ?
        0000009C m_mGroomWishList ZMap<unsigned long,ZRef<ZArray<ZXString<char> > >,unsigned long> ?
        000000B4 m_mBrideWishList ZMap<unsigned long,ZRef<ZArray<ZXString<char> > >,unsigned long> ?
        000000CC m_mEngagementPending ZMap<unsigned long,ZRef<GW_MarriageRecord>,unsigned long> ?
        000000E4 m_nCurrentWeddingState dd ?
        000000E8 m_dwCurrentWeddingNo dd ?
        000000EC m_dwCurrentWeddingMap dd ?
        000000F0 m_bIsReservationLoaded dd ?
        000000F4 m_dwNumGuestBless dd ?
        000000F8 m_bPhotoSuccess dd ?
        000000FC m_tLastUpdate   dd ?
        00000100 m_bStartWeddingCeremony dd ?
        00000104 CWeddingMan     ends
    */
    
    public class Field_Wedding {
        public int m_nNoticeCount;
        public int m_nCurrentStep;
        public int m_nBlessStartTime;
    }
    
    public class Field_WeddingPhoto {
        public boolean m_bPictureTook;
    }
    
    public class GW_WeddingReservation {
        public int dwReservationNo;
        public int dwGroom, dwBride;
        public String sGroomName, sBrideName;
        public int usWeddingType;
    }
    
    public class WeddingWishList {
        public MapleCharacter pUser;
        public int dwMarriageNo;
        public int nGender;
        public int nWLType;
        public int nSlotCount;
        public List<String> asWishList = new ArrayList<>();
        public List<List<GW_ItemSlotBase>> aaItemSlot = new ArrayList<>(6);
        public int usModifiedFlag; // dword
        public boolean bLoaded;
    }
    
    public class GW_WeddingWishList {
        public final int WEDDINGWL_MAX = 0xA; // enum WEDDINGWL
        public int dwReservationNo;
        public byte nGender;
        public String sItemName;
    }
    
    public enum MarriageStatus {
        SINGLE(0x0),
        ENGAGED(0x1),
        RESERVED(0x2),
        MARRIED(0x3);
        private int ms;
        private MarriageStatus(int ms) {
            this.ms = ms;
        }
        
        public int getMarriageStatus() {
            return ms;
        }
    }
    
    public enum MarriageRequest {
        AddMarriageRecord(0x0),
        SetMarriageRecord(0x1),
        DeleteMarriageRecord(0x2),
        LoadReservation(0x3),
        AddReservation(0x4),
        DeleteReservation(0x5),
        GetReservation(0x6);
        private int req;
        private MarriageRequest(int req) {
            this.req = req;
        }
        
        public int getMarriageRequest() {
            return req;
        }
    }
    
    public enum WeddingType {
        CATHEDRAL(0x1),
        VEGAS(0x2),
        CATHEDRAL_PREMIUM(0xA),
        CATHEDRAL_NORMAL(0xB),
        VEGAS_PREMIUM(0x14),
        VEGAS_NORMAL(0x15);
        private int wt;
        private WeddingType(int wt) {
            this.wt = wt;
        }
        
        public int getType() {
            return wt;
        }
    }
    
    public enum WeddingMap {
        WEDDINGTOWN(680000000),
        CHAPEL_STARTMAP(680000110),
        CATHEDRAL_STARTMAP(680000210),
        PHOTOMAP(680000300),
        EXITMAP(680000500);
        private int wm;
        private WeddingMap(int wm) {
            this.wm = wm;
        }
        
        public int getMap() {
            return wm;
        }
    }
    
    public enum WeddingItem {
        WR_MOONSTONE(1112803), // Wedding Ring
        WR_STARGEM(1112806),
        WR_GOLDENHEART(1112807),
        WR_SILVERSWAN(1112809),
        ERB_MOONSTONE(2240000), // Engagement Ring Box
        ERB_STARGEM(2240001),
        ERB_GOLDENHEART(2240002),
        ERB_SILVERSWAN(2240003),
        ERBE_MOONSTONE(4031357), // Engagement Ring Box (Empty)
        ER_MOONSTONE(4031358), // Engagement Ring
        ERBE_STARGEM(4031359),
        ER_STARGEM(4031360),
        ERBE_GOLDENHEART(4031361),
        ER_GOLDENHEART(4031362),
        ERBE_SILVERSWAN(4031363),
        ER_SILVERSWAN(4031364),
        PARENTS_BLESSING(4031373), // Parents Blessing
        OFFICIATORS_PERMISSION(4031374), // Officiator's Permission
        WR_CATHEDRAL_PREMIUM(4031375), // Wedding Ring?
        WR_VEGAS_PREMIUM(4031376),
        IB_VEGAS(4031377), // Invitation B????
        IB_CATHEDRAL(4031395),
        IG_VEGAS(4031406), // Invitation G????
        IG_CATHEDRAL(4031407),
        OB_FORCOUPLE(4031424), // Onyx Box? For Couple
        WR_CATHEDRAL_NORMAL(4031480), // Wedding Ring?
        WR_VEGAS_NORMAL(4031481),
        WT_CATHEDRAL_NORMAL(5251000), // Wedding Ticket
        WT_VEGAS_NORMAL(5251001),
        WT_VEGAS_PREMIUM(5251002),
        WT_CATHEDRAL_PREMIUM(5251003);
        private int wi;
        private WeddingItem(int wi) {
            this.wi = wi;
        }
        
        public int getItem() {
            return wi;
        }
    }
    
    /**
     * <name> has requested engagement. Will you accept this proposal?
     * 
     *    [USER=2000183830]para[/USER]m name
     *    [USER=2000183830]para[/USER]m playerid
     *    [USER=850422]return[/USER]
     */
    public static MaplePacket OnMarriageRequest(String name, int playerid) {
        MaplePacketLittleEndianWriter mplew = new MaplePacketLittleEndianWriter();
        mplew.writeShort(MARRIAGE_REQUEST);
        mplew.write(0); //mode, 0 = engage, 1 = cancel, 2 = answer.. etc
        mplew.writeMapleAsciiString(name); // name
        mplew.writeInt(playerid); // playerid
        return mplew.getPacket();
    }
    
    /**
     * A quick rundown of how (I think based off of enough BMS searching) WeddingPhoto_OnTakePhoto works:
     * - We send this packet with (first) the Groom / Bride IGNs
     * - We then send a fieldId (unsure about this part at the moment, 90% sure it's the id of the map)
     * - After this, we write an integer of the amount of characters within the current map (which is the Cake Map -- exclude users within Exit Map)
     * - Once we've retrieved the size of the characters, we begin to write information about them (Encode their name, guild, etc info)
     * - Now that we've Encoded our character data, we begin to Encode the ScreenShotPacket which requires a TemplateID, IGN, and their positioning
     * - Finally, after encoding all of our data, we send this packet out to a MapGen application server
     * - The MapGen server will then retrieve the packet byte array and convert the bytes into a ImageIO 2D JPG output
     * - The result after converting into a JPG will then be remotely uploaded to /weddings/ with ReservedGroomName_ReservedBrideName to be displayed on the web server.
     * 
     * - Will no longer continue Wedding Photos, needs a WvsMapGen :(
     * 
     *    [USER=2000183830]para[/USER]m ReservedGroomName The groom IGN of the wedding
     *    [USER=2000183830]para[/USER]m ReservedBrideName The bride IGN of the wedding
     *    [USER=2000183830]para[/USER]m m_dwField The current field id (the id of the cake map, ex. 680000300)
     *    [USER=2000183830]para[/USER]m m_uCount The current user count (equal to m_dwUsers.size)
     *    [USER=2000183830]para[/USER]m m_dwUsers The List of all MapleCharacter guests within the current cake map to be encoded
     *    [USER=850422]return[/USER] (MaplePacket) Byte array to be converted and read for byte[]->ImageIO
     */
    public static MaplePacket OnTakePhoto(String ReservedGroomName, String ReservedBrideName, int m_dwField, int m_uCount, List<MapleCharacter> m_dwUsers) { // OnIFailedAtWeddingPhotos
        MaplePacketLittleEndianWriter mplew = new MaplePacketLittleEndianWriter();
        mplew.writeShort(WEDDING_PHOTO); // v53 header, convert -> v83
        mplew.writeMapleAsciiString(ReservedGroomName);
        mplew.writeMapleAsciiString(ReservedBrideName);
        mplew.writeInt(m_dwField); // field id?
        mplew.writeInt(m_uCount);
        if (m_uCount > 0) {
            for (MapleCharacter guest : m_dwUsers) {
                // Begin Avatar Encoding
                guest.getAvatarLook().Encode(mplew, false); // CUser::EncodeAvatar
                mplew.writeInt(30000); // v20 = *(_DWORD *)(v13 + 2192) -- new groom marriage ID??
                mplew.writeInt(30000); // v20 = *(_DWORD *)(v13 + 2192) -- new bride marriage ID??
                mplew.writeMapleAsciiString(guest.getName());
                mplew.writeMapleAsciiString(guest.getGuildId() > 0 && guest.getGuild() != null ? guest.getGuild().getName() : "");
                mplew.writeShort(guest.getGuildId() > 0 && guest.getGuild() != null ? guest.getGuild().getLogoBG() : 0);
                mplew.write(guest.getGuildId() > 0 && guest.getGuild() != null ? guest.getGuild().getLogoBGColor() : 0);
                mplew.writeShort(guest.getGuildId() > 0 && guest.getGuild() != null ? guest.getGuild().getLogo() : 0);
                mplew.write(guest.getGuildId() > 0 && guest.getGuild() != null ? guest.getGuild().getLogoColor() : 0);
                mplew.writeShort(guest.getPosition().x); // v18 = *(_DWORD *)(v13 + 3204);
                mplew.writeShort(guest.getPosition().y); // v20 = *(_DWORD *)(v13 + 3208);
                // Begin Screenshot Encoding
                mplew.write(1); // // if ( *(_DWORD *)(v13 + 288) ) { COutPacket::Encode1(&thisa, v20);
                // CPet::EncodeScreenShotPacket(*(CPet **)(v13 + 288), &thisa);
                mplew.writeInt(1); // dwTemplateID
                mplew.writeMapleAsciiString(guest.getName()); // m_sName
                mplew.writeShort(guest.getPosition().x); // m_ptCurPos.x
                mplew.writeShort(guest.getPosition().y); // m_ptCurPos.y
                mplew.write(guest.m_bMoveAction);
            }
        }
        return mplew.getPacket();
    }
    
    /**
     * Enable spouse chat and their engagement ring without @relog
     * 
     *    [USER=2000183830]para[/USER]m chr
     *    [USER=2000183830]para[/USER]m wedding
     *    [USER=850422]return[/USER]
     */
    public static MaplePacket OnMarriageResult(MapleCharacter chr, boolean wedding) {
        MaplePacketLittleEndianWriter mplew = new MaplePacketLittleEndianWriter();
        mplew.writeShort(MARRIAGE_RESULT);
        mplew.write(wedding ? 12 : 11);
        int marriageId = 30000;
        mplew.writeInt(marriageId);
        mplew.writeInt(chr.getGender() == 0 ? chr.getId() : chr.getRelationship());
        mplew.writeInt(chr.getGender() == 0 ? chr.getRelationship() : chr.getId());
        mplew.writeShort(wedding ? 3 : 1); // impossible, always 1
        if (wedding) {
            mplew.writeInt(chr.getMarriageItemId());
            mplew.writeInt(chr.getMarriageItemId());
        } else {
            mplew.writeInt(1112803); // Engagement Ring's Outcome (doesn't matter for engagement)
            mplew.writeInt(1112803); // Engagement Ring's Outcome (doesn't matter for engagement)
        }
        mplew.writeAsciiString(Utilities.getRightPaddedStr(chr.getGender() == 0 ? chr.getName() : MapleCharacter.getNameById(chr.getRelationship()), '\0', 13));
        mplew.writeAsciiString(Utilities.getRightPaddedStr(chr.getGender() == 0 ? MapleCharacter.getNameById(chr.getRelationship()) : chr.getName(), '\0', 13));
        marriageId++;
        return mplew.getPacket();
    }
    
    /**
     * To exit the Engagement Window (Waiting for her response...), we send a GMS-like pop-up.
     * 
     *    [USER=2000183830]para[/USER]m msg
     *    [USER=850422]return[/USER]
     */
    public static MaplePacket OnMarriageResult(final byte msg) {
        MaplePacketLittleEndianWriter mplew = new MaplePacketLittleEndianWriter();
        mplew.writeShort(MARRIAGE_RESULT);
        mplew.write(msg);
        if (msg == 36) {
            mplew.write(1);
            mplew.writeMapleAsciiString("You are now engaged.");
        }
        return mplew.getPacket();
    }
    
    /**
     * The World Map includes 'loverPos' in which this packet controls
     * 
     *    [USER=2000183830]para[/USER]m partner
     *    [USER=2000183830]para[/USER]m mapid
     *    [USER=850422]return[/USER]
     */
    public static MaplePacket OnNotifyWeddingPartnerTransfer(int partner, int mapid) {
        MaplePacketLittleEndianWriter mplew = new MaplePacketLittleEndianWriter();
        mplew.writeShort(NOTIFY_MARRIED_PARTNER_MAP_TRANSFER);
        mplew.writeInt(mapid);
        mplew.writeInt(partner);
        return mplew.getPacket();
    }
    
    /**
     * The wedding packet to display Pelvis Bebop and enable the Wedding Ceremony Effect between two characters
     * CField_Wedding::OnWeddingProgress - Stages
     * CField_Wedding::OnWeddingCeremonyEnd - Wedding Ceremony Effect
     * 
     *    [USER=2000183830]para[/USER]m SetBlessEffect
     *    [USER=2000183830]para[/USER]m groom
     *    [USER=2000183830]para[/USER]m bride
     *    [USER=2000183830]para[/USER]m step
     *    [USER=850422]return[/USER]
     */
    public static MaplePacket OnWeddingProgress(boolean SetBlessEffect, int groom, int bride, byte step) {
        MaplePacketLittleEndianWriter mplew = new MaplePacketLittleEndianWriter();
        mplew.writeShort(SetBlessEffect ? WEDDING_CEREMONY_END : WEDDING_PROGRESS);
        if (!SetBlessEffect) { // in order for ceremony packet to send, byte step = 2 must be sent first
            mplew.write(step);
        }
        mplew.writeInt(groom);
        mplew.writeInt(bride);
        return mplew.getPacket();
    }
    
    /**
     * When we open a Wedding Invitation, we display the Bride & Groom
     * 
     *    [USER=2000183830]para[/USER]m groom
     *    [USER=2000183830]para[/USER]m bride
     *    [USER=850422]return[/USER]
     */
    public static MaplePacket sendWeddingInvitation(String groom, String bride) {
        MaplePacketLittleEndianWriter mplew = new MaplePacketLittleEndianWriter();
        mplew.writeShort(MARRIAGE_RESULT);
        mplew.write(15);
        mplew.writeMapleAsciiString(groom);
        mplew.writeMapleAsciiString(bride);
        mplew.writeShort(1); // 0 = Cathedral Normal?, 1 = Cathedral Premium?, 2 = Chapel Normal?
        return mplew.getPacket();
    }
    
    public static MaplePacket sendWishList() { // duck my life
        MaplePacketLittleEndianWriter mplew = new MaplePacketLittleEndianWriter();
        mplew.writeShort(MARRIAGE_REQUEST);
        mplew.write(9);
        return mplew.getPacket();
    }

    /**
     * Handles all of WeddingWishlist packets
     * 
     *    [USER=2000183830]para[/USER]m mode
     *    [USER=2000183830]para[/USER]m itemnames
     *    [USER=2000183830]para[/USER]m items
     *    [USER=850422]return[/USER]
     */
    public static MaplePacket OnWeddingGiftResult(byte mode, List<String> itemnames, List<IItem> items) {
        // if (itemnames == null || itemnames.size() < 1) { // for now lol
        //     itemnames = new ArrayList<>();
        //     itemnames.add("mesos");
        //     itemnames.add("rare items");
        //     itemnames.add("more mesos");
        // }
        MaplePacketLittleEndianWriter mplew = new MaplePacketLittleEndianWriter();
        mplew.writeShort(WEDDING_GIFT_RESULT);
        mplew.write(mode);
        switch(mode) {
            case 0x09: { // Load Wedding Registry
                mplew.write(itemnames.size());
                for (String names : itemnames) {
                    mplew.writeMapleAsciiString(names);
                }
                mplew.write(itemnames.size());
                for (String names : itemnames) {
                    mplew.writeMapleAsciiString(names);
                }
                // need to load items somehow
                break;
            }
            case 0xA: // Load Bride's Wishlist 
            case 0xF: // 10, 15, 16 = CWishListRecvDlg::OnPacket
            case 0xB: { // Add Item to Wedding Registry 
                // 11 : You have sent a gift | 12 : You cannot give more than one present for each wishlist | 13 : Failed to send the gift. | 14 : Failed to send the gift.
                if (mode == 0xB) {
                    mplew.write(itemnames.size());
                    for (String names : itemnames) {
                        mplew.writeMapleAsciiString(names);
                    }
                }
                switch (items.get((items.size() - 1)).getType()) {
                    case 0x01:
                        mplew.writeLong(4);
                        break;
                    case 0x02:
                        mplew.writeLong(8);
                        break;
                    case 0x03:
                        mplew.writeLong(16);
                        break;
                    case 0x04:
                        mplew.writeLong(32);
                        break;
                    default: { // impossible flag, cash item can't be sent
                        if (items.get((items.size() - 1)).getType() != 5) {
                            mplew.writeLong(0);
                        }
                    }
                }
                if (mode == 0xA) { // random unknown bytes involved within Bride's Wishlist
                    mplew.writeInt(0);
                }
                mplew.write(items.size());
                for (IItem item : items) {
                    addItemInfo(mplew, item, true);
                }
                break;
            }
            default: {
                System.out.println("Unknown Wishlist Mode: " + mode);
                break;
            }
        }
        return mplew.getPacket();
    }
}

This is the WeddingHandler. This handles sending an engagement request, cancelling, accept/denying, breaking engagement, inviting players to your wedding, viewing invitations, and handles groom and bride's wishlist. Also has Wedding Progress though I couldn't ever get the Cathedral packet to work for the life of me. :(
PHP:
/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package net.channel.handler;

import client.IItem;
import client.MapleCharacter;
import client.MapleClient;
import constants.InventoryConstants;
import constants.InventoryConstants.InventoryType;
import database.DatabaseConnection;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.List;
import server.MapleInventoryManipulator;
import tools.MaplePacketCreator;
import tools.data.input.SeekableLittleEndianAccessor;
import tools.packets.InventoryManipulator;
import tools.packets.Wedding;

/**
 *
 * @author Eric
 */
public class WeddingHandler {
    
    public static void DoRing(final MapleClient c, final String name, final int itemid) {
        final int newItemId = itemid == 2240000 ? 1112803 : (itemid == 2240001 ? 1112806 : (itemid == 2240002 ? 1112807 : (itemid == 2240003 ? 1112809 : (1112300 + (itemid - 2240004)))));
        final MapleCharacter chr = c.getChannelServer().getPlayerStorage().getUserByName(name);
        // TODO: get the correct packet bytes for these popups
        if (c.getPlayer().getRelationship() > 0) {
            c.getPlayer().dropMessage(1, "You're already married!");
            c.getSession().write(MaplePacketCreator.enableActions());
            return;
        } else if (chr == null) {
            c.getPlayer().dropMessage(1, "Unable to find " + name);
            c.getSession().write(MaplePacketCreator.enableActions());
            return;
        } else if (chr == c.getPlayer()) {
            c.getPlayer().dropMessage(1, "You can't engage yourself.");
            c.getSession().write(MaplePacketCreator.enableActions());
            return;
        } else if (chr.getMapId() != c.getPlayer().getMapId()) {
            c.getPlayer().dropMessage(1, "Make sure your partner is on the same map!");
            c.getSession().write(MaplePacketCreator.enableActions());
            return;
        } else if (!c.getPlayer().haveItem(itemid) || itemid < 2240000 || itemid > 2240015) {
            c.getSession().write(MaplePacketCreator.enableActions());
            return;
        } else if (chr.getRelationship() > 0 || chr.getMarriageItemId() > 0) {
            c.getPlayer().dropMessage(1, "The player is already married!");
            c.getSession().write(MaplePacketCreator.enableActions());
            return;
        } else if (chr.getGender() != 1) {
            c.getPlayer().dropMessage(1, "You may only propose to a girl!");
            c.getSession().write(MaplePacketCreator.enableActions());
            return;
        } else if (!MapleInventoryManipulator.checkSpace(c, newItemId, 1, "")) {
            c.getSession().write(MaplePacketCreator.enableActions());
            return;
        } else if (!MapleInventoryManipulator.checkSpace(chr.getClient(), newItemId, 1, "")) {
            c.getSession().write(MaplePacketCreator.enableActions());
            return;
        }
        c.getPlayer().setMarriageItemId(itemid);
        chr.getClient().getSession().write(Wedding.OnMarriageRequest(c.getPlayer().getName(), c.getPlayer().getId()));
    }
    
    public static final void RingAction(SeekableLittleEndianAccessor slea, MapleClient c) {
        byte mode = slea.readByte();
        String name;
        byte slot;
        switch(mode) {
            case 0: // Send Proposal
                DoRing(c, slea.readMapleAsciiString(), slea.readInt());
                break;
            case 1: // Cancel Proposal
                System.out.println("Cancel Ring Action: " + slea.toString()); // log packet and see if any bytes
                c.getPlayer().setMarriageItemId(0);
                break;
            case 2: // Accept/Deny Proposal
                final boolean accepted = slea.readByte() > 0;
                name = slea.readMapleAsciiString();
                final int id = slea.readInt();
                final MapleCharacter chr = c.getChannelServer().getPlayerStorage().getUserByName(name);
                if (c.getPlayer().getRelationship() > 0 || chr == null || chr.getId() != id || chr.getMarriageItemId() <= 0 || !chr.haveItem(chr.getMarriageItemId()) || chr.getRelationship() > 0 || !chr.isAlive() || chr.getEventInstance() != null || !c.getPlayer().isAlive() || c.getPlayer().getEventInstance() != null) {
                    c.getSession().write(MaplePacketCreator.enableActions());
                    return;
                }
                if (accepted) {
                    final int itemid = chr.getMarriageItemId();
                    final int newItemId = itemid == 2240000 ? 4031357 : (itemid == 2240001 ? 4031359 : (itemid == 2240002 ? 4031361 : (itemid == 2240003 ? 4031363 : (1112300 + (itemid - 2240004)))));
                    if (!MapleInventoryManipulator.checkSpace(c, newItemId, 1, "") || !MapleInventoryManipulator.checkSpace(chr.getClient(), newItemId, 1, "")) {
                        c.getSession().write(MaplePacketCreator.enableActions());
                        return;
                    }
                    try {
                        chr.removeById(InventoryType.USE, chr.getMarriageItemId(), 1, false);
                        chr.setRelationship(c.getPlayer().getId()); // engage them
                        c.getPlayer().setRelationship(chr.getId());
                        MapleInventoryManipulator.addById(c, (newItemId + 1), (short)1);
                        MapleInventoryManipulator.addById(chr.getClient(), newItemId, (short)1);
                        chr.getClient().getSession().write(Wedding.OnMarriageResult((byte) 36));
                        c.getSession().write(Wedding.OnMarriageResult((byte) 36));
                        chr.getClient().getSession().write(Wedding.OnMarriageResult(chr, false));
                        c.getSession().write(Wedding.OnMarriageResult(chr, false));
                    } catch (Exception e) {
                        System.out.println("Error with engagement " + e.getMessage());
                    }
                } else {
                    c.getPlayer().dropMessage(1, "She has politely declined your engagement request.");
                }
                break;
            case 3: // Break Engagement
                if (!c.getPlayer().isMarried() && c.getPlayer().getRelationship() > 0) {
                    final int itemId = slea.readInt();
                    final InventoryType type = InventoryType.getByType((byte) (itemId / 1000000));
                    final IItem item = c.getPlayer().getInventory(type).findById(itemId);
                    if (item != null && type == InventoryType.ETC && itemId / 10000 == 403) { // TODO: Breaking engagement.. xD
                        InventoryManipulator.ChangeSlotPosition(c.getPlayer(), true, type.getType(), item.getPosition(), 0, item.getQuantity(), 1000);
                    }
                }
                break;
            case 5: // Invite %s to Wedding
                name = slea.readMapleAsciiString();
                int marriageId = slea.readInt(); // THIS is how Nexon tracks invitations! I need to code these :(
                slot = slea.readByte(); // this is an int
                String groom = c.getPlayer().getName(), bride = MapleCharacter.getNameById(c.getPlayer().getRelationship());
                int guest = MapleCharacter.getIdByName(name);
                if (groom == null || bride == null || groom.equals(bride) || groom.equals("") || groom.equals("nobody") || bride.equals("") || bride.equals("nobody") || guest == 0) {
                    c.getPlayer().dropMessage(5, "Unable to find " + name + "!");
                    return;
                }
                try {
                    MapleCharacter.sendNote(groom, MapleCharacter.getNameById(guest), "You've been invited to " + groom + " and " + bride + "'s Wedding!", true);
                } catch (SQLException ex) {
                    ex.printStackTrace();
                    return;
                }
                c.getPlayer().gainItem(c.getPlayer().getInventory(InventoryType.ETC).getItem(slot).getItemId(), (short)-1);
                break;
            case 6: // Open Wedding Invitation
                slot = slea.readByte();
                // IItem item = c.getPlayer().getInventory(InventoryType.ETC).getItem(slot); // TODO: do item checks, what if they move the slot? :/
                Integer groomId = null, brideId = null;
                try {
                    Connection con = DatabaseConnection.getConnection();
                    PreparedStatement ps = con.prepareStatement("SELECT * FROM weddings WHERE guestid = ? AND slot = ?");
                    ps.setInt(1, c.getPlayer().getId());
                    ps.setInt(2, slot);
                    ResultSet rs = ps.executeQuery();
                    while (rs.next()) {
                        groomId = rs.getInt("groomid");
                        brideId = rs.getInt("brideid");
                    }
                } catch (SQLException ex) {
                    System.out.println("Error loading wedding invitations " + ex.getMessage());
                }
                if (groomId != null && brideId != null) {
                    c.announce(Wedding.sendWeddingInvitation(MapleCharacter.getNameById(groomId), MapleCharacter.getNameById(brideId)));
                }
                break;
            case 9: // Groom and Bride's Wishlist
                short size = slea.readShort();
                List<String> itemnames = new ArrayList<>(size);
                for (int i = 0; i < size; i++) {
                    itemnames.add(slea.readMapleAsciiString());
                }
                if (c.getPlayer().getMarriageItemId() > -1) {
                    switch(c.getPlayer().getMarriageItemId()) {
                        case 10: // Premium Cathedral
                            c.getPlayer().gainItem(4031375, (short)1);
                            c.getPlayer().gainItem(4031395, (short)15);
                            break;
                        case 11: // Normal Cathedral
                            c.getPlayer().gainItem(4031480, (short)1);
                            c.getPlayer().gainItem(4031395, (short)15);
                            break;
                        case 20: // Premium Chapel
                            c.getPlayer().gainItem(4031376, (short)1);
                            c.getPlayer().gainItem(4031377, (short)15);
                            break;
                        case 21: // Normal Chapel
                            c.getPlayer().gainItem(4031481, (short)1);
                            c.getPlayer().gainItem(4031377, (short)15);
                            break;
                        default: {
                            System.out.println("Invalid Wedding Type for player " + c.getPlayer().getName() + "!");
                            break;
                        }
                    }
                    c.getPlayer().setMarriageItemId(-1);
                }
                if (c.getPlayer().getWishlist() == null) {
                    c.getPlayer().registerWishlist(itemnames);
                }
                /*if (c.getPlayer().getWedding() != null) {
                    if (c.getPlayer().getGender() == 0 ? c.getPlayer().getWedding().isExistantGroom(c.getPlayer().getId()) : c.getPlayer().getWedding().isExistantBride(c.getPlayer().getId())) {
                        c.getPlayer().getWedding().registerWishlist(c.getPlayer().getGender() == 1, itemnames);
                    }
                }*/
                break;
            default: {
                System.out.println("Unhandled RING_ACTION Mode: " + slea.toString());
                break;
            }
        }
        c.getSession().write(MaplePacketCreator.enableActions());
    }
    
    public static final void OnWeddingProgress(byte action, MapleClient c) {
        // -- Pelvis Bebop: 
        // 0x00: "We are gathered here today..."
        // 0x01: "Very well! I pronounce you..."
        // 0x02: "You two truly are a sight to..."
        // 0x03: Wedding Ceremony Ended, initialize the Wedding Effect upon the two married characters
        // -- High Priest John: (Unknown action bytes)
        // 0x00: " "
        // 0x01: " "
        // 0x02: "Do you wish to bless this couple?..."
        // 0x03: Wedding Ceremony Ended, initialize the Wedding Effect upon the two married characters
        if (c.getPlayer().getWedding() != null) {
            if (c.getPlayer().getGender() == 0 ? c.getPlayer().getWedding().isExistantGroom(c.getPlayer().getId()) : c.getPlayer().getWedding().isExistantBride(c.getPlayer().getId())) {
                c.getPlayer().getField().broadcastMessage(Wedding.OnWeddingProgress(action == 2, c.getPlayer().getId(), c.getPlayer().getRelationship(), (byte)(action+1)));
                c.getPlayer().getWedding().incrementStage();
                c.getPlayer().getPartner().getWedding().incrementStage(); // pls don't b a witch and throw npe ):<
                if (action == 2) {
                    c.getPlayer().setMarried(true);
                    c.getChannelServer().getPlayerStorage().getUserByID(c.getPlayer().getRelationship()).setMarried(true);
                }
            }
        }
        c.announce(MaplePacketCreator.enableActions());
    }
    
    public static final void OnWeddingGiftResult(SeekableLittleEndianAccessor slea, MapleClient c) {
        System.out.println("New WEDDING_GIFT_RESULT: " + slea.toString());
        byte mode = slea.readByte();
        switch(mode) {
            case 0x06: // "SEND ITEM"
                short slot = slea.readShort(); // isn't this a byte? o.O
                int itemId = slea.readInt();
                short quantity = slea.readShort();
                if (c.getPlayer().getInventory(InventoryConstants.getInventoryType(itemId)).getItem((byte)slot).getItemId() == itemId && c.getPlayer().getInventory(InventoryConstants.getInventoryType(itemId)).getItem((byte)slot).getQuantity() >= quantity) {
                    if (c.getPlayer().getWedding() == null) {
                        c.getPlayer().startWedding(); // TODO
                    }
                    List<String> itemnames = new ArrayList<>();
                    IItem item = c.getPlayer().getInventory(InventoryConstants.getInventoryType(itemId)).getItem((byte)slot);
                    boolean bride = false;
                    c.getPlayer().getWedding().registerWishlistItem(item, bride);
                    c.announce(Wedding.OnWeddingGiftResult((byte)11, itemnames, c.getPlayer().getWedding().getWishlistItems(bride))); // todo: remove item from inventory if success
                }
            case 0x08: // "EXIT"
                if (slea.available() != 0) {
                    System.out.println("WEDDING_GIFT_RESULT: " + slea.toString());
                }
                c.announce(MaplePacketCreator.enableActions());
                break;
            default: {
                System.out.println("Unknown Mode Found: " + mode + " : " + slea.toString());
            }
        }
    }
}

Here is the "Marriage Record" class. The variables at the top are commented below. I never finished these as you can see but you can instance the class and change static encode to regular encode with just the inner variables if you wanted to.
PHP:
/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package tools.packets;

import client.MapleCharacter;
import client.MapleRing;
import tools.Utilities;
import tools.data.output.MaplePacketLittleEndianWriter;

/**
 * GW_MarriageRecord
 * 
 * @author Eric
 */
public class GW_MarriageRecord {
    public int dwMarriageNo;
    public int dwGroomID, dwBrideID;
    public int usStatus;
    public int nGroomItemID, nBrideItemID;
    public String sGroomName, sBrideName;
    
    public static void Encode(MaplePacketLittleEndianWriter mplew, MapleCharacter chr) {
        mplew.writeInt(chr.getRelationship()); // dwMarriageNo
        mplew.writeInt(chr.getGender() == 0 ? chr.getId() : chr.getRelationship()); // dwGroomID
        mplew.writeInt(chr.getGender() == 0 ? chr.getRelationship() : chr.getId()); // dwBrideID
        mplew.writeShort(chr.isMarried() ? 3 : 1); // usStatus
        if (chr.isMarried() && chr.getMarriageItemId() == -1) {
            for (MapleRing ring : chr.getCharacterData().getMarriageRecord()) {
                mplew.writeInt(ring.getItemId()); // nGroomItemID
                mplew.writeInt(ring.getItemId()); // nBrideItemID
            }
        } else { // This is wrong, it actually loads their engagement ring/box id's when engaged..
            mplew.writeInt(chr.isMarried() && chr.getMarriageItemId() > 0 ? chr.getMarriageItemId() : 1112803); // nGroomItemID
            mplew.writeInt(chr.isMarried() && chr.getMarriageItemId() > 0 ? chr.getMarriageItemId() : 1112803); // nBrideItemID
        }
        mplew.writeAsciiString(Utilities.getRightPaddedStr(chr.getGender() == 0 ? chr.getName() : MapleCharacter.getNameById(chr.getRelationship()), '\0', 13)); // sGroomName
        mplew.writeAsciiString(Utilities.getRightPaddedStr(chr.getGender() == 0 ? MapleCharacter.getNameById(chr.getRelationship()) : chr.getName(), '\0', 13)); // sBrideName
    }
}

Spouse chat (use true for the boolean in the packet):
PHP:
public static MaplePacket OnCoupleMessage(String fiance, String text, boolean spouse) {
        MaplePacketLittleEndianWriter mplew = new MaplePacketLittleEndianWriter();
        mplew.writeShort(CField.COUPLE_MESSAGE.getVal());
        mplew.write(spouse ? 5 : 4); // v2 = CInPacket::Decode1(a1) - 4;
        if (spouse) { // if ( v2 ) {
            mplew.writeMapleAsciiString(fiance);
        }
        mplew.write(spouse ? 5 : 1);
        mplew.writeMapleAsciiString(text);
        return mplew.getPacket();
    }

PHP:
public static final void SpouseChat(String spouseName, String msg, MapleClient c) {
        if (c.getPlayer().getRelationship() >= 0) { // yay marriage
            if (c.getPlayer().getName().equalsIgnoreCase(spouseName)) { 
                if (c.getChannelServer().getPlayerStorage().getUserByID(c.getPlayer().getRelationship()) != null)
                    spouseName = c.getChannelServer().getPlayerStorage().getUserByID(c.getPlayer().getRelationship()).getName();
                else {
                    c.getPlayer().dropMessage(5, "You are not married or your spouse is currently offline.");
                    return;
                }
            }
            final int channel = Center.getInstance().findChannel(spouseName);
            final int world = Center.getInstance().findWorld(spouseName);
            MapleCharacter spouse = ChannelServer.getInstance(world, channel).getPlayerStorage().getUserByName(spouseName);
            if (spouse != null) {
                if (c.getPlayer().getWatcher() != null) {
                    c.getPlayer().getWatcher().dropMessage(6, "[" + c.getPlayer().getName() + " - Spouse] : " + msg);
                }
                spouse.getClient().getSession().write(Field.OnCoupleMessage(c.getPlayer().getName(), msg, true));
                c.getSession().write(Field.OnCoupleMessage(c.getPlayer().getName(), msg, true));
            } else
                c.getPlayer().dropMessage(5, "You are not married or your spouse is currently offline.");
        }
    }

Only other thing I could think of that I used for Weddings was the NPC scripts. Here they are!

PHP:
/**
 * @author: Eric
 *   [USER=806871]NPC[/USER]: 92010000 (Moony)
 *   [USER=443547]func[/USER]: The Official Nexon MapleStory Moony NPC ported from "EngageRing" Nexon Script.
*/

var ret = -1;
// If we ever decide to have Full GMS-like Engagement Quests, make this true.
var proofOfLoves = false;
// The fee multiplier for mesos. | 1 = Same price as GMS
var fee = 1;

function start() {
	cm.sendSimple("Have you found true love? If so, I can make you a ring worthy of your devotion...\r\n#b#L0#I would like to make an engagement ring for my lover.\r\n#L1#I want an annulment.#l#k");
}

function action(m, t, choosemenu) {
	if (m <= 0) {
		cm.dispose();
		return;
	}
	(m == 1 ? ret++ : ret--);
	if (ret == 0) {
		if (choosemenu == 0) {
			// if female user clicks to make a ring
			if (cm.getPlayer().getGender() == 1) cm.sendOk ( "Let's see... I only make rings for guys who want to get married.");
			// if a user whose level is less than 10 clicks to make a ring
			else if ( cm.getPlayer().getLevel() < 10 )    cm.sendOk ( "Let's see... I don't think you are strong enough. You'll have to be at least #bLevel 10#k to get married." );
			else {
				if (checkQuestRecord(cm) == "end") {
					// if a user who got Engagement ring 
					cm.sendOk( "Hey, I've already given you an engagement ring already!");
				} else if (checkQuestRecord(cm) == "ing") { // lol nexon o.o
					var canMakeRing = true;
					if (proofOfLoves) {
						var count;
						for (var i = 0; i <= 5; i++) {
							if (cm.haveItem(4031367 + i, 1)) {
								count++;
							}
						}
						// if a user comes without enough (4) "proof of love"s.
						if (count < 4) {
							cm.sendOk("Looks like you're not quite done. If you want that ring, you'd better hurry and get me the following all materials to make an engagement ring. I need you to bring me #b4 Proof of Love#k from Nana.");
							canMakeRing = false;
							cm.dispose();
						} else {
							ret = -1;
							// if a user comes with enough "proof of love"s.
							cm.sendNext ("Wow, I am impressed! Your mate is a very lucky person to have someone so willing to prove their love. I am honored to make you an engagement ring.");
							canMakeRing = true;
						}
					}
					if (canMakeRing) {
						// explanation
						ret = 9;
						cm.sendNext ("You need the following raw materials to make an engagement ring.\r\n#b#eMoonstone Ring:#k\r\n #v4011007# #t4011007# 1, #v4021007# #t4021007# 1, 30,000 Meso \r\n#b#eStar gem ring:#k\r\n #v4021009# #t4021009# 1, #v4021007# #t4021007# 1, 20,000 Meso \r\n#b#eGolden Heart Ring:#k\r\n #v4011006# #t4011006# 1, #v4021007# #t4021007# 1, 10,000 Meso \r\n#b#eSilver Swan Ring:#k\r\n #v4011004# #t4011004# 1, #v4021007# #t4021007# 1, 5,000 Meso");
					}
				} else { // -.-
					cm.sendYesNo("So you want a special ring, eh? Well you've come to the right guy. My rings are for those who want to truly prove their love. Are you up for that?");
					/*
						if(nRet!=0) {
						self.say( "Ok, you look like one who is devoted to their mate. I need you to bring me 4 Proof of Love from Nana. She뭩 special, and the only one I can trust in this world. If she can see the true depth of your feelings, she will hand you a Proof of Love." );
						self.say( "Bring me four and I will make you an engagement ring to make you both smile on your wedding day. Please remember, if you뭭e recently had an Annulment, you뭠l need to wait 7 days before I can make you a new Wedding ring! Speak with Nana to prove your love, and come back when you뭨e ready for the ring that fits best!" );            
						valT = qr.get( 8844 );
									
						aTime = compareTime( cTime, valT );
						
						if ( aTime >= 10080 ) qr.set( 8809, "ing" );
						else self.say( "Hey, I've given you an engagement ring once! Why do you need another one now? If you broke your engagement this fast, that's too bad but to me, this means you need to learn to be patient and serious about engagements. Come back when you are really ready for this.");
						}
						else self.say( "Are you sure? Maybe you haven't found that special someone yet. That's alright. I'll be here if you need me~" );
					*/
				}
			}
		}
	} else if (ret == 10) {
		cm.sendSimple(" What kind would you like?\r\n#b#L0##v2240000# #t2240000##l\r\n#L1##v2240001# #t2240001##l\r\n#L2##v2240002# #t2240002##l\r\n#L3##v2240003# #t2240003##l\r\n#L4#I don't want to pick one right now.#l#k");
	} else if (ret == 11) {
		v1 = choosemenu;
		if (v1 == 0) { // moonrock
			if (cm.haveItem(4011007, 1) && cm.haveItem(4021007, 1) && cm.canHold(2240000) && cm.getMeso() >= 30000) {
				// user succeeded to get a moonrock engagement ring
				cm.gainItem(4011007, -1); // Moon Rock
				cm.gainItem(4021007, -1); // Diamond
				cm.gainMeso(-(30000 * fee));
				cm.gainItem(2240000, 1);
				cm.gainExp(2360);
				cm.sendOk( "Here is your well-earned, hand-crafted engagement ring. It is worthy of the love shared between the both of you-I hope she accepts your proposal. It always pleasures me to help two lovebirds. Good luck!");
			} else {
				// if a user doesn't fulfill items to make a ring 
				cm.sendOk ( "Looks like you're not quite done. If you want that ring, you'd better hurry!" );
			}
			cm.dispose();
			/* 
			 * Incase we ever enable Proof of Love quests, here's how Nexon does it
				 if (count==4){
                     while ( count > 0 ){
                      num = 4031367 + j;
                      nItem = inventory.itemCount(num);
                       if (nItem > 0) {
                        count = count - 1;
                        ret= inventory.exchange(0,num, -1);
                    
                       }
                     j=j+1;
                     }
                    }

                if (count==5){
                     while ( count > 1 ){
                      num = 4031367 + j;
                      nItem = inventory.itemCount(num);
                       if (nItem > 0) {
                        count = count - 1;
                        ret= inventory.exchange(0,num, -1);
                    
                       }
                     j=j+1;
                     }
                }

                if (count==6){
                     while ( count > 2 ){
                      num = 4031367 + j;
                      nItem = inventory.itemCount(num);
                       if (nItem > 0) {
                        count = count - 1;
                        ret= inventory.exchange(0,num, -1);
                    
                       }
                     j=j+1;
                     }
                }
			*/
		} else if ( v1 == 1 ) {    //starrock
			if (cm.haveItem(4021009, 1) && cm.haveItem(4021007, 1) && cm.canHold(2240001) && cm.getMeso() >= 20000) {
				cm.gainItem(4021009, -1); // Star Rock
				cm.gainItem(4021007, -1); // Diamond
				cm.gainMeso(-(20000 * fee));
				cm.gainItem(2240001, 1);
				cm.gainExp(2360);
				cm.sendOk( "Here is your well-earned, hand-crafted engagement ring. It is worthy of the love shared between the both of you-I hope she accepts your proposal. It always pleasures me to help two lovebirds. Good luck!");
			} else {
				cm.sendOk ( "Looks like you're not quite done. If you want that ring, you'd better hurry!" );
			}
			cm.dispose();
		} else if ( v1 == 2 ) {    //gold
			if (cm.haveItem(4011006, 1) && cm.haveItem(4021007, 1) && cm.canHold(2240002) && cm.getMeso() >= 10000) {
				cm.gainItem(4011006, -1); // Gold Plate
				cm.gainItem(4021007, -1); // Diamond
				cm.gainMeso(-(10000 * fee));
				cm.gainItem(2240002, 1);
				cm.gainExp(2360);
				cm.sendOk( "Here is your well-earned, hand-crafted engagement ring. It is worthy of the love shared between the both of you-I hope she accepts your proposal. It always pleasures me to help two lovebirds. Good luck!");
			} else {
				cm.sendOk ( "Looks like you're not quite done. If you want that ring, you'd better hurry!" );
			}
			cm.dispose();
		} else if ( v1 == 3 ) {    //silver
			if (cm.haveItem(4011004, 1) && cm.haveItem(4021007, 1) && cm.canHold(2240003) && cm.getMeso() >= 5000) {
				cm.gainItem(4011004, -1); // Silver Plate
				cm.gainItem(4021007, -1); // Diamond
				cm.gainMeso(-(5000 * fee));
				cm.gainItem(2240003, 1);
				cm.gainExp(2360);
				cm.sendOk( "Here is your well-earned, hand-crafted engagement ring. It is worthy of the love shared between the both of you-I hope she accepts your proposal. It always pleasures me to help two lovebirds. Good luck!");
			} else {
				cm.sendOk ( "Looks like you're not quite done. If you want that ring, you'd better hurry!" );
			}
			cm.dispose();
		} else if (v1 == 4) { // no
			cm.sendOk( "Ok, feel free to return at anytime and I will give you the ring you want.");
			cm.dispose();
		}
	}
}

function checkQuestRecord(cm) {
	if (cm.getPlayer().getRelationship() > 0 || cm.getPlayer().isMarried()) {
		return "end";
	}
	for (var i = 0; i <= 5; i++) {
		if (cm.haveItem(4031357 + i, 1)) {
			return "ing";
		}
	}
	for (var i = 0; i <= 8; i++) {
		if (cm.haveItem(4031367 + i, 1)) {
			return "end";
		}
	}
	return "ing"; //return "start";
}

PHP:
/**
 * @author: Eric
 *   [USER=806871]NPC[/USER]: 9201002 (High Priest John)
 *   [USER=443547]func[/USER]: The Official Nexon MapleStory High Priest John NPC ported from "HighPriest" Nexon Script.
*/

function start() {
	if (cm.getMapId() == 680000000) {
		// checking : if target has Cathedral Reservation Receipt (initial)
        if (!cm.haveItem(4031375, 1) && !cm.haveItem(4031480, 1)) 
			cm.sendOk( "I oversee all Cathedral Weddings...if you'd like to get married in the Cathedral, please speak with me as well!"); 
		else {                        
            if (cm.getPlayer().getGender() == 0)
                cm.sendOk( "I oversee all Cathedral Weddings. There are a few reminders for Grooms that reserved the Cathedral Wedding. You will have to wait or help your Bride getting a blessing from her parents. After that, I'll give her my permission for the wedding so that she can initiate the Wedding by talking to one of my assistants, Nicole. Only your Bride can initiate the Wedding for Cathedral so you need to be patient for this."); 
            else {
                //if (val == "end" )        // user already finished the quest 
				cm.sendOk( "You have already received the Officiator's Permission.");
			}
		}
	}
	if (cm.getMapId() == 680000210) { //High priest is in the cathedral
		cm.sendOk ( "Humm...");
	}
	cm.dispose();
}

function action(mode, type, selection) {
	// 680000300 -- Cherished Visage Photos
	// 680000500 -- Wedding Exit Map
	var status = -1;
    if (status == 0) {
		cm.sendYesNo("Do you want to get this show on the road?");
    } else if (status == 1) {
		if (cm.isWeddingCouple() == 0) {
		    cm.sendOk("You guys look fantastic!");
		    cm.dispose();
		    return;
		}
		var chr = cm.getMap().getCharacterById(cm.getPlayer().getRelationship());
		if (chr == null) {
		    cm.sendOk("Make sure your partner is in the map.");
		    cm.dispose();
		    return;
		}
		cm.startMarriage();
		cm.dispose();
    }
}

/**
 * @author: Nexon
 *   [USER=806871]NPC[/USER]: High Priest John
 *   [USER=2000175386]Script[/USER]: "HighPriest"
 *   [USER=443547]func[/USER]: Meet the Parents Quest Record Data
*
*
	field = self.field;
    qr = target.questRecord;
    val = qr.get( 8816 );
    inventory = target.inventory;
        
	if (val == "end" )        // user already finished the quest 
		self.say( "You have already received the Officiator's Permission.");
	else if (val == "ing"){
		   nItem = inventory.itemCount( 4031373 ); // checkikng : parent bless (complete this Quest)
		   if (nItem > 0)     {   // user got the parents blessing
			   self.say ("I see a smile on your face...you received your Parent's Blessing, didn't you? Great! Now, take the Officiator's Permission. You'll need to get married in cathedral. See you at the wedding!");
			   if (inventory.itemCount( 4031375 )>0) {
				ret = inventory.exchange( 0, 4031373, -1, 4031374, 1);
				if (ret !=0) {
					qr.set( 8816, "end" );                            
					target.incEXP (500, 0);
				}
				else self.say("Oh dear, looks like I can't find that information right now...I'm having a bit of trouble with my database, please try again later");
			   }
			   else if (inventory.itemCount( 4031480 )>0) {
				ret = inventory.exchange( 0, 4031373, -1, 4031374, 1);
				if (ret !=0) {
					qr.set( 8816, "end" );
					target.incEXP (500, 0);
					}
				else self.say("Oh dear, looks like I can't find that information right now...I'm having a bit of trouble with my database, please try again later");
				}
		   }
		   else  self.say(" You still need your parents blessing, my friend. True Love knows no bounds, head out there and obtain your Parent's Blessing.");

	}
	else {    //quest starts
	nRet = self.askYesNo("Ah, there is seldom a sight more beautiful than two people in love. I can see that you want to get married. Have you got your Parent's Blessing yet? It is important that your parents give their blessing for a happy marriage. Do you wish to go visit your parents now?");
		if(nRet!=0) {    // user accepts the quest
			qr.set( 8816, "ing" );
			self.say( "Fantastic. It's always great to see a couple fall in love. Why don't you go speak with Mom and Dad for their blessing? I'm sure they will see that you two are meant to be. While going there, why don't you tell Cody that I said Hello if you have time." );

		}
		// user doesn't accept the quest
		else self.say( "Well, let's not rush things. Come back when you're ready to visit your Parents. " );
	}
*
*
*/

PHP:
/**
 * @author: Eric
 *   [USER=806871]NPC[/USER]: 9201004 (Ames the Wise)
 *   [USER=2000175386]Script[/USER]: The Official Nexon MapleStory Ames the Wise NPC ported from "aboutthewedding" Nexon Script.
*/

var v1;
var v2 = -1;
var v3;

function start() {
	cm.sendSimple("Greetings Traveler! I trust your adventures have proven lively thus far. My name is Ames the Wise, and I'm the oldest citizen in Amoria. I can offer a lifetime's worth of advice if you want to get married. Would you like to know more?\r\n#b#L0#Yes, I'm interested in marriage.#l\r\n#L1#No, no...I'm definitely not ready for that. But I'd still like to see what Amoria's about. Do I have to be married?#l\r\n#L2#Ok, I think I'll talk to some people around here.#l\r\n#L3#How do I get engaged?#l\r\n#L4#How do I get married?#l\r\n#L5#I want to be married in the White Wedding Chapel!#l\r\n#L6#I want the wedding of my dreams in the Cathedral!#l\r\n#L7#How do I invite my friends?#l\r\n#L8#What happens after the Wedding?#l\r\n#L9#What's the difference between normal and Premium Weddings?#l\r\n#L10#What about Marriage Benefits?#l\r\n#L11#How do I get my marriage annulled?#l\r\n#L12#Ok, I understand the system. Thank you!#l#k");
}

function action(m, t, s) {
	if (m <= 0 && v2 <= 0) {
		cm.dispose();
		return;
	}
	(m == 1 ? v2 ++ : v2--);
	if (v2 == 0) {
		v1 = s;
		if ( v1 == 0 ) {
            cm.sendNext( "Ready to get married, eh? First things first-congratulations! I'm happy for you. Second, you'll need to get engaged. After that, figure out where you want to get married-at the Cathedral or the White Wedding Chapel. Both are great places as far as I'm concerned." );
        } else if ( v1 == 1 ) {
            cm.sendOk( "Amoria welcomes everyone. You do not have to married to help some of the good townspeople around here-or hunt. I invite you to speak with a few of them and see if you can assist them. " );
        } else if ( v1 == 2 ) {
            cm.sendOk( "Great! Stay as long as you like. See me if you have some questions." );
        } else if ( v1 == 3 ) {
            cm.sendNext( "Good thinking. You'll have to be male to obtain an Engagement Ring. After you have one, select the propose option, and wait for a response from your sweetheart. I recommend both of you being online so you can celebrate. As for getting an engagement ring, I'd speak with Moony, our ring-maker." );
        } else if ( v1 == 4 ) {
            cm.sendNext( "Straight to the point, eh? I like that. Well, after you're engaged, you'll need to speak with Wedding Coordinator Victoria or Wayne and make your reservation. You will need a normal or Premium Wedding Ticket from the Cash Shop, an Engagement Ring and some time. If you're recently performed an annulment, then you'll need to wait 7 days before you can marry again and Moony will make you a new ring." );
        } else if ( v1 == 5 ) {
            cm.sendNext( "Bit of an adventurous streak, I see. Pelvis Bebop and his crew know how to put on a nice show. Just speak with Wedding Assistant Bonnie, and be sure you have a Wedding Receipt, an Engagement Ring and about 5-10 minutes." );
        } else if ( v1 == 6 ) {
            cm.sendNext( "Ah, the Cathedral. If there's a place you want to really want to get married in style, that's it. As I mentioned before, they have a more elaborate system, so you'll need to speak with High Priest John for his permission." );
        } else if ( v1 == 7 ) {
            cm.sendNext( "You will receive Wedding Invitations along with your Wedding ticket. If you need more, you can talk with one of the Wedding Assistants. The invitations are pretty simple, you just type in your friend's name, hit send, and off they go." );
        } else if ( v1 == 8 ) {
            cm.sendNext( "For the White Wedding Chapel and the cathedral, after the Wedding ends, you and your guests are sent to the photo area, Cherished Visage. You can snap away for 60 seconds, and then relax with the new couple for 5 minutes." );
        } else if ( v1 == 9 ) {
            cm.sendNext( "Well, the normal Wedding ticket is nice enough; however, the Premium Wedding ticket gives the newly married couple and their guests a Wedding Party afterwards at the Untamed Hearts Hunting Ground." );
        } else if ( v1 == 10 ) {
            cm.sendNext( "Now you're talking. As a way to remember Elias the Hunter, Married Couples receive the rings, which produce an effect whenever you're near each other-it's different depending on the ring you choose. You'll also get to do some activities that are for Couples only." );
        } else if ( v1 == 11 ) {
            cm.sendOk( "Some marriages don't work out for the best. It's unfortunate, but you can visit Moony to end your marriage. Make sure you have a good amount of money as well. Anything else?" );
        } else if ( v1 == 12 ) {
            cm.sendOk( "My pleasure, friend! Visit me anytime if you need to know more." );
        }
	} else if (v2 == 1) {
		switch(v1) {
			case 0:
				cm.sendNext( "You'll also need a Normal or Premium Wedding ticket from the Cash Shop for either location-just one per couple. After that, you'll be happily married and enjoy the benefits of marriage. I can explain a little more if you want..." ); 
				break;
			case 3:
				cm.sendNext( "He's crafts the best rings I've ever seen-4 different kinds in fact. When you do select your engagement ring, please pick carefully-wouldn't want to make a mistake! What else is on your mind?" );
				break;
			case 4:
				cm.sendNext( "There's a bit more documentation for the Cathedral, they have a more elaborate system over there. Also, you'll need to tell the Wedding Coordinator your wish lists." );
				break;
			case 5:
				cm.sendNext( "The White Wedding Chapel is faster, and a little more care-free. Anything else you're interested in?" );
				break;
			case 6:
				cm.sendNext( "The bride-to-be will also have to call on Mom and Dad to vouch for you both. To get married in the Cathedral, Just speak with Wedding Assistant Nicole and be sure you have a Wedding Receipt, the Officiator's Permission, and an Engagement Ring and about 10-20 minutes." );
				break;
			case 7:
				cm.sendNext( "They'll land in the Etc slot-make sure they have a few spaces free. What else would you like to know?" );
				break;
			case 8:
				cm.sendNext( "After that, you're whisked back to Amoria. Unless you have a premium ticket, in which case you get to visit the famous Robin the Huntress. What else are you curious about?" );
				break;
			case 9:
				cm.sendNext( "It's hosted by the legendary lady archer herself, Robin the Huntress. There's quite a few valuables there I'm told, though you'll see for yourself." );
				break;
			case 10:
				cm.sendNext( "For instance, some of the townsfolk here will give you tasks that they wouldn't give others, they'll trust you a little more. It's a different lifestyle, and you'll always be with your sweetheart. What else can I assist with?" );
				break;
		}
		cm.dispose();
	} else if (v2 == 2) {
		switch(v1) {
			case 4:
				cm.sendNext( "Pila Present will hold them for you when your friends turn them in, and you can pick them up afterwards. You'll also get wedding invitations to send them. Do you know where you want to get married?" );
				break;
			case 6:
				cm.sendNext( "Also, the Cathedral allows your guests to give the married couple an experience blessing during the wedding-1 exp per click, in fact. What else would you like to know?" );
				break;
		}
		cm.dispose();
	}
}

PHP:
/**
 * @author: Eric
 *   [USER=806871]NPC[/USER]: 9201005 (Assistant Nicole)
 *   [USER=2000175386]Script[/USER]: The Official Nexon MapleStory Assistant Nicole NPC ported from "cathedral" Nexon Script.
*/

var v1 = -1;
var v2 = -1;
var result = -1;
var mapid = 680000210; // Cathedral Wedding Altar

function start() {
	if (cm.getPlayer().getMapId() == 680000000) {
		cm.sendSimple("I can guide you to the Wedding. Which one suits you?\r\n#b#L0#I am now ready to get Married in cathedral.#l\r\n#L1#I am invited to the wedding!#l#k");
	} else if (cm.getPlayer().getMapId() == 680000200) {
		cm.sendYesNo("Would you like to go back outside? ");
	} else { // impossible unless used in a command or spawned improperly in a map
		cm.dispose();
	}
}

function action(mode, type, selection) {
	if (cm.getPlayer().getMapId() == 680000200) {
		if (mode < 1) {
			cm.sendOk("Please take a seat, and wait for the ceremony to begin.");
		} else if (mode > 0) {
			cm.warp(680000500, 0); // registerTransferField( 680000500, "" );
			cm.sendOk("Maybe we'll see you at the altar someday. Happy travels! ");
		}
		cm.dispose();
	} else if (cm.getPlayer().getMapId() == 680000000) {
		if (mode != 1 && v1 == -1) {
			cm.dispose();
			return;
		} else if (v1 > -1 && v2 > -1) { // have already selected and incremented action
			if (v2 == 1 && mode < 1) {
				cm.sendOk("Well, it looks like this isn't your cup of tea, please stand aside and let others enter. ");
				cm.dispose();
				return;
			}
		}
		(mode == 1 ? v1++ : v1--);
		if (v1 == 0) {
			v2 = selection;
			if (v2 == 0) {
				if (cm.getPlayer().getParty() == null) {
					cm.sendOk("You need to be in #ba 2-person party with your fiance#k to get married.");
				} else {
					if (cm.haveItem(4031375, 1) || cm.haveItem(4031480, 1)) { // Normal and Premium Receipts 
						if (cm.getPlayer().getClient().getChannelServer().getMapFactory().getMap(mapid).getCharacters().size() > 0) { // TODO: active wedding check hehe
							result = 1;
							cm.sendOk(" Looks like another Wedding has begun, sweetie. When it finishes, I'll be sure to let you in!");
						} else if (cm.getPlayer().getRelationship() <= 0 || cm.getPlayer().getGender() != 0) {
							result = 3;
							cm.sendOk("You need to be in #ba 2-person party with your fiance#k to get married.");
						} else if (cm.getPlayer().getClient().getChannelServer().getPlayerStorage().getCharacterById(cm.getPlayer().getRelationship()) == null) {
							result = 4;
							cm.sendOk("You need to be in #ba 2-person party with your fiance#k to get married.");
						} else if (cm.getPlayer().getClient().getChannelServer().getPlayerStorage().getCharacterById(cm.getPlayer().getRelationship()).getMapId() != cm.getPlayer().getMapId()) {
							result = 2;
							cm.sendOk("You need to be in a 2-person party with your fiance and in #bthe same map#k to get married.");
						} else if (cm.getPartyMembers().size() > 2 || cm.getPlayer().getParty().getMemberById(cm.getPlayer().getRelationship()) == null) {
							result = 5;
							cm.sendOk("You need to be in #ba 2-person party with your fiance#k to get married.");
						} else if (!cm.canHold(1112803)) {
							result = 6;
							cm.sendOk("You need an equip slot open to receive the ring, as soon as you make room, we can begin.");
						} else if (cm.haveItem(4031376, 1) && !cm.haveItem(4031375, 1)) {
							result = 11;
							cm.sendOk("It appears that you've made your reservation at another wedding hall");
						} else if (cm.haveItem(4031381, 1) && !cm.haveItem(4031380, 1)) {
							result = 11;
							cm.sendOk("It appears that you've made your reservation at another wedding hall");
						} else if (!cm.haveItem(4031375, 1) && !cm.haveItem(4031380, 1)) {
							result = 10;
							cm.sendOk ("You have to make a reservation to start the wedding");
						} else {
							result = 0;
							cm.getPlayer().startWedding();
							cm.warpWedding(true);
						}
					} else {
						cm.sendOk("Let's see...I'm sorry, but I don't think you have the Reservation Receipt with you right now. Without the Reservation Receipt, I'm afraid I can't help you. You'd better talk to Victoria first Sorry. ");
					}
				}
				cm.dispose();
			} else if (v2 == 1) {
				if (cm.getPlayer().getParty() == null) {
					cm.sendYesNo("Greetings! I can tell that you're a guest of the Bride and Groom, would you like to enter the Cathedral?");
				} else {
					cm.sendOk("Oh no, I am sorry, but I cannot let you in since you're in a party with someone other than your loved one. I suggest you leave the party first, and then come back and see me~");
					cm.dispose();
				}
			}
		} else if (v1 == 1) {
			if (cm.haveItem(4031407, 1)) {
				if (cm.getPlayer().getClient().getChannelServer().getMapFactory().getMap(mapid).getCharacters().size() == 0) { // TODO: active wedding check hehe
					// this needs to be a more advanced check, we'll do more checking on invites before getting here :)
					cm.sendOk("I apologize, but the Wedding hasn't started yet. When it does, I'll be sure to let you in. ");
				} else {
					cm.warp(680000100, 0);
				}
				// else if ( result == 9) self.say ("Oh dear, looks like I can't find that information right now...I'm having a bit of trouble with my logbook, please try again later");
			} else {
				cm.sendOk("Sorry, but without an invitation, I can't let you in.");
			}
			cm.dispose();
		}
	}
}

PHP:
/**
 * @author: Eric
 *   [USER=806871]NPC[/USER]: 9201006 (Assistant Debbie)
 *   [USER=2000175386]Script[/USER]: The Official Nexon MapleStory Assistant Debbie NPC ported from "watingCathedral" Nexon Script.
*/

var nRet = 0;
var result = 0;

function start() {
    if (cm.getPlayer().getMapId() == 680000200) {
		cm.sendYesNo("Salutations! Would you like to get into the Wedding Hall? ");
    } else if (cm.getPlayer().getMapId() == 680000210) {
		if (cm.getPlayer().getParty() != null && cm.isWeddingCouple() == 1 && cm.getCurrentWeddingState() <= 2) {
			cm.sendOk("You both look fantastic! Please, wait the ceremony to end.");
			cm.dispose();
		} else if (cm.getPlayer().getParty() != null && cm.isWeddingCouple() == 1) {
			nRet = 2;
			cm.sendYesNo("You both look fantastic! Are you ready to go to the Photo Map? ");
		} else if (cm.isWeddingCouple() == 0) {
			nRet = 3;
			cm.sendYesNo("Hi! Would you like to leave the Cathedral? ");
		}
	} else if (cm.getPlayer().getMapId() == 680000300 && cm.isWeddingCouple() == 1) { // not in Nexon's "waitingCathedral" script.
		cm.sendOk("Welcome to Cherished Visage Photo Section! On here, we are taking a picture of you and your guests that will allow you to remember your very own Wedding day forever! The picture will be automatically taken after 1 minute timer runs out. So you need to be ready and try out some new poses before it's taken~ To see the picture that was taken, please visit [url=http://dchaosms.net/]D.ChaosMS[/url] for more details.");
		cm.dispose();
	} else if (cm.getMapId() == 680000300 && cm.isWeddingCouple() == 0) {
		cm.sendYesNo("Do you want to go back outside?");
	}
}

function action(mode, type, selection) {
	if (cm.getPlayer().getMapId() == 680000200) {
		(mode > 0 ? cm.warp(680000210, 0) : cm.sendOk("Ok, please let me know when you're ready to go in."));
		if (mode > 0)
			cm.sendOk( "Feel free to head inside now. Give my regards to the newlyweds!");
	} else if (cm.getPlayer().getMapId() == 680000300 && cm.isWeddingCouple() == 0) {
		(mode > 0 ? cm.warp(680000500, 0) : cm.sendOk("Ok, please let me know when you're ready to go!"));
		if (mode > 0)
			cm.sendOk( "Ok, I'll show you the way out. Have fun out there!");
	} else if (cm.getPlayer().getMapId() == 680000210 && nRet == 2) {
		if (mode < 1) {
			cm.sendOk("Ok, please remember that the Photo time will automatically start after the clock stops.");
		} else {
			result = 1; // 7: Wedding hasn't started 8: Without an invitation, can't let you in 9: Database error
			cm.sendNext("Sounds good, take some good pictures. Off you go!");
		}
	} else if (cm.getPlayer().getMapId() == 680000210 && nRet == 3) {
		(mode < 1 ? cm.sendOk("Ok, please let me know when you're ready to go out.") : cm.warp(680000500, 0));
		if (mode > 0)
			cm.sendOk("Ok, I'll show you the way out..."); // result++
	} else if (result > 0) {
		// set = FieldSet( "Wedding30" ); // OH, this is saveLocation in OdinMS.. never realized that!
		// result = set.enter( target.nCharacterID, 0 );
		if (result == 1) {
			cm.warp(680000300, 0);
		} else if (result == 7) {
			cm.sendOk("I apologize, but the Wedding hasn't started yet. When it does, I'll be sure to let you in. ");
		} else if (result == 8) {
			cm.sendOk("Sorry, but without an invitation, I can't let you in.");
		} else if (result == 9) {
			cm.sendOk("Oh dear, looks like I can't find that information right now...I'm having a bit of trouble with my logbook, please try again later");
		}
		cm.dispose();
	}
	if (result == 0) {
		cm.dispose();
	}
}

PHP:
/**
 * @author: Eric
 *   [USER=806871]NPC[/USER]: Assistant Nancy
 *   [USER=443547]func[/USER]: The Official Nexon MapleStory Assistant Nancy NPC ported from "beginCeremony" Nexon Script.
*/

function start() {
    if (cm.getPlayer().getParty() != null && cm.isWeddingCouple() == 1) {
        // if(inventory.slotCount( 1 ) > inventory.holdCount( 1 ) and inventory.slotCount( 4 ) > inventory.holdCount( 4 )){
		if (cm.canHold(1112803) && cm.canHold(4031424)) {
			cm.sendYesNo( "You two both look fantastic! Are you ready to begin the Wedding Ceremony? ");
		} else {
			cm.sendOk("You need an equip slot and an etc slot open to receive #bthe Ring and the Onyx Chest#k, as soon as you make room, we can begin.");
			cm.dispose();
		}
    } else if (cm.getParty() == null && cm.isWeddingCouple() == 1) {
		cm.sendOk("You both look fantastic!");
		cm.dispose();
	} else {
		cm.sendOk(" Please wait for the ceremony to begin.");
		cm.dispose();
	}
}

function action(mode, type, selection) {
	if (mode < 1) {
		cm.sendOk("Ok, please remember that the ceremony will automatically start 10 minutes after you enter the Cathedral.");
	} else if (mode > 0) { // Completely unknown beyond this point, Nexon runs a serversided function to run the wedding timers and system functions
		if (getCurrentWeddingState() < 0) {
			cm.startMarriage();
		} else {
			cm.sendOk ("Please wait for the ceremony to end");
		}
	}
	cm.dispose();
}

PHP:
/**
 * @author: Eric
 *   [USER=806871]NPC[/USER]: Assistant Bonnie
 *   [USER=443547]func[/USER]: The Official Nexon MapleStory Assistant Bonnie NPC ported from "vegas" Nexon Script.
*/

var v1 = -1;
var v2 = -1;
var result = -1;
var mapid = 680000110; // Vegas Wedding Altar

function start() {
	if (cm.getPlayer().getMapId() == 680000000) {
		cm.sendSimple("I can guide you to the Wedding. Which one suits you?\r\n#b#L0#I am now ready to get Married in Chapel.#l\r\n#L1#I am invited to the wedding!#l#k");
	} else if (cm.getPlayer().getMapId() == 680000100) {
		cm.sendYesNo("Stiff legs, I see. Would you like to head outside and stretch a bit?");
	} else { // impossible unless used in a command or spawned improperly in a map
		cm.dispose();
	}
}

function action(mode, type, selection) {
	if (cm.getPlayer().getMapId() == 680000100) {
		if (mode < 1) {
			cm.sendOk("Well, take a seat. The ceremony should start soon.");
		} else if (mode > 0) {
			cm.warp(680000500, 0); // registerTransferField( 680000500, "" );
			cm.sendOk("Ok, come on back when you're ready. ");
		}
		cm.dispose();
	} else if (cm.getPlayer().getMapId() == 680000000) {
		if (mode != 1 && v1 == -1) {
			cm.dispose();
			return;
		} else if (v1 > -1 && v2 > -1) { // have already selected and incremented action
			if (v2 == 1 && mode < 1) {
				cm.sendOk("Step aside then, there are others ready to go in.");
				cm.dispose();
				return;
			}
		}
		(mode == 1 ? v1++ : v1--);
		if (v1 == 0) {
			v2 = selection;
			if (v2 == 0) {
				if (cm.getPlayer().getParty() == null) {
					cm.sendOk("You need to be in #ba 2-person party with your fiance#k to get married.");
				} else {
					if (cm.haveItem(4031376, 1) || cm.haveItem(4031481, 1)) { // Normal and Premium Receipts 
						if (cm.getPlayer().getClient().getChannelServer().getMapFactory().getMap(mapid).getCharacters().size() > 0) { // TODO: active wedding check hehe
							result = 1;
							cm.sendOk(" Looks like another Wedding has begun, sweetie. When it finishes, I'll be sure to let you in!");
						} else if (cm.getPlayer().getRelationship() <= 0 || cm.getPlayer().getGender() != 0) {
							result = 3;
							cm.sendOk("You need to be in #ba 2-person party with your fiance#k to get married.");
						} else if (cm.getPlayer().getClient().getChannelServer().getPlayerStorage().getCharacterById(cm.getPlayer().getRelationship()) == null) {
							result = 4;
							cm.sendOk("You need to be in #ba 2-person party with your fiance#k to get married.");
						} else if (cm.getPlayer().getClient().getChannelServer().getPlayerStorage().getCharacterById(cm.getPlayer().getRelationship()).getMapId() != cm.getPlayer().getMapId()) {
							result = 2;
							cm.sendOk("You need to be in a 2-person party with your fiance and in #bthe same map#k to get married.");
						} else if (cm.getPartyMembers().size() > 2 || cm.getPlayer().getParty().getMemberById(cm.getPlayer().getRelationship()) == null) {
							result = 5;
							cm.sendOk("You need to be in #ba 2-person party with your fiance#k to get married.");
						} else if (!cm.canHold(1112803)) {
							result = 6;
							cm.sendOk("You need an equip slot open to receive the ring, as soon as you make room, we can begin.");
						} else if (cm.haveItem(4031375, 1) && !cm.haveItem(4031376, 1)) {
							result = 11;
							cm.sendOk("It appears that you've made your reservation at another wedding hall");
						} else if (cm.haveItem(4031380, 1) && !cm.haveItem(4031381, 1)) {
							result = 11;
							cm.sendOk("It appears that you've made your reservation at another wedding hall");
						} else if (!cm.haveItem(4031376, 1) && !cm.haveItem(4031381, 1)) {
							result = 10;
							cm.sendOk ("You have to make a reservation to start the wedding");
						} else {
							result = 0;
							cm.getPlayer().startWedding();
							cm.warpWedding(false);
						}
					} else {
						cm.sendOk("Let's see...I'm sorry, but I don't think you have Reservation ticket with you right now. Without the Reservation Receipt, I'm afraid I can't help you. You'd better talk to Wayne first. Sorry. ");
					}
				}
				cm.dispose();
			} else if (v2 == 1) {
				if (cm.getPlayer().getParty() == null) {
					cm.sendYesNo("Welcome! I can tell that you're a guest of the Bride and Groom, would you like to enter the Chapel?");
				} else {
					cm.sendOk("Oh no, I am sorry, but I cannot let you in since you're in a party with someone. I suggest you leave the party first, and then come back and see me~");
					cm.dispose();
				}
			}
		} else if (v1 == 1) {
			if (cm.haveItem(4031406, 1)) {
				if (cm.getPlayer().getClient().getChannelServer().getMapFactory().getMap(mapid).getCharacters().size() == 0) { // TODO: active wedding check hehe
					// this needs to be a more advanced check, we'll do more checking on invites before getting here :)
					cm.sendOk("I apologize, but the Wedding hasn't started yet. When it does, I'll be sure to let you in. ");
				} else {
					cm.warp(680000100, 0);
				}
				// else if ( result == 9) self.say ("Oh dear, looks like I can't find that information right now...I'm having a bit of trouble with my logbook, please try again later");
			} else {
				cm.sendOk("Sorry, but without an invitation, I can't let you in.");
			}
			cm.dispose();
		}
	}
}

PHP:
/**
 * @author: Eric
 *   [USER=806871]NPC[/USER]: Assistant Jackie
 *   [USER=443547]func[/USER]: The Official Nexon MapleStory Assistant Jackie NPC ported from "beginVagasCeremony" Nexon Script.
*/

function start() {
    if (cm.getPlayer().getParty() != null && cm.isWeddingCouple() == 1) {
        // if(inventory.slotCount( 1 ) > inventory.holdCount( 1 ) and inventory.slotCount( 4 ) > inventory.holdCount( 4 )){
		if (cm.canHold(1112803) && cm.canHold(4031424)) {
			cm.sendYesNo( "You're certainly dressed for the occasion. Are you ready to get this show on the road?");
		} else {
			cm.sendOk("You need an equip slot and an etc slot open to receive #bthe Ring and the Onyx Chest#k, as soon as you make room, we can begin.");
			cm.dispose();
		}
    } else if (cm.getParty() == null && cm.isWeddingCouple() == 1) {
		cm.sendOk("You both look fantastic!");
		cm.dispose();
	} else {
		cm.sendOk(" Please wait for the ceremony to begin.");
		cm.dispose();
	}
}

function action(mode, type, selection) {
	if (mode < 1) {
		cm.sendOk("No problem. Please remember that the ceremony will automatically start 5 minutes after you enter the Chapel.");
	} else if (mode > 0) { // Completely unknown beyond this point, Nexon runs a serversided function to run the wedding timers and system functions
		if (cm.getCurrentWeddingState() < 0) {
			cm.startMarriage();
		} else {
			cm.sendOk ("Please wait for the ceremony to end");
		}
	}
	cm.dispose();
}

PHP:
/**
 * @author: Eric
 *   [USER=806871]NPC[/USER]: Assistant Travis
 *   [USER=443547]func[/USER]: The Official Nexon MapleStory Assistant Travis NPC ported from "waitingChapel" Nexon Script.
*/

var nRet = 0;
var result = 0;

function start() {
    if (cm.getPlayer().getMapId() == 680000100) {
		cm.sendYesNo("Salutations! Would you like to get into the Wedding Hall? ");
    } else if (cm.getPlayer().getMapId() == 680000110) {
		if (cm.getPlayer().getParty() != null && cm.isWeddingCouple() == 1 && cm.getCurrentWeddingState() <= 2) {
			cm.sendOk("You both look fantastic! Please, wait the ceremony to end.");
			cm.dispose();
		} else if (cm.getPlayer().getParty() != null && cm.isWeddingCouple() == 1) {
			nRet = 2;
			cm.sendYesNo("You both look fantastic! Are you ready to go to the Photo Map? ");
		} else if (cm.isWeddingCouple() == 0) {
			nRet = 3;
			cm.sendYesNo("Hi! Would you like to leave the Chapel? ");
		}
	} else if (cm.getPlayer().getMapId() == 680000300) {
		cm.sendOk("Welcome to Cherished Visage Photo Section! On here, we are taking a picture of you and your guests that will allow you to remember your very own Wedding day forever! The picture will be automatically taken after 1 minute timer runs out. So you need to be ready and try out some new poses before it's taken~ To see the picture that was taken, please visit [url=http://dchaosms.net/]D.ChaosMS[/url] for more details.");
		cm.dispose();
	}
}

function action(mode, type, selection) {
	if (cm.getPlayer().getMapId() == 680000100) {
		(mode > 0 ? cm.warp(680000110, 0) : cm.sendOk("Ok, please let me know when you're ready to go in."));
		if (mode > 0)
			cm.sendOk( "Feel free to head inside now. Give my regards to the newlyweds!");
	} else if (cm.getPlayer().getMapId() == 680000110 && nRet == 2) {
		if (mode < 1) {
			cm.sendOk("Ok, please remember that the Photo time will automatically start after the clock stops.");
		} else {
			result = 1; // 7: Wedding hasn't started 8: Without an invitation, can't let you in 9: Database error
			cm.sendNext("Tubular! Snap some nice shots for the Wedding book!");
		}
	} else if (cm.getPlayer().getMapId() == 680000110 && nRet == 3) {
		(mode < 1 ? cm.sendOk("Ok, please let me know when you're ready to go out.") : cm.warp(680000500, 0));
		if (mode > 0)
			cm.sendOk("Ok, I'll show you the way out..."); // result++
	} else if (result > 0) {
		// set = FieldSet( "Wedding30" ); // OH, this is saveLocation in OdinMS.. never realized that!
		// result = set.enter( target.nCharacterID, 0 );
		if (result == 1) {
			cm.warp(680000300, 0);
		} else if (result == 7) {
			cm.sendOk("I apologize, but the Wedding hasn't started yet. When it does, I'll be sure to let you in. ");
		} else if (result == 8) {
			cm.sendOk("Sorry, but without an invitation, I can't let you in.");
		} else if (result == 9) {
			cm.sendOk("Oh dear, looks like I can't find that information right now...I'm having a bit of trouble with my logbook, please try again later");
		}
		cm.dispose();
	}
	if (result == 0) {
		cm.dispose();
	}
}

PHP:
/**
 * @author: Eric
 *   [USER=806871]NPC[/USER]: Wayne
 *   [USER=443547]func[/USER]: The Official Nexon MapleStory Wayne NPC ported from "vegasCoordinator" Nexon Script.
*/

var result = -1;
var v1 = -1;

function start() {
	cm.sendSimple("You are looking lovely today! I'm here to help you prepare for your Wedding. I can help you make a Reservation, get additional Invitations, or tell you what you'll need to get married in our Chapel. What would you like to know?\r\n#b#L0#How can I get married here?#l\r\n#L1#I'd like to make a Premium Reservation.#l\r\n#L2#I'd like to make a Normal Reservation.#l\r\n#L3#I have more guests coming, I'd like some more Invitations.#l#k");
}

function action(m, t, s) {
	if (m <= 0) {
		if (v1 == 3) cm.sendOk("Hmm... let me know when you are ready. I am always here for you!");
		cm.dispose();
		return;
	}
	(m == 1 ? result++ : result--);
	if (result == 0) {
		v1 = s;
		if (v1 == 0) {
			cm.sendOk("To get married in the Chapel, you'll need #ra Chapel Wedding Ticket, any Engagement Ring or an Empty Engagement Ring Box#k and some time. Soon as you have them, we'll be happy to assist with your Wedding plans!");
			cm.dispose();
		} else if (v1 == 1) {
			if (cm.getPlayer().getParty() == null) {
				cm.sendOk("To make a Reservation, you'll need to be grouped with your fiance.. ");
				cm.dispose();
			} else {
				result = 20; // 20 : Premium Chapel
				cm.sendNext( "To make a Reservation, you'll need to be grouped with your fiance and ready to walk down the aisle. Let's book your reservation now. " );
			}
		} else if (v1 == 2) {
			if (cm.getPlayer().getParty() == null) {
				cm.sendOk("To make a Reservation, you'll need to be grouped with your fiance.. ");
				cm.dispose();
			} else {
				result = 21; // 21 : Normal Chapel
				cm.sendNext( "To make a Reservation, you'll need to be grouped with your fiance and ready to walk down the aisle. Let's book your reservation now. " );
			}
		} else if (v1 == 3) {
			if (cm.getPlayer().getParty() == null) {
				cm.sendOk("To receive some more invitations, you'll need to be grouped with your fiance.. ");
				cm.dispose();
			} else {
				result = 10; // 10 : Wedding Invitations
				cm.sendYesNo("Popular, huh? No problem, I can help you with that. Here are a few more. Did you get your #bReservation Receipt and the Wedding Invitation Ticket#k?");
			}
		}
	} else if (result == 21) {
		if (cm.canHold(4031376) && !cm.haveItem(4031376)) {
			if (cm.haveItem(5251002, 1)) {
				// retPos = target.hasRequestedTransferWorld; // TODO: Code world transferring once we fully implement multi-world
				// if ( retPos == 0 ) {
				// result = target.makeReservation(20); // 20 : Premium Chapel
				if (cm.getPlayer().getClient().getChannelServer().getPlayerStorage().getCharacterById(cm.getPlayer().getRelationship()) == null || cm.getPlayer().getGender() != 0) {
					cm.sendOk("You also need to be in a #b2-person party with your fiance#k and in the same map to get married.");
				} else if (cm.getPlayer().getClient().getChannelServer().getPlayerStorage().getCharacterById(cm.getPlayer().getRelationship()).getMapId() != cm.getPlayer().getMapId()) {
					cm.sendOk("You need to be in a 2-person party with your fiance and in #bthe same map#k to get married.");
				} else if (cm.getPartyMembers().size() > 2 || cm.getPlayer().getParty().getMemberById(cm.getPlayer().getRelationship()) == null) {
					cm.sendOk("You also need to be in a 2-person party with #byour fiance#k and in the same map to get married.");
				} else if (cm.haveItem(1112803, 1)) { // TODO: check for reservation id not this lol xD
					cm.sendOk("Sorry... but your wedding reservation is already done.");
				} else if (!isEngaged(cm) || cm.getPlayer().getRelationship() <= 0) {
					cm.sendOk("Please remember that you need #ba Chapel Wedding Ticket, any Engagement Ring or an Empty Engagement Ring Box#k to make a reservation.");
				} else if (!cm.canHold(4031377)) {
					cm.sendOk("You need an etc slot open to receive the Reservation receipt and Invitations, as soon as you make room, we can begin.");
				} else {
					cm.gainItem(5251002, -1);
					cm.makeReservation(20); // 20 : Premium Chapel
					cm.registerMarriage(cm.getPlayer(), cm.getPlayer().getPartner(), 4031406);
				}
				// } else self.say( "Sorry, but you are disabled from getting married." ); 
			} else {
				cm.sendOk(" Looks like you're missing something you need. Please remember that you need #ra Chapel Wedding Ticket, any Engagement Ring or an Empty Engagement Ring Box#k to make a reservation.");
			}
		} else {
			cm.sendOk("You need an etc slot open to receive the Reservation receipt and Invitations, as soon as you make room, we can begin. Additionally, check if you have an old Reservation receipt.");
		}
		cm.dispose();
	} else if (result == 22) {
		if (cm.canHold(4031481) && !cm.haveItem(4031376)) {
			if (cm.haveItem(5251001, 1)) {
				// retPos = target.hasRequestedTransferWorld;
				// if ( retPos == 0 )     {
				// result = target.makeReservation(21); // 21 : Normal Chapel
				if (cm.getPlayer().getClient().getChannelServer().getPlayerStorage().getCharacterById(cm.getPlayer().getRelationship()) == null || cm.getPlayer().getGender() != 0) {
					cm.sendOk("You also need to be in a #b2-person party with your fiance#k and in the same map to get married.");
				} else if (cm.getPlayer().getClient().getChannelServer().getPlayerStorage().getCharacterById(cm.getPlayer().getRelationship()).getMapId() != cm.getPlayer().getMapId()) {
					cm.sendOk("You need to be in a 2-person party with your fiance and in #bthe same map#k to get married.");
				} else if (cm.getPartyMembers().size() > 2 || cm.getPlayer().getParty().getMemberById(cm.getPlayer().getRelationship()) == null) {
					cm.sendOk("You also need to be in a 2-person party with #byour fiance#k and in the same map to get married.");
				} else if (cm.haveItem(1112803, 1)) { // TODO: check for reservation id not this lol xD
					cm.sendOk("Sorry... but your wedding reservation is already done.");
				} else if (!isEngaged(cm) || cm.getPlayer().getRelationship() <= 0) {
					cm.sendOk("Please remember that you need #ba Chapel Wedding Ticket, any Engagement Ring or an Empty Engagement Ring Box#k to make a reservation.");
				} else if (!cm.canHold(4031377)) {
					cm.sendOk("You need an etc slot open to receive the Reservation receipt and Invitations, as soon as you make room, we can begin.");
				} else {
					cm.gainItem(5251001, -1);
					cm.makeReservation(21); // 21 : Normal Chapel
					cm.registerMarriage(cm.getPlayer(), cm.getPlayer().getPartner(), 4031406);
				}
				// } else self.say( "Sorry, but you are disabled from getting married." );
			} else {
				cm.sendOk(" Looks like you're missing something you need. Please remember that you need #ra Chapel Wedding Ticket, any Engagement Ring or an Empty Engagement Ring Box#k to make a reservation.");
			}
		} else {
			cm.sendOk("You need an etc slot open to receive the Reservation receipt and Invitations, as soon as you make room, we can begin. Additionally, check if you have an old Reservation receipt.");
		}
		cm.dispose();
	} else if (result == 11) {
		if (!cm.haveItem(4031376, 1) && !cm.haveItem(4031481, 1)) {
			cm.sendOk("Oh dear, it looks like you're missing #ra Chapel Reservation Receipt#k. I'm afraid I'll have to postpone those invitations for now. When you get one, be sure to return!");
		} else if (cm.haveItem(4031376, 1) && !cm.haveItem(5251100, 1)) {
			cm.sendOk("Oh dear, it looks like you're missing a #rWedding Invitation Ticket#k. I'm afraid I'll have to postpone those invitations for now. When you get one, be sure to return!");
		} else if (cm.haveItem(4031481, 1) && !cm.haveItem(5251100, 1)) { // lol nexon
			cm.sendOk("Oh dear, it looks like you're missing a #rWedding Invitation Ticket#k. I'm afraid I'll have to postpone those invitations for now. When you get one, be sure to return!");
		} else if (cm.haveItem(4031376, 1) && cm.haveItem(5251100, 1)) {
			cm.gainItem(4031377, 10);
			cm.getPlayer().getPartner().gainItem(4031377, 10);
			cm.sendOk("Here you are~");
			/*
				ret = inventory.getAdditionalInvitation;
				if (ret == 0) self.say(" Oh dear, looks like I can't find that information right now...I'm having a bit of trouble with my database, please try again later. Please check your inventory is full and come to see me again!!");
				else self.say("Here you are~");
			*/
		} else if (cm.haveItem(4031481, 1) && cm.haveItem(5251100, 1)) {
			cm.gainItem(4031377, 15);
			cm.getPlayer().getPartner().gainItem(4031377, 15);
			cm.sendOk("Here you are~");
			/*
				ret = inventory.getAdditionalInvitation;
				if (ret == 0) self.say(" Oh dear, looks like I can't find that information right now...I'm having a bit of trouble with my database, please try again later. Please check your inventory is full and come to see me again!!");
				else self.say("Here you are~");
			*/
		}
		cm.dispose();
	}
}

function isEngaged(cm) {
	var engaged = false;
	if (cm.haveItem(5251001, 1) || cm.haveItem(5251002, 1)) {	
		for (var x = 4031357; x <= 4031364; x++ ) {
			if (cm.haveItem(x, 1)) {
				engaged = true;
				break;
			}
		}
	} else {
		engaged = false;
	}
	return engaged;
}

PHP:
/**
 * @author: Eric
 *   [USER=806871]NPC[/USER]: Victoria
 *   [USER=443547]func[/USER]: The Official Nexon MapleStory Victoria NPC ported from "cathedralCoordinator" Nexon Script.
*/

var result = -1;
var v1 = -1;

function start() {
	cm.sendNext("Before I help you make a reservation for the Cathedral Wedding, I strongly recommend that #bboth you and your partner#k need to have at least #b3 Etc. slots#k available. Please check your etc. inventory.");
}

function action(m,t,s) {
	if (m <= 0) {
		cm.dispose();
		return;
	}
	(m == 1 ? result++ : result--);
	if (result == 0) {
		cm.sendSimple("And by the way, I must tell you, you look wonderful today! I'm here to help you prepare for your Wedding. I can help you make a Reservation, get additional Invitations, or tell you what you'll need to get married in our Cathedral. What would you like to know?\r\n#b#L0#How can I get married here?#l\r\n#L1#I'd like to make a Premium Reservation.#l\r\n#L2#I'd like to make a Normal Reservation.#l\r\n#L3#I have more guests coming, I'd like some more Invitations.#l#k");
	} else if (result == 1) {
		v1 = s;
		if (v1 == 0) {
			cm.sendOk( "To get married in the Cathedral, you'll need #ra Cathedral Wedding Ticket, any Engagement Ring or an Empty Engagement Ring Box and most of all, love#k. Soon as you have them, we'll be happy to assist with your Wedding plans! If you reserved the Cathedral don't forget to see High Priest John for the Officiator's permission." );
			cm.dispose();
		} else if (v1 == 1) {
			if (cm.getPlayer().getParty() == null) {
				cm.sendOk("To make a Reservation, you'll need to be grouped with your fiance.. ");
				cm.dispose();
			} else {
				result = 10; // 10 : Premium Cathedral
				cm.sendNext( "Ready to walk down the aisle. Let's book your reservation now." );
			}
		} else if (v1 == 2) {
			if (cm.getPlayer().getParty() == null) {
				cm.sendOk("To make a Reservation, you'll need to be grouped with your fiance.. ");
				cm.dispose();
			} else {
				result = 11; // 11 : Normal Cathedral
				cm.sendNext( "To make a Reservation, you'll need to be grouped with your fiance, engaged, and ready to walk down the aisle. Let's book your reservation now. " );
			}
		} else if (v1 == 3) {
			if (cm.getPlayer().getParty() == null) {
				cm.sendOk("To receive some more invitations, you'll need to be grouped with your fiance.. ");
				cm.dispose();
			} else {
				result = 20; // 20 : Wedding Invitations
				cm.sendYesNo("That's wonderful! I thought you might need a few more, so here you go. Pass them out to many people as you want! Do you get your #bReservation Receipt and the Wedding Invitation Ticket#k?");
			}
		}
	} else if (result == 11) {
		if (cm.canHold(4031375) && !cm.haveItem(4031375) && !cm.haveItem(4031480)) {
			if (cm.haveItem(5251003, 1)) {
				// retPos = target.hasRequestedTransferWorld; // TODO: Code world transferring once we fully implement multi-world
				// if ( retPos == 0 ) {
				// result = target.makeReservation(10); // 10 : Premium Cathedral
				if (cm.getPlayer().getClient().getChannelServer().getPlayerStorage().getCharacterById(cm.getPlayer().getRelationship()) == null || cm.getPlayer().getGender() != 0) {
					cm.sendOk("You also need to be in a #b2-person party with your fiance#k and in the same map to get married.");
				} else if (cm.getPlayer().getClient().getChannelServer().getPlayerStorage().getCharacterById(cm.getPlayer().getRelationship()).getMapId() != cm.getPlayer().getMapId()) {
					cm.sendOk("You need to be in a 2-person party with your fiance and in #bthe same map#k to get married.");
				} else if (cm.getPartyMembers().size() > 2 || cm.getPlayer().getParty().getMemberById(cm.getPlayer().getRelationship()) == null) {
					cm.sendOk("You also need to be in a 2-person party with #byour fiance#k and in the same map to get married.");
				} else if (cm.haveItem(1112803, 1)) { // TODO: check for reservation id not this lol xD
					cm.sendOk("Sorry... but your wedding reservation is already done.");
				} else if (!isEngaged(cm) || cm.getPlayer().getRelationship() <= 0) {
					cm.sendOk("Please remember that you need #ba Cathedral Wedding Ticket, any Engagement Ring or an Empty Engagement Ring Box#k to make a reservation.");
				} else if (!cm.canHold(4031395)) {
					cm.sendOk("You need an etc slot open to receive the Reservation receipt and Invitations, as soon as you make room, we can begin.");
				} else {
					cm.gainItem(5251003, -1);
					cm.makeReservation(10); // 10 : Premium Cathedral
					cm.registerMarriage(cm.getPlayer(), cm.getPlayer().getPartner(), 4031407);
				}
				// } else self.say( "Sorry, but you are disabled from getting married." ); 
			} else {
				cm.sendOk(" Looks like you're missing something you need. Please remember that you need #ra Cathedral Wedding Ticket, any Engagement Ring or an Empty Engagement Ring Box#k to make a reservation.");
			}
		} else {
			cm.sendOk("You need an etc slot open to receive the Reservation receipt and Invitations, as soon as you make room, we can begin. Additionally, check if you have an old Reservation receipt.");
		}
		cm.dispose();
	} else if (result == 12) {
		if (cm.canHold(4031480) && !cm.haveItem(4031480) && !cm.haveItem(4031375)) {
			if (cm.haveItem(5251000, 1)) {
				// retPos = target.hasRequestedTransferWorld;
				// if ( retPos == 0 )     {
				// result = target.makeReservation(11); // 11 : Normal Cathedral
				if (cm.getPlayer().getClient().getChannelServer().getPlayerStorage().getCharacterById(cm.getPlayer().getRelationship()) == null || cm.getPlayer().getGender() != 0) {
					cm.sendOk("You also need to be in a #b2-person party with your fiance#k and in the same map to get married.");
				} else if (cm.getPlayer().getClient().getChannelServer().getPlayerStorage().getCharacterById(cm.getPlayer().getRelationship()).getMapId() != cm.getPlayer().getMapId()) {
					cm.sendOk("You need to be in a 2-person party with your fiance and in #bthe same map#k to get married.");
				} else if (cm.getPartyMembers().size() > 2 || cm.getPlayer().getParty().getMemberById(cm.getPlayer().getRelationship()) == null) {
					cm.sendOk("You also need to be in a 2-person party with #byour fiance#k and in the same map to get married.");
				} else if (cm.haveItem(1112803, 1)) { // TODO: check for reservation id not this lol xD
					cm.sendOk("Sorry... but your wedding reservation is already done.");
				} else if (!isEngaged(cm) || cm.getPlayer().getRelationship() <= 0) {
					cm.sendOk("Please remember that you need #ba Cathedral Wedding Ticket, any Engagement Ring or an Empty Engagement Ring Box#k to make a reservation.");
				} else if (!cm.canHold(4031395)) {
					cm.sendOk("You need an etc slot open to receive the Reservation receipt and Invitations, as soon as you make room, we can begin.");
				} else {
					cm.gainItem(5251000, -1);
					cm.makeReservation(11); // 11 : Normal Cathedral
					cm.registerMarriage(cm.getPlayer(), cm.getPlayer().getPartner(), 4031407);
				}
				// } else self.say( "Sorry, but you are disabled from getting married." );
			} else {
				cm.sendOk(" Looks like you're missing something you need. Please remember that you need #ra Cathedral Wedding Ticket, any Engagement Ring or an Empty Engagement Ring Box#k to make a reservation.");
			}
		} else {
			cm.sendOk("You need an etc slot open to receive the Reservation receipt and Invitations, as soon as you make room, we can begin. Additionally, check if you have an old Reservation receipt.");
		}
		cm.dispose();
	} else if (result == 21) {
		if (!cm.haveItem(4031375, 1) && !cm.haveItem(4031480, 1)) {
			cm.sendOk("Oh dear, it looks like you're missing a Cathedral Reservation Receipt. I'm afraid I'll have to postpone those invitations for now. When you get one, be sure to return!");
		} else if (cm.haveItem(4031375, 1) && !cm.haveItem(5251100, 1)) {
			cm.sendOk("Oh dear, it looks like you're missing #ba Wedding Invitation Ticket#k. I'm afraid I'll have to postpone those invitations for now. When you get one, be sure to return!");
		} else if (cm.haveItem(4031480, 1) && !cm.haveItem(5251100, 1)) { // lol nexon
			cm.sendOk("Oh dear, it looks like you're missing #ba Wedding Invitation Ticket#k. I'm afraid I'll have to postpone those invitations for now. When you get one, be sure to return!");
		} else if (cm.haveItem(4031375, 1) && cm.haveItem(5251100, 1) && cm.canHold(4031395)) {
			cm.gainItem(4031395, 10);
			cm.getPlayer().getPartner().gainItem(4031395, 15);
			cm.sendOk("Here you are~");
		} else if (cm.haveItem(4031480, 1) && cm.haveItem(5251100, 1)) {
			cm.gainItem(4031395, 15);
			cm.getPlayer().getPartner().gainItem(4031395, 15);
			cm.sendOk("Here you are~");
		} else {
			cm.sendOk(" Oh dear, looks like I can't find that information right now...I'm having a bit of trouble with my database, please try again later. Please check your inventory is full and come to see me again!!");
		}
		cm.dispose();
	}
}

function isEngaged(cm) {
	var engaged = false;
	if (cm.haveItem(5251000, 1) || cm.haveItem(5251003, 1)) {	
		for (var x = 4031357; x <= 4031364; x++ ) {
			if (cm.haveItem(x, 1)) {
				engaged = true;
				break;
			}
		}
	} else {
		engaged = false;
	}
	return engaged;
}

PHP:
/**
 * @author: Eric
 *   [USER=806871]NPC[/USER]: 9201014 (Pila Present)
 *   [USER=443547]func[/USER]: Treasure/present exchange
 *   [USER=2000175386]Script[/USER]: The Official Nexon MapleStory Pila Present NPC ported from "presentExchange" Nexon Script.
*/

function start() {
	if (cm.getMapId() == 680000100 || cm.getMapId() == 680000200) {
		cm.sendSimple("Who do you want to give your present for? \r\n#L0#I will give my present for #bhandsome Groom#k.#l\r\n#L1#I will give my present for #bpretty Bride#k.#l");
	} else if (cm.getMapId() == 680000000) {
		cm.dispose();
	} else {
		cm.dispose();
	}
}

function action(m,t,s) {
	if (cm.getMapId() == 680000100 || cm.getMapId() == 680000200) {
		// at the wating room for invited people
		cm.dispose();
	}
}

/*
field = self.field;
inventory = target.inventory;

    if (field.id == 680000100 or field.id == 680000200) {
    // at the wating room for invited people
    v1 = self.askMenu( "Who do you want to give your present for? \r\n#L0#I will give my present for #bhandsome Groom#k.#l\r\n#L1#I will give my present for #bpretty Bride#k.#l" );
        if (v1 == 0){
            ret = target.openWishList( 1, 0 );
            if (ret == 1) self.say ( "There's no wedding currently in progress.");
        }
    if (v1 == 1){
        ret = target.openWishList( 1, 1 );
        if (ret == 1) self.say ( "There's no wedding currently in progress.");
    }    
    }
    else if (field.id == 680000000 ){
    // at the amoria for wedding couple
    v1 = self.askMenu( "How do I help you? \r\n#b#L0#I am about to finish my wedding and want to pick my presents which my friends gave to me.#l\r\n#L1#I have an #rOnyx Chest#k and want to ask for you to open it.#l\r\n#L2#I have an #rOnyx Chest for Bride and Groom#k and want to ask for you to open it.#l#k" );
        if (v1 == 0 and target.nGender == 0 ){
            ret = target.openWishList( 2, 0 );
            if (ret == 2) self.say ( "You are currently not married.");
        }
        if (v1 == 0 and target.nGender == 1 ){
            ret = target.openWishList( 2, 1 );
            if (ret == 2) self.say ( "You are currently not married.");
        }
        if (v1 == 1){
        // Onyx Chest 
        nRet1 = self.askYesNo ( "I've got some fabulous items ready for you. Are you ready to pick them out?" );
        if ( nRet1 != 0 )    {    // answer : Yes        
        if ( inventory.itemCount( 4031423 ) < 1 )    // there's no Onyx Chest
        self.say ( "I don't think you have an Onyx Chest that I can open, kid..." );
        else { // there's Onyx Chest
            if ( inventory.slotCount( 2 ) > inventory.holdCount( 2 ) and inventory.slotCount( 4 ) > inventory.holdCount( 4 ) and inventory.slotCount( 1 ) > inventory.holdCount( 1 ) )
             { // there's  empty slot.
                rn1 = random( 1, 10000 );
                        // opened the onyx chect                        
                if (1 <= rn1 and rn1 <= 2000) {
                ret = inventory.exchange( 0, 4031423, -1, 2022011, 1 );

                if (ret == 1) self.say ( "No problem! Give my best to the happy couple. I'll open this present for you now. Voila! \r\n #v2022011# #b#t2022011# " );
                else self.say("I'm sorry, but I can't give you the present if your inventory is full! Check your inventory and make the necessary adjustments~");                
                }
                else if (2000 < rn1 and rn1 <= 3500)     {
                ret = inventory.exchange( 0, 4031423, -1, 2020020, 1 );
                if (ret == 1) self.say ( "No problem! Give my best to the happy couple. I'll open this present for you now. Voila! \r\n #v2020020# #b#t2020020# " );
                else self.say("I'm sorry, but I can't give you the present if your inventory is full! Check your inventory and make the necessary adjustments~");
                }
                else if (3500 < rn1 and rn1 <= 4700)     {
                ret = inventory.exchange( 0, 4031423, -1, 2022001, 1 );
                if (ret == 1) self.say ( "No problem! Give my best to the happy couple. I'll open this present for you now. Voila! \r\n #v2022001# #b#t2022001# " );
                else self.say("I'm sorry, but I can't give you the present if your inventory is full! Check your inventory and make the necessary adjustments~");
                }
                else if (4700 < rn1 and rn1 <= 5900)     {
                ret = inventory.exchange( 0, 4031423, -1, 2022015, 1 );
                if (ret == 1) self.say ( "No problem! Give my best to the happy couple. I'll open this present for you now. Voila! \r\n #v2022015# #b#t2022015# " );
                else self.say("I'm sorry, but I can't give you the present if your inventory is full! Check your inventory and make the necessary adjustments~");
                }
                else if (5900 < rn1 and rn1 <= 7100)     {
                ret = inventory.exchange( 0, 4031423, -1, 2012001, 1 );
                if (ret == 1) self.say ( "No problem! Give my best to the happy couple. I'll open this present for you now. Voila! \r\n #v2012001# #b#t2012001# " );
                else self.say("I'm sorry, but I can't give you the present if your inventory is full! Check your inventory and make the necessary adjustments~");
                }
                else if (7100 < rn1 and rn1 <= 8000) {
                ret = inventory.exchange( 0, 4031423, -1, 2020015, 1 );
                if (ret == 1) self.say ( "No problem! Give my best to the happy couple. I'll open this present for you now. Voila! \r\n #v2020015# #b#t2020015# " );
                else self.say("I'm sorry, but I can't give you the present if your inventory is full! Check your inventory and make the necessary adjustments~");
                }            
                else if (8000 < rn1 and rn1 <= 8900) {
                ret = inventory.exchange( 0, 4031423, -1, 2022000, 1 );
                if (ret == 1) self.say ( "No problem! Give my best to the happy couple. I'll open this present for you now. Voila! \r\n #v2022000# #b#t2022000# " );
                else self.say("I'm sorry, but I can't give you the present if your inventory is full! Check your inventory and make the necessary adjustments~");
                }
                else if (8900 < rn1 and rn1 <= 9400) {
                ret = inventory.exchange( 0, 4031423, -1, 2002011, 1 );
                if (ret == 1) self.say ( "No problem! Give my best to the happy couple. I'll open this present for you now. Voila! \r\n #v2002011# #b#t2002011# " );
                else self.say("I'm sorry, but I can't give you the present if your inventory is full! Check your inventory and make the necessary adjustments~");
                }            
                else if (9400 < rn1 and rn1 <= 9670) {
                ret = inventory.exchange( 0, 4031423, -1, 4021007, 1 );
                if (ret == 1) self.say ( "No problem! Give my best to the happy couple. I'll open this present for you now. Voila! \r\n #v4021007# #b#t4021007# " );
                else self.say("I'm sorry, but I can't give you the present if your inventory is full! Check your inventory and make the necessary adjustments~");
                }            
                else if (9670 < rn1 and rn1 <= 9770) {
                ret = inventory.exchange( 0, 4031423, -1, 2001002, 1 );
                if (ret == 1) self.say ( "No problem! Give my best to the happy couple. I'll open this present for you now. Voila! \r\n #v2001002# #b#t2001002# " );
                else self.say("I'm sorry, but I can't give you the present if your inventory is full! Check your inventory and make the necessary adjustments~");
                }            
                else if (9770 < rn1 and rn1 <= 9870) {
                ret = inventory.exchange( 0, 4031423, -1, 2048001, 1 );
                if (ret == 1) self.say ( "No problem! Give my best to the happy couple. I'll open this present for you now. Voila! \r\n #v2048001# #b#t2048001# " );
                else self.say("I'm sorry, but I can't give you the present if your inventory is full! Check your inventory and make the necessary adjustments~");
                }            
                else if (9870 < rn1 and rn1 <= 9920) {
                ret = inventory.exchange( 0, 4031423, -1, 4021008, 1 );
                if (ret == 1) self.say ( "No problem! Give my best to the happy couple. I'll open this present for you now. Voila! \r\n #v4021008# #b#t4021008# " );
                else self.say("I'm sorry, but I can't give you the present if your inventory is full! Check your inventory and make the necessary adjustments~");
                }            
                else if (9920 < rn1 and rn1 <= 9945) {
                ret = inventory.exchange( 0, 4031423, -1, 1102024, 1 );
                if (ret == 1) self.say ( "No problem! Give my best to the happy couple. I'll open this present for you now. Voila! \r\n #v1102024# #b#t1102024# " );
                else self.say("I'm sorry, but I can't give you the present if your inventory is full! Check your inventory and make the necessary adjustments~");
                }            
                else if (9945 < rn1 and rn1 <= 9965) {
                ret = inventory.exchange( 0, 4031423, -1, 2041007, 1 );
                if (ret == 1) self.say ( "No problem! Give my best to the happy couple. I'll open this present for you now. Voila! \r\n #v2041007# #b#t2041007# " );
                else self.say("I'm sorry, but I can't give you the present if your inventory is full! Check your inventory and make the necessary adjustments~");
                }            
                else if (9965 < rn1 and rn1 <= 9985) {
                ret = inventory.exchange( 0, 4031423, -1, 2041010, 1 );
                if (ret == 1) self.say ( "No problem! Give my best to the happy couple. I'll open this present for you now. Voila! \r\n #v2041010# #b#t2041010# " );
                else self.say("I'm sorry, but I can't give you the present if your inventory is full! Check your inventory and make the necessary adjustments~");
                }            
                else if (9985 < rn1 and rn1 <= 9990) {
                ret = inventory.exchange( 0, 4031423, -1, 4011007, 1 );
                if (ret == 1) self.say ( "No problem! Give my best to the happy couple. I'll open this present for you now. Voila! \r\n #v4011007# #b#t4011007# " );
                else self.say("I'm sorry, but I can't give you the present if your inventory is full! Check your inventory and make the necessary adjustments~");
                }            
                else if (9990 < rn1 and rn1 <= 9995) {
                ret = inventory.exchange( 0, 4031423, -1, 4021009, 1 );
                if (ret == 1) self.say ( "No problem! Give my best to the happy couple. I'll open this present for you now. Voila! \r\n #v4021009# #b#t4021009# " );
                else self.say("I'm sorry, but I can't give you the present if your inventory is full! Check your inventory and make the necessary adjustments~");
                }            
                else if (9995 < rn1 and rn1 <= 9998) {
                ret = inventory.exchange( 0, 4031423, -1, 2000004, 1 );
                if (ret == 1) self.say ( "No problem! Give my best to the happy couple. I'll open this present for you now. Voila! \r\n #v2000004# #b#t2000004# " );
                else self.say("I'm sorry, but I can't give you the present if your inventory is full! Check your inventory and make the necessary adjustments~");
                }            
                else if (9998 < rn1 and rn1 <= 10000) {
                ret = inventory.exchange( 0, 4031423, -1, 2000005, 1 );
                if (ret == 1) self.say ( "No problem! Give my best to the happy couple. I'll open this present for you now. Voila! \r\n #v2000005# #b#t2000005# " );
                else self.say("I'm sorry, but I can't give you the present if your inventory is full! Check your inventory and make the necessary adjustments~");
                }                                
            } 
            else // there's no empty slot.
                self.say("I'm sorry, but I can't open and give you this present if your inventory is full! Check your inventory and make the necessary adjustments~"); 
            
        }
        }    
        else // answer : No
        self.say ( "Awww, really? I'm the only one who can open your Onyx Chest! I will be here and wait for you~" );
        }
        if (v1 == 2){
        // Onyx Chest 
        nRet1 = self.askYesNo ( "I've got some fabulous items ready for you. Are you ready to pick them out?" );
        if ( nRet1 != 0 )    {    // answer : Yes        
        if ( inventory.itemCount( 4031424 ) < 1 )    // there's no Onyx Chest
        self.say ( "I don't think you have an #rOnyx Chest for Bride and Groom#k that I can open, kid..." );
        else { // there's Onyx Chest
            if ( inventory.slotCount( 2 ) > inventory.holdCount( 2 ) )
             { // there's  empty slot.
                rn1 = random( 1, 1000 );
                        // opened the onyx chect                        
                if (1 <= rn1 and rn1 <= 190) {
                ret = inventory.exchange( 0, 4031424, -1, 2000006, 1 );
                if (ret == 1) self.say ( "No problem! Give my best to the happy couple. I'll open this present for you now. Voila! \r\n #v2000006# #b#t2000006# " );
                else self.say("I'm sorry, but I can't give you the present if your inventory is full! Check your inventory and make the necessary adjustments~");                
                }
                else if (190 < rn1 and rn1 <= 390)     {
                ret = inventory.exchange( 0, 4031424, -1, 2000005, 1 );
                if (ret == 1) self.say ( "No problem! Give my best to the happy couple. I'll open this present for you now. Voila! \r\n #v2000005# #b#t2000005# " );
                else self.say("I'm sorry, but I can't give you the present if your inventory is full! Check your inventory and make the necessary adjustments~");
                }
                else if (390 < rn1 and rn1 <= 499)     {
                ret = inventory.exchange( 0, 4031424, -1, 2000004, 1 );
                if (ret == 1) self.say ( "No problem! Give my best to the happy couple. I'll open this present for you now. Voila! \r\n #v2000004# #b#t2000004# " );
                else self.say("I'm sorry, but I can't give you the present if your inventory is full! Check your inventory and make the necessary adjustments~");
                }
                else if (499 < rn1 and rn1 <= 599)     {
                ret = inventory.exchange( 0, 4031424, -1, 2022123, 2 );
                if (ret == 1) self.say ( "No problem! Give my best to the happy couple. I'll open this present for you now. Voila! \r\n 2 #v2022123# #b#t2022123# " );
                else self.say("I'm sorry, but I can't give you the present if your inventory is full! Check your inventory and make the necessary adjustments~");
                }
                else if (599 < rn1 and rn1 <= 619)     {
                ret = inventory.exchange( 0, 4031424, -1, 1102021, 1 );
                if (ret == 1) self.say ( "No problem! Give my best to the happy couple. I'll open this present for you now. Voila! \r\n #v1102021# #b#t1102021# " );
                else self.say("I'm sorry, but I can't give you the present if your inventory is full! Check your inventory and make the necessary adjustments~");
                }
                else if (619 < rn1 and rn1 <= 639) {
                ret = inventory.exchange( 0, 4031424, -1, 1102024, 1 );
                if (ret == 1) self.say ( "No problem! Give my best to the happy couple. I'll open this present for you now. Voila! \r\n #v1102024# #b#t1102024# " );
                else self.say("I'm sorry, but I can't give you the present if your inventory is full! Check your inventory and make the necessary adjustments~");
                }            
                else if (639 < rn1 and rn1 <= 689) {
                ret = inventory.exchange( 0, 4031424, -1, 2022121, 2 );
                if (ret == 1) self.say ( "No problem! Give my best to the happy couple. I'll open this present for you now. Voila! \r\n 2 #v2022121# #b#t2022121# " );
                else self.say("I'm sorry, but I can't give you the present if your inventory is full! Check your inventory and make the necessary adjustments~");
                }
                else if (689 < rn1 and rn1 <= 699) {
                ret = inventory.exchange( 0, 4031424, -1, 1032027, 1 );
                if (ret == 1) self.say ( "No problem! Give my best to the happy couple. I'll open this present for you now. Voila! \r\n #v1032027# #b#t1032027# " );
                else self.say("I'm sorry, but I can't give you the present if your inventory is full! Check your inventory and make the necessary adjustments~");
                }
                else if (699 < rn1 and rn1 <= 774) {
                ret = inventory.exchange( 0, 4031424, -1, 2041022, 1 );
                if (ret == 1) self.say ( "No problem! Give my best to the happy couple. I'll open this present for you now. Voila! \r\n #v2041022# #b#t2041022# " );
                else self.say("I'm sorry, but I can't give you the present if your inventory is full! Check your inventory and make the necessary adjustments~");
                }
                else if (774 < rn1 and rn1 <= 849) {
                ret = inventory.exchange( 0, 4031424, -1, 2041019, 1 );
                if (ret == 1) self.say ( "No problem! Give my best to the happy couple. I'll open this present for you now. Voila! \r\n #v2041019# #b#t2041019# " );
                else self.say("I'm sorry, but I can't give you the present if your inventory is full! Check your inventory and make the necessary adjustments~");
                }
                else if (849< rn1 and rn1 <= 924) {
                ret = inventory.exchange( 0, 4031424, -1, 2041016, 1 );
                if (ret == 1) self.say ( "No problem! Give my best to the happy couple. I'll open this present for you now. Voila! \r\n #v2041016# #b#t2041016# " );
                else self.say("I'm sorry, but I can't give you the present if your inventory is full! Check your inventory and make the necessary adjustments~");
                }                
                else if (924< rn1 and rn1 <= 999) {
                ret = inventory.exchange( 0, 4031424, -1, 2041013, 1 );
                if (ret == 1) self.say ( "No problem! Give my best to the happy couple. I'll open this present for you now. Voila! \r\n #v2041013# #b#t2041013# " );
                else self.say("I'm sorry, but I can't give you the present if your inventory is full! Check your inventory and make the necessary adjustments~");
                }
                else if (999 < rn1 and rn1 <= 1000) {
                ret = inventory.exchange( 0, 4031424, -1, 1082148, 1 );
                if (ret == 1) self.say ( "No problem! Give my best to the happy couple. I'll open this present for you now. Voila! \r\n #v1082148# #b#t1082148# " );
                else self.say("I'm sorry, but I can't give you the present if your inventory is full! Check your inventory and make the necessary adjustments~");
                }                                        
            } 
            else // there's no empty slot.
                self.say("I'm sorry, but I can't open and give you this present if your inventory is full! Check your inventory and make the necessary adjustments~"); 
        }
        }    
        else // answer : No
        self.say ( "Awww, really? I'm the only one who can open your Onyx Chest! I will be here and wait for you~" );
        }    
}*/

PHP:
/** 
 * @author: Eric
 *   [USER=806871]NPC[/USER]: Robin the Huntress
 *   [USER=443547]func[/USER]: The Official Nexon MapleStory Robin The Huntress NPC ported from "weddingParty" Nexon Script.
*/

function start() {
	if (cm.getPlayer().getMapId() == 680000300) {
		if (cm.isWeddingCouple() == 1) { // if ( target.isWeddingCouple == 1 ) {
			if (cm.haveItem(4031375, 1) || cm.haveItem(4031376, 1)) {
				cm.sendOk("For your first minute, the wedding photo will be taken automatically. From there, five more minutes will be given to you and your friends to just hang around. When all that is over, your Premium Hunting Event is awaiting you just around the corner! Hang on tight and be ready to fight some monsters before time runs out!");
			} else {
				cm.sendOk(" Congratulations~ "); // self.say (" Congratulations~ ");
			}			
		} else {
			cm.sendOk(" Let's enjoy the party!~ "); // self.say( " Let's enjoy the party!~ ");
		}
		cm.dispose();
	} else if (cm.getPlayer().getMapId() == 680000400) {
		if (!cm.haveItem(4031409, 5)) {
			cm.sendOk(" Hmm, looks like you're not done collecting keys. Come back when you've got five! "); // if ( inventory.itemCount( 4031409 ) < 5 ) self.say(" Hmm, looks like you're not done collecting keys. Come back when you've got five! ");
		} else {
			// if( ret == 0) self.say("Oh dear, looks like I can't find that information right now...I'm having a bit of trouble with my database, please try again later!!!");
			cm.gainItem(4031409, -5); // ret = inventory.exchange(0, 4031409, -1, 4031409, -1, 4031409, -1, 4031409, -1, 4031409, -1);
			cm.warp(680000401, 0); // registerTransferField( 680000401, "" );
			cm.sendNext(" There's only one place I've seen those keys unlock. You're more than worthy having obtained it, head on inside and do your best!");
		}
		cm.dispose();
	} else if (cm.getPlayer().getMapId() == 680000401) {
		cm.sendYesNo("Do you want to go back outside?");
	}
}  

function action(mode, type, selection) {
	if (mode < 1) {
        cm.sendOk("Ok, please let me know when you're ready to go!");
    } else if (mode > 0) {
		if (cm.getPlayer().getMapId() == 680000401) {
			cm.warp(680000500, 0);
		}
		cm.sendOk("Ok, I'll show you the way out. Have fun out there!"); // TODO: real results
	}
	cm.dispose();
}

PHP:
/**
 * @author: Eric
 *   [USER=806871]NPC[/USER]: 9201022 (Thomas Swift)
 *   [USER=2000175386]Script[/USER]: The Official Nexon MapleStory Thomas Swift NPC ported from "Thomas" Nexon Script.
*/

function start() {
	cm.sendYesNo(cm.getMapId() == 680000000 ? "I can take you back to your original location. Are you ready to go?" : "I can take you to the Amoria Village. Are you ready to go?");
}

function action(m, t, s) {
	// var nRet;
	if (m > 0) {
		cm.warp(cm.getMapId() == 680000000 ? 100000000 : 680000000); // registerTransferField( 680000000, "" );
		cm.sendOk("I hope you had a great time! See you around!"); // nexon sends before warp, but we don't want to use status :/
	} else
		cm.sendOk("Ok, feel free to hang around until you're ready to go!");
	cm.dispose();
}

If you still wish to code the Wedding scripts yourself, here is Nexon's Wedding script:
PHP:
module "standard.s";

//******* Wedding: Engagement Ring 8809
script "EngageRing" {
  //choose making a ring or divorce
  //choosemenu = self.askMenu("Have you found true love? If so, I can make you a ring worthy of your devotion...\r\n#b#L0#I would like to make an engagement ring for my lover.#l#k");
  choosemenu = self.askMenu("Have you found true love? If so, I can make you a ring worthy of your devotion...\r\n#b#L0#I would like to make an engagement ring for my lover.\r\n#L1#I want an annulment.#l#k");
  
  
// \r\n#L1#I want an annulment.
  cTime = currentTime;
  inventory = target.inventory;
  if ( choosemenu == 0 ) {
    // if female user clicks to make a ring
    if (target.nGender == 1) self.say ( "Let's see... I only make rings for guys who want to get married.");
    // if a user whose level is less than 10 clicks to make a ring
    else if ( target.nLevel < 10 )    self.say ( "Let's see... I don't think you are strong enough. You'll have to be at least #bLevel 10#k to get married." );
    else {
         qr = target.questRecord;
        val = qr.get( 8809 );
        count = 0;
        j=0;
        
        if (val == "end" ) {
        // if a user who got Engagement ring 
            self.say( "Hey, I've already given you an engagement ring already!");
            qr.set( 8844, cTime );
        }
        else if (val == "ing"){
            for ( i = 0..5 ) {
            nItem = inventory.itemCount( 4031367 + i );
            if (nItem > 0) count = count + 1;
            }
            // if a user comes without enough (4) "proof of love"s.
            if (count < 4) self.say("Looks like you're not quite done. If you want that ring, you'd better hurry and get me the following all materials to make an engagement ring. I need you to bring me #b4 Proof of Love#k from Nana.");
            else {
                // if a user comes with enough "proof of love"s.
                self.say ("Wow, I am impressed! Your mate is a very lucky person to have someone so willing to prove their love. I am honored to make you an engagement ring.");
                // explanation
                self.say ("You need the following raw materials to make an engagement ring.\r\n#b#eMoonstone Ring:#k\r\n #v4011007# #t4011007# 1, #v4021007# #t4021007# 1, 30,000 Meso \r\n#b#eStar gem ring:#k\r\n #v4021009# #t4021009# 1, #v4021007# #t4021007# 1, 20,000 Meso \r\n#b#eGolden Heart Ring:#k\r\n #v4011006# #t4011006# 1, #v4021007# #t4021007# 1, 10,000 Meso \r\n#b#eSilver Swan Ring:#k\r\n #v4011004# #t4011004# 1, #v4021007# #t4021007# 1, 5,000 Meso");
                // choose a ring
                v1 = self.askMenu(" What kind would you like?\r\n#b#L0##v2240000# #t2240000##l\r\n#L1##v2240001# #t2240001##l\r\n#L2##v2240002# #t2240002##l\r\n#L3##v2240003# #t2240003##l\r\n#L4#I don't want to pick one right now.#l#k");
            
                if ( v1 == 0 ) {        // moonrock
                ret = inventory.exchange( -30000, 4011007, -1, 4021007, -1, 2240000, 1);
                    // if a user doesn't fulfill items to make a ring 
                    if ( ret == 0 ) self.say( "Looks like you're not quite done. If you want that ring, you'd better hurry!" );
                else {
                if (count==4){
                     while ( count > 0 ){
                      num = 4031367 + j;
                      nItem = inventory.itemCount(num);
                       if (nItem > 0) {
                        count = count - 1;
                        ret= inventory.exchange(0,num, -1);
                    
                       }
                     j=j+1;
                     }
                    }

                if (count==5){
                     while ( count > 1 ){
                      num = 4031367 + j;
                      nItem = inventory.itemCount(num);
                       if (nItem > 0) {
                        count = count - 1;
                        ret= inventory.exchange(0,num, -1);
                    
                       }
                     j=j+1;
                     }
                }

                if (count==6){
                     while ( count > 2 ){
                      num = 4031367 + j;
                      nItem = inventory.itemCount(num);
                       if (nItem > 0) {
                        count = count - 1;
                        ret= inventory.exchange(0,num, -1);
                    
                       }
                     j=j+1;
                     }
                }
                // user succeeded to get a moonrock engagement ring
    
                qr.set( 8809, "end" );
                target.incEXP (2360, 0);
                self.say( "Here is your well-earned, hand-crafted engagement ring. It is worthy of the love shared between the both of you-I hope she accepts your proposal. It always pleases me to help two lovebirds. Good luck!");        
                  }
                  }
                //same structure with moonrock ring script. please, check with it.
                else if ( v1 == 1 ) {    //starrock
                ret = inventory.exchange( -20000, 4021009, -1, 4021007, -1, 2240001, 1);
                    if ( ret == 0 ) self.say( "Looks like you're not quite done. If you want that ring, you'd better hurry!" );
                else {
                if (count==4){
                 while ( count > 0 ){
                  num = 4031367 + j;
                  nItem = inventory.itemCount(num);
                   if (nItem > 0) {
                    count = count - 1;
                    ret= inventory.exchange(0,num, -1);
                
                   }
                 j=j+1;
                 }
                }

                if (count==5){
                 while ( count > 1 ){
                  num = 4031367 + j;
                  nItem = inventory.itemCount(num);
                   if (nItem > 0) {
                    count = count - 1;
                    ret= inventory.exchange(0,num, -1);
                
                   }
                 j=j+1;
                 }
                }

                if (count==6){
                 while ( count > 2 ){
                  num = 4031367 + j;
                  nItem = inventory.itemCount(num);
                   if (nItem > 0) {
                    count = count - 1;
                    ret= inventory.exchange(0,num, -1);
                
                   }
                 j=j+1;
                 }
                }
                
                  qr.set( 8809, "end" );
                target.incEXP (2360, 0);
                self.say( "Here is your well-earned, hand-crafted engagement ring. It is worthy of the love shared between the both of you-I hope she accepts your proposal. It always pleasures me to help two lovebirds. Good luck!");

                  }
                  }
                //same structure with moonrock ring script. please, check with it.
                else if ( v1 == 2 ) {    //gold
                ret = inventory.exchange( -10000, 4011006, -1, 4021007, -1, 2240002, 1);
                    if ( ret == 0 ) self.say( "Looks like you're not quite done. If you want that ring, you'd better hurry!" );

                else {
                if (count==4){
                 while ( count > 0 ){
                  num = 4031367 + j;
                  nItem = inventory.itemCount(num);
                   if (nItem > 0) {
                    count = count - 1;
                    ret= inventory.exchange(0,num, -1);
                
                   }
                 j=j+1;
                 }
                }

                if (count==5){
                 while ( count > 1 ){
                  num = 4031367 + j;
                  nItem = inventory.itemCount(num);
                   if (nItem > 0) {
                    count = count - 1;
                    ret= inventory.exchange(0,num, -1);
                
                   }
                 j=j+1;
                 }
                }

                if (count==6){
                 while ( count > 2 ){
                  num = 4031367 + j;
                  nItem = inventory.itemCount(num);
                   if (nItem > 0) {
                    count = count - 1;
                    ret= inventory.exchange(0,num, -1);
                
                   }
                 j=j+1;
                 }
                }
                qr.set( 8809, "end" );
                target.incEXP (2360, 0);
                  self.say( "Here is your well-earned, hand-crafted engagement ring. It is worthy of the love shared between the both of you-I hope she accepts your proposal. It always pleasures me to help two lovebirds. Good luck!");
                  }
                      }
                //same structure with moonrock ring script. please, check with it.
                else if ( v1 == 3 ) {    //silver
                ret = inventory.exchange( -5000, 4011004, -1, 4021007, -1, 2240003, 1);
                    if ( ret == 0 ) self.say( "Looks like you're not quite done. If you want that ring, you'd better hurry!" );
                else {
                if (count==4){
                 while ( count > 0 ){
                  num = 4031367 + j;
                  nItem = inventory.itemCount(num);
                   if (nItem > 0) {
                    count = count - 1;
                    ret= inventory.exchange(0,num, -1);
                
                   }
                 j=j+1;
                 }
                }

                if (count==5){
                 while ( count > 1 ){
                  num = 4031367 + j;
                  nItem = inventory.itemCount(num);
                   if (nItem > 0) {
                    count = count - 1;
                    ret= inventory.exchange(0,num, -1);
                
                   }
                 j=j+1;
                 }
                }

                if (count==6){
                 while ( count > 2 ){
                  num = 4031367 + j;
                  nItem = inventory.itemCount(num);
                   if (nItem > 0) {
                    count = count - 1;
                    ret= inventory.exchange(0,num, -1);
                
                   }
                 j=j+1;
                 }
                }
        
                      qr.set( 8809, "end" );
                    target.incEXP(2360, 0);
                    self.say( "Here is your well-earned, hand-crafted engagement ring. It is worthy of the love shared between the both of you-I hope she accepts your proposal. It always pleasures me to help two lovebirds. Good luck!");
                      }
                  }
                else if ( v1 == 4 )     // no
                self.say( "Ok, feel free to return at anytime and I will give you the ring you want.");
            }
        }
        else {
        nRet = self.askYesNo("So you want a special ring, eh? Well you've come to the right guy. My rings are for those who want to truly prove their love. Are you up for that?");
            if(nRet!=0) {
            self.say( "Ok, you look like one who is devoted to their mate. I need you to bring me 4 Proof of Love from Nana. She뭩 special, and the only one I can trust in this world. If she can see the true depth of your feelings, she will hand you a Proof of Love." );
            self.say( "Bring me four and I will make you an engagement ring to make you both smile on your wedding day. Please remember, if you뭭e recently had an Annulment, you뭠l need to wait 7 days before I can make you a new Wedding ring! Speak with Nana to prove your love, and come back when you뭨e ready for the ring that fits best!" );            
            valT = qr.get( 8844 );
                        
            aTime = compareTime( cTime, valT );
            
            if ( aTime >= 10080 ) qr.set( 8809, "ing" );
            else self.say( "Hey, I've given you an engagement ring once! Why do you need another one now? If you broke your engagement this fast, that's too bad but to me, this means you need to learn to be patient and serious about engagements. Come back when you are really ready for this.");
            }
            else self.say( "Are you sure? Maybe you haven't found that special someone yet. That's alright. I'll be here if you need me~" );
        }
       }

  }
  if ( choosemenu == 1 ) {
   
     state = target.IsMarried;
     if (state == 1) {
            qr = target.questRecord;
            val = qr.get( 8818 );                    // Divorce Quest 
            if (val == "end" )                        // if a user is single - after divorce (single)
                self.say( "Humm...Being alone can be a good thing. Good things come to those who wait." );
            else if (val == "ing"){
            // divorce procedures succeed    
                if (target.nMoney < 500000) 
                    self.say( "Looks like your wallet is a little too light for me to break that ring. When you get enough credits, head back here and I can help you out." );
                else {
                    ret = target.divorce;
                    if (ret == 0) 
                        self.say( "It looks like you haven't married yet. I don't have anything to talk to you about this." );
                    else    {     // Divorce Quest end
                        target.incMoney(-500000, 1);
                        qr.set( 8818, "end" );
                        self.say ("All done... remember to head back to Amoria if you find true love!"); 
                    }
                }
            }
                
               
            else {                                // explanation - if a user isn't single. divorce procedure available.
                if (inventory.itemCount(1112803)==0 and inventory.itemCount(1112806)==0 and inventory.itemCount(1112807)==0 and inventory.itemCount(1112809)==0) self.say("The only way for a married couple to annul the marriage is by destroying their Wedding rings, and that's where I come in. If you are really sure of breaking this eternal bond, then please remove the rings from your hand, and then let me know.");            
                else{
                nRet = self.askYesNo("How unfortunate. I can end your marriage via annulment by breaking your ring, but please remember you will no longer be married after this. My annulment fee for marriage is 500,000 mesos. As you know, I don't take checks. Are you sure you want to get your marriage annulled?");
                if(nRet!=0) {    // a user wants to divorce
                    self.say( "Ok, I can see you've thought about this, but I want you to be clear. You will no longer be married, nor receive any of the boons associated with marriage. Are you positive that you want to get your marriage annulled?" );
                    qr.set( 8818, "ing" );
                }
                else    // a user doesn't want to divorce
                    self.say( "Fair enough. I can do it anytime, provided you're ready to go through with it. Come back if you change your mind." );
                }
            }
      }  
    else self.say( "It looks like you haven't married yet. I don't have anything to talk to you about this." );
    }
}

//******* Wedding: Engagement Ring - Proof of Love(Henesys) 8810
script "ProofHene" {

    inventory = target.inventory;
    qr = target.questRecord;
    pre_val = qr.get(8809);        // Wedding: Engagement Ring (Moony)
    pre_val2 = qr.get(8816);    // Wedding: Meet the Parents    
    val = qr.get( 8810 );        // Wedding: Engagement Ring - Proof of Love(Henesys) 

    if( target.nGender == 0 and pre_val != "ing" )     // if a male user who doesn't accept Moony's engagement quest clicks nana
        self.say ("Nice to meet you! I am Nana the Fairy from Amoria. I am waiting for you to prove your devotion to your loved one by obtaining a Proof of Love! To start, you'll have to venture to Amoria to find my good friend, Moony the Ringmaker. Even if you are not interested in marriage yet, Amoria is open for everyone! Go visit Thomas Swift at Henesys to head to Amoria If you are interested in weddings, be sure to speak with Ames the Wise once you get there!");
        
    else if (target.nGender == 1 and pre_val2 != "ing")     // if a female user who doesn't accept meet the parents quest clicks nana.
        self.say("Nice to meet you! I'm Nana the Fairy from Amoria. Amoria is a beautiful town full of passion and adventure that everyone can enjoy! Go visit Thomas Swift at Henesys to visit Amoria. If you are interested in weddings, be sure to speak with Ames the Wise once you get there!");  

    else { // target.nGender == 1 and pre_val2 == "ing" or target.nGender == 0 and pre_val == "ing"

            if (val == "end" )    {            // if a user already finished the 1st nana quest
        
                nItem = inventory.itemCount(4031367);
                if (nItem == 0) {            // if a user lost the item
                    self.say( "Oh no, did you lose the Proof of Love? Luckily I have some extra here with me. I'll give you another one. Please don't lose it this time!" );
                    ret = inventory.exchange( 0, 4031367, 1);
                    if (ret != 0) 
                        self.say( "Now you earned a Proof of Love!" );
                    else self.say("I'm sorry but I keep having trouble putting an item into your inventory. Please check back with me later."); 
                }
                else    self.say( "Excellent work! You earned a Proof of Love!" );    
            }
            
            else if (val == "ing")    {
                nItem = inventory.itemCount(4000001);
                
                  if (target.nGender == 0 and nItem < 50)     //if a man user doesn't get 50 Orange Mushroom Cap
                    self.say("Not quite complete yet... Please come back with #b50 Orange Mushroom Caps#k. I'll need everything if I'm to convince Moony that you're in love.");
                    
                else if (target.nGender == 1 and nItem < 50)     //if a woman user doesn't get 50 Orange Mushroom Cap
                    self.say("Not quite complete yet... Please come back with #b50 Orange Mushroom Caps#k. I'll need everything if I'm to be convinced you're in love.");
                
                else {
                        if (target.nGender == 0) {    // a man quest finished 
                           nRet = self.askYesNo( "Fantastic! Now that I know that you are truly in love, I have this item that should prove it. This is the Proof of Love, the item that represents the true love you share with your lover. Would you like to receive this item?");
                           if ( nRet != 0 )     {        // reward
                                self.say("Great. This should help convince Moony that you are devoted to your lover. I hope everything goes well with your wedding!");
                                
                                ret = inventory.exchange( 0, 4000001, -50, 4031367, 1);
                                if (ret != 0)     {
                                    qr.set( 8810, "end" );
                                    target.incEXP(500, 0);
                                }
                                else self.say("I'm sorry but I keep having trouble putting an item into your inventory. Please check back with me later.");                 
                            }
                            else     self.say("Really? Without that item, it may be difficult for you to convince Moony of your true love. Please reconsider.");
                           
                          }
                        if (target.nGender == 1)    { // a woman quest finished 
                            nRet = self.askYesNo( "Fantastic! Now that I know that you are truly in love, I have this item that should prove it. This is the Proof of Love, the item that represents the true love you share with your lover. Would you like to receive this item?");
                            if ( nRet != 0 )     {    // reward
                                self.say("Great. This should help convince the parents that you are devoted to your lover. I hope everything goes well with your wedding!");                        
                                
                                ret = inventory.exchange( 0, 4000001, -50, 4031367, 1);
                                if (ret != 0)     {
                                    qr.set( 8810, "end" );
                                    target.incEXP(500, 0);
                                }
                                else self.say("I'm sorry but I keep having trouble putting an item into your inventory. Please check back with me later.");                 
                            }
                            else     self.say("Really? Without that item, it may be difficult for you to convince Moony of your true love. Please reconsider.");
                        }
                            
                }
            }
            else {
                if(target.nGender == 0) {    // a man quest start
                    nRet = self.askYesNo("You must be from Moony... I can see that you're in love. The question is how deeply? I can help you if you are really in love, in return I only ask for a favor... Well, could you get me #b50 Orange Mushroom Caps?#k");
                    if(nRet!=0) {
                        //user accepts the quest
                        self.say( "Okay, I will wait for you. Good luck!!!" );
                        qr.set( 8810, "ing" );
                    }
                    //user doesn't accept the quest
                    else self.say( "I must have been mistaken. I thought you were in love... Return when you are ready to prove the depth of your devotion." );                
                
                }
                if(target.nGender == 1)    {    // a woman quest start
                    nRet = self.askYesNo("I can see that you're in love. The question is how deeply? I can help you if you are really in love, in return I only ask for a favor... Well, could you get me #b50 Orange Mushroom Caps?#k");    
                
                    if(nRet!=0) {
                        //user accepts the quest
                        self.say( "Okay, I will wait for you. Good luck!!!" );
                        qr.set( 8810, "ing" );
                    }
                    //user doesn't accept the quest
                    else self.say( "I must have been mistaken. I thought you were in love... Return when you are ready to prove the depth of your devotion." );
                }
            }
    }
}


//******* Wedding: Engagement Ring - Proof of Love(Kerning City)    8811
script "ProofKern" {

    inventory = target.inventory;
    qr = target.questRecord;
    pre_val = qr.get(8809);        // Wedding: Engagement Ring (Moony)
    pre_val2 = qr.get(8816);    // Wedding: Meet the Parents    
    val = qr.get( 8811 );        // Wedding: Engagement Ring - Proof of Love(Kerning City) 

    if( target.nGender == 0 and pre_val != "ing" )     // if a male user who doesn't accept Moony's engagement quest clicks nana
        self.say ("Nice to meet you! I am Nana the Fairy from Amoria. I am waiting for you to prove your devotion to your loved one by obtaining a Proof of Love! To start, you'll have to venture to Amoria to find my good friend, Moony the Ringmaker. Even if you are not interested in marriage yet, Amoria is open for everyone! Go visit Thomas Swift at Henesys to head to Amoria If you are interested in weddings, be sure to speak with Ames the Wise once you get there!");
        
    else if (target.nGender == 1 and pre_val2 != "ing")     // if a female user who doesn't accept meet the parents quest clicks nana.
        self.say("Nice to meet you! I'm Nana the Fairy from Amoria. Amoria is a beautiful town full of passion and adventure that everyone can enjoy! Go visit Thomas Swift at Henesys to visit Amoria. If you are interested in weddings, be sure to speak with Ames the Wise once you get there!");  

    else { // target.nGender == 1 and pre_val2 == "ing" or target.nGender == 0 and pre_val == "ing"

            if (val == "end" )    {            // if a user already finished the 1st nana quest
        
                nItem = inventory.itemCount(4031368);
                if (nItem == 0) {            // if a user lost the item
                    self.say( "Oh no, did you lose the Proof of Love? Luckily I have some extra here with me. I'll give you another one. Please don't lose it this time!" );
                    ret = inventory.exchange( 0, 4031368, 1);
                    if (ret != 0) 
                        self.say( "Now you earned a Proof of Love!" );
                    else self.say("I'm sorry but I keep having trouble putting an item into your inventory. Please check back with me later."); 
                }
                else    self.say( "Excellent work! You earned a Proof of Love!" );    
            }
            
            else if (val == "ing")    {
                nItem = inventory.itemCount(4000015);
                
                  if (target.nGender == 0 and nItem < 40)     //if a man user doesn't get 40 Horny Mushroom Caps
                    self.say("Not quite complete yet... Please come back with #b40 Horny Mushroom Caps#k. I'll need everything if I'm to convince Moony that you're in love.");
                    
                else if (target.nGender == 1 and nItem < 40)     //if a woman user doesn't get 40 Horny Mushroom Caps
                    self.say("Not quite complete yet... Please come back with #b40 Horny Mushroom Caps#k. I'll need everything if I'm to be convinced you're in love.");
                
                else {
                        if (target.nGender == 0) {    // a man quest finished 
                           nRet = self.askYesNo( "Fantastic! Now that I know that you are truly in love, I have this item that should prove it. This is the Proof of Love, the item that represents the true love you share with your lover. Would you like to receive this item?");
                           if ( nRet != 0 )     {        // reward
                                self.say("Great. This should help convince Moony that you are devoted to your lover. I hope everything goes well with your wedding!");
                                
                                ret = inventory.exchange( 0, 4000015, -40, 4031368, 1);
                                if (ret != 0)     {
                                    qr.set( 8811, "end" );
                                    target.incEXP(700, 0);                                
                                }
                                else self.say("I'm sorry but I keep having trouble putting an item into your inventory. Please check back with me later.");                 
                            }
                            else     self.say("Really? Without that item, it may be difficult for you to convince Moony of your true love. Please reconsider.");
                           
                          }
                        if (target.nGender == 1)    { // a woman quest finished 
                            nRet = self.askYesNo( "Fantastic! Now that I know that you are truly in love, I have this item that should prove it. This is the Proof of Love, the item that represents the true love you share with your lover. Would you like to receive this item?");
                            if ( nRet != 0 )     {    // reward
                                self.say("Great. This should help convince the parents that you are devoted to your lover. I hope everything goes well with your wedding!");                        
                                
                                ret = inventory.exchange( 0, 4000015, -40, 4031368, 1);
                                if (ret != 0)     {
                                    qr.set( 8811, "end" );
                                    target.incEXP(700, 0);                                    
                                }
                                else self.say("I'm sorry but I keep having trouble putting an item into your inventory. Please check back with me later.");                 
                            }
                            else     self.say("Really? Without that item, it may be difficult for you to convince Moony of your true love. Please reconsider.");
                        }
                            
                }
            }
            else {
                if(target.nGender == 0) {    // a man quest start
                    nRet = self.askYesNo("You must be from Moony... I can see that you're in love. The question is how deeply? I can help you if you are really in love, in return I only ask for a favor... Well, could you get me #b40 Horny Mushroom Caps?#k");
                    if(nRet!=0) {
                        //user accepts the quest
                        self.say( "Okay, I will wait for you. Good luck!!!" );
                        qr.set( 8811, "ing" );
                    }
                    //user doesn't accept the quest
                    else self.say( "I must have been mistaken. I thought you were in love... Return when you are ready to prove the depth of your devotion." );                
                
                }
                if(target.nGender == 1)    {    // a woman quest start
                    nRet = self.askYesNo("I can see that you're in love. The question is how deeply? I can help you if you are really in love, in return I only ask for a favor... Well, could you get me #b40 Horny Mushroom Caps?#k");    
                
                    if(nRet!=0) {
                        //user accepts the quest
                        self.say( "Okay, I will wait for you. Good luck!!!" );
                        qr.set( 8811, "ing" );
                    }
                    //user doesn't accept the quest
                    else self.say( "I must have been mistaken. I thought you were in love... Return when you are ready to prove the depth of your devotion." );
                }
            }
    }
}


//******* Wedding: Engagement Ring - Proof of Love(Ellina)        8812
script "ProofElli" {

    inventory = target.inventory;
    qr = target.questRecord;
    pre_val = qr.get(8809);        // Wedding: Engagement Ring (Moony)
    pre_val2 = qr.get(8816);    // Wedding: Meet the Parents    
    val = qr.get( 8812 );        // Wedding: Engagement Ring - Proof of Love(Ellina)

    if( target.nGender == 0 and pre_val != "ing" )     // if a male user who doesn't accept Moony's engagement quest clicks nana
        self.say ("Nice to meet you! I am Nana the Fairy from Amoria. I am waiting for you to prove your devotion to your loved one by obtaining a Proof of Love! To start, you'll have to venture to Amoria to find my good friend, Moony the Ringmaker. Even if you are not interested in marriage yet, Amoria is open for everyone! Go visit Thomas Swift at Henesys to head to Amoria If you are interested in weddings, be sure to speak with Ames the Wise once you get there!");
        
    else if (target.nGender == 1 and pre_val2 != "ing")     // if a female user who doesn't accept meet the parents quest clicks nana.
        self.say("Nice to meet you! I'm Nana the Fairy from Amoria. Amoria is a beautiful town full of passion and adventure that everyone can enjoy! Go visit Thomas Swift at Henesys to visit Amoria. If you are interested in weddings, be sure to speak with Ames the Wise once you get there!");  

    else { // target.nGender == 1 and pre_val2 == "ing" or target.nGender == 0 and pre_val == "ing"

            if (val == "end" )    {            // if a user already finished the 1st nana quest
        
                nItem = inventory.itemCount(4031369);
                if (nItem == 0) {            // if a user lost the item
                    self.say( "Oh no, did you lose the Proof of Love? Luckily I have some extra here with me. I'll give you another one. Please don't lose it this time!" );
                    ret = inventory.exchange( 0, 4031369, 1);
                    if (ret != 0) 
                        self.say( "Now you earned a Proof of Love!" );
                    else self.say("I'm sorry but I keep having trouble putting an item into your inventory. Please check back with me later."); 
                }
                else    self.say( "Excellent work! You earned a Proof of Love!" );    
            }
            
            else if (val == "ing")    {
                nItem = inventory.itemCount(4003005);
                
                  if (target.nGender == 0 and nItem < 20)     //if a man user doesn't get 20 Soft Feathers
                    self.say("Not quite complete yet... Please come back with #b20 Soft Feathers#k. I'll need everything if I'm to convince Moony that you're in love.");
                    
                else if (target.nGender == 1 and nItem < 20)     //if a woman user doesn't get 20 Soft Feathers
                    self.say("Not quite complete yet... Please come back with #b20 Soft Feathers#k. I'll need everything if I'm to be convinced you're in love.");
                
                else {
                        if (target.nGender == 0) {    // a man quest finished 
                           nRet = self.askYesNo( "Fantastic! Now that I know that you are truly in love, I have this item that should prove it. This is the Proof of Love, the item that represents the true love you share with your lover. Would you like to receive this item?");
                           if ( nRet != 0 )     {        // reward
                                self.say("Great. This should help convince Moony that you are devoted to your lover. I hope everything goes well with your wedding!");
        
                                ret = inventory.exchange( 0, 4003005, -20, 4031369, 1);
                                if (ret != 0)     {
                                    qr.set( 8812, "end" );
                                    target.incEXP(900, 0);
                                }
                                else self.say("I'm sorry but I keep having trouble putting an item into your inventory. Please check back with me later.");                 
                            }
                            else     self.say("Really? Without that item, it may be difficult for you to convince Moony of your true love. Please reconsider.");
                           
                          }
                        if (target.nGender == 1)    { // a woman quest finished 
                            nRet = self.askYesNo( "Fantastic! Now that I know that you are truly in love, I have this item that should prove it. This is the Proof of Love, the item that represents the true love you share with your lover. Would you like to receive this item?");
                            if ( nRet != 0 )     {    // reward
                                self.say("Great. This should help convince the parents that you are devoted to your lover. I hope everything goes well with your wedding!");                        
                                
                                ret = inventory.exchange( 0, 4003005, -20, 4031369, 1);
                                if (ret != 0)     {
                                    qr.set( 8812, "end" );
                                    target.incEXP(900, 0);                                    
                                }
                                else self.say("I'm sorry but I keep having trouble putting an item into your inventory. Please check back with me later.");                 
                            }
                            else     self.say("Really? Without that item, it may be difficult for you to convince Moony of your true love. Please reconsider.");
                        }
                            
                }
            }
            else {
                if(target.nGender == 0) {    // a man quest start
                    nRet = self.askYesNo("You must be from Moony... I can see that you're in love. The question is how deeply? I can help you if you are really in love, in return I only ask for a favor... Well, could you get me #b20 Soft Feathers?#k");
                    if(nRet!=0) {
                        //user accepts the quest
                        self.say( "Okay, I will wait for you. Good luck!!!" );
                        qr.set( 8812, "ing" );
                    }
                    //user doesn't accept the quest
                    else self.say( "I must have been mistaken. I thought you were in love... Return when you are ready to prove the depth of your devotion." );                
                
                }
                if(target.nGender == 1)    {    // a woman quest start
                    nRet = self.askYesNo("I can see that you're in love. The question is how deeply? I can help you if you are really in love, in return I only ask for a favor... Well, could you get me #b20 Soft Feathers?#k");    
                
                    if(nRet!=0) {
                        //user accepts the quest
                        self.say( "Okay, I will wait for you. Good luck!!!" );
                        qr.set( 8812, "ing" );
                    }
                    //user doesn't accept the quest
                    else self.say( "I must have been mistaken. I thought you were in love... Return when you are ready to prove the depth of your devotion." );
                }
            }
    }
}


//******* Wedding: Engagement Ring - Proof of Love(Orbis)  8813
script "ProofOrbi" {

    inventory = target.inventory;
    qr = target.questRecord;
    pre_val = qr.get(8809);        // Wedding: Engagement Ring (Moony)
    pre_val2 = qr.get(8816);    // Wedding: Meet the Parents    
    val = qr.get( 8813 );        // Wedding: Engagement Ring - Proof of Love(Orbis)

    if( target.nGender == 0 and pre_val != "ing" )     // if a male user who doesn't accept Moony's engagement quest clicks nana
        self.say ("Nice to meet you! I am Nana the Fairy from Amoria. I am waiting for you to prove your devotion to your loved one by obtaining a Proof of Love! To start, you'll have to venture to Amoria to find my good friend, Moony the Ringmaker. Even if you are not interested in marriage yet, Amoria is open for everyone! Go visit Thomas Swift at Henesys to head to Amoria If you are interested in weddings, be sure to speak with Ames the Wise once you get there!");
        
    else if (target.nGender == 1 and pre_val2 != "ing")     // if a female user who doesn't accept meet the parents quest clicks nana.
        self.say("Nice to meet you! I'm Nana the Fairy from Amoria. Amoria is a beautiful town full of passion and adventure that everyone can enjoy! Go visit Thomas Swift at Henesys to visit Amoria. If you are interested in weddings, be sure to speak with Ames the Wise once you get there!");  

    else { // target.nGender == 1 and pre_val2 == "ing" or target.nGender == 0 and pre_val == "ing"

            if (val == "end" )    {            // if a user already finished the 1st nana quest
        
                nItem = inventory.itemCount(4031370);
                if (nItem == 0) {            // if a user lost the item
                    self.say( "Oh no, did you lose the Proof of Love? Luckily I have some extra here with me. I'll give you another one. Please don't lose it this time!" );
                    ret = inventory.exchange( 0, 4031370, 1);
                    if (ret != 0) 
                        self.say( "Now you earned a Proof of Love!" );
                    else self.say("I'm sorry but I keep having trouble putting an item into your inventory. Please check back with me later."); 
                }
                else    self.say( "Excellent work! You earned a Proof of Love!" );    
            }
            
            else if (val == "ing")    {
                nItem = inventory.itemCount(4000083);
                
                  if (target.nGender == 0 and nItem < 20)     //if a man user doesn't get 20 Jr. Sentinel Shellpieces
                    self.say("Not quite complete yet... Please come back with #b20 Jr. Sentinel Shellpieces#k. I'll need everything if I'm to convince Moony that you're in love.");
                    
                else if (target.nGender == 1 and nItem < 20)     //if a woman user doesn't get 20 Jr. Sentinel Shellpieces
                    self.say("Not quite complete yet... Please come back with #b20 Jr. Sentinel Shellpieces#k. I'll need everything if I'm to be convinced you're in love.");
                
                else {
                        if (target.nGender == 0) {    // a man quest finished 
                           nRet = self.askYesNo( "Fantastic! Now that I know that you are truly in love, I have this item that should prove it. This is the Proof of Love, the item that represents the true love you share with your lover. Would you like to receive this item?");
                           if ( nRet != 0 )     {        // reward
                                self.say("Great. This should help convince Moony that you are devoted to your lover. I hope everything goes well with your wedding!");
                                ret = inventory.exchange( 0, 4000083, -20, 4031370, 1);
                                if (ret != 0)     {
                                    qr.set( 8813, "end" );
                                    target.incEXP(800, 0);                                
                                }
                                else self.say("I'm sorry but I keep having trouble putting an item into your inventory. Please check back with me later.");                 
                            }
                            else     self.say("Really? Without that item, it may be difficult for you to convince Moony of your true love. Please reconsider.");
                           
                          }
                        if (target.nGender == 1)    { // a woman quest finished 
                            nRet = self.askYesNo( "Fantastic! Now that I know that you are truly in love, I have this item that should prove it. This is the Proof of Love, the item that represents the true love you share with your lover. Would you like to receive this item?");
                            if ( nRet != 0 )     {    // reward
                                self.say("Great. This should help convince the parents that you are devoted to your lover. I hope everything goes well with your wedding!");                        
                                
                                ret = inventory.exchange( 0, 4000083, -20, 4031370, 1);
                                if (ret != 0)     {
                                    qr.set( 8813, "end" );
                                    target.incEXP(800, 0);
                                }
                                else self.say("I'm sorry but I keep having trouble putting an item into your inventory. Please check back with me later.");                 
                            }
                            else     self.say("Really? Without that item, it may be difficult for you to convince Moony of your true love. Please reconsider.");
                        }
                            
                }
            }
            else {
                if(target.nGender == 0) {    // a man quest start
                    nRet = self.askYesNo("You must be from Moony... I can see that you're in love. The question is how deeply? I can help you if you are really in love, in return I only ask for a favor... Well, could you get me #b20 Jr. Sentinel Shellpieces?#k");
                    if(nRet!=0) {
                        //user accepts the quest
                        self.say( "Okay, I will wait for you. Good luck!!!" );
                        qr.set( 8813, "ing" );
                    }
                    //user doesn't accept the quest
                    else self.say( "I must have been mistaken. I thought you were in love... Return when you are ready to prove the depth of your devotion." );                
                
                }
                if(target.nGender == 1)    {    // a woman quest start
                    nRet = self.askYesNo("I can see that you're in love. The question is how deeply? I can help you if you are really in love, in return I only ask for a favor... Well, could you get me #b20 Jr. Sentinel Shellpieces?#k");    
                
                    if(nRet!=0) {
                        //user accepts the quest
                        self.say( "Okay, I will wait for you. Good luck!!!" );
                        qr.set( 8813, "ing" );
                    }
                    //user doesn't accept the quest
                    else self.say( "I must have been mistaken. I thought you were in love... Return when you are ready to prove the depth of your devotion." );
                }
            }
    }
}



//******* Wedding: Engagement Ring - Proof of Love(Ludibrium)        8814
script "ProofLudi" {

    inventory = target.inventory;
    qr = target.questRecord;
    pre_val = qr.get(8809);        // Wedding: Engagement Ring (Moony)
    pre_val2 = qr.get(8816);    // Wedding: Meet the Parents    
    val = qr.get( 8814 );        // Wedding: Engagement Ring - Proof of Love(Ludibrium)

    if( target.nGender == 0 and pre_val != "ing" )     // if a male user who doesn't accept Moony's engagement quest clicks nana
        self.say ("Nice to meet you! I am Nana the Fairy from Amoria. I am waiting for you to prove your devotion to your loved one by obtaining a Proof of Love! To start, you'll have to venture to Amoria to find my good friend, Moony the Ringmaker. Even if you are not interested in marriage yet, Amoria is open for everyone! Go visit Thomas Swift at Henesys to head to Amoria If you are interested in weddings, be sure to speak with Ames the Wise once you get there!");
        
    else if (target.nGender == 1 and pre_val2 != "ing")     // if a female user who doesn't accept meet the parents quest clicks nana.
        self.say("Nice to meet you! I'm Nana the Fairy from Amoria. Amoria is a beautiful town full of passion and adventure that everyone can enjoy! Go visit Thomas Swift at Henesys to visit Amoria. If you are interested in weddings, be sure to speak with Ames the Wise once you get there!");  

    else { // target.nGender == 1 and pre_val2 == "ing" or target.nGender == 0 and pre_val == "ing"

            if (val == "end" )    {            // if a user already finished the 1st nana quest
        
                nItem = inventory.itemCount(4031371);
                if (nItem == 0) {            // if a user lost the item
                    self.say( "Oh no, did you lose the Proof of Love? Luckily I have some extra here with me. I'll give you another one. Please don't lose it this time!" );
                    ret = inventory.exchange( 0, 4031371, 1);
                    if (ret != 0) 
                        self.say( "Now you earned a Proof of Love!" );
                    else self.say("I'm sorry but I keep having trouble putting an item into your inventory. Please check back with me later."); 
                }
                else    self.say( "Excellent work! You earned a Proof of Love!" );    
            }
            
            else if (val == "ing")    {
                nItem = inventory.itemCount(4000106);
                
                  if (target.nGender == 0 and nItem < 20)     //if a man user doesn't get 20 Teddy's Cotton
                    self.say("Not quite complete yet... Please come back with #b20 Teddy's Cotton#k. I'll need everything if I'm to convince Moony that you're in love.");
                    
                else if (target.nGender == 1 and nItem < 20)     //if a woman user doesn't get 20 Teddy's Cotton
                    self.say("Not quite complete yet... Please come back with #b20 Teddy's Cotton#k. I'll need everything if I'm to be convinced you're in love.");
                
                else {
                        if (target.nGender == 0) {    // a man quest finished 
                           nRet = self.askYesNo( "Fantastic! Now that I know that you are truly in love, I have this item that should prove it. This is the Proof of Love, the item that represents the true love you share with your lover. Would you like to receive this item?");
                           if ( nRet != 0 )     {        // reward
                                self.say("Great. This should help convince Moony that you are devoted to your lover. I hope everything goes well with your wedding!");
                                
                                ret = inventory.exchange( 0, 4000106, -20, 4031371, 1);
                                if (ret != 0)     {
                                    qr.set( 8814, "end" );
                                    target.incEXP(700, 0);                                
                                }
                                else self.say("I'm sorry but I keep having trouble putting an item into your inventory. Please check back with me later.");                 
                            }
                            else     self.say("Really? Without that item, it may be difficult for you to convince Moony of your true love. Please reconsider.");
                           
                          }
                        if (target.nGender == 1)    { // a woman quest finished 
                            nRet = self.askYesNo( "Fantastic! Now that I know that you are truly in love, I have this item that should prove it. This is the Proof of Love, the item that represents the true love you share with your lover. Would you like to receive this item?");
                            if ( nRet != 0 )     {    // reward
                                self.say("Great. This should help convince the parents that you are devoted to your lover. I hope everything goes well with your wedding!");                        
                                
                                ret = inventory.exchange(0, 4000106, -20, 4031371, 1);
                                if (ret != 0)     {
                                    qr.set( 8814, "end" );
                                    target.incEXP(700, 0);                                
                                }
                                else self.say("I'm sorry but I keep having trouble putting an item into your inventory. Please check back with me later.");                 
                            }
                            else     self.say("Really? Without that item, it may be difficult for you to convince Moony of your true love. Please reconsider.");
                        }
                            
                }
            }
            else {
                if(target.nGender == 0) {    // a man quest start
                    nRet = self.askYesNo("You must be from Moony... I can see that you're in love. The question is how deeply? I can help you if you are really in love, in return I only ask for a favor... Well, could you get me #b20 Teddy's Cotton?#k");
                    if(nRet!=0) {
                        //user accepts the quest
                        self.say( "Okay, I will wait for you. Good luck!!!" );
                        qr.set( 8814, "ing" );
                    }
                    //user doesn't accept the quest
                    else self.say( "I must have been mistaken. I thought you were in love... Return when you are ready to prove the depth of your devotion." );                
                
                }
                if(target.nGender == 1)    {    // a woman quest start
                    nRet = self.askYesNo("I can see that you're in love. The question is how deeply? I can help you if you are really in love, in return I only ask for a favor... Well, could you get me #b20 Teddy's Cotton?#k");    
                
                    if(nRet!=0) {
                        //user accepts the quest
                        self.say( "Okay, I will wait for you. Good luck!!!" );
                        qr.set( 8814, "ing" );
                    }
                    //user doesn't accept the quest
                    else self.say( "I must have been mistaken. I thought you were in love... Return when you are ready to prove the depth of your devotion." );
                }
            }
    }
}



//******* Wedding: Engagement Ring - Proof of Love(Perion)        8815
script "ProofPeri" {

    inventory = target.inventory;
    qr = target.questRecord;
    pre_val = qr.get(8809);        // Wedding: Engagement Ring (Moony)
    pre_val2 = qr.get(8816);    // Wedding: Meet the Parents    
    val = qr.get( 8815 );        // Wedding: Engagement Ring - Proof of Love(Perion)

    if( target.nGender == 0 and pre_val != "ing" )     // if a male user who doesn't accept Moony's engagement quest clicks nana
        self.say ("Nice to meet you! I am Nana the Fairy from Amoria. I am waiting for you to prove your devotion to your loved one by obtaining a Proof of Love! To start, you'll have to venture to Amoria to find my good friend, Moony the Ringmaker. Even if you are not interested in marriage yet, Amoria is open for everyone! Go visit Thomas Swift at Henesys to head to Amoria If you are interested in weddings, be sure to speak with Ames the Wise once you get there!");
        
    else if (target.nGender == 1 and pre_val2 != "ing")     // if a female user who doesn't accept meet the parents quest clicks nana.
        self.say("Nice to meet you! I'm Nana the Fairy from Amoria. Amoria is a beautiful town full of passion and adventure that everyone can enjoy! Go visit Thomas Swift at Henesys to visit Amoria. If you are interested in weddings, be sure to speak with Ames the Wise once you get there!");  

    else { // target.nGender == 1 and pre_val2 == "ing" or target.nGender == 0 and pre_val == "ing"

            if (val == "end" )    {            // if a user already finished the 1st nana quest
        
                nItem = inventory.itemCount(4031372);
                if (nItem == 0) {            // if a user lost the item
                    self.say( "Oh no, did you lose the Proof of Love? Luckily I have some extra here with me. I'll give you another one. Please don't lose it this time!" );
                    ret = inventory.exchange( 0, 4031372, 1);
                    if (ret != 0) 
                        self.say( "Now you earned a Proof of Love!" );
                    else self.say("I'm sorry but I keep having trouble putting an item into your inventory. Please check back with me later."); 
                }
                else    self.say( "Excellent work! You earned a Proof of Love!" );    
            }
            
            else if (val == "ing")    {
                nItem = inventory.itemCount(4000018);
                
                  if (target.nGender == 0 and nItem < 40)     //if a man user doesn't get 40 Firewood
                    self.say("Not quite complete yet... Please come back with #b40 Firewood#k. I'll need everything if I'm to convince Moony that you're in love.");
                    
                else if (target.nGender == 1 and nItem < 40)     //if a woman user doesn't get 40 Firewood
                    self.say("Not quite complete yet... Please come back with #b40 Firewood#k. I'll need everything if I'm to be convinced you're in love.");
                
                else {
                        if (target.nGender == 0) {    // a man quest finished 
                           nRet = self.askYesNo( "Fantastic! Now that I know that you are truly in love, I have this item that should prove it. This is the Proof of Love, the item that represents the true love you share with your lover. Would you like to receive this item?");
                           if ( nRet != 0 )     {        // reward
                                self.say("Great. This should help convince Moony that you are devoted to your lover. I hope everything goes well with your wedding!");
                                
                                ret = inventory.exchange( 0, 4000018, -40, 4031372, 1);
                                if (ret != 0)     {
                                    qr.set( 8815, "end" );
                                    target.incEXP(800, 0);
                                }
                                else self.say("I'm sorry but I keep having trouble putting an item into your inventory. Please check back with me later.");                 
                            }
                            else     self.say("Really? Without that item, it may be difficult for you to convince Moony of your true love. Please reconsider.");
                           
                          }
                        if (target.nGender == 1)    { // a woman quest finished 
                            nRet = self.askYesNo( "Fantastic! Now that I know that you are truly in love, I have this item that should prove it. This is the Proof of Love, the item that represents the true love you share with your lover. Would you like to receive this item?");
                            if ( nRet != 0 )     {    // reward
                                self.say("Great. This should help convince the parents that you are devoted to your lover. I hope everything goes well with your wedding!");                        
                                
                                ret = inventory.exchange(0, 4000018, -40, 4031372, 1);
                                if (ret != 0)     {
                                    qr.set( 8815, "end" );
                                    target.incEXP(800, 0);
                                }
                                else self.say("I'm sorry but I keep having trouble putting an item into your inventory. Please check back with me later.");                 
                            }
                            else     self.say("Really? Without that item, it may be difficult for you to convince Moony of your true love. Please reconsider.");
                        }
                            
                }
            }
            else {
                if(target.nGender == 0) {    // a man quest start
                    nRet = self.askYesNo("You must be from Moony... I can see that you're in love. The question is how deeply? I can help you if you are really in love, in return I only ask for a favor... Well, could you get me #b40 Firewood#k");
                    if(nRet!=0) {
                        //user accepts the quest
                        self.say( "Okay, I will wait for you. Good luck!!!" );
                        qr.set( 8815, "ing" );
                    }
                    //user doesn't accept the quest
                    else self.say( "I must have been mistaken. I thought you were in love... Return when you are ready to prove the depth of your devotion." );                
                
                }
                if(target.nGender == 1)    {    // a woman quest start
                    nRet = self.askYesNo("I can see that you're in love. The question is how deeply? I can help you if you are really in love, in return I only ask for a favor... Well, could you get me #b40 Firewood?#k");    
                
                    if(nRet!=0) {
                        //user accepts the quest
                        self.say( "Okay, I will wait for you. Good luck!!!" );
                        qr.set( 8815, "ing" );
                    }
                    //user doesn't accept the quest
                    else self.say( "I must have been mistaken. I thought you were in love... Return when you are ready to prove the depth of your devotion." );
                }
            }
    }
}


//******* Wedding: High Priest's Quest            8816
script "HighPriest" {

    field = self.field;
    qr = target.questRecord;
    val = qr.get( 8816 );
    inventory = target.inventory;

    if (field.id == 680000000 ) {
        
        // checking : if target has Cathedral Reservation Receipt (initial)
        if (inventory.itemCount( 4031375 )==0 and inventory.itemCount( 4031480 )==0 ) self.say( "I oversee all Cathedral Weddings...if you'd like to get married in the Cathedral, please speak with me as well!"); 
        
        else {                        
            if (target.nGender == 0)
                self.say( "I oversee all Cathedral Weddings. There are a few reminders for Grooms that reserved the Cathedral Wedding. You will have to wait or help your Bride getting a blessing from her parents. After that, I'll give her my permission for the wedding so that she can initiate the Wedding by talking to one of my assistants, Nicole. Only your Bride can initiate the Wedding for Cathedral so you need to be patient for this."); 
            else {
                if (val == "end" )        // user already finished the quest 
                    self.say( "You have already received the Officiator's Permission.");
                else if (val == "ing"){
                       nItem = inventory.itemCount( 4031373 ); // checkikng : parent bless (complete this Quest)
                       if (nItem > 0)     {   // user got the parents blessing
                           self.say ("I see a smile on your face...you received your Parent's Blessing, didn't you? Great! Now, take the Officiator's Permission. You'll need to get married in cathedral. See you at the wedding!");
                           if (inventory.itemCount( 4031375 )>0) {
                            ret = inventory.exchange( 0, 4031373, -1, 4031374, 1);
                            if (ret !=0) {
                                qr.set( 8816, "end" );                            
                                target.incEXP (500, 0);
                            }
                            else self.say("Oh dear, looks like I can't find that information right now...I'm having a bit of trouble with my database, please try again later");
                           }
                           else if (inventory.itemCount( 4031480 )>0) {
                            ret = inventory.exchange( 0, 4031373, -1, 4031374, 1);
                            if (ret !=0) {
                                qr.set( 8816, "end" );
                                target.incEXP (500, 0);
                                }
                            else self.say("Oh dear, looks like I can't find that information right now...I'm having a bit of trouble with my database, please try again later");
                            }
                       }
                       else  self.say(" You still need your parents blessing, my friend. True Love knows no bounds, head out there and obtain your Parent's Blessing.");

                }
                else {    //quest starts
                nRet = self.askYesNo("Ah, there is seldom a sight more beautiful than two people in love. I can see that you want to get married. Have you got your Parent's Blessing yet? It is important that your parents give their blessing for a happy marriage. Do you wish to go visit your parents now?");
                    if(nRet!=0) {    // user accepts the quest
                        qr.set( 8816, "ing" );
                        self.say( "Fantastic. It's always great to see a couple fall in love. Why don't you go speak with Mom and Dad for their blessing? I'm sure they will see that you two are meant to be. While going there, why don't you tell Cody that I said Hello if you have time." );

                    }
                    // user doesn't accept the quest
                    else self.say( "Well, let's not rush things. Come back when you're ready to visit your Parents. " );
                }
            }
        }
    }
    if (field.id == 680000210 )     //High priest is in the cathedral
        self.say ( "Humm...");
}

//******* Wedding: Meet the Parents            8817
script "MeetPare" {

    qr = target.questRecord;
    pre_val = qr.get( 8816 );    // High Priest's Quest
    val = qr.get( 8817 );        // Meet the Parents    
    inventory = target.inventory;
    count = 0;
    num = 0;
    j = 0;
    
    if (target.nGender == 0) //if male user clicks
        self.say ( "...Can I help you?");

    else {
            if( pre_val != "ing" )    //user should visit High priest john first    
                self.say ( "Hello, dear... We'll need to think about this... why don't you visit High Priest John in the meantime?");
            else if (pre_val== "ing" and target.isInParty != 1) //checking party
                self.say ( "Hello, dear...why don't you party with your soon-to-be husband?");
        
            else {
                    for ( i = 0..5 ) {
                        nItem = inventory.itemCount( 4031367 + i );
                        if (nItem > 0) count = count + 1;
                    }
    
                    if (val == "end" )    // user already finished the quest
                        self.say( "Congratulations, dear! We wish you the best at your wedding!" );
        
                    else if (val == "ing"){    // need 2 proof of loves to finish the quest
                          if (count < 2) self.say("We remain unconvinced. We won't give you our Parent's Blessing until you give us #b2 Proof of Love#k. Be firm in your decision!");
                        else {    // quest finished
                                 self.say ("It looks like you two are definitely in love...it's touching to see such devotion. Take our Blessing, and we wish you the best at your wedding!");
                                 while ( count > 0 ){
                                  num = 4031367 + j;
                                  nItem = inventory.itemCount(num);
                                   if (nItem > 0) {
                                    count = count - 1;
                                    ret= inventory.exchange(0,num, -1);
                                   }
                                 j=j+1;
                                 }
                                ret = inventory.exchange( 0, 4031373, 1);
                                if (ret !=0) {
                                    qr.set( 8817, "end" );
                                    target.incEXP (700, 0);
                                }
                                else self.say("Oh dear, looks like I can't find that information right now...I'm having a bit of trouble with my database, please try again later");
                        }
                    }
                    else {
                    //quest starts
                    nRet = self.askYesNo("Hello, my child. Are you sure that you want to get married to this man? I believe in love at first sight, but this is rather sudden... I don't think we are ready for this. Let's think about it.  Do you really love this man? ");
                        if(nRet!=0) {    //user accepts the quest.
                            self.say( "I trust your judgement, dear. If you really love this man, you will need to show it.  We need you to bring me #b2 Proof of Love#k from Nana. She's special, and we trust her judgment in matters of the heart. If she can see the true depth of your feelings, she will hand you a Proof of Love. Are you ready to take the next step?" );
                            qr.set( 8817, "ing" );
                        }
                        //user doesn't accept the quest
                        else self.say( "Why in the name of Eros would you want to get married if you don't love this man? Our answer is No!" );
                    }
            }
    }
}

//Wedding Assistant Nicole
script "cathedral" {
field = self.field;
inventory = target.inventory;
qr = target.questRecord;
    
if (field.id == 680000000 ) {
//first words
    v1 = self.askMenu( "I can guide you to the Wedding. Which one suits you?\r\n#b#L0#I am now ready to get Married in cathedral.#l\r\n#L1#I am invited to the wedding!#l#k" );
    if ( v1 == 0 ) {
        if (target.isInParty == 1 ) {
                //checking the Reservation Receipt
                if ( inventory.itemCount(4031375) == 0 and inventory.itemCount(4031480) == 0 )  self.say( "Let's see...I'm sorry, but I don't think you have the Reservation Receipt with you right now. Without the Reservation Receipt, I'm afraid I can't help you. You'd better talk to Victoria first Sorry. " );
                //checking the Officiator's Permission
                  else if ( inventory.itemCount(4031374) == 0 )  self.say( "Let's see...I'm sorry, but I don't think you have the Officiator's Permission with you right now. Without the Officiator's Permission, I'm afraid I can't help you. You'd better talk to High Priest John first. Sorry. " );
            else {
                set = FieldSet( "Wedding2" );
                      result = set.enter( target.nCharacterID, 1 );
                //Enter Return Code
        //1 : another wedding has started.
        //2 : bride and groom are not in the same map.
        //3 : there are not 2 members in party
        //4 : male-male female-female couple
        //5 : not engaged yet
        //6 : there's no empty slot 
        //7 : there's no wedding available(for invited people)
        //8 : there's no wedding invitation(for invited people)
        //9 : Unknown Error
        //10 : bride and groom didn't reserve the hall
        //11 : wedding type mismatching

                if ( result == 1) self.say ("Looks like another Wedding has begun, sweetie. When it finishes, I'll be sure to let you in!");
                      else if ( result == 2) self.say ("You need to be in a 2-person party with your fianc? or fianc?and in #bthe same map#k to get married.");
                       else if ( result == 3) self.say ("You need to be in #ba 2-person party with your fianc? or fianc?#kto get married.");
                       else if ( result == 4) self.say ("You need to be in #ba 2-person party with your fianc? or fianc?#kto get married.");
                       else if ( result == 5) self.say ("You need to be in #ba 2-person party with your fianc? or fianc?#kto get married.");
                       else if ( result == 6) self.say ("You need an equip slot open to receive the ring, as soon as you make room, we can begin.");
                       else if ( result == 9) self.say ("Oh dear, looks like I can't find that information right now...I'm having a bit of trouble with my database, please try again later");
                else if ( result == 10) self.say ("You have to make a reservation to start the wedding");
                else if ( result == 11) self.say ("It appears that you've made your reservation at another wedding hall");
                  }
        }
        //bride and groom are not in the party
        else self.say("You need to be in #ba 2-person party with your fianc? or fianc?#kto get married.");
    }
    else if ( v1 == 1 ) {
        if (target.isInParty == 0) {
            nRet = self.askYesNo( "Greetings! I can tell that you're a guest of the Bride and Groom, would you like to enter the Cathedral?");
            if ( nRet == 0 ) self.say( "Well, it looks like this isn't your cup of tea, please stand aside and let others enter. " );
                  else {
                set = FieldSet( "Wedding2" );
                result = set.enter( target.nCharacterID, 0 );
                if ( result == 7) self.say ("I apologize, but the Wedding hasn't started yet. When it does, I'll be sure to let you in. ");
                else if ( result == 8) self.say ("Sorry, but without an invitation, I can't let you in.");
                else if ( result == 9) self.say ("Oh dear, looks like I can't find that information right now...I'm having a bit of trouble with my database, please try again later");
                  }
        }
        //invited people are in the party
        else self.say("Oh no, I am sorry, but I cannot let you in since you're in a party with someone other than your loved one. I suggest you leave the party first, and then come back and see me~");
    }
}
else if (field.id == 680000200) {
// in the cathedral 
nRet = self.askYesNo( "Would you like to go back outside? ");
    if ( nRet == 0 ) self.say( "Please take a seat, and wait for the ceremony to begin." );
    else {
        // user wants to exit
        self.say( "Maybe we'll see you at the altar someday. Happy travels! ");
        if (field.id == 680000200 ) registerTransferField( 680000500, "" );
    }
}
}

//Wedding Coordinator Victoria - Cathedral
script "cathedralCoordinator" {
inventory = target.inventory;
//first dialog
self.say("Before I help you make a reservation for the Cathedral Wedding, I strongly recommend that #bboth you and your partner#k need to have at least #b3 Etc. slots#k available. Please check your etc. inventory.");
v1 = self.askMenu( "And by the way, I must tell you, you look wonderful today! I'm here to help you prepare for your Wedding. I can help you make a Reservation, get additional Invitations, or tell you what you'll need to get married in our Cathedral. What would you like to know?\r\n#b#L0#How can I get married here?#l\r\n#L1#I'd like to make a Premium Reservation.#l\r\n#L2#I'd like to make a Normal Reservation.#l\r\n#L3#I have more guests coming, I'd like some more Invitations.#l#k" );
if ( v1 == 0 ) {
//How can I get married here?
    self.say( "To get married in the Cathedral, you'll need #ra Cathedral Wedding Ticket, any Engagement Ring or an Empty Engagement Ring Box and most of all, love#k. Soon as you have them, we'll be happy to assist with your Wedding plans! If you reserved the Cathedral don't forget to see High Priest John for the Officiator's permission." );
}
else if ( v1 == 1 ) {
//I'd like to make a Premium Reservation.
    if (target.isInParty == 1) {
        self.say("Ready to walk down the aisle. Let's book your reservation now.");
        if (inventory.slotCount( 4 ) > inventory.holdCount( 4 )+1 and inventory.itemCount(4031375) == 0){
            // cash item check
            if (inventory.itemCount( 5251003 ) == 0 ) self.say(" Looks like you're missing something you need. Please remember that you need #ra Cathedral Wedding Ticket, any Engagement Ring or an Empty Engagement Ring Box#k to make a reservation.");
            else if (inventory.itemCount( 5251003 ) > 0 ) {
            retPos = target.hasRequestedTransferWorld;
            
            if ( retPos == 0 ) {
                    result = target.makeReservation(10); // 10 : Premium Cathedral
//MakeReservation Return Code

//0 : Success
//1 : bride and groom are not in the party
//2 : bride and groom are not in the same map.
//3 : there are not 2 members in party
//4 : male-male female-female couple
//5 : not engaged yet
//9 : Unknown Error

                    if (result == 1) self.say("You also need to be in #ba 2-person party with your fianc? or fianc?#kand in the same map to get married.");
                    else if (result == 2) self.say("You need to be in a 2-person party with your fianc? or fianc?and in #bthe same map#k to get married.");
                    else if (result == 3) self.say("You also need to be in a #b2-person party with your fianc? or fianc?k and in the same map to get married.");
                    else if (result == 4) self.say("You also need to be in a 2-person party with #byour fianc? or fianc?k and in the same map to get married.");
                    else if (result == 5) self.say("Please remember that you need #ba Cathedral Wedding Ticket, any Engagement Ring or an Empty Engagement Ring Box#k to make a reservation.");
                else if (result == 6) self.say("Sorry... but your wedding reservation is already done.");
                    else if (result == 7) self.say("You need an etc slot open to receive the Reservation receipt and Invitations, as soon as you make room, we can begin.");
                else if (result == 9) self.say("Oh dear, looks like I can't find that information right now...I'm having a bit of trouble with my database, please try again later!");                
            }
            else self.say( "Sorry, but you are disabled from getting married." );
            }
        }
        //no empty slot
        else self.say("You need an etc slot open to receive the Reservation receipt and Invitations, as soon as you make room, we can begin. Additionally, check if you have an old Reservation receipt.");
    }
    //bride and groom are not in the party
    else self.say( "To make a Reservation, you'll need to be grouped with your fianc?or fianc?... " );
}
else if ( v1 == 2 ) {
//I'd like to make a normal Reservation.    
//same structure with  'I'd like to make a premium Reservation.'
    if (target.isInParty == 1) {
            self.say( "To make a Reservation, you'll need to be grouped with your fianc?engaged, and ready to walk down the aisle. Let's book your reservation now. " );
        if (inventory.slotCount( 4 ) > inventory.holdCount( 4 )+1 and inventory.itemCount(4031480) == 0){ 
            if (inventory.itemCount( 5251000 ) == 0  ) self.say(" Looks like you're missing something you need. Please remember that you need #ra Cathedral Wedding Ticket, any Engagement Ring or an Empty Engagement Ring Box#k to make a reservation. ");
            else if (inventory.itemCount( 5251000 ) > 0 ) {
            retPos = target.hasRequestedTransferWorld;
            
            if ( retPos == 0 ) {
            
                result = target.makeReservation(11); // 11 : Normal Cathedral

                if (result == 1) self.say("You also need to be in #ba 2-person party with your fianc? or fianc?#kand in the same map to get married.");
                else if (result == 2) self.say("You need to be in a 2-person party with your fianc? or fianc?and in #bthe same map#k to get married.");
                else if (result == 3) self.say("You also need to be in a #b2-person party with your fianc? or fianc?k and in the same map to get married.");
                else if (result == 4) self.say("You also need to be in a 2-person party with #byour fianc? or fianc?k and in the same map to get married.");
                else if (result == 5) self.say("Please remember that you need #ba Cathedral Wedding Ticket, any Engagement Ring or an Empty Engagement Ring Box#k to make a reservation.");
                else if (result == 6) self.say("Sorry... but your wedding reservation is already done.");
                    else if (result == 7) self.say("You need an etc slot open to receive the Reservation receipt and Invitations, as soon as you make room, we can begin.");
                else if (result == 9) self.say("Oh dear, looks like I can't find that information right now...I'm having a bit of trouble with my database, please try again later!");                
                }
                else self.say( "Sorry, but you are disabled from getting married." );
            }
        }
        else self.say("You need an etc slot open to receive the Reservation receipt and Invitations, as soon as you make room, we can begin. Additionally, check if you have an old Reservation receipt.");
    }
    else self.say( "To make a Reservation, you'll need to be grouped with your fianc?.. " );

}
else if ( v1 == 3 ) {
//I have more guests coming, I'd like some more Invitations.
    if (target.isInParty == 1) {
        v2 = self.askYesNo("That's wonderful! I thought you might need a few more, so here you go. Pass them out to many people as you want! Do you get your #bReservation Receipt and the Wedding Invitation Ticket#k?");
        // clicks 'no'
        if(v2 == 0) self.say("Hmm... let me know when you are ready. I am always here for you!");
        else {
        //checking a Cathedral Reservation Receipt
            if(inventory.itemCount(4031375)==0 and inventory.itemCount(4031480)==0 ) self.say("Oh dear, it looks like you're missing a Cathedral Reservation Receipt. I'm afraid I'll have to postpone those invitations for now. When you get one, be sure to return!");
            //a Cathedral Reservation Receipt and cash item invitation ticket
            else if (inventory.itemCount(4031375)==1 and inventory.itemCount(5251100)==0) self.say("Oh dear, it looks like you're missing #ba Wedding Invitation Ticket#k. I'm afraid I'll have to postpone those invitations for now. When you get one, be sure to return!");
            else if (inventory.itemCount(4031480)==1 and inventory.itemCount(5251100)==0) self.say("Oh dear, it looks like you're missing #ba Wedding Invitation Ticket#k. I'm afraid I'll have to postpone those invitations for now. When you get one, be sure to return!");
            else if (inventory.itemCount(4031375)==1 and inventory.itemCount(5251100)>0) {
                ret = inventory.getAdditionalInvitation;
                //inventory is full or unknown error
                if (ret == 0) self.say(" Oh dear, looks like I can't find that information right now...I'm having a bit of trouble with my database, please try again later. Please check your inventory is full and come to see me again!!");
                // exchange succeeded
                else self.say("Here you are~");
            }
            else if (inventory.itemCount(4031480)==1 and inventory.itemCount(5251100)>0) {
                ret = inventory.getAdditionalInvitation;
                //inventory is full or unknown error
                if (ret == 0) self.say(" Oh dear, looks like I can't find that information right now...I'm having a bit of trouble with my database, please try again later. Please check your inventory is full and come to see me again!!");
                // exchange succeeded
                else self.say("Here you are~");
            }
            
        }
    }
    //bride and groom are not in the party
    else self.say( "To receive some more invitations, you'll need to be grouped with your fianc?.. " );
}

}

//Wedding Asistant Nancy - beginCeremony QID
script "beginCeremony" {
qr = target.questRecord;
inventory = target.inventory;

if (target.isWeddingCouple == 1 and target.isInParty == 1 ) {
    if(inventory.slotCount( 1 ) > inventory.holdCount( 1 ) and inventory.slotCount( 4 ) > inventory.holdCount( 4 )){
    //begin the ceremony
        nRet = self.askYesNo( "You two both look fantastic! Are you ready to begin the Wedding Ceremony? ");
        if ( nRet == 0 ) self.say( "Ok, please remember that the ceremony will automatically start 10 minutes after you enter the Cathedral." );
        else {
        // want to begin the ceremony
            if (getCurrentWeddingState==1) target.startWedding;
            else if (getCurrentWeddingState==2) self.say ("Please wait for the ceremony to end");
        }
    }
    else self.say("You need an equip slot and an etc slot open to receive #bthe Ring and the Onyx Chest#k, as soon as you make room, we can begin.");
}
        //bride and groom are not in the party
else if ( target.isWeddingCouple == 1 and target.isInParty == 0) self.say("You both look fantastic!");
        //invited people
else self.say(" Please wait for the ceremony to begin.");
}


//Wedding Asistant Debbie
script "watingCathedral" {
field = self.field;
if (field.id == 680000200 ) {
    //wating room -> cathedral wedding hall
    nRet = self.askYesNo( "Salutations! Would you like to get into the Wedding Hall? ");
    if ( nRet == 0 ) self.say( "Ok, please let me know when you're ready to go in." );
      else {
       // user wants to go inside
       self.say( "Feel free to head inside now. Give my regards to the newlyweds!  ");
        if (field.id == 680000200 ) registerTransferField( 680000210, "" );
      }
}
else if (field.id == 680000210 ) {
    if( target.isWeddingCouple == 1 and target.isInParty == 1 and getCurrentWeddingState == 2){
            // asking if bride and groom want to move to Photomap
            nRet = self.askYesNo( "You two both look fantastic! Are you ready to go to the Photo Map? ");
            // bride and groom doesn't want to move to Photomap
            if ( nRet == 0 ) self.say( "Ok, please remember that the Photo time will automatically start after the clock stops." );
          else {
            // bride and groom want to move to Photomap
               self.say( "Sounds good, take some good pictures. Off you go!");
               set = FieldSet( "Wedding30" );
                 result = set.enter( target.nCharacterID, 0 );
               
            if ( result == 7) self.say ("I apologize, but the Wedding hasn't started yet. When it does, I'll be sure to let you in. ");
                   else if ( result == 8) self.say ("Sorry, but without an invitation, I can't let you in.");
                   else if ( result == 9) self.say ("Oh dear, looks like I can't find that information right now...I'm having a bit of trouble with my logbook, please try again later");

          }
         
    }
        // The wedding is not finished yet
    else if (target.isWeddingCouple == 1 and target.isInParty == 1 and getCurrentWeddingState == 1) self.say("You both look fantastic! Please, wait the ceremony to end.");
    else if (target.isWeddingCouple == 0) {
    // for invited people
    nRet = self.askYesNo( "Hi! Would you like to leave the Cathedral? ");
          if ( nRet == 0 ) self.say( "Ok, please let me know when you're ready to go out." );
      else {
       // user wants to go out
       self.say( "Ok, I'll show you the way out...");
        if (field.id == 680000210 ){ 
       set = FieldSet( "Wedding2" );
       registerTransferField( 680000500, "" );
    }
}
      }
  }
  else if (field.id == 680000300 and target.isWeddingCouple == 0) {
    // for invited people at the photomap
      nRet = self.askYesNo( "Do you want to go back outside?");
      if ( nRet == 0 ) self.say( "Ok, please let me know when you're ready to go!" );
        else {
          self.say( "Ok, I'll show you the way out. Have fun out there!");
           if (field.id == 680000300 ) registerTransferField( 680000500, "" );
        }
  }
}


//Wedding Assistant Bonnie 
script "vegas" {
field = self.field;
inventory = target.inventory;
qr = target.questRecord;
    
if (field.id == 680000000 ) {
    v1 = self.askMenu( "I can guide you to the Wedding. Which one suits you?\r\n#b#L0#I am now ready to get Married in Chapel.#l\r\n#L1#I am invited to the wedding!#l#k" );
    if ( v1 == 0 ) {
        if (target.isInParty == 1) {
            if (inventory.itemCount(4031376) == 0 and inventory.itemCount(4031481) == 0 ) self.say( "Let's see...I'm sorry, but I don't think you have Reservation ticket with you right now. Without the Reservation Receipt, I'm afraid I can't help you. You'd better talk to Wayne first. Sorry. " );
            else{
                set = FieldSet( "Wedding1" );
                result = set.enter( target.nCharacterID, 1 );
                
                if ( result == 1) self.say (" Looks like another Wedding has begun, sweetie. When it finishes, I'll be sure to let you in!");
                else if ( result == 2) self.say ("You need to be in a 2-person party with your fianc? or fianc?and in #bthe same map#k to get married.");
                else if ( result == 3) self.say ("You need to be in #ba 2-person party with your fianc? or fianc?#kto get married.");
                else if ( result == 4) self.say ("You need to be in #ba 2-person party with your fianc? or fianc?#kto get married.");
                else if ( result == 5) self.say ("You need to be in #ba 2-person party with your fianc? or fianc?#kto get married.");
                else if ( result == 6) self.say ("You need an equip slot open to receive the ring, as soon as you make room, we can begin.");
                else if ( result == 9) self.say ("Oh dear, looks like I can't find that information right now...I'm having a bit of trouble with my database, please try again later");
                else if ( result == 10) self.say ("You have to make a reservation to start the wedding");
                else if ( result == 11) self.say ("It appears that you've made your reservation at another wedding hall");
                  }
        }
        else self.say("You need to be in #ba 2-person party with your fianc? or fianc?#kto get married.");
    }
    else if ( v1 == 1 ) {
        if (target.isInParty == 0) {
            nRet = self.askYesNo( "Welcome! I can tell that you're a guest of the Bride and Groom, would you like to enter the Chapel?");
            if ( nRet == 0 ) self.say( "Step aside then, there are others ready to go in." );
            else {
                set = FieldSet( "Wedding1" );
                result = set.enter( target.nCharacterID, 0 );
                if ( result == 7) self.say ("I apologize, but the Wedding hasn't started yet. When it does, I'll be sure to let you in. ");
                else if ( result == 8) self.say ("Sorry, but without an invitation, I can't let you in.");
                else if ( result == 9) self.say ("Oh dear, looks like I can't find that information right now...I'm having a bit of trouble with my logbook, please try again later");
            }
        }
        else self.say("Oh no, I am sorry, but I cannot let you in since you're in a party with someone. I suggest you leave the party first, and then come back and see me~");
    }
}
else if (field.id == 680000100) {
    nRet = self.askYesNo( "Stiff legs, I see. Would you like to head outside and stretch a bit?");
    if ( nRet == 0 ) self.say( "Well, take a seat. The ceremony should start soon." );
    else {
        self.say( "Ok, come on back when you're ready. ");
        if (field.id == 680000100 ) registerTransferField( 680000500, "" );
    }
}
}

// Wedding Coordinator Wayne- Vegas
script "vegasCoordinator" {
inventory = target.inventory;
v1 = self.askMenu( "You are looking lovely today! I'm here to help you prepare for your Wedding. I can help you make a Reservation, get additional Invitations, or tell you what you'll need to get married in our Chapel. What would you like to know?\r\n#b#L0#How can I get married here?#l\r\n#L1#I'd like to make a Premium Reservation.#l\r\n#L2#I'd like to make a Normal Reservation.#l\r\n#L3#I have more guests coming, I'd like some more Invitations.#l#k" );
    if ( v1 == 0 ) {
        self.say( "To get married in the Chapel, you'll need #ra Chapel Wedding Ticket, any Engagement Ring or an Empty Engagement Ring Box#k and some time. Soon as you have them, we'll be happy to assist with your Wedding plans!" );
    }
    else if ( v1 == 1 ) {
        if (target.isInParty == 1) {
            self.say( "To make a Reservation, you'll need to be grouped with your fianc? and ready to walk down the aisle. Let's book your reservation now. " );
            if (inventory.slotCount( 4 ) > inventory.holdCount( 4 )+1 and inventory.itemCount(4031376) == 0){ 
                if (target.inventory.itemCount( 5251002 ) == 0  ) self.say(" Looks like you're missing something you need. Please remember that you need #ra Chapel Wedding Ticket, any Engagement Ring or an Empty Engagement Ring Box#k to make a reservation.");
                else if (target.inventory.itemCount( 5251002 ) >0) {
                
                retPos = target.hasRequestedTransferWorld;
            
                if ( retPos == 0 )         {
                    result = target.makeReservation(20); // 20 : Premium Chapel
                        if (result == 1) self.say("You also need to be in #ba 2-person party with your fianc? or fianc?#kand in the same map to get married.");
                        else if (result == 2) self.say("You need to be in a 2-person party with your fianc? or fianc?and in #bthe same map#k to get married.");
                        else if (result == 3) self.say("You also need to be in a #b2-person party with your fianc? or fianc?k and in the same map to get married.");
                        else if (result == 4) self.say("You also need to be in a 2-person party with #byour fianc? or fianc?k and in the same map to get married.");
                        else if (result == 5) self.say("Please remember that you need #ba Chapel Wedding Ticket, any Engagement Ring or an Empty Engagement Ring Box#k to make a reservation.");
                    else if (result == 6) self.say("Sorry... but your wedding reservation is already done.");
                        else if (result == 7) self.say("You need an etc slot open to receive the Reservation receipt and Invitations, as soon as you make room, we can begin.");
                        else if (result == 9) self.say("Oh dear, looks like I can't find that information right now...I'm having a bit of trouble with my database, please try again later!");
                }
                else self.say( "Sorry, but you are disabled from getting married." );
                }
            }
            else self.say("You need an etc slot open to receive the Reservation receipt and Invitations, as soon as you make room, we can begin. Additionally, check if you have an old Reservation receipt.");
        }
        else self.say( "To make a Reservation, you'll need to be grouped with your fianc?.. " );
    }
    else if ( v1 == 2 ) {
        if (target.isInParty == 1) {
            self.say( "To make a Reservation, you'll need to be grouped with your fianc? and ready to walk down the aisle. Let's book your reservation now. " );
            if (inventory.slotCount( 4 ) > inventory.holdCount( 4 )+1 and inventory.itemCount(4031481) == 0){ 
                if (target.inventory.itemCount( 5251001 ) == 0  ) self.say(" Looks like you're missing something you need. Please remember that you need #ra Chapel Wedding Ticket, any Engagement Ring or an Empty Engagement Ring Box#k to make a reservation.");
                else if (target.inventory.itemCount( 5251001 ) > 0) {
                
                retPos = target.hasRequestedTransferWorld;    
            
                if ( retPos == 0 )     {    
                result = target.makeReservation(21); // 21 : Normal Chapel
                if (result == 1) self.say("You also need to be in #ba 2-person party with your fianc? or fianc?#kand in the same map to get married.");
                else if (result == 2) self.say("You need to be in a 2-person party with your fianc? or fianc?and in #bthe same map#k to get married.");
                else if (result == 3) self.say("You also need to be in a #b2-person party with your fianc? or fianc?k and in the same map to get married.");
                else if (result == 4) self.say("You also need to be in a 2-person party with #byour fianc? or fianc?k and in the same map to get married.");
                else if (result == 5) self.say("Please remember that you need #ba Chapel Wedding Ticket, any Engagement Ring or an Empty Engagement Ring Box#k to make a reservation.");
                else if (result == 6) self.say("Sorry... but your wedding reservation is already done.");
                    else if (result == 7) self.say("You need an etc slot open to receive the Reservation receipt and Invitations, as soon as you make room, we can begin.");
                else if (result == 9) self.say("Oh dear, looks like I can't find that information right now...I'm having a bit of trouble with my database, please try again later!");                
                }
                else self.say( "Sorry, but you are disabled from getting married." );
                }
            }
            else self.say("You need an etc slot open to receive the Reservation receipt and Invitations, as soon as you make room, we can begin. Additionally, check if you have an old Reservation receipt.");
        }
        else self.say( "To make a Reservation, you'll need to be grouped with your fianc?.. " );
    }
    else if ( v1 == 3 ) {
        if (target.isInParty == 1) {
        v2 = self.askYesNo("Popular, huh? No problem, I can help you with that. Here are a few more. Did you get your #bReservation Receipt and the Wedding Invitation Ticket#k?");
            if(v2 == 0) self.say("Hmm... let me know when you are ready. I am always here for you!");
            else {
                if(target.inventory.itemCount(4031376)==0 and target.inventory.itemCount(4031481)==0) self.say("Oh dear, it looks like you're missing #ra Chapel Reservation Receipt#k. I'm afraid I'll have to postpone those invitations for now. When you get one, be sure to return!");
                else if (target.inventory.itemCount(4031376)==1 and target.inventory.itemCount(5251100)==0) self.say("Oh dear, it looks like you're missing a #rWedding Invitation Ticket#k. I'm afraid I'll have to postpone those invitations for now. When you get one, be sure to return!");
                else if (target.inventory.itemCount(4031481)==1 and target.inventory.itemCount(5251100)==0) self.say("Oh dear, it looks like you're missing a #rWedding Invitation Ticket#k. I'm afraid I'll have to postpone those invitations for now. When you get one, be sure to return!");
                else if (target.inventory.itemCount(4031376)==1 and target.inventory.itemCount(5251100)>0) {
                    ret = inventory.getAdditionalInvitation;
                    if (ret == 0) self.say(" Oh dear, looks like I can't find that information right now...I'm having a bit of trouble with my database, please try again later. Please check your inventory is full and come to see me again!!");
                    else self.say("Here you are~");
                }
                else if (target.inventory.itemCount(4031481)==1 and target.inventory.itemCount(5251100)>0) {
                    ret = inventory.getAdditionalInvitation;
                    if (ret == 0) self.say(" Oh dear, looks like I can't find that information right now...I'm having a bit of trouble with my database, please try again later. Please check your inventory is full and come to see me again!!");
                    else self.say("Here you are~");
                }
            }
        }
        else self.say( "To receive some more invitations, you'll need to be grouped with your fianc?.. " );
    }
}

//Wedding Asistant Jackie
script "beginVagasCeremony" {
qr = target.questRecord;
inventory = target.inventory;

if (target.isWeddingCouple == 1 and target.isInParty == 1 ) {
    if(inventory.slotCount( 1 ) > inventory.holdCount( 1 ) and inventory.slotCount( 4 ) > inventory.holdCount( 4 )){
    nRet = self.askYesNo( "You're certainly dressed for the occasion. Are you ready to get this show on the road?");
    if ( nRet == 0 ) self.say( "No problem. Please remember that the ceremony will automatically start 5 minutes after you enter the Chapel." );
    else {
            if (getCurrentWeddingState==1) target.startWedding;
            else if (getCurrentWeddingState==2) self.say ("Please wait for the ceremony to end");
        }
    }
    else self.say("You need an equip slot and an etc slot open to receive #bthe Ring and the Onyx Chest#k, as soon as you make room, we can begin.");
}
else if ( target.isWeddingCouple == 1 and target.isInParty == 0) self.say("You both look fantastic!");
else self.say(" Please wait for the ceremony to begin.");

}


//Wedding Asistant Travis
script "waitingChapel" {
  field = self.field;
  if (field.id == 680000100 ) {
    nRet = self.askYesNo( "Salutations! Would you like to get into the Wedding Hall? ");
    if ( nRet == 0 ) self.say( "Ok, please let me know when you're ready to go in." );
      else {
       self.say( "Feel free to head inside now. Give my regards to the newlyweds!");
        if (field.id == 680000100 ) registerTransferField( 680000110, "" );
      }
  }
  else if (field.id == 680000110 ) {
    if( target.isWeddingCouple == 1 and target.isInParty == 1 and getCurrentWeddingState == 2){
            nRet = self.askYesNo( "You both look fantastic! Are you ready to go to the Photo Map? ");
            if ( nRet == 0 ) self.say( "Ok, please remember that the Photo time will automatically start after the clock stops." );
          else {
               self.say( "Tubular! Snap some nice shots for the Wedding book!");
               set = FieldSet( "Wedding30" );
                 result = set.enter( target.nCharacterID, 0 );
               
            if ( result == 7) self.say ("I apologize, but the Wedding hasn't started yet. When it does, I'll be sure to let you in. ");
                   else if ( result == 8) self.say ("Sorry, but without an invitation, I can't let you in.");
                   else if ( result == 9) self.say ("Oh dear, looks like I can't find that information right now...I'm having a bit of trouble with my logbook, please try again later");

          }
         
    }    
    else if (target.isWeddingCouple == 1 and target.isInParty == 1 and getCurrentWeddingState == 1) self.say("You both look fantastic! Please, wait the ceremony to end.");

    else if (target.isWeddingCouple == 0) {
    nRet = self.askYesNo( "Hi! Would you like to leave the Chapel? ");
    if ( nRet == 0 ) self.say( "Ok, please let me know when you're ready to go out." );
      else {
        self.say( "Ok, I'll show you the way out...");
         if (field.id == 680000110 ){ 
            set = FieldSet( "Wedding1" );
            registerTransferField( 680000500, "" ); 
        }
        
      }
    }
  }
  else if (field.id == 680000300 ) 
    self.say("Welcome to Cherished Visage Photo Section! On here, we are taking a picture of you and your guests that will allow you to remember your very own Wedding day forever! The picture will be automatically taken after 1 minute timer runs out. So you need to be ready and try out some new poses before it's taken~ To see the picture that was taken, please visit WWW.NEXON.NET for more details.");
}


//Wedding Party NPC - Robin the Huntress
script "weddingParty" {
  inventory = target.inventory;
  field = self.field;
  if( field.id == 680000300  ) {
  // at the Photo map
    if ( target.isWeddingCouple == 1 ) {
      if ( inventory.itemCount(4031375)==1 or inventory.itemCount(4031376)==1) {
      //premium ticket user
        self.say( "For your first minute, the wedding photo will be taken automatically. From there, five more minutes will be given to you and your friends to just hang around. When all that is over, your Premium Hunting Event is awaiting you just around the corner! Hang on tight and be ready to fight some monsters before time runs out!" );
      }
      //normal ticket user
      else self.say (" Congratulations~ ");
    }
    else self.say( " Let's enjoy the party!~ ");
  }
  else if (field.id == 680000400  ) {
  // at the hunting map
    if ( inventory.itemCount( 4031409 ) < 5 ) self.say(" Hmm, looks like you're not done collecting keys. Come back when you've got five! ");
    else if (inventory.itemCount( 4031409 ) > 4) {
      self.say( " There's only one place I've seen those keys unlock. You're more than worthy having obtained it, head on inside and do your best!");
      ret = inventory.exchange(0, 4031409, -1, 4031409, -1, 4031409, -1, 4031409, -1, 4031409, -1);
      if( ret == 0) self.say("Oh dear, looks like I can't find that information right now...I'm having a bit of trouble with my database, please try again later!!!");
      else registerTransferField( 680000401, "" );
      
    }
  }
  else if (field.id == 680000401  ) {
  // at the hunting map
        nRet = self.askYesNo( "Do you want to go back outside?");
        if ( nRet == 0 ) self.say( "Ok, please let me know when you're ready to go!" );
        else {
          self.say( "Ok, I'll show you the way out. Have fun out there!");
           if (field.id == 680000401 ) registerTransferField( 680000500, "" );
        }
  }
}


// Wedding explanation (Ames the Wise)
script "abouttheWedding" {
while(1){
    v1 = self.askMenu( "Greetings Traveler! I trust your adventures have proven lively thus far. My name is Ames the Wise, and I'm the oldest citizen in Amoria. I can offer a lifetime's worth of advice if you want to get married. Would you like to know more?\r\n#b#L0#Yes, I'm interested in marriage.#l\r\n#L1#No, no...I'm definitely not ready for that. But I'd still like to see what Amoria's about. Do I have to be married?#l\r\n#L2#Ok, I think I'll talk to some people around here.#l\r\n#L3#How do I get engaged?#l\r\n#L4#How do I get married?#l\r\n#L5#I want to be married in the White Wedding Chapel!#l\r\n#L6#I want the wedding of my dreams in the Cathedral!#l\r\n#L7#How do I invite my friends?#l\r\n#L8#What happens after the Wedding?#l\r\n#L9#What's the difference between normal and Premium Weddings?#l\r\n#L10#What about Marriage Benefits?#l\r\n#L11#How do I get my marriage annulled?#l\r\n#L12#Ok, I understand the system. Thank you!#l#k" );
        if ( v1 == 0 ) {
            self.say( "Ready to get married, eh? First things first-congratulations! I'm happy for you. Second, you'll need to get engaged. After that, figure out where you want to get married-at the Cathedral or the White Wedding Chapel. Both are great places as far as I'm concerned." );
            self.say( "You'll also need a Normal or Premium Wedding ticket from the Cash Shop for either location-just one per couple. After that, you'll be happily married and enjoy the benefits of marriage. I can explain a little more if you want..." ); 
        }
        else if ( v1 == 1 ) {
            self.say( "Amoria welcomes everyone. You do not have to married to help some of the good townspeople around here-or hunt. I invite you to speak with a few of them and see if you can assist them. " );
        }
        else if ( v1 == 2 ) {
            self.say( "Great! Stay as long as you like. See me if you have some questions." );
            end;
        }
        else if ( v1 == 3 ) {
            self.say( "Good thinking. You'll have to be male to obtain an Engagement Ring. After you have one, select the propose option, and wait for a response from your sweetheart. I recommend both of you being online so you can celebrate. As for getting an engagement ring, I'd speak with Moony, our ring-maker." );
            self.say( "He's crafts the best rings I've ever seen-4 different kinds in fact. When you do select your engagement ring, please pick carefully-wouldn't want to make a mistake! What else is on your mind?" );
        }
        else if ( v1 == 4 ) {
            self.say( "Straight to the point, eh? I like that. Well, after you뭨e engaged, you뭠l need to speak with Wedding Coordinator Victoria or Wayne and make your reservation. You will need a normal or Premium Wedding Ticket from the Cash Shop, an Engagement Ring and some time. If you뭭e recently performed an annulment, then you뭠l need to wait 7 days before you can marry again and Moony will make you a new ring." );
            self.say( "There뭩 a bit more documentation for the Cathedral, they have a more elaborate system over there. Also, you뭠l need to tell the Wedding Coordinator your wish lists." );
            self.say( "Pila Present will hold them for you when your friends turn them in, and you can pick them up afterwards. You뭠l also get wedding invitations to send them. Do you know where you want to get married?" );
        }
        else if ( v1 == 5 ) {
            self.say( "Bit of an adventurous streak, I see. Pelvis Bebop and his crew know how to put on a nice show. Just speak with Wedding Assistant Bonnie, and be sure you have a Wedding Receipt, an Engagement Ring and about 5-10 minutes." );
            self.say( "The White Wedding Chapel is faster, and a little more care-free. Anything else you're interested in?" );
        }
        else if ( v1 == 6 ) {
            self.say( "Ah, the Cathedral. If there's a place you want to really want to get married in style, that's it. As I mentioned before, they have a more elaborate system, so you'll need to speak with High Priest John for his permission." );
            self.say( "The bride-to-be will also have to call on Mom and Dad to vouch for you both. To get married in the Cathedral, Just speak with Wedding Assistant Nicole and be sure you have a Wedding Receipt, the Officiator's Permission, and an Engagement Ring and about 10-20 minutes." );
            self.say( "Also, the Cathedral allows your guests to give the married couple an experience blessing during the wedding-1 exp per click, in fact. What else would you like to know?" );
        }
        else if ( v1 == 7 ) {
            self.say( "You will receive Wedding Invitations along with your Wedding ticket. If you need more, you can talk with one of the Wedding Assistants. The invitations are pretty simple, you just type in your friend's name, hit 밪end?and off they go." );
            self.say( "They'll land in the Etc slot-make sure they have a few spaces free. What else would you like to know?" );
        }
        else if ( v1 == 8 ) {
            self.say( "For the White Wedding Chapel and the cathedral, after the Wedding ends, you and your guests are sent to the photo area, Cherished Visage. You can snap away for 60 seconds, and then relax with the new couple for 5 minutes." );
            self.say( "After that, you're whisked back to Amoria. Unless you have a premium ticket, in which case you get to visit the famous Robin the Huntress. What else are you curious about?" );
        }
        else if ( v1 == 9 ) {
            self.say( "Well, the normal Wedding ticket is nice enough; however, the Premium Wedding ticket gives the newly married couple and their guests a Wedding Party afterwards at the Untamed Hearts Hunting Ground." );
            self.say( "It's hosted by the legendary lady archer herself, Robin the Huntress. There's quite a few valuables there I'm told, though you'll see for yourself." );
        }
        else if ( v1 == 10 ) {
            self.say( "Now you're talking. As a way to remember Elias the Hunter, Married Couples receive the rings, which produce an effect whenever you're near each other-it's different depending on the ring you choose. You'll also get to do some activities that are for Couples only." );
            self.say( "For instance, some of the townsfolk here will give you tasks that they wouldn't give others, they'll trust you a little more. It's a different lifestyle, and you'll always be with your sweetheart. What else can I assist with?" );
        }
        else if ( v1 == 11 ) {
            self.say( "Some marriages don't work out for the best. It's unfortunate, but you can visit Moony to end your marriage. Make sure you have a good amount of money as well. Anything else?" );
        }
        else if ( v1 == 12 ) {
            self.say( "My pleasure, friend! Visit me anytime if you need to know more." );
            end;
        }

    }
}

// Treasure/present exchange (Pila)
script "presentExchange" {
field = self.field;
inventory = target.inventory;

    if (field.id == 680000100 or field.id == 680000200) {
    // at the wating room for invited people
    v1 = self.askMenu( "Who do you want to give your present for? \r\n#L0#I will give my present for #bhandsome Groom#k.#l\r\n#L1#I will give my present for #bpretty Bride#k.#l" );
        if (v1 == 0){
            ret = target.openWishList( 1, 0 );
            if (ret == 1) self.say ( "There's no wedding currently in progress.");
        }
    if (v1 == 1){
        ret = target.openWishList( 1, 1 );
        if (ret == 1) self.say ( "There's no wedding currently in progress.");
    }    
    }
    else if (field.id == 680000000 ){
    // at the amoria for wedding couple
    v1 = self.askMenu( "How do I help you? \r\n#b#L0#I am about to finish my wedding and want to pick my presents which my friends gave to me.#l\r\n#L1#I have an #rOnyx Chest#k and want to ask for you to open it.#l\r\n#L2#I have an #rOnyx Chest for Bride and Groom#k and want to ask for you to open it.#l#k" );
        if (v1 == 0 and target.nGender == 0 ){
            ret = target.openWishList( 2, 0 );
            if (ret == 2) self.say ( "You are currently not married.");
        }
        if (v1 == 0 and target.nGender == 1 ){
            ret = target.openWishList( 2, 1 );
            if (ret == 2) self.say ( "You are currently not married.");
        }
        if (v1 == 1){
        // Onyx Chest 
        nRet1 = self.askYesNo ( "I've got some fabulous items ready for you. Are you ready to pick them out?" );
        if ( nRet1 != 0 )    {    // answer : Yes        
        if ( inventory.itemCount( 4031423 ) < 1 )    // there's no Onyx Chest
        self.say ( "I don't think you have an Onyx Chest that I can open, kid..." );
        else { // there's Onyx Chest
            if ( inventory.slotCount( 2 ) > inventory.holdCount( 2 ) and inventory.slotCount( 4 ) > inventory.holdCount( 4 ) and inventory.slotCount( 1 ) > inventory.holdCount( 1 ) )
             { // there's  empty slot.
                rn1 = random( 1, 10000 );
                        // opened the onyx chect                        
                if (1 <= rn1 and rn1 <= 2000) {
                ret = inventory.exchange( 0, 4031423, -1, 2022011, 1 );

                if (ret == 1) self.say ( "No problem! Give my best to the happy couple. I'll open this present for you now. Voila! \r\n #v2022011# #b#t2022011# " );
                else self.say("I'm sorry, but I can't give you the present if your inventory is full! Check your inventory and make the necessary adjustments~");                
                }
                else if (2000 < rn1 and rn1 <= 3500)     {
                ret = inventory.exchange( 0, 4031423, -1, 2020020, 1 );
                if (ret == 1) self.say ( "No problem! Give my best to the happy couple. I'll open this present for you now. Voila! \r\n #v2020020# #b#t2020020# " );
                else self.say("I'm sorry, but I can't give you the present if your inventory is full! Check your inventory and make the necessary adjustments~");
                }
                else if (3500 < rn1 and rn1 <= 4700)     {
                ret = inventory.exchange( 0, 4031423, -1, 2022001, 1 );
                if (ret == 1) self.say ( "No problem! Give my best to the happy couple. I'll open this present for you now. Voila! \r\n #v2022001# #b#t2022001# " );
                else self.say("I'm sorry, but I can't give you the present if your inventory is full! Check your inventory and make the necessary adjustments~");
                }
                else if (4700 < rn1 and rn1 <= 5900)     {
                ret = inventory.exchange( 0, 4031423, -1, 2022015, 1 );
                if (ret == 1) self.say ( "No problem! Give my best to the happy couple. I'll open this present for you now. Voila! \r\n #v2022015# #b#t2022015# " );
                else self.say("I'm sorry, but I can't give you the present if your inventory is full! Check your inventory and make the necessary adjustments~");
                }
                else if (5900 < rn1 and rn1 <= 7100)     {
                ret = inventory.exchange( 0, 4031423, -1, 2012001, 1 );
                if (ret == 1) self.say ( "No problem! Give my best to the happy couple. I'll open this present for you now. Voila! \r\n #v2012001# #b#t2012001# " );
                else self.say("I'm sorry, but I can't give you the present if your inventory is full! Check your inventory and make the necessary adjustments~");
                }
                else if (7100 < rn1 and rn1 <= 8000) {
                ret = inventory.exchange( 0, 4031423, -1, 2020015, 1 );
                if (ret == 1) self.say ( "No problem! Give my best to the happy couple. I'll open this present for you now. Voila! \r\n #v2020015# #b#t2020015# " );
                else self.say("I'm sorry, but I can't give you the present if your inventory is full! Check your inventory and make the necessary adjustments~");
                }            
                else if (8000 < rn1 and rn1 <= 8900) {
                ret = inventory.exchange( 0, 4031423, -1, 2022000, 1 );
                if (ret == 1) self.say ( "No problem! Give my best to the happy couple. I'll open this present for you now. Voila! \r\n #v2022000# #b#t2022000# " );
                else self.say("I'm sorry, but I can't give you the present if your inventory is full! Check your inventory and make the necessary adjustments~");
                }
                else if (8900 < rn1 and rn1 <= 9400) {
                ret = inventory.exchange( 0, 4031423, -1, 2002011, 1 );
                if (ret == 1) self.say ( "No problem! Give my best to the happy couple. I'll open this present for you now. Voila! \r\n #v2002011# #b#t2002011# " );
                else self.say("I'm sorry, but I can't give you the present if your inventory is full! Check your inventory and make the necessary adjustments~");
                }            
                else if (9400 < rn1 and rn1 <= 9670) {
                ret = inventory.exchange( 0, 4031423, -1, 4021007, 1 );
                if (ret == 1) self.say ( "No problem! Give my best to the happy couple. I'll open this present for you now. Voila! \r\n #v4021007# #b#t4021007# " );
                else self.say("I'm sorry, but I can't give you the present if your inventory is full! Check your inventory and make the necessary adjustments~");
                }            
                else if (9670 < rn1 and rn1 <= 9770) {
                ret = inventory.exchange( 0, 4031423, -1, 2001002, 1 );
                if (ret == 1) self.say ( "No problem! Give my best to the happy couple. I'll open this present for you now. Voila! \r\n #v2001002# #b#t2001002# " );
                else self.say("I'm sorry, but I can't give you the present if your inventory is full! Check your inventory and make the necessary adjustments~");
                }            
                else if (9770 < rn1 and rn1 <= 9870) {
                ret = inventory.exchange( 0, 4031423, -1, 2048001, 1 );
                if (ret == 1) self.say ( "No problem! Give my best to the happy couple. I'll open this present for you now. Voila! \r\n #v2048001# #b#t2048001# " );
                else self.say("I'm sorry, but I can't give you the present if your inventory is full! Check your inventory and make the necessary adjustments~");
                }            
                else if (9870 < rn1 and rn1 <= 9920) {
                ret = inventory.exchange( 0, 4031423, -1, 4021008, 1 );
                if (ret == 1) self.say ( "No problem! Give my best to the happy couple. I'll open this present for you now. Voila! \r\n #v4021008# #b#t4021008# " );
                else self.say("I'm sorry, but I can't give you the present if your inventory is full! Check your inventory and make the necessary adjustments~");
                }            
                else if (9920 < rn1 and rn1 <= 9945) {
                ret = inventory.exchange( 0, 4031423, -1, 1102024, 1 );
                if (ret == 1) self.say ( "No problem! Give my best to the happy couple. I'll open this present for you now. Voila! \r\n #v1102024# #b#t1102024# " );
                else self.say("I'm sorry, but I can't give you the present if your inventory is full! Check your inventory and make the necessary adjustments~");
                }            
                else if (9945 < rn1 and rn1 <= 9965) {
                ret = inventory.exchange( 0, 4031423, -1, 2041007, 1 );
                if (ret == 1) self.say ( "No problem! Give my best to the happy couple. I'll open this present for you now. Voila! \r\n #v2041007# #b#t2041007# " );
                else self.say("I'm sorry, but I can't give you the present if your inventory is full! Check your inventory and make the necessary adjustments~");
                }            
                else if (9965 < rn1 and rn1 <= 9985) {
                ret = inventory.exchange( 0, 4031423, -1, 2041010, 1 );
                if (ret == 1) self.say ( "No problem! Give my best to the happy couple. I'll open this present for you now. Voila! \r\n #v2041010# #b#t2041010# " );
                else self.say("I'm sorry, but I can't give you the present if your inventory is full! Check your inventory and make the necessary adjustments~");
                }            
                else if (9985 < rn1 and rn1 <= 9990) {
                ret = inventory.exchange( 0, 4031423, -1, 4011007, 1 );
                if (ret == 1) self.say ( "No problem! Give my best to the happy couple. I'll open this present for you now. Voila! \r\n #v4011007# #b#t4011007# " );
                else self.say("I'm sorry, but I can't give you the present if your inventory is full! Check your inventory and make the necessary adjustments~");
                }            
                else if (9990 < rn1 and rn1 <= 9995) {
                ret = inventory.exchange( 0, 4031423, -1, 4021009, 1 );
                if (ret == 1) self.say ( "No problem! Give my best to the happy couple. I'll open this present for you now. Voila! \r\n #v4021009# #b#t4021009# " );
                else self.say("I'm sorry, but I can't give you the present if your inventory is full! Check your inventory and make the necessary adjustments~");
                }            
                else if (9995 < rn1 and rn1 <= 9998) {
                ret = inventory.exchange( 0, 4031423, -1, 2000004, 1 );
                if (ret == 1) self.say ( "No problem! Give my best to the happy couple. I'll open this present for you now. Voila! \r\n #v2000004# #b#t2000004# " );
                else self.say("I'm sorry, but I can't give you the present if your inventory is full! Check your inventory and make the necessary adjustments~");
                }            
                else if (9998 < rn1 and rn1 <= 10000) {
                ret = inventory.exchange( 0, 4031423, -1, 2000005, 1 );
                if (ret == 1) self.say ( "No problem! Give my best to the happy couple. I'll open this present for you now. Voila! \r\n #v2000005# #b#t2000005# " );
                else self.say("I'm sorry, but I can't give you the present if your inventory is full! Check your inventory and make the necessary adjustments~");
                }                                
            } 
            else // there's no empty slot.
                self.say("I'm sorry, but I can't open and give you this present if your inventory is full! Check your inventory and make the necessary adjustments~"); 
            
        }
        }    
        else // answer : No
        self.say ( "Awww, really? I'm the only one who can open your Onyx Chest! I will be here and wait for you~" );
        }
        if (v1 == 2){
        // Onyx Chest 
        nRet1 = self.askYesNo ( "I've got some fabulous items ready for you. Are you ready to pick them out?" );
        if ( nRet1 != 0 )    {    // answer : Yes        
        if ( inventory.itemCount( 4031424 ) < 1 )    // there's no Onyx Chest
        self.say ( "I don't think you have an #rOnyx Chest for Bride and Groom#k that I can open, kid..." );
        else { // there's Onyx Chest
            if ( inventory.slotCount( 2 ) > inventory.holdCount( 2 ) )
             { // there's  empty slot.
                rn1 = random( 1, 1000 );
                        // opened the onyx chect                        
                if (1 <= rn1 and rn1 <= 190) {
                ret = inventory.exchange( 0, 4031424, -1, 2000006, 1 );
                if (ret == 1) self.say ( "No problem! Give my best to the happy couple. I'll open this present for you now. Voila! \r\n #v2000006# #b#t2000006# " );
                else self.say("I'm sorry, but I can't give you the present if your inventory is full! Check your inventory and make the necessary adjustments~");                
                }
                else if (190 < rn1 and rn1 <= 390)     {
                ret = inventory.exchange( 0, 4031424, -1, 2000005, 1 );
                if (ret == 1) self.say ( "No problem! Give my best to the happy couple. I'll open this present for you now. Voila! \r\n #v2000005# #b#t2000005# " );
                else self.say("I'm sorry, but I can't give you the present if your inventory is full! Check your inventory and make the necessary adjustments~");
                }
                else if (390 < rn1 and rn1 <= 499)     {
                ret = inventory.exchange( 0, 4031424, -1, 2000004, 1 );
                if (ret == 1) self.say ( "No problem! Give my best to the happy couple. I'll open this present for you now. Voila! \r\n #v2000004# #b#t2000004# " );
                else self.say("I'm sorry, but I can't give you the present if your inventory is full! Check your inventory and make the necessary adjustments~");
                }
                else if (499 < rn1 and rn1 <= 599)     {
                ret = inventory.exchange( 0, 4031424, -1, 2022123, 2 );
                if (ret == 1) self.say ( "No problem! Give my best to the happy couple. I'll open this present for you now. Voila! \r\n 2 #v2022123# #b#t2022123# " );
                else self.say("I'm sorry, but I can't give you the present if your inventory is full! Check your inventory and make the necessary adjustments~");
                }
                else if (599 < rn1 and rn1 <= 619)     {
                ret = inventory.exchange( 0, 4031424, -1, 1102021, 1 );
                if (ret == 1) self.say ( "No problem! Give my best to the happy couple. I'll open this present for you now. Voila! \r\n #v1102021# #b#t1102021# " );
                else self.say("I'm sorry, but I can't give you the present if your inventory is full! Check your inventory and make the necessary adjustments~");
                }
                else if (619 < rn1 and rn1 <= 639) {
                ret = inventory.exchange( 0, 4031424, -1, 1102024, 1 );
                if (ret == 1) self.say ( "No problem! Give my best to the happy couple. I'll open this present for you now. Voila! \r\n #v1102024# #b#t1102024# " );
                else self.say("I'm sorry, but I can't give you the present if your inventory is full! Check your inventory and make the necessary adjustments~");
                }            
                else if (639 < rn1 and rn1 <= 689) {
                ret = inventory.exchange( 0, 4031424, -1, 2022121, 2 );
                if (ret == 1) self.say ( "No problem! Give my best to the happy couple. I'll open this present for you now. Voila! \r\n 2 #v2022121# #b#t2022121# " );
                else self.say("I'm sorry, but I can't give you the present if your inventory is full! Check your inventory and make the necessary adjustments~");
                }
                else if (689 < rn1 and rn1 <= 699) {
                ret = inventory.exchange( 0, 4031424, -1, 1032027, 1 );
                if (ret == 1) self.say ( "No problem! Give my best to the happy couple. I'll open this present for you now. Voila! \r\n #v1032027# #b#t1032027# " );
                else self.say("I'm sorry, but I can't give you the present if your inventory is full! Check your inventory and make the necessary adjustments~");
                }
                else if (699 < rn1 and rn1 <= 774) {
                ret = inventory.exchange( 0, 4031424, -1, 2041022, 1 );
                if (ret == 1) self.say ( "No problem! Give my best to the happy couple. I'll open this present for you now. Voila! \r\n #v2041022# #b#t2041022# " );
                else self.say("I'm sorry, but I can't give you the present if your inventory is full! Check your inventory and make the necessary adjustments~");
                }
                else if (774 < rn1 and rn1 <= 849) {
                ret = inventory.exchange( 0, 4031424, -1, 2041019, 1 );
                if (ret == 1) self.say ( "No problem! Give my best to the happy couple. I'll open this present for you now. Voila! \r\n #v2041019# #b#t2041019# " );
                else self.say("I'm sorry, but I can't give you the present if your inventory is full! Check your inventory and make the necessary adjustments~");
                }
                else if (849< rn1 and rn1 <= 924) {
                ret = inventory.exchange( 0, 4031424, -1, 2041016, 1 );
                if (ret == 1) self.say ( "No problem! Give my best to the happy couple. I'll open this present for you now. Voila! \r\n #v2041016# #b#t2041016# " );
                else self.say("I'm sorry, but I can't give you the present if your inventory is full! Check your inventory and make the necessary adjustments~");
                }                
                else if (924< rn1 and rn1 <= 999) {
                ret = inventory.exchange( 0, 4031424, -1, 2041013, 1 );
                if (ret == 1) self.say ( "No problem! Give my best to the happy couple. I'll open this present for you now. Voila! \r\n #v2041013# #b#t2041013# " );
                else self.say("I'm sorry, but I can't give you the present if your inventory is full! Check your inventory and make the necessary adjustments~");
                }
                else if (999 < rn1 and rn1 <= 1000) {
                ret = inventory.exchange( 0, 4031424, -1, 1082148, 1 );
                if (ret == 1) self.say ( "No problem! Give my best to the happy couple. I'll open this present for you now. Voila! \r\n #v1082148# #b#t1082148# " );
                else self.say("I'm sorry, but I can't give you the present if your inventory is full! Check your inventory and make the necessary adjustments~");
                }                                        
            } 
            else // there's no empty slot.
                self.say("I'm sorry, but I can't open and give you this present if your inventory is full! Check your inventory and make the necessary adjustments~"); 
        }
        }    
        else // answer : No
        self.say ( "Awww, really? I'm the only one who can open your Onyx Chest! I will be here and wait for you~" );
        }        
    }
}

//Wedding Thomas Swift Wedding Village Portal NPC
script "Thomas" {
field = self.field;
if ( field.id == 680000000 ) {
    nRet = self.askYesNo( "I can take you back to your original location. Are you ready to go?");
    if ( nRet == 1 ) { 
        self.say( "I hope you had a great time! See you around!" );
        registerTransferField( 100000000, "" );
    }
    else self.say( "Ok, feel free to hang around until you're ready to go!");
}
else if ( field.id == 100000000 ){
    nRet = self.askYesNo( "I can take you to Amoria Village. Are you ready to go?");
    if ( nRet == 1 ) { 
        self.say( "I hope you had a great time! See you around!" );
        registerTransferField( 680000000, "" );
    }
    else self.say( "Ok, feel free to hang around until you're ready to go!");

}        

    
}

function(integer) takeaway_engageitem (integer takeaway) {    
    inven = target.inventory;

    nItem = inven.itemCount(4031357) ; // moonrock empty box
    if ( nItem > 0 ) {
        ret = inven.exchange( 0, 4031357, -nItem, 1112803, 1 );
        if (ret == 1 ) takeaway = 1;
        else takeaway = 2;        
    }
    
    nItem = inven.itemCount(4031358) ; // moonrock ring
    if ( nItem > 0 ) {
        ret = inven.exchange( 0, 4031358, -nItem, 1112803, 1 );
        if (ret == 1 ) takeaway = 1;
        else takeaway = 2;
    }
    
    nItem = inven.itemCount(4031359) ; // starrock emmty box
    if ( nItem > 0 ) {
        ret = inven.exchange( 0, 4031359, -nItem, 1112806, 1 );
        if (ret == 1 ) takeaway = 1;
        else takeaway = 2;
    }
    
    nItem = inven.itemCount(4031360) ; // starrock ring
    if ( nItem > 0 ) {
        ret = inven.exchange( 0, 4031360, -nItem, 1112806, 1 );
        if (ret == 1 ) takeaway = 1;
        else takeaway = 2;
    }
    
    nItem = inven.itemCount(4031361) ; // golden empty box
    if ( nItem > 0 ) {
        ret = inven.exchange( 0, 4031361, -nItem, 1112807, 1 );
        if (ret == 1 ) takeaway = 1;
        else takeaway = 2;
    }
    
    nItem = inven.itemCount(4031362) ; // golden ring
    if ( nItem > 0 ) {
        ret = inven.exchange( 0, 4031362, -nItem, 1112807, 1 );
        if (ret == 1 ) takeaway = 1;
        else takeaway = 2;
    }
    
    nItem = inven.itemCount(4031363) ; // silver empty box
    if ( nItem > 0 ) {
        ret = inven.exchange( 0, 4031363, -nItem, 1112809, 1 );
        if (ret == 1 ) takeaway = 1;
        else takeaway = 2;
    }
    
    nItem = inven.itemCount(4031364) ; // silver ring
    if ( nItem > 0 ) {    
        ret = inven.exchange( 0, 4031364, -nItem, 1112809, 1 );
        if (ret == 1 ) takeaway = 1;
        else takeaway = 2;
    }
    
    return takeaway ;
}

script "ExitWedding" {

    inventory = target.inventory;
    qr = target.questRecord;
    val = qr.getState( 8862 );    
    
    nRet = self.askYesNo( "I can take you to Amoria Village. Are you ready to go?");
    if ( nRet == 1 ) {        
        if ( target.IsMarried == 1) {        
        
            takeaway = 0 ;
            takeaway = takeaway_engageitem(takeaway);
            
            if (takeaway == 1) {            //  the bride and the groom - success
                        
                qr.set( 8862, "1" );                
                qr.setComplete( 8862 );
        
                ret = inventory.exchange( 0, 4031424, 1 ); // Onyx Chest for Bride and Groom
                
                nItem = inventory.itemCount(4031376) ; // VEGAS_PREMIUM
                if ( nItem > 0 )     ret = inventory.exchange( 0, 4031376, -nItem );
                
                nItem = inventory.itemCount(4031375) ; // CATHEDRAL_PREMIUM
                if ( nItem > 0 )     ret = inventory.exchange( 0, 4031375, -nItem );
                
                nItem = inventory.itemCount(4031481) ; // VEGAS_NORMAL
                if ( nItem > 0 )     ret = inventory.exchange( 0, 4031481, -nItem );
                
                nItem = inventory.itemCount(4031480) ; // CATHEDRAL_NORMAL
                if ( nItem > 0 )     ret = inventory.exchange( 0, 4031480, -nItem );
                
                nItem = inventory.itemCount(4031377) ; // VEGAS
                if ( nItem > 0 )     ret = inventory.exchange( 0, 4031377, -nItem );
                
                nItem = inventory.itemCount(4031395) ; // CATHEDRAL 
                if ( nItem > 0 )     ret = inventory.exchange( 0, 4031395, -nItem );
                
                nItem = inventory.itemCount(4031374) ; // OFFICIATORS_PERMISSION 
                if ( nItem > 0 )     ret = inventory.exchange( 0, 4031374, -nItem );
                
                self.say( "Congratulates!!! I hope you had a great time! See you around!" );
                registerTransferField( 680000000, "" );                
            } 
            else if (takeaway == 2)          //  the bride and the groom - fail
                self.say("I'm sorry but I keep having trouble putting an item into your#bEquip#k inventory. You need at least one #bEquip#k slot to get a wedding ring. Please check back with me later."); 
            else if (takeaway == 0)  {        //congratulators( already married)
                self.say( "The wedding congratulator!!! I hope you had a great time in your friend's wedding. See you again!" );    
                registerTransferField( 680000000, "" );
            }            
        }
        else {    //congratulators or failed wedding couples
            self.say( "I hope you had a great time! See you someday when you get merried." );
            registerTransferField( 680000000, "" );
        }
    }
    else  self.say( "Ok, feel free to hang around here until you're ready to go out!");    
}

This is all you need to get everything working. I must say that I didn't have BMS leak knowledge during the beginning of this so I was unaware of how Nexon did them. You're better off just looking at it yourself and converting as you'll be able to get everything you need from there.
 
Last edited:
Initiate Mage
Joined
May 28, 2012
Messages
44
Reaction score
6
WOOOOOOOOOOOOOOOOOOOOOOOOOOOOOW!!!!!!
what about wedding ring effects between the lovers? like those weird birds effect for moonstone and stuff...
 
🎀 Moderator 🎀
Staff member
Moderator
Joined
Jan 18, 2010
Messages
3,109
Reaction score
1,136
WOOOOOOOOOOOOOOOOOOOOOOOOOOOOOW!!!!!!
what about wedding ring effects between the lovers? like those weird birds effect for moonstone and stuff...

If you properly add all of the code and convert everything yourself, then everything below will work:
- All GMS's Amorian NPC's (Moony for Engagements, the NPC's for real Weddings (like reservations and etc), the styles, the wishlists, etc)
- Engagement Proposal Actions (send, cancel, accept/deny) -- properly gives engagement ring boxes as well to the couple
- MiniMap's loverPos for your engagement partner
- Wedding Ceremony effects (the priest's that popup for all players attending the wedding)
- Wedding Wishlists
- Wedding invitations (should be re-done to what nexon does, my way based it off the slot number..)
- Spouse chat
- and lastly, yes, working Wedding Ring Effects between the lovers. They work for all parties as well (1st, 2nd, and 3rd).

EDIT: As for the ring effects though, the part included is only 1st person. For 3rd, you have to EncodeMarriageInfo in OnUserEnterField (spawnPlayerMapObject).

The three should be in order:
Code:
CUser.EncodeCoupleInfo(mplew, chr);
CUser.EncodeFriendshipInfo(mplew, chr);
CUser.EncodeMarriageInfo(mplew, chr);

After you found your friendship ring bytes, you can add your marriage ring ones: (though this part is probably already in your source)

PHP:
public static void EncodeMarriageInfo(MaplePacketLittleEndianWriter mplew, MapleCharacter chr) {
        for (MapleRing ring : chr.getCharacterData().getMarriageRecord()) {
            if (ring.equipped()) {
                mplew.write(1);
                mplew.writeInt(chr.getId()); // dwGroomID
                mplew.writeInt(ring.getPartnerChrId()); // dwBrideID
                mplew.writeInt(ring.getItemId()); // m_aRealEquip[g_anRingBodyPart].p.nItemID
                return;
            }
        }
        mplew.write(0);
    }
 
Last edited:
(O_o(o_O(O_O)o_O)O_o)
Member
Joined
Apr 9, 2009
Messages
1,088
Reaction score
322
I'm sooo gonna try adding this to acernis. Hope i can make it work <3. (Think i can, might take a while finding the right headers though, asuming they differ per version as usual)
 
Custom Title Activated
Member
Joined
Mar 14, 2010
Messages
5,363
Reaction score
1,343
I'm sooo gonna try adding this to acernis. Hope i can make it work <3. (Think i can, might take a while finding the right headers though, asuming they differ per version as usual)

OnCoupleMessageis in CField::OnPacket at the very bottom ish in the only remaining long good structured switch case

The rest of wedding can be gotten via xref from CField::OnPacket (Which also includes most, if not all, of the other events)
 
Elite Diviner
Joined
May 4, 2011
Messages
491
Reaction score
105
OnCoupleMessageis in CField::OnPacket at the very bottom ish in the only remaining long good structured switch case

The rest of wedding can be gotten via xref from CField::OnPacket (Which also includes most, if not all, of the other events)

Thank you <3
 
(O_o(o_O(O_O)o_O)O_o)
Member
Joined
Apr 9, 2009
Messages
1,088
Reaction score
322
OnCoupleMessageis in CField::OnPacket at the very bottom ish in the only remaining long good structured switch case

The rest of wedding can be gotten via xref from CField::OnPacket (Which also includes most, if not all, of the other events)

You are the best <3 especially since you also have the IDB's ready to go :D THANK YOU!

--edit:

As a kind gesture I'll post the scripts here after I coded them. Will spare others some time. Least I can do after a release like this.
 
Initiate Mage
Joined
Apr 8, 2014
Messages
7
Reaction score
0
lol yeaaaaahhhh... for anyone reading this wondering why OP didn't write what version this is for, it's for v1.11.
 
(O_o(o_O(O_O)o_O)O_o)
Member
Joined
Apr 9, 2009
Messages
1,088
Reaction score
322
Updated thread. Included all of the NPC's for the weddings. :)

Wow you beat me to it, was working on them already xD. Ah well, at least i can still post some opcodes for a couple different versions later :D
 
(O_o(o_O(O_O)o_O)O_o)
Member
Joined
Apr 9, 2009
Messages
1,088
Reaction score
322
this work for v62 leaderms source?

Does amoria exist in v62? If so, I'm pretty sure at least most of it will work. As long as you get the right opcodes/ headers.
 
🎀 Moderator 🎀
Staff member
Moderator
Joined
Jan 18, 2010
Messages
3,109
Reaction score
1,136
Oh wow, here i was thinking it was added somewhere after v55. I've never been so far off before..

Well, you have Crush Rings in v.40 Beta Edition before we even had Friendships and stuff soo ye lmao
 
Junior Spellweaver
Joined
Apr 18, 2008
Messages
108
Reaction score
46
this work for v62 leaderms source?
The logic is the same regardless of source and version... Having started the process of implementing this into my LeaderMS-based development, I can say that the methods and general structure are drastically different. It will take a significant amount of method re-naming/re-writing... Furthermore, LeaderMS has a very crappy implementation of rings and such that kind of "works", but it isn't at all how it should have been done. Thus you'll likely have to remove a lot of that junk too.

Short Answer: Yes, it will work if you know what you're doing and are willing to go through the effort to re-write things. If you're not skilled with java, well... good luck.
 
🎀 Moderator 🎀
Staff member
Moderator
Joined
Jan 18, 2010
Messages
3,109
Reaction score
1,136
The logic is the same regardless of source and version... Having started the process of implementing this into my LeaderMS-based development, I can say that the methods and general structure are drastically different. It will take a significant amount of method re-naming/re-writing... Furthermore, LeaderMS has a very crappy implementation of rings and such that kind of "works", but it isn't at all how it should have been done. Thus you'll likely have to remove a lot of that junk too.

Short Answer: Yes, it will work if you know what you're doing and are willing to go through the effort to re-write things. If you're not skilled with java, well... good luck.

If you're not skilled with Java nor know how to re-write things then they shouldn't be viewing this thread in the first place.. ;P
 
Experienced Elementalist
Joined
Sep 8, 2012
Messages
260
Reaction score
6
For some reason only 3rd party users are seeing the rings effects, I'm using MapleBlade/KyraMS. Anyone has any idea where I should start looking for making it so the groom and the bride will be able to see it aswell?
 
Status
Not open for further replies.
Back
Top