GetGold(object)

From NWN Lexicon
Jump to navigationJump to search

Gets the amount of gold that a creature possesses.

int GetGold(
    object oTarget = OBJECT_SELF
);

Parameters

oTarget
The creature to inspect for gold. (Default: OBJECT_SELF)


Description

Returns the amount of gold possessed by oTarget.


Remarks

This simply is an integer value - noting that gold weighs nothing.

It should be possible to put oTarget as something other then a creature (say, a chest) but this hasn't been tested.


Version

1.22


Example

// This can be used to only say a line in a conversation if the
// speaker has 100gp or more.
int StartingConditional()
{
   int iResult;

   iResult = (GetGold(GetPCSpeaker()) >= 100);
   return iResult;
}

See Also

functions:

HasGold



author: Tom Cassiotis, editor: Jasperre, additional contributor(s): Jasperre