// 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(); }
// Adds the provided special ability to the provided creature. public static void AddSpecialAbility(uint creature, SpecialAbilitySlot ability) { Internal.NativeFunctions.nwnxSetFunction(PluginName, "AddSpecialAbility"); Internal.NativeFunctions.nwnxPushInt(ability.ID); Internal.NativeFunctions.nwnxPushInt(ability.Ready); Internal.NativeFunctions.nwnxPushInt(ability.Level); Internal.NativeFunctions.nwnxPushObject(creature); Internal.NativeFunctions.nwnxCallFunction(); }
// 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); }