Example #1
0
        /// Gets the player's quickbar slot info
        /// <param name="player">The player object.</param>
        /// <param name="slot">Slot ID 0-35</param>
        /// <returns>An NWNX_Player_QuickBarSlot struct.</returns>
        public static QuickBarSlot GetQuickBarSlot(uint player, int slot)
        {
            const string sFunc = "GetQuickBarSlot";

            VM.NWNX.SetFunction(NWNX_Player, sFunc);
            QuickBarSlot qbs = default;

            VM.NWNX.StackPush(slot);
            VM.NWNX.StackPush(player);
            VM.NWNX.Call();
            qbs.oAssociate     = VM.NWNX.StackPopObject();
            qbs.nAssociateType = VM.NWNX.StackPopInt();
            qbs.nDomainLevel   = VM.NWNX.StackPopInt();
            qbs.nMetaType      = VM.NWNX.StackPopInt();
            qbs.nINTParam1     = VM.NWNX.StackPopInt();
            qbs.sToolTip       = VM.NWNX.StackPopString();
            qbs.sCommandLine   = VM.NWNX.StackPopString();
            qbs.sCommandLabel  = VM.NWNX.StackPopString();
            qbs.sResRef        = VM.NWNX.StackPopString();
            qbs.nMultiClass    = VM.NWNX.StackPopInt();
            qbs.nObjectType    = VM.NWNX.StackPopInt();
            qbs.oSecondaryItem = VM.NWNX.StackPopObject();
            qbs.oItem          = VM.NWNX.StackPopObject();
            return(qbs);
        }
Example #2
0
        /// Sets the player&apos;s quickbar slot info
        /// <param name="player">The player object.</param>
        /// <param name="slot">Slot ID 0-35</param>
        /// <param name="qbs">An NWNX_Player_QuickBarSlot struct.</param>
        public static void SetQuickBarSlot(uint player, int slot, QuickBarSlot qbs)
        {
            const string sFunc = "SetQuickBarSlot";

            VM.NWNX.SetFunction(NWNX_Player, sFunc);
            VM.NWNX.StackPush(qbs.oItem);
            VM.NWNX.StackPush(qbs.oSecondaryItem);
            VM.NWNX.StackPush(qbs.nObjectType);
            VM.NWNX.StackPush(qbs.nMultiClass);
            VM.NWNX.StackPush(qbs.sResRef);
            VM.NWNX.StackPush(qbs.sCommandLabel);
            VM.NWNX.StackPush(qbs.sCommandLine);
            VM.NWNX.StackPush(qbs.sToolTip);
            VM.NWNX.StackPush(qbs.nINTParam1);
            VM.NWNX.StackPush(qbs.nMetaType);
            VM.NWNX.StackPush(qbs.nDomainLevel);
            VM.NWNX.StackPush(qbs.nAssociateType);
            VM.NWNX.StackPush(qbs.oAssociate);
            VM.NWNX.StackPush(slot);
            VM.NWNX.StackPush(player);
            VM.NWNX.Call();
        }