Ejemplo n.º 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 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);
        }
Ejemplo n.º 2
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);
        }