Exemple #1
0
        /// <summary>
        /// Gets the player's quickbar slot info
        /// </summary>
        /// <param name="player"></param>
        /// <param name="slot"></param>
        /// <returns></returns>
        public static QuickBarSlot GetQuickBarSlot(NWPlayer player, int slot)
        {
            string       sFunc = "GetQuickBarSlot";
            QuickBarSlot qbs   = new QuickBarSlot();

            NWNX_PushArgumentInt(NWNX_Player, sFunc, slot);
            NWNX_PushArgumentObject(NWNX_Player, sFunc, player.Object);
            NWNX_CallFunction(NWNX_Player, sFunc);

            qbs.Associate     = (NWNX_GetReturnValueObject(NWNX_Player, sFunc));
            qbs.AssociateType = NWNX_GetReturnValueInt(NWNX_Player, sFunc);
            qbs.DomainLevel   = NWNX_GetReturnValueInt(NWNX_Player, sFunc);
            qbs.MetaType      = NWNX_GetReturnValueInt(NWNX_Player, sFunc);
            qbs.INTParam1     = NWNX_GetReturnValueInt(NWNX_Player, sFunc);
            qbs.ToolTip       = NWNX_GetReturnValueString(NWNX_Player, sFunc);
            qbs.CommandLine   = NWNX_GetReturnValueString(NWNX_Player, sFunc);
            qbs.CommandLabel  = NWNX_GetReturnValueString(NWNX_Player, sFunc);
            qbs.Resref        = NWNX_GetReturnValueString(NWNX_Player, sFunc);
            qbs.MultiClass    = NWNX_GetReturnValueInt(NWNX_Player, sFunc);
            qbs.ObjectType    = (QuickBarSlotType)NWNX_GetReturnValueInt(NWNX_Player, sFunc);
            qbs.SecondaryItem = (NWNX_GetReturnValueObject(NWNX_Player, sFunc));
            qbs.Item          = (NWNX_GetReturnValueObject(NWNX_Player, sFunc));

            return(qbs);
        }
Exemple #2
0
        /// <summary>
        /// Create a QBS for toggling a mode
        /// </summary>
        /// <param name="nMode"></param>
        /// <returns></returns>
        public static QuickBarSlot ToggleMode(int nMode)
        {
            QuickBarSlot qbs = Empty(QuickBarSlotType.ModeToggle);

            qbs.INTParam1 = nMode;

            return(qbs);
        }
Exemple #3
0
        /// <summary>
        /// Create a QBS for using a skill
        /// </summary>
        /// <param name="nSkill"></param>
        /// <returns></returns>
        public static QuickBarSlot UseSkill(int nSkill)
        {
            QuickBarSlot qbs = Empty(QuickBarSlotType.Skill);

            qbs.INTParam1 = nSkill;

            return(qbs);
        }
Exemple #4
0
        /// <summary>
        /// Create a QBS for quickchat command
        /// </summary>
        /// <param name="nCommand"></param>
        /// <returns></returns>
        public static QuickBarSlot QuickChat(int nCommand)
        {
            QuickBarSlot qbs = Empty(QuickBarSlotType.QuickChat);

            qbs.INTParam1 = nCommand;

            return(qbs);
        }
Exemple #5
0
        /// <summary>
        /// Create a QBS for emoting
        /// </summary>
        /// <param name="nEmote"></param>
        /// <returns></returns>
        public static QuickBarSlot Emote(int nEmote)
        {
            QuickBarSlot qbs = Empty(QuickBarSlotType.Emote);

            qbs.INTParam1 = nEmote;

            return(qbs);
        }
Exemple #6
0
        /// <summary>
        /// Create a QBS for using a feat
        /// </summary>
        /// <param name="nFeat"></param>
        /// <returns></returns>
        public static QuickBarSlot UseFeat(int nFeat)
        {
            QuickBarSlot qbs = Empty(QuickBarSlotType.Feat);

            qbs.INTParam1 = nFeat;

            return(qbs);
        }
