Included Scripts (Utility) - BG3-Community-Library-Team/BG3-Community-Library GitHub Wiki

Utility

These functions assist in performing specific actions.


CL_ApplyEquipmentPactStatus

Deprecated, see `CL_ApplyEquipmentPactStatus_v2

Introduced: 2.0.4.3

Removed: (Not yet) 2.0.6.0

Parameters:

  • weapon - mainHand, offHand, rangedMainHand, rangedOffHand. Defaults to mainHand
  • attribute - Optional. String representation of Attribute, in all caps. Valid options: 'STR', 'DEX', 'CON', 'INT', 'WIS', 'CHA'. Defaults to 'CHA'.
  • chance - Optional. Percentage, 0-100. Defaults to 100.
  • duration - Optional. Number, indicated amount of rounds for effect to be active. Defaults to -1 (Indefinite)

Applies the specific Pact Status to the weapon in the specified position.

Example uses:

  • CL_ApplyEquipmentPactStatus(mainHand, 'CL_PACT_BLADE_WIS', 100, -1) Applies CL_PACT_BLADE_WIS to the Main Hand Weapon Indefinitely, 100% chance.

CL_ApplyEquipmentPactStatus_v2

Introduced: 2.0.4.3

Parameters:

  • weapon - mainHand, offHand, rangedMainHand, rangedOffHand. Defaults to mainHand
  • chance - Optional. Percentage, 0-100. Defaults to 100.
  • duration - Optional. Number, indicated amount of rounds for effect to be active. Defaults to -1 (Indefinite)

Applies the specific Pact Status to the weapon in the specified position, based on a Pact Attribute Tag present on context.Source.

Example uses:

  • CL_ApplyEquipmentPactStatus(mainHand, 100, -1) Applies the relevant PACT_BLADE status variant to the Main Hand Weapon Indefinitely, 100% chance.

CL_ApplyEquipmentStatusBulk

Introduced: 2.0.4.3

Parameters:

  • weapons - Required. List of weapon positions: mainHand, offHand, rangedMainHand, rangedOffHand. Defaults to mainHand
  • statuses - Required. String ID of specific statuses.
  • chances - Optional. Percentage, 0-100. Defaults to 100.
  • durations - Optional. Number, indicated amount of rounds for effect to be active. Defaults to -1 (Indefinite)

Parameters will repeat their last or default value until all statuses are set. Applies the specific Pact Status to the weapon in the specified position.

Example Usage:

  • CL_ApplyEquipmentStatusBulk({mainHand, rangedMainHand}, {'PACT_BLADE', 'CL_STATUS_BRAVERY'}, {100, 55}, {-1, 3}) Applies PACT_BLADE to the Main Hand Weapon Indefinitely, 100% chance. Applies CL_STATUS_BRAVERY to the Ranged Main Hand Weapon for 3 turns, 55% to succeed.
  • CL_ApplyEquipmentStatusBulk({mainHand}, {'CL_CHILLED', 'CL_STATUS_BRAVERY', 'CL_STATUS_SPELLSTRIKE'}, {100, 55}) Applies CL_CHILLED to the Main Hand Weapon Indefinitely, 100% chance. Applies CL_STATUS_BRAVERY and CL_STATUS_SPELLSTRIKE to the Main Hand Weapon Indefinitely, 55% chance.

CL_ApplyStatusBulk

Introduced: 2.0.4.3

Parameters:

  • statuses - Required. String ID of specific statuses.
  • targets - Optional. List of targets to apply statuses to. Defaults to context.Source.
  • chances - Optional. Percentage, 0-100. Defaults to 100.
  • durations - Optional. Number, indicated amount of rounds for effect to be active. Defaults to -1 (Indefinite)

Parameters will repeat their last or default value until all statuses are set. Applies the specific Pact Status to the weapon in the specified position.

Example Usage:

  • CL_ApplyStatusBulk({'CL_CHILLED', 'CL_STATUS_ALTERWEAPON_ENFLAME'}, {context.Target, GetActiveWeapon(context.Source)}, {75, 95}, {5, 3}) Applies CL_CHILLED to the Target of the spell, 75% chance for 5 rounds. Applies CL_STATUS_ALTERWEAPON_ENFLAME to the Caster's Weapon for 3 turns, 95% to succeed.
  • CL_ApplyStatusBulk({'CL_STATUS_BRAVERY', 'CL_STATUS_LESSER_WARD'}, {context.Target}, {100, 55}, {2}) Applies CL_STATUS_BRAVERY(100% chance) and CL_STATUS_LESSER_WARD(55% chance) to the Target for two turns.

CL_GetPactTagStatus

Introuced: 2.0.4.3

Parameters: entity - Target character.

Detects the Pact Tag given to a character, and returns the relevant PACT_BLADE variant status as a string.


CL_RemoveAnyStatus

Introduced: 2.0.4.3

Parameters:

  • entity - Optional. Defaults to context.Source
  • statuses - Required. List of String IDs for specific statuses.

Example Usage:

  • data "SpellProperties" "CL_RemoveAnyStatus(SELF, {'CL_CHILLED', 'CL_STATUS_BRAVERY'})" Removes the CL_CHILLED and CL_STATUS_BRAVERY statuses from the caster of the Spell

CL_RemovePactStatus

Introuced: 2.0.4.3

Parameters: entity - Target character.

Removes the Pact Status and its relevant tag from a given Character.


CL_SummonPactWeapon

Introuced: Unreleased, targeted for 2.0.4.3

Parameters:

  • guid - UUID of Specific Weapon being summoned
  • permanent- pass-through of Permanent from the original SummonInInventory() call

Wrapper function for SummonInInventory to automatically retrieve the pact tag status and apply it to the summoned weapon.