OpenStore(object, object, int, int)

From NWN Lexicon
Jump to: navigation, search

Opens a store for PCs to barter.

void OpenStore(
    object oStore,
    object oPC,
    int nBonusMarkUp = 0,
    int nBonusMarkDown = 0
);

Parameters

oStore
The store object to open.
oPC
The player to present the store.
nBonusMarkUp
A number in percent to mark up prices. (Default: 0)
nBonusMarkDown
A number in percent to mark down prices. (Default: 0)

Description

Open oStore for oPC. You can mark up or down the prices with the optional parameters. If nBonusMarkUp is given a value of 10, prices will be 110% of the normal prices.

Remarks

The merchant panel can be kept open by a PC for longer than you might like - if so you can cancel it being opened by causing the PC who has the store open to ActionInteractObject on something, such as the original placeable or NPC that opened the store for the player (or create a new placeable to quickly interact with).

Version

1.22

Example

// From Bioware's David Gaider Scripting FAQ:
 
// The storekeeper doubles all prices for elves 
// (I guess he doesn't like them):
void main()
{
  object oStore = GetObjectByTag("STORE_TAG_HERE");
  if (GetRacialType(GetPCSpeaker()) == RACIAL_TYPE_ELF)
  {
    OpenStore(oStore, GetPCSpeaker(), 100);
  }
  else OpenStore(oStore, GetPCSpeaker());
}

See Also

functions: 

gplotAppraiseOpenStore



 author: Tom Cassiotis, editor: Kristian Markon, Mistress