Exemple #7
0
        /// <summary>
        /// Create a QBS for equipping an item
        /// </summary>
        /// <param name="oItem"></param>
        /// <param name="oSecondaryItem"></param>
        /// <returns></returns>
        public static QuickBarSlot EquipItem(NWItem oItem, NWItem oSecondaryItem)
        {
            QuickBarSlot qbs = Empty(QuickBarSlotType.Item);

            qbs.Item          = oItem;
            qbs.SecondaryItem = oSecondaryItem;

            return(qbs);
        }
Exemple #8
0
        /// <summary>
        /// Create a QBS for using an item
        /// </summary>
        /// <param name="oItem"></param>
        /// <param name="nPropertyID"></param>
        /// <returns></returns>
        public static QuickBarSlot UseItem(NWItem oItem, int nPropertyID)
        {
            QuickBarSlot qbs = Empty(QuickBarSlotType.Item);

            qbs.Item      = oItem;
            qbs.INTParam1 = nPropertyID;

            return(qbs);
        }
Exemple #9
0
        /// <summary>
        /// Create a QBS for running a command
        /// </summary>
        /// <param name="sCommandLabel"></param>
        /// <param name="sCommandLine"></param>
        /// <returns></returns>
        public static QuickBarSlot Command(string sCommandLabel, string sCommandLine)
        {
            QuickBarSlot qbs = Empty(QuickBarSlotType.Command);

            qbs.CommandLabel = sCommandLabel;
            qbs.CommandLine  = sCommandLine;

            return(qbs);
        }
Exemple #10
0
        /// <summary>
        /// Create a QBS for casting a spell
        /// </summary>
        /// <param name="nSpell"></param>
        /// <param name="nCasterLevel"></param>
        /// <returns></returns>
        public static QuickBarSlot UseSpecialAbility(int nSpell, int nCasterLevel)
        {
            QuickBarSlot qbs = Empty(QuickBarSlotType.Spell);

            qbs.INTParam1   = nSpell;
            qbs.DomainLevel = nCasterLevel;

            return(qbs);
        }
Exemple #11
0
        /// <summary>
        /// Create a QBS for casting a spell
        /// </summary>
        /// <param name="nSpell"></param>
        /// <param name="nClassIndex"></param>
        /// <param name="nMetamagic"></param>
        /// <param name="nDomainLevel"></param>
        /// <returns></returns>
        public static QuickBarSlot CastSpell(int nSpell, int nClassIndex, int nMetamagic, int nDomainLevel)
        {
            QuickBarSlot qbs = Empty(QuickBarSlotType.Spell);

            qbs.INTParam1   = nSpell;
            qbs.MultiClass  = nClassIndex;
            qbs.MetaType    = nMetamagic;
            qbs.DomainLevel = nDomainLevel;

            return(qbs);
        }
Exemple #12
0
 // Sets a player's quickbar slot
 public static void SetQuickBarSlot(uint player, int slot, QuickBarSlot qbs)
 {
     Internal.NativeFunctions.nwnxSetFunction(PLUGIN_NAME, "SetQuickBarSlot");
     Internal.NativeFunctions.nwnxPushObject(qbs.Item ?? Internal.OBJECT_INVALID);
     Internal.NativeFunctions.nwnxPushObject(qbs.SecondaryItem ?? Internal.OBJECT_INVALID);
     Internal.NativeFunctions.nwnxPushInt((int)qbs.ObjectType);
     Internal.NativeFunctions.nwnxPushInt(qbs.MultiClass);
     Internal.NativeFunctions.nwnxPushString(qbs.Resref !);
     Internal.NativeFunctions.nwnxPushString(qbs.CommandLabel !);
     Internal.NativeFunctions.nwnxPushString(qbs.CommandLine !);
     Internal.NativeFunctions.nwnxPushString(qbs.ToolTip !);
     Internal.NativeFunctions.nwnxPushInt(qbs.INTParam1);
     Internal.NativeFunctions.nwnxPushInt(qbs.MetaType);
     Internal.NativeFunctions.nwnxPushInt(qbs.DomainLevel);
     Internal.NativeFunctions.nwnxPushInt(qbs.AssociateType);
     Internal.NativeFunctions.nwnxPushObject(qbs.Associate ?? Internal.OBJECT_INVALID);
     Internal.NativeFunctions.nwnxPushInt(slot);
     Internal.NativeFunctions.nwnxPushObject(player !);
     Internal.NativeFunctions.nwnxCallFunction();
 }
