TakeGold(int, object, int)

Removes a given amount of gold from the targets inventory, and optionally removes it from the game.

void TakeGold(
    int nAmount,
    object oGoldHolder,
    int bDestroy = TRUE
);

Parameters

nAmount

The amount of gold to take.

oGoldHolder

The object to take the gold from.

bDestroy

Should the amount taken be removed from the game? (Default: TRUE)


Description

Removes nAmount gold from oGoldHolder and removes it from the game world. Can optionally be called to give the gold to the caller.



Remarks

Function can be found in nw_i0_plot.nss on line 44.
Function can be found in nw_i0_tool.nss on line 55.

A very simple function which merely takes the passed in parameters and calls the TakeGoldFromCreature() function using those same parameters. It is also defined exactly the same in two different include files. This is also the unfortunate reason why you can't include those two files in the same script.

This function will fail if called from an area or module event (like an area's OnEnter). However, it works on triggers, so you can just paint a trigger around the arrival area to get the same effect.


Requirements

#include "nw_i0_plot" or "nw_i0_tool"

Version

1.22

See Also

functions: TakeGoldFromCreature | TakeNumItems
categories: Inventory Functions | Money Functions


 author: John Shuell, editors: Lilac Soul, Mistress