NWNWiki
Advertisement
NWNWiki
3,718
pages

This file contains utility functions that do not fall into the other categories of Grimoire include files.

Includes[]

Standard:

  • X0_I0_Position

Grimoire:

Constants[]

  • int DEBUGGING = TRUE/FALSE (Switch to keep AutoDebugString (below) from sending the debug strings.)
  • int DUR_TYPE_ROUNDS = 1
  • int DUR_TYPE_TURNS = 2
  • int DUR_TYPE_HOURS = 3
  • int DUR_TYPE_DAYS = 4

Functions[]

float SGMetersToFeet (float fMeters) This function converts meters to feet.

float SGAbsF (float fNum) This function returns the absolute value of a float.

location SGGetMissLocation (object oTarget) This function returns a random location from around the target object. It was originally used for locations for a missed attack of a hurled substance.

float SGGetDuration (int iNumber, int iDurationType=DUR_TYPE_ROUNDS,
int iElementalType=DAMAGE_TYPE_MAGICAL, int iFogSpell=FALSE) This function is a wrapper for the RoundsToSeconds(), TurnsToSeconds(), and HoursToSeconds() functions that are used in spell duration determination. It also uses the elemental type and fog spell values to adjust duration in underwater environments.

int SGCheckMetamagic (int iMetamagic, int iMetamagicType=0) This function checks if the first parameter is equal to the second parameter. It is used in determining if a certain metamagic feat is being used and is necessary for custom metamagic feats.

void AutoDebugString (string sDebugString) This function sends a debug string to the first PC in the module and also writes the string to the server log for debugging purposes.

string SGBooleanToString (int i) This function converts an integer being used as a boolean value to a string — either "TRUE" or "FALSE". It is mainly used for debugging purposes.

string SGFeatToString (int iFeat) This function returns the label of a feat from feat.2da, given the feat constant. It is used for debugging purposes.

string SGSpellToString (int iSpellID) This function returns the label of a spell from spells.2da, given the spell id. It is used for debugging purposes.

Advertisement