GetGold

From NWN Lexicon



Contents

[edit] GetGold(object)

Gets the amount of gold that a creature possesses.

int GetGold(
    object oTarget = OBJECT_SELF
);

[edit] Parameters

oTarget

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


[edit] Description

Returns the amount of gold possessed by oTarget.



[edit] 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.


[edit] Version

1.22

[edit] 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;
}

[edit] See Also

functions: 

HasGold



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

Personal tools
Categories