Пример #1
0
 // Sets the special ability at the provided index for the provided creature to the provided ability.
 // Index bounds: 0 <= index < GetSpecialAbilityCount(creature).
 public static void SetSpecialAbility(uint creature, int index, SpecialAbilitySlot ability)
 {
     Internal.NativeFunctions.nwnxSetFunction(PLUGIN_NAME, "SetSpecialAbility");
     Internal.NativeFunctions.nwnxPushInt(ability.ID);
     Internal.NativeFunctions.nwnxPushInt(ability.Ready);
     Internal.NativeFunctions.nwnxPushInt(ability.Level);
     Internal.NativeFunctions.nwnxPushObject(creature);
     Internal.NativeFunctions.nwnxCallFunction();
 }
Пример #2
0
        // Sets the special ability at the provided index for the provided creature to the provided ability.
        // Index bounds: 0 <= index < GetSpecialAbilityCount(creature).
        public void SetSpecialAbility(NWCreature creature, int index, SpecialAbilitySlot ability)
        {
            string sFunc = "SetSpecialAbility";

            NWNX_PushArgumentInt(NWNX_Creature, sFunc, ability.ID);
            NWNX_PushArgumentInt(NWNX_Creature, sFunc, ability.Ready);
            NWNX_PushArgumentInt(NWNX_Creature, sFunc, ability.Level);
            NWNX_PushArgumentObject(NWNX_Creature, sFunc, creature.Object);

            NWNX_CallFunction(NWNX_Creature, sFunc);
        }
Пример #3
0
        /// <summary>
        /// Adds the provided special ability to the provided creature.
        /// </summary>
        /// <param name="creature"></param>
        /// <param name="ability"></param>
        public static void AddSpecialAbility(NWCreature creature, SpecialAbilitySlot ability)
        {
            string sFunc = "AddSpecialAbility";

            NWNX_PushArgumentInt(NWNX_Creature, sFunc, ability.ID);
            NWNX_PushArgumentInt(NWNX_Creature, sFunc, ability.Ready);
            NWNX_PushArgumentInt(NWNX_Creature, sFunc, ability.Level);
            NWNX_PushArgumentObject(NWNX_Creature, sFunc, creature);

            NWNX_CallFunction(NWNX_Creature, sFunc);
        }
Пример #4
0
        // Returns the special ability of the provided creature at the provided index.
        // Index bounds: 0 <= index < GetSpecialAbilityCount(creature).
        public static SpecialAbilitySlot GetSpecialAbility(uint creature, int index)
        {
            Internal.NativeFunctions.nwnxSetFunction(PLUGIN_NAME, "GetSpecialAbility");
            var ability = new SpecialAbilitySlot();

            Internal.NativeFunctions.nwnxPushInt(index);
            Internal.NativeFunctions.nwnxPushObject(creature);
            Internal.NativeFunctions.nwnxCallFunction();
            ability.Level = Internal.NativeFunctions.nwnxPopInt();
            ability.Ready = Internal.NativeFunctions.nwnxPopInt();
            ability.ID    = Internal.NativeFunctions.nwnxPopInt();
            return(ability);
        }
Пример #5
0
        // Returns the special ability of the provided creature at the provided index.
        // Index bounds: 0 <= index < GetSpecialAbilityCount(creature).
        public SpecialAbilitySlot GetSpecialAbility(NWCreature creature, int index)
        {
            string sFunc = "GetSpecialAbility";

            SpecialAbilitySlot ability = new SpecialAbilitySlot();

            NWNX_PushArgumentInt(NWNX_Creature, sFunc, index);
            NWNX_PushArgumentObject(NWNX_Creature, sFunc, creature.Object);

            NWNX_CallFunction(NWNX_Creature, sFunc);

            ability.Level = NWNX_GetReturnValueInt(NWNX_Creature, sFunc);
            ability.Ready = NWNX_GetReturnValueInt(NWNX_Creature, sFunc);
            ability.ID    = NWNX_GetReturnValueInt(NWNX_Creature, sFunc);

            return(ability);
        }