fi_encounter

Handle encounters and creature generation.

float GetEncounterMinCR(object oEncounter);
Parameters:
  • oEncounter – An encounter

Returns:

An integer as a float

Get the minimun CR from encounter

float GetEncounterMaxCR(object oEncounter);
Parameters:
  • oEncounter – An encounter

Returns:

An integer as a float

Get the maximum CR from encounter

void ResetEncounterAlreadyUsed(object oEncounter);
Parameters:
  • oEncounter – An encounter

Reset the alreadyUsed flag of all creatures in encounter

json GetEncounterAsJson(object oEncounter);
Parameters:
  • oEncounter – An encounter

Returns:

A json array of encounter structure

Translate the encounter as a json structure.

Possible fields: index (int), resref (string), challengeRating (float)

unique (int), alreadyUsed (int)

int GetEncounterCreature(json jEncounter, float fCR);
Parameters:
  • jEncounter – An json encounter

  • fCR – Approximative CR of creature to return.

Returns:

Index of creature to use

Return index of a pseudo-random creature from json array.

object CreateCreatureFromEncounter(object oEncounter, float fCR, location lWhere);
Parameters:
  • jEncounter – An json encounter

  • fCR – Approximative CR of creature to return.

Returns:

Creature created

Create a single creature from encounter.