Exemple #13
0
        /// <summary>
        /// Create an empty QBS of given type
        /// </summary>
        /// <param name="type"></param>
        /// <returns></returns>
        public static QuickBarSlot Empty(QuickBarSlotType type)
        {
            QuickBarSlot qbs = new QuickBarSlot
            {
                ObjectType    = type,
                Item          = (new Object()),
                SecondaryItem = (new Object()),
                MultiClass    = 0,
                Resref        = "",
                CommandLabel  = "",
                CommandLine   = "",
                ToolTip       = "",
                INTParam1     = 0,
                MetaType      = 0,
                DomainLevel   = 0,
                AssociateType = 0,
                Associate     = (new Object())
            };

            return(qbs);
        }
Exemple #14
0
        /// <summary>
        /// Sets a player's quickbar slot
        /// </summary>
        /// <param name="player"></param>
        /// <param name="slot"></param>
        /// <param name="qbs"></param>
        public static void SetQuickBarSlot(NWPlayer player, int slot, QuickBarSlot qbs)
        {
            string sFunc = "SetQuickBarSlot";

            NWNX_PushArgumentObject(NWNX_Player, sFunc, qbs.Item.Object);
            NWNX_PushArgumentObject(NWNX_Player, sFunc, qbs.SecondaryItem.Object);
            NWNX_PushArgumentInt(NWNX_Player, sFunc, (int)qbs.ObjectType);
            NWNX_PushArgumentInt(NWNX_Player, sFunc, qbs.MultiClass);
            NWNX_PushArgumentString(NWNX_Player, sFunc, qbs.Resref);
            NWNX_PushArgumentString(NWNX_Player, sFunc, qbs.CommandLabel);
            NWNX_PushArgumentString(NWNX_Player, sFunc, qbs.CommandLine);
            NWNX_PushArgumentString(NWNX_Player, sFunc, qbs.ToolTip);
            NWNX_PushArgumentInt(NWNX_Player, sFunc, qbs.INTParam1);
            NWNX_PushArgumentInt(NWNX_Player, sFunc, qbs.MetaType);
            NWNX_PushArgumentInt(NWNX_Player, sFunc, qbs.DomainLevel);
            NWNX_PushArgumentInt(NWNX_Player, sFunc, qbs.AssociateType);
            NWNX_PushArgumentObject(NWNX_Player, sFunc, qbs.Associate.Object);

            NWNX_PushArgumentInt(NWNX_Player, sFunc, slot);
            NWNX_PushArgumentObject(NWNX_Player, sFunc, player.Object);
            NWNX_CallFunction(NWNX_Player, sFunc);
        }
Exemple #15
0
        // Gets the player's quickbar slot info
        public static QuickBarSlot GetQuickBarSlot(uint player, int slot)
        {
            Internal.NativeFunctions.nwnxSetFunction(PLUGIN_NAME, "GetQuickBarSlot");
            var qbs = new QuickBarSlot();

            Internal.NativeFunctions.nwnxPushInt(slot);
            Internal.NativeFunctions.nwnxPushObject(player);
            Internal.NativeFunctions.nwnxCallFunction();
            qbs.Associate     = Internal.NativeFunctions.nwnxPopObject();
            qbs.AssociateType = Internal.NativeFunctions.nwnxPopInt();
            qbs.DomainLevel   = Internal.NativeFunctions.nwnxPopInt();
            qbs.MetaType      = Internal.NativeFunctions.nwnxPopInt();
            qbs.INTParam1     = Internal.NativeFunctions.nwnxPopInt();
            qbs.ToolTip       = Internal.NativeFunctions.nwnxPopString();
            qbs.CommandLine   = Internal.NativeFunctions.nwnxPopString();
            qbs.CommandLabel  = Internal.NativeFunctions.nwnxPopString();
            qbs.Resref        = Internal.NativeFunctions.nwnxPopString();
            qbs.MultiClass    = Internal.NativeFunctions.nwnxPopInt();
            qbs.ObjectType    = (QuickBarSlotType)Internal.NativeFunctions.nwnxPopInt();
            qbs.SecondaryItem = Internal.NativeFunctions.nwnxPopObject();
            qbs.Item          = Internal.NativeFunctions.nwnxPopObject();
            return(qbs);
